Roundup 1.4.20 released

2012-05-15 Thread Ralf Schlatterbeck

I'm proud to release version 1.4.20 of Roundup which can be seen as a
security release. We've fixed several security issues, in particular
some XSS issues. We've also dropped support for python 2.4 with this
release. This release also introduces some minor features and, as usual,
fixes some bugs:

Features:

- Experimental support for the new Chameleon templating engine.
  We now have two configurable templating engines, the old Zope TAL
  templates (called zopetal in the config) and the new Chameleon (called
  chameleon in the config). A new config-option template_engine under
  [main] can take these config-options, the default is zopetal.
  Thanks to Cheer Xiao for the idea of making this configurable *and*
  for the actual implementation! (Ralf)
  WARNING: Chameleon support is highly experimental and *not* recommended for
  production use. It has known performance issues and i18n is not yet
  functioning. It's still under active development. Only use this feature if
  you want to experiment with Chameleon and/or help with Roundup
  developement. If you found a bug in Chameleon support, please report after
  testing against latest Roundup source from the Mercurial repository.
- issue2550678: Allow pagesize=-1 which returns all results.
  Suggested and implemented by John Kristensen. 
  Tested by Satchidanand Haridas. (Bernhard)
- Allow to turn off translation of generated html options in menu method
  of LinkHTMLProperty and MultilinkHTMLProperty -- default is
  translation as it used to be (Ralf)
- Sending of OpenPGP encrypted mail to all users or selected users (via
  roles) is now working. (Ralf)
- Add config-option nosy to messages_to_author setting in [nosy]
  section of config: This will send a message to the author only
  in the case where the author is on the nosy-list (either added
  earlier or via the add_author setting). Current config-options
  for this setting will send / not send to author without considering
  the nosy list. (Ralf)

Fixed:

- issue2550730: FAQ has broken link to Zope book. Reported and fixed by
  John Rouillard.(Bernhard)
- issue2550728: remove buggy parentheses in TAL/DummyEngine.py.
  Reported and fixed by Ralf Hemmecke. (Bernhard)
- issue2550715: IndexError when requesting non-existing file via http.
  Reported and fixed by Cedric Krier. (Bernhard)
- issue2550712: exportcsvaction errors poorly when given invalid columns.
  Reported by Will Kahn-Greene, fixed by Cedric Krier. (Bernhard)
- issue2550695: 'No sort or group' settings not retained when editing queries.
  Reported and fixed by John Kristensen. Tested by Satchidanand Haridas. 
  (Bernhard)
- Fix matching of incoming email addresses to the alternate_addresses
  field of a user -- this would match substrings, e.g. if the user has
  discuss-supp...@example.com as an alternate email and an incoming mail
  is addressed to supp...@example.com this would (wrongly) match. (Ralf)
- issue2550729: Fix password history display for anydbm backend, thanks
  to Ralf Hemmecke for reporting. (Ralf)
- OpenPGP support is again working (pyme API has changed significantly) and
  we now have a regression test. We now take care that bounce-messages
  for incoming encrypted mails or mails where the policy dictates that
  outgoing traffic should be encrypted is actually OpenPGP encrypted. (Ralf)
- Ignore confirm set() fields by themselves in the absence of non-confirm
  values; otherwise a bare confirm field can be used to change the a
  password. Reported by Cam Blackwood. (Ralf)
- Updated version of simplified Chinese message file by Cheer Xiao:
  Corrected some mistakes, added a few more items and did some
  formating. (Ralf)
- Fix xmlrpc URL parsing so that passwords may contain a ':' character
  (Ralf)
- Be more tolerant when parsing RFC2047 encoded mail headers. Use
  backported version of my proposed changes to
  email.header.decode_header in http://bugs.python.org/issue1079
  (Ralf)
- issue2550684 Fix XSS vulnerability when username contains HTML code,
  thanks to Thomas Arendsen Hein for reporting and patch. (Ralf)
- issue2550711 Fix XSS vulnerability in @action parameter,
  thanks to om for reporting. (Ralf)
- issue2550535 In some cases even when keep_quoted_text=yes is
  configured we would strip quoted sections. This hit the python
  bug-tracker especially for python interpreter examples with leading
  '' strings. The fix is slightly different compared to the proposal
  as this broke keep_quoted_text=no in certain cases. We also fix a bug
  where keep_quoted_text=no would drop the last line of a non-quoted
  section if there wasn't an empty line between the next quotes. (Ralf)
- issue2431638 wrong registration link in bounce mail for non-registered
  users reported *years* ago by anonymous (Ralf)
- Fix doc/upgrading.txt which produces errors with latest docutils about
  wrong block structure. Fix .gitignore in doc directory. Thanks to
  Cheer Xiao for the patches. (Ralf)
- Fix wrong execute permissions on some files, 

Re: specify end of line character for readline

2012-05-15 Thread Ian Kelly
On Fri, May 11, 2012 at 1:32 PM, Jason ja...@deadtreepages.com wrote:
 Is there any way to specify the end of line character to use in 
 file.readline() ?

 I would like to use '\r\n' as the end of line and allow either \r or \n by 
 itself within the line.

In Python 3 you can pass the argument newline='\r\n' to the open
function when you open the file.  I don't know of anything comparable
in Python 2.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: specify end of line character for readline

2012-05-15 Thread Serhiy Storchaka

On 15.05.12 09:29, Ian Kelly wrote:

In Python 3 you can pass the argument newline='\r\n' to the open
function when you open the file.  I don't know of anything comparable
in Python 2.


io.open supports newline argument.

--
http://mail.python.org/mailman/listinfo/python-list


Re: Hashability questions

2012-05-15 Thread Chris Angelico
On Tue, May 15, 2012 at 3:27 PM, Ian Kelly ian.g.ke...@gmail.com wrote:
 Why?  I can't see any purpose in implementing __eq__ this way, but I
 don't see how it's broken (assuming that __hash__ is actually
 implemented somehow and doesn't just raise TypeError).  The
 requirement is that if two objects compare equal, then they must have
 the same hash, and that clearly holds true here.

 Can you give a concrete example that demonstrates how this __eq__
 method is dangerous and broken?

Its brokenness is that hash collisions result in potentially-spurious
equalities. But I can still invent a (somewhat contrived) use for such
a setup:


class Modulo:
base = 256
def __init__(self,n):
self.val=int(n)
def __str__(self):
return str(self.val)
__repr__=__str__
def __hash__(self):
return self.val%self.base
def __eq__(self,other):
return hash(self)==hash(other)
def __iadd__(self,other):
try:
self.val+=other.val
except:
try:
self.val+=int(other)
except:
pass
return self

Two of these numbers will hash and compare equal if they are equal
modulo 'base'. Useful? Probably not. But it's plausibly defined.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


ANNOUNCE: byteformat0.2a

2012-05-15 Thread Steven D'Aprano
I am pleased to announce a new release of byteformat.


http://pypi.python.org/pypi/byteformat


byteformat is a Python module for intelligently formatting numbers of 
bytes using common human-readable strings:

 from byteformat import format
 format(12000)
'12 KB'
 format(510, style='ABBREV')
'5.1 Mbytes'
 format(485000, style='LONG')
'48.5 terabytes'


byteformat understands SI decimal units, IEC binary units, and mixed 
units:

 format(12000, scheme='IEC')
'11.7 KiB'
 format(12000, scheme='MIXED')
'11.7 KB'


You can also specify which prefix to use:

 format(485000, style='LONG', prefix='M')
'4850 megabytes'


byteformat can be used as a command-line tool:

[steve@ando ~]$ python -m byteformat --prefix=K 1000 12300 145000 
1 KB
12.3 KB
145 KB


byteformat understands all the relevant SI and IEC unit prefixes, and is 
released under the MIT licence.



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANNOUNCE: byteformat0.2a

2012-05-15 Thread Karim



Cool steven, very helpful

I have a db which holds units data it will avoids me to do such format 
conversion.


Thnx

Cheers
Karim


Le 15/05/2012 10:30, Steven D'Aprano a écrit :

I am pleased to announce a new release of byteformat.


http://pypi.python.org/pypi/byteformat


byteformat is a Python module for intelligently formatting numbers of
bytes using common human-readable strings:


from byteformat import format
format(12000)

'12 KB'

format(510, style='ABBREV')

'5.1 Mbytes'

format(485000, style='LONG')

'48.5 terabytes'


byteformat understands SI decimal units, IEC binary units, and mixed
units:


format(12000, scheme='IEC')

'11.7 KiB'

format(12000, scheme='MIXED')

'11.7 KB'


You can also specify which prefix to use:


format(485000, style='LONG', prefix='M')

'4850 megabytes'


byteformat can be used as a command-line tool:

[steve@ando ~]$ python -m byteformat --prefix=K 1000 12300 145000
1 KB
12.3 KB
145 KB


byteformat understands all the relevant SI and IEC unit prefixes, and is
released under the MIT licence.





--
http://mail.python.org/mailman/listinfo/python-list


Re: Hashability questions

2012-05-15 Thread Christian Heimes
Am 15.05.2012 07:27, schrieb Ian Kelly:
 Why?  I can't see any purpose in implementing __eq__ this way, but I
 don't see how it's broken (assuming that __hash__ is actually
 implemented somehow and doesn't just raise TypeError).  The
 requirement is that if two objects compare equal, then they must have
 the same hash, and that clearly holds true here.
 
 Can you give a concrete example that demonstrates how this __eq__
 method is dangerous and broken?

Code explains more than words. I've created two examples that some issues.

Mutable values break dicts as you won't be able to retrieve the same
object again:

 class Example(object):
... def __init__(self, value):
... self.value = value
... def __hash__(self):
... return hash(self.value)
... def __eq__(self, other):
... if not isinstance(other, Example):
... return NotImplemented
... return self.value == other.value
...


 ob = Example(egg)
 d = {}
 d[ob] = True
 d[egg] = True
 d[spam] = True
 ob in d
True
 d
{'egg': True, __main__.Example object at 0x7fab66cb7450: True, 'spam':
True}

 ob.value = spam
 ob in d
False
 d
{'egg': True, __main__.Example object at 0x7fab66cb7450: True, 'spam':
True}


When you mess up __eq__ you'll get funny results and suddenly the
insertion order does unexpected things to you:

 class Example2(object):
... def __init__(self, value):
... self.value = value
... def __hash__(self):
... return hash(self.value)
... def __eq__(self, other):
... return hash(self) == hash(other)
...
 d = {}
 ob = Example2(egg)
 d[ob] = True
 d
{__main__.Example2 object at 0x7fab66cb7610: True}
 d[egg] = True
 d
{__main__.Example2 object at 0x7fab66cb7610: True}
 d2 = {}
 d2[egg] = True
 d2[ob] = True
 d2
{'egg': True}


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newby Python Programming Question

2012-05-15 Thread Jean-Michel Pichavant

Coyote wrote:

CM writes:

  

I don't know Spyder IDE, but I don't think this should happen; could
there just be a simple mistake?  Because you first refer to the .py
file as 'file_utils.py' but then you refer to the file as
'pwd.py'...which is also the name of your function. Room for
confusion...so could you test this by saving only your one function
(below), give the .py a new name to avoid confusion (like test_pwd.py)
and then running *that* through Spyder IDE?

def pwd():
import os
print os.getcwd()



I probably explained the situation badly. I have a file pwd.py with these two 
lines of code in it:

import os
print os.getcwd()

If I start a new Spyder IDL session and run this file by choosing RUN from 
the menu bar, the directory is printed twice. This appears to me now to be an IDE error, 
because if I use a runfile command, the directory is printed only once, as I expect.

   runfile('pwd.py')
C:\Users\coyote\pyscripts

I've been playing around with a couple of IDEs because I liked the one I used 
with IDL and I wanted to use something similar for Python. The IDLDE was an 
Eclipse variant, but I've tried installing Eclipse before for something else 
and I'm pretty sure I don't need *that* kind of headache on a Friday afternoon. 
Unless, of course, I need a good excuse to head over to the Rio for the 
margaritas. :-)

Cheers,

David
  
Could be that the IDE is first importing the file before executing it, 
that would be strange.
Since you have print statements at the module level it is executed on 
import.


Anyway in order to avoid any issue, as everybody does, you better write :

pwd.py:

import os

def getcwd():
   print os.getcwd()

if __name__ == '__main__': # true if this file is used as program entry 
point

   getcwd()

That way you can either execute your script as a program, or use it as a 
module.


JM


Note : there is a 'pwd' module (linux password db), thus it would be 
wise to avoid naming any file pwd.py, or your statement 'import pwd' may 
yield unexpected results.

--
http://mail.python.org/mailman/listinfo/python-list


Re: Sharing Data in Python

2012-05-15 Thread Jean-Michel Pichavant

raunakgu...@gmail.com wrote:

I have some Pickled data, which is stored on disk, and it is about 100 MB in 
size.

When my python program is executed, the picked data is loaded using the cPickle 
module, and all that works fine.

If I execute the python multiple times using python main.py for example, each 
python process will load the same data multiple times, which is the correct 
behaviour.

How can I make it so, all new python process share this data, so it is only 
loaded a single time into memory?

asked the same question on SO, but could not get any constructive responses.. 
http://stackoverflow.com/questions/10550870/sharing-data-in-python/10551845
  

Well a straightforward way of solving this is to use threads.

Have your main program spawn threads for processing data.
Now what triggers a thread is up to you, your main program can listen to 
commands, or catch keyboard events ...


If you want to make sure your using all CPU cores, you may want to use 
the module

http://docs.python.org/library/multiprocessing.html

It emulates threads with subprocesses, and features a way to share memory.
I do tend to prefer processes over threads, I find them easier to 
monitor and control.


Cheers,

JM
--
http://mail.python.org/mailman/listinfo/python-list


ucs2 and ucs4 python

2012-05-15 Thread Alan Kesselmann
Hello

I tried using one compiled library and got this error:
ImportError: /home/alan/Downloads/pdftron/PDFNetC64/Lib/
_PDFNetPython2.so: undefined symbol: PyUnicodeUCS2_AsUTF8String

I googled around and found some info about the meaning of the error.
The creators of PDFNet suggested i install UCS2 python next to my UCS4
version to try their library.

Can someone point me towards a resource or two which will tell me how
to do this - im not very good with whole linux/servers stuff. Im using
ubuntu linux - if that makes any difference.

Alan
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-15 Thread Pascal Chambon

Hi,

cool down, people, if anything gave FOSS a bad reputation, that's well 
the old pyjamas website (all broken, because wheel must be reinvented 
here), and most of all the terror management that occurred on its 
mailing list.
Previously I had always considered open-source as a benevolent state of 
mind, until I got, there, the evidence that it could also be, for some 
people, an irrational and harmful cult (did you know github were 
freaking evildoers ?).


Blatantly the pyjs ownership  change turned out to be an awkward 
operation (as reactions on that ML show it), but a fork could also have 
very harmfully split pyjs-interested people, so all in all I don't 
think there was a perfect solution - dictatorships never fall harmlessly.


The egos of some might have been hurt, the legal sense of others might 
have been questioned, but believe me all this fuss is pitiful compared 
to the real harm that was done numerous time to willing newcomers, on 
pyjs' old ML, when they weren't aware about the heavy dogmas lying around.


A demo sample  (I quote it each time the suvject arises, sorry for 
duplicates)


| Please get this absolutely clear in your head: that  |
| you do not understand my reasoning is completely and utterly   |
| irrelevant.  i understand *your* reasoning; i'm the one making the   |
| decisions, that's my role to understand the pros and cons.  i make a |
| decision: that's the end of it.  |
| You present reasoning to me: i weight it up, against the other   |
| reasoning, and i make a decision.  you don't have to understand that |
| decision, you do not have to like that decision, you do not have to  |
| accept that decision.|


Ling live pyjs,
++
PKL



Le 08/05/2012 07:37, alex23 a écrit :

On May 8, 1:54 pm, Steven D'Apranosteve
+comp.lang.pyt...@pearwood.info  wrote:

Seriously, this was a remarkably ham-fisted and foolish way to resolve
a dispute over the direction of an open source project. That's the sort
of thing that gives open source a bad reputation.

The arrogance and sense of entitlement was so thick you could choke on
it. Here's a sampling from the circle jerk of self-justification that
flooded my inbox over the weekend:

i did not need to consult Luke, nor would that have be productive

No, it's generally _not_ productive to ask someone if you can steal
their project from them.

i have retired Luke of the management duties, particularly, *above*
the source

Who is this C Anthony Risinger asshole and in what way did he _hire_
the lead developer?

What I have wondered is, what are effects of having the project
hostage to the whims of an individuals often illogically radical
software libre beliefs which are absolutely not up for discussion at
all with anyone.

What I'm wondering is: how is the new set up any different? Why were
Luke Leighton's philosophies/whims any more right or wrong than
those held by the new Gang of Dicks?

Further more, the reason I think it's a bad idea to have this drawn
out discussion is that pretty much the main reason for this fork is
because of Luke leadership and project management decisions and
actions. To have discussions of why the fork was done would invariably
lead to quite a bit of personal attacks and petty arguments.

Apparently it's nicer to steal someone's work than be mean to them.

I agree, Lex - this is all about moving on.  This is a software
project, not a cult of personality.

Because recognising the effort of the lead developer is cult-like.

My only quibble is with the term fork.  A fork is created when you
disagree with the technical direction of a project.  That's not the
issue here.  This is a reassignment of the project administration only
- a shuffling of responsibility among *current leaders* of the
community.  There is no divine right of kings here.

My quibble is over the term fork too, as this is outright theft. I
don't remember the community acknowledging _any other leadership_ over
Luke Leighton's.

I suspect Luke will be busy with other projects and not do much more
for Pyjamas/pyjs, Luke correct me if you see this and I am wrong.

How about letting the man make his own fucking decisions?

All of you spamming the list with your unsubscribe attempts: Anthony
mentioned in a previous email that he's using mailman now

Apparently it's the responsibility of the person who was subscribed
without their permission to find out the correct mechanism for
unsubscribing from that list.

apparantly a bunch of people were marked as POSTING in the DB, but
not receiving mail (?)

Oh I see, the sudden rush of email I received was due to an error in
the data they stole...

Nobody wins if we spend any amount of time debating the details of
this transition, what's done is done.

Truly the 

compiling Tkinter

2012-05-15 Thread Rita
Hello,

I understand Tkinter is part of the python distribution but for me it
always fails when I try to load the module. I get:

 import Tkinter
...
import _tkinter # if this fails your Python may not be configured for Tk
ImportError: No module named _tkinter


So, here is how I am compiling tcl/tk and Python please let me know if you
see any issues with this.

assuming, my prefix is /tmp/testdir

wget http://prdownloads.sourceforge.net/tcl/tcl8.5.11-src.tar.gz
wget http://prdownloads.sourceforge.net/tcl/tk8.5.11-src.tar.gz

tar -xzpf tcl8.5.11-src.tar.gz  tar -xzpf tk8.5.11-src.tar.gz

#compile tcl
cd tcl8.5.11/unix/
./configure --prefix=/tmp/testdir --enable-64bit --enable-threads
make
make test
make install

#compile tk
cd tk8.5.11/unix/
./configure --prefix=/tmp/testdir --enable-threads --enable-64-bit
--with-tcl=/tmp/testdir/lib
make
make install

#compile python
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar -xzpvf Python-2.7.3.tgz
cd Python-2.7.3/
./configure --prefix=/tmp/testdir --enable-shared
LDFLAGS=-Wl,-rpath,/tmp/testdir/lib


Any thoughts?

-- 
--- Get your facts first, then you can distort them as you please.--
-- 
http://mail.python.org/mailman/listinfo/python-list


How to call and execute C code in Python?

2012-05-15 Thread David Shi
How to call and execute C code in Python?

Is there any publication/documentation for this?   For the worst scenario, how 
many ways are there to call and execute C codes, in Python. 


For instance, having got hold some C codes, attempting to use Python to call 
and execute C codes.  I.e.  Python, as the integrating language.

Can anyone send publications/instructions to davidg...@yahoo.co.uk?

All the best to everyone!

Regards.

David




 From: python-list-requ...@python.org python-list-requ...@python.org
To: python-list@python.org 
Sent: Sunday, 13 May 2012, 19:14
Subject: Python-list Digest, Vol 104, Issue 67
 
- Forwarded Message -

Send Python-list mailing list submissions to
    python-list@python.org

To subscribe or unsubscribe via the World Wide Web, visit
    http://mail.python.org/mailman/listinfo/python-list
or, via email, send a message with subject or body 'help' to
    python-list-requ...@python.org

You can reach the person managing the list at
    python-list-ow...@python.org

When replying, please edit your Subject line so it is more specific
than Re: Contents of Python-list digest...

Today's Topics:

   1. Re: Good data structure for finding date intervals including
      a given    date (Arnaud Delobelle)
   2. Re: Good data structure for finding date intervals including
      a given    date (Emile van Sebille)
   3. Re: How to call and execute C code in Python? (Chris Angelico)
   4. Re: How to call and execute C code in Python? (Stefan Behnel)
   5. Re: How to call and execute C code in Python? (Mark Lawrence)
   6. Re: How to call and execute C code in Python? (Mark Lawrence)
   7. Re: How to call and execute C code in Python? (Stefan Behnel)
   8. Re: How to call and execute C code in Python? (Stefan Behnel)
   9. Re: How to call and execute C code in Python? (Mark Lawrence)
  10. Re: How to call and execute C code in Python? (Stefan Behnel)
On 13 May 2012 13:29, Alec Taylor alec.tayl...@gmail.com wrote:
 There is an ordered dict type since Python 3.1[1] and Python 2.7.3[2].

I don't think that'll help the OP.  Python's OrderedDict keeps track
of the order in which the keys were inserted into the dictionary (a
bit like a list), it doesn't keep the keys sorted.

 If you are looking for the best possible self-sorting structure for
 searching, then perhaps you are looking for what's outlined in the
 2002 article by Han  Thorup: Integer Sorting in O(n sqrt(log log n))
 Expected Time and Linear Space[3].

I can't access it but it seems to me it's not about self sorted data
structures, which is what the OP is looking for.

-- 
Arnaud

On 5/12/2012 5:17 AM Jean-Daniel said...
 Hello,
 
 I have a long list of n date intervals that gets added or suppressed
 intervals regularly. I am looking for a fast way to find the intervals
 containing a given date, without having to check all intervals (less
 than O(n)).

ISTM the fastest way is to retrieve the list of intervals from a dict using the 
date as a key.  You don't say how long your list of intervals is, nor how large 
each interval can be so I don't have enough info to determine the setup reqs, 
but I'd suspect that a list of tens of thousands of intervals covering ranges 
of days to weeks would be doable.  If instead you're talking about millions of 
ranges covering years to decades I'd start elsewhere.

Emile



On Sun, May 13, 2012 at 11:25 PM, David Shi davidg...@yahoo.co.uk wrote:
 Can anyone tell me how to call and exectute C code in Python?

Browse the documentation about Extending and Embedding Python, there's
an extensive API.

Chris Angelico

David Shi, 13.05.2012 15:25:
 Can anyone tell me how to call and exectute C code in Python?

Take a look at Cython, a Python-like language that supports native calls to
and from C/C++ code. It translates your code into very efficient C code, so
the wrapping code tends to be very fast (often faster than hand written C
code).

http://cython.org/

Here are a couple of examples:

http://docs.cython.org/src/tutorial/external.html

There's also the ctypes package in the standard library, which is usable
for simple wrapping cases that are not performance critical.

Stefan


On 13/05/2012 16:39, Chris Angelico wrote:
 On Sun, May 13, 2012 at 11:25 PM, David Shidavidg...@yahoo.co.uk  wrote:
 Can anyone tell me how to call and exectute C code in Python?

 Browse the documentation about Extending and Embedding Python, there's
 an extensive API.

 Chris Angelico

I like your response, my first thought was to say yes :)

-- 
Cheers.

Mark Lawrence.


On 13/05/2012 16:58, Stefan Behnel wrote:
 David Shi, 13.05.2012 15:25:
 Can anyone tell me how to call and exectute C code in Python?

 Take a look at Cython, a Python-like language that supports native calls to
 and from C/C++ code. It translates your code into very efficient C code, so
 the wrapping code tends to be very fast (often faster than hand written C
 code).

 http://cython.org/

 Here are a couple of 

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-15 Thread Tim Wintle
On Tue, 2012-05-15 at 12:39 +0200, Pascal Chambon wrote:
 believe me all this fuss is pitiful compared to the real harm that was
 done numerous time to willing newcomers, on pyjs' old ML, when they
 weren't aware about the heavy dogmas lying around.
 
 A demo sample  (I quote it each time the suvject arises, sorry for
 duplicates)
  
 | Please get this absolutely clear in your head: that
 | 
 | you do not understand my reasoning is completely and utterly
 | 
 | irrelevant.  i understand *your* reasoning; i'm the one making the
 | 
 | decisions, that's my role to understand the pros and cons.  i make a
 | 
 | decision: that's the end of it.
 | 
 | You present reasoning to me: i weight it up, against the other
 | 
 | reasoning, and i make a decision.  you don't have to understand that
 | 
 | decision, you do not have to like that decision, you do not have to
 | 
 | accept that decision.
 | 
  

The above seems perfectly reasonable to me.

You're working with Python anyway - a language organised by a team that
gives full control to the BDFL...

Imagine instead that you were talking about a bug in a proprietary piece
of software (Oracle / Internet Explorer / etc) - do you think they'd let
*you* make the decision, or keep the option under discussion until *you*
fully understood the reasoning of the company that owned the code? No -
they'd listen to your argument, weigh up the two sides, and make a
decision on their own.

The idea of having two sides able to make their cases and one person
rule on them is incredibly common - it's how courts across the world
work, and it's how management of any team (software related or not)
goes.

Tim

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to call and execute C code in Python?

2012-05-15 Thread Chris Angelico
On Tue, May 15, 2012 at 10:08 PM, David Shi davidg...@yahoo.co.uk wrote:
 How to call and execute C code in Python?

 Is there any publication/documentation for this?   For the worst scenario,
 how many ways are there to call and execute C codes, in Python.

 For instance, having got hold some C codes, attempting to use Python to call
 and execute C codes.  I.e.  Python, as the integrating language.

 Can anyone send publications/instructions to davidg...@yahoo.co.uk?
 [chomp lots of digest]

As you've seen, there've been quite a few posts on the subject. Please
don't simply repeat your question and quote them all underneath -
we've all seen those posts already.

The polite thing to do would be to read through all the responses so
far and respond to them with clarifications and/or more information so
that we are better able to help you. You've been given two or three
separate lines of inquiry to follow up; have you looked into any of
them? What did you find out?

Also, this might be a handy reference:
http://www.catb.org/~esr/faqs/smart-questions.html

Chris Angelico
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Yet another split string by spaces preserving single quotes problem

2012-05-15 Thread Steven D'Aprano
On Sun, 13 May 2012 14:14:58 -0700, Massi wrote:

 Hi everyone,
 I know this question has been asked thousands of times, but in my case I
 have an additional requirement to be satisfied. I need to handle
 substrings in the form 'string with spaces':'another string with spaces'
 as a single token; I mean, if I have this string:
 
 s =This is a 'simple test':'string which' shows 'exactly my' problem
 
 I need to split it as follow (the single quotes must be mantained in the
 splitted list):
 
 [This, is,  a,  'simple test':'string which', shows, 'exactly
 my', problem]
 
 Up to know I have written some ugly code which uses regular expression:

And now you have two problems *wink*


 Any hints? Thanks in advance!

 s = This is a 'simple test':'string which' shows 'exactly my' 
problem
 import shlex
 result = shlex.split(s, posix=True)
 result
['This', 'is', 'a', 'simple test:string which', 'shows', 'exactly my', 
'problem']


Then do some post-processing on the result:

 ['+s+' if   in s else s for s in result]
['This', 'is', 'a', 'simple test:string which', 'shows', 'exactly 
my', 'problem']


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hashability questions

2012-05-15 Thread Bob Grommes
On Monday, May 14, 2012 8:35:36 PM UTC-5, alex23 wrote:
 It looks like this has changed between Python 2 and 3:
 
 If a class does not define an __eq__() method it should not define a
 __hash__() operation either; if it defines __eq__() but not
 __hash__(), its instances will not be usable as items in hashable
 collections.
 
 From: http://docs.python.org/dev/reference/datamodel.html#object.__hash__
 
 You should just be able to add a __hash__ to Utility and it'll be fine.

Thanks, Alex.  I should have mentioned I was using Python 3.  I guess all this 
is a bit over-thought to just crank out some code -- in practice, comparing two 
classes for equality is mostly YAGNI -- but it's my way of coming to a 
reasonably in-depth understanding of how things work ... 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-15 Thread Daniel Fetchinson
 Blatantly the pyjs ownership  change turned out to be an awkward
 operation (as reactions on that ML show it), but a fork could also have
 very harmfully split pyjs-interested people, so all in all I don't
 think there was a perfect solution - dictatorships never fall harmlessly.

You say fork could also have very harmfully split, what harms are
you referring to?
In the open source world there were tons of forks of projects and it
proved to be a useful mechanism for resolving serious management
issues.  On the other hand the kind of hostile takeover that happened
with pyjs is virtually unparalleled in the open source world. What
made you think such a unique operation will be less harmful than the
other which has already been tried many times?

 
 | Please get this absolutely clear in your head: that  |
 | you do not understand my reasoning is completely and utterly   |
 | irrelevant.  i understand *your* reasoning; i'm the one making the   |
 | decisions, that's my role to understand the pros and cons.  i make a |
 | decision: that's the end of it.  |
 | You present reasoning to me: i weight it up, against the other   |
 | reasoning, and i make a decision.  you don't have to understand that |
 | decision, you do not have to like that decision, you do not have to  |
 | accept that decision.|
 

Again, if you don't like the lead developer just fork the project,
come up with a new name, new website and new infrastructure and start
building a new community. Why didn't the rebels do that?

Cheers,
Daniel


-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ucs2 and ucs4 python

2012-05-15 Thread Miki Tebeka
 Can someone point me towards a resource or two which will tell me how
 to do this - im not very good with whole linux/servers stuff. Im using
 ubuntu linux - if that makes any difference.
Did not test, but this is the direction I would take:
* Download Python sources
* Open Terminal
* Run the following commands in the Terminal window
  - sudo apt-get build-dep python
  - tar -xjf Python-2.7.3.tar.bz2
  - cd Python-2.7.3
  - ./configure --prefix=/opt --enable-unicode=ucs2  make
  - sudo make install
* Now you should have /opt/bin/python with ucs2

HTH
--
Miki Tebeka miki.teb...@gmail.com
http://pythonwise.blogspot.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Carbon Event Manager (Carbon.CarbonEvt module) - working?

2012-05-15 Thread msmucr
Hello,

i would like to ask you for some information regarding Carbon Event
Manager ( Carbon.CarbonEvt ) library in Python.
I need to recieve and work with few Carbon events in my program. I've
followed some examples on PyObjC site, but wasn't successful. I know,
that both Carbon library and this Python module is deprecated, but
frankly i didn't find any usable alternative except of writing of
something from scratch..
I ended on basic import of required objects from Carbon.CarbonEvt
module -
like from Carbon.CarbonEvt import RegisterEventHotKey
I tried it in Python 2.7.1 (standard distribution in OS X 10.7 Lion)
and Python 2.6.1 (standard Apple distribution in OS X 10.6).
Do I have something wrong or is it simply broken and unmaintained now?

Thank You,

Michal
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Carbon Event Manager (Carbon.CarbonEvt module) - working?

2012-05-15 Thread John Gordon
In c4dc4a8f-52cc-4447-b199-dafcc296e...@e20g2000vbm.googlegroups.com msmucr 
msm...@gmail.com writes:

 Do I have something wrong or is it simply broken and unmaintained now?

We have no idea if you did anything wrong, because you didn't tell us
exactly what you did and exactly what error message you received.

-- 
John Gordon   A is for Amy, who fell down the stairs
gor...@panix.com  B is for Basil, assaulted by bears
-- Edward Gorey, The Gashlycrumb Tinies

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Carbon Event Manager (Carbon.CarbonEvt module) - working?

2012-05-15 Thread Ned Deily
In article 
c4dc4a8f-52cc-4447-b199-dafcc296e...@e20g2000vbm.googlegroups.com,
 msmucr msm...@gmail.com wrote:
 i would like to ask you for some information regarding Carbon Event
 Manager ( Carbon.CarbonEvt ) library in Python.
 I need to recieve and work with few Carbon events in my program. I've
 followed some examples on PyObjC site, but wasn't successful. I know,
 that both Carbon library and this Python module is deprecated, but
 frankly i didn't find any usable alternative except of writing of
 something from scratch..
 I ended on basic import of required objects from Carbon.CarbonEvt
 module -
 like from Carbon.CarbonEvt import RegisterEventHotKey
 I tried it in Python 2.7.1 (standard distribution in OS X 10.7 Lion)
 and Python 2.6.1 (standard Apple distribution in OS X 10.6).
 Do I have something wrong or is it simply broken and unmaintained now?

You may want to ask OS X specific questions on the macpython mailing 
list (http://www.python.org/community/sigs/current/pythonmac-sig/). The 
main reason that these modules are deprecated (and have been removed in 
Python 3) is because they depend on obsolete APIs in OS X that are only 
available in 32-bit versions.  Apple has made it clear that they will 
not be made available as 64-bit and will eventually go away.  You should 
try to find ways not to use the Carbon model in your applications.  That 
said, you can use these modules, even with the Apple-supplied Pythons in 
OS X 10.6 and 10.7, if you force Python to run in 32-bit-mode.  For 
those Apple-supplied Pythons, see the Apple man page (man 1 python) for 
system Python specific ways to force 32-bit mode persistently.  Another 
way that should work for any OS X universal Python 2.7.x:

arch -i386 python2.7

-- 
 Ned Deily,
 n...@acm.org

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Carbon Event Manager (Carbon.CarbonEvt module) - working?

2012-05-15 Thread Kevin Walzer

On 5/15/12 3:06 PM, msmucr wrote:

Do I have something wrong or is it simply broken and unmaintained now?


Support for Carbon Events was removed in Python 3.x and it does not work 
in 64-bit, to my knowledge--most of the Carbon API's are not supported 
by Apple anymore.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-15 Thread Mark Lawrence

On 15/05/2012 17:44, Daniel Fetchinson wrote:

Blatantly the pyjs ownership  change turned out to be an awkward
operation (as reactions on that ML show it), but a fork could also have
very harmfully split pyjs-interested people, so all in all I don't
think there was a perfect solution - dictatorships never fall harmlessly.


You say fork could also have very harmfully split, what harms are
you referring to?
In the open source world there were tons of forks of projects and it
proved to be a useful mechanism for resolving serious management
issues.  On the other hand the kind of hostile takeover that happened
with pyjs is virtually unparalleled in the open source world. What
made you think such a unique operation will be less harmful than the
other which has already been tried many times?



| Please get this absolutely clear in your head: that  |
| you do not understand my reasoning is completely and utterly   |
| irrelevant.  i understand *your* reasoning; i'm the one making the   |
| decisions, that's my role to understand the pros and cons.  i make a |
| decision: that's the end of it.  |
| You present reasoning to me: i weight it up, against the other   |
| reasoning, and i make a decision.  you don't have to understand that |
| decision, you do not have to like that decision, you do not have to  |
| accept that decision.|



Again, if you don't like the lead developer just fork the project,
come up with a new name, new website and new infrastructure and start
building a new community. Why didn't the rebels do that?

Cheers,
Daniel




Typical shabby Nazi trick.

--
Cheers.

Mark Lawrence.

--
http://mail.python.org/mailman/listinfo/python-list


Re: Carbon Event Manager (Carbon.CarbonEvt module) - working?

2012-05-15 Thread msmucr
On 15 kvě, 21:21, John Gordon gor...@panix.com wrote:
 In c4dc4a8f-52cc-4447-b199-dafcc296e...@e20g2000vbm.googlegroups.com msmucr 
 msm...@gmail.com writes:

  Do I have something wrong or is it simply broken and unmaintained now?

 We have no idea if you did anything wrong, because you didn't tell us
 exactly what you did and exactly what error message you received.

 --
 John Gordon                   A is for Amy, who fell down the stairs
 gor...@panix.com              B is for Basil, assaulted by bears
                                 -- Edward Gorey, The Gashlycrumb Tinies

Hello,

i'm sorry for my very vague specification. I had problems with
importing of anything from Carbon.CarbonEvt module and i wasn't sure
what is wrong and was little bit stucked.
I tried several desperate things before that as i've never worked with
this module and it is my first thing with Carbon library.. Just before
i read Kevin's reply i've figured, problem was, that OS X shipped
Python wrapper /usr/bin/python runs by default 64bit version on recent
Macs. So bindings for 32bit Carbon lib didn't work.
Here is my output (i've choose RegisterEventHotKey as example):

macmini-E514:~ macek$ /usr/bin/python -c import sys; print
sys.maxint; from Carbon.CarbonEvt import RegisterEventHotKey;
print(RegisterEventHotKey.__doc__)
9223372036854775807
Traceback (most recent call last):
  File string, line 1, in module
ImportError: cannot import name RegisterEventHotKey

macmini-E514:~ macek$ env VERSIONER_PYTHON_PREFER_32_BIT=yes /usr/bin/
python -c import sys; print sys.maxint; from Carbon.CarbonEvt import
RegisterEventHotKey; print(RegisterEventHotKey.__doc__)
2147483647
(UInt32 inHotKeyCode, UInt32 inHotKeyModifiers, EventHotKeyID
inHotKeyID, EventTargetRef inTarget, OptionBits inOptions) -
(EventHotKeyRef outRef)

So, now i could start playing with it.. :-)

I'm trying to do something like this in Python
http://www.macosxguru.net/article.php?story=20060204132802111

Best regards and thank you for replies

Michal
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Carbon Event Manager (Carbon.CarbonEvt module) - working?

2012-05-15 Thread Arnaud Delobelle
On 15 May 2012 20:55, Ned Deily n...@acm.org wrote:
 In article
 c4dc4a8f-52cc-4447-b199-dafcc296e...@e20g2000vbm.googlegroups.com,
  msmucr msm...@gmail.com wrote:
 i would like to ask you for some information regarding Carbon Event
 Manager ( Carbon.CarbonEvt ) library in Python.
 I need to recieve and work with few Carbon events in my program. I've
 followed some examples on PyObjC site, but wasn't successful. I know,
 that both Carbon library and this Python module is deprecated, but
 frankly i didn't find any usable alternative except of writing of
 something from scratch..
 I ended on basic import of required objects from Carbon.CarbonEvt
 module -
 like from Carbon.CarbonEvt import RegisterEventHotKey
 I tried it in Python 2.7.1 (standard distribution in OS X 10.7 Lion)
 and Python 2.6.1 (standard Apple distribution in OS X 10.6).
 Do I have something wrong or is it simply broken and unmaintained now?

 You may want to ask OS X specific questions on the macpython mailing
 list (http://www.python.org/community/sigs/current/pythonmac-sig/). The
 main reason that these modules are deprecated (and have been removed in
 Python 3) is because they depend on obsolete APIs in OS X that are only
 available in 32-bit versions.  Apple has made it clear that they will
 not be made available as 64-bit and will eventually go away.  You should
 try to find ways not to use the Carbon model in your applications.  That
 said, you can use these modules, even with the Apple-supplied Pythons in
 OS X 10.6 and 10.7, if you force Python to run in 32-bit-mode.  For
 those Apple-supplied Pythons, see the Apple man page (man 1 python) for
 system Python specific ways to force 32-bit mode persistently.  Another
 way that should work for any OS X universal Python 2.7.x:

    arch -i386 python2.7

This is what I have with system python 2.6:

$ cat ~/bin/python_32
#! /bin/bash
export VERSIONER_PYTHON_PREFER_32_BIT=yes
/usr/bin/python $@

I use it for wxpython, which only seems to work in 32 bit mode.  I
can't remember where I found it.  Maybe I read the man page?

-- 
Arnaud
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Carbon Event Manager (Carbon.CarbonEvt module) - working?

2012-05-15 Thread Ned Deily
In article 
caj6ck1bsvgimsrqndwxcev_ttwa8zjs6wpmdonehmbe5zvg...@mail.gmail.com,
 Arnaud Delobelle arno...@gmail.com wrote:
 This is what I have with system python 2.6:
 
 $ cat ~/bin/python_32
 #! /bin/bash
 export VERSIONER_PYTHON_PREFER_32_BIT=yes
 /usr/bin/python $@
 
 I use it for wxpython, which only seems to work in 32 bit mode.  I
 can't remember where I found it.  Maybe I read the man page?

Yes, that is one of the two documented ways in the Apple man page to 
force 32-bit mode; the other way is to set a plist using the defaults 
command.  Keep in mind that these are Apple modifications to Python so 
they won't work with other OS X Python distributions like those from 
python.org.  The arch command should work with all of them, as long as 
you use python2.7;  it won't work with the Apple wrapper program 
/usr/bin/python.  And I believe the Apple modifications only work when 
you use /usr/bin/python.

-- 
 Ned Deily,
 n...@acm.org

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Hashability questions

2012-05-15 Thread Ian Kelly
On Tue, May 15, 2012 at 3:25 AM, Christian Heimes li...@cheimes.de wrote:
 Code explains more than words. I've created two examples that some issues.

 Mutable values break dicts as you won't be able to retrieve the same
 object again:

Sure, you'll get no argument from me on that.  I was more interested
in the other one.

 When you mess up __eq__ you'll get funny results and suddenly the
 insertion order does unexpected things to you:

 class Example2(object):
 ...     def __init__(self, value):
 ...         self.value = value
 ...     def __hash__(self):
 ...         return hash(self.value)
 ...     def __eq__(self, other):
 ...         return hash(self) == hash(other)
 ...
 d = {}
 ob = Example2(egg)
 d[ob] = True
 d
 {__main__.Example2 object at 0x7fab66cb7610: True}
 d[egg] = True
 d
 {__main__.Example2 object at 0x7fab66cb7610: True}
 d2 = {}
 d2[egg] = True
 d2[ob] = True
 d2
 {'egg': True}

That's just how sets and dicts work with distinct objects that compare
equal.  I don't see any fundamental difference between that and this:

 d = {}
 d[42] = True
 d
{42: True}
 d[42.0] = True
 d
{42: True}
 d2 = {}
 d2[42.0] = True
 d2
{42.0: True}
 d2[42] = True
 d2
{42.0: True}

I wouldn't consider the hashing of ints and floats to be broken.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: %d not working in re at Python 2.7?

2012-05-15 Thread Tim Roberts
vacu vacu...@gmail.com wrote:

I am frustrated to see %d not working in my Python 2.7 re.search, like
this example:

 (re.search('%d', asdfdsf78asdfdf)).group(0)
Traceback (most recent call last):
  File stdin, line 1, in module
AttributeError: 'NoneType' object has no attribute 'group'

\d works fine:

 (re.search('\d+', asdfdsf78asdfdf)).group(0)
'78'

And google search ignores % in their search, so I failed to find
answer from Python mailing list or web,
Do you have any idea what's problem here?

Yes.  %d has never worked.  \d+ is the right answer.  It's just that
simple.  Where did you read that %d should work?
-- 
Tim Roberts, t...@probo.com
Providenza  Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue14810] Bug in tarfile

2012-05-15 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

The tar file format does nt support timestamps before 1970. From

http://sunsite.ualberta.ca/Documentation/Gnu/tar-1.13/html_chapter/tar_8.html

POSIX tar format can represent time stamps in the range 1970-01-01 00:00:00 
through 2242-03-16 12:56:31 UTC. ...
Portable archives should also avoid time stamps before 1970. These time stamps 
are a common POSIX extension but their time_t representations are negative. 
Many traditional tar implementations generate a two's complement representation 
for negative time stamps that assumes a signed 32-bit time_t; hence they 
generate archives that are not portable to hosts with differing time_t 
representations.

Out of curiosity: where did you get a file that was last modified in 1956?

--
nosy: +loewis

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14810
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

Forgot to mention that I was running on Windows, 64-bit.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14802] Python fails to compile with VC11 ARM configuration

2012-05-15 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

In any case, there is a branch supporting Python as a metro app at

http://hg.python.org/sandbox/loewis#win8app

This may get folded back into Python at some point, but certainly not before 
Windows 8 is released.

--
nosy: +loewis

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14802
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14798] pyclbr raises KeyError when the prefix of a dotted name is not a package

2012-05-15 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


--
keywords: +needs review
nosy: +petri.lehtinen
stage:  - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14798
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
components: +Unicode
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

Would you mind adding more information like the full traceback? By saying 
compilation error, I presume you mean the compilation of the t33a.py file 
into byte code (and not compilation of Python itself)?

I can't reproduce it neither with the vanilla 3.2.3 on OS X nor with Ubuntu's 
3.2.

My only suspicion is that the platform default encoding has bitten you, does it 
also crash if you add # -*- coding: utf-8 -*- as the first line?

--
nosy: +hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14133] improved PEP 409 implementation

2012-05-15 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

I hope you're not disappointed when that PEP doesn't show up in the release 
notes :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14133
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8996] Add a default role to allow writing bare `len` instead of :func:`len`

2012-05-15 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8996
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14804] Wrong defaults args notation in docs

2012-05-15 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Are you referring to #8350?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14804
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1294959] Problems with /usr/lib64 builds.

2012-05-15 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

Éric Araujo wrote:
 
 Éric Araujo mer...@netwok.org added the comment:
 
 On Mar 29, 2011, at 10:12 PM, Matthias Klose wrote:
 no, it looks for headers and libraries in more directories.  But really, this
 whole testing for paths is wrong. Just use the compiler to search for headers
 and libraries, no need to check these on your own.
 
 Do all compilers provide this info, including Windows ones?  If so, that 
 would be a nice feature for distutils2.

This only works for a handful of system library paths, not the extra
ones that you may need to search for local installations of
libraries and which you have to inform the compiler about :-)

Many gcc installations, for example, don't include the /usr/local
or /opt/local dir trees in the search. On Windows, you have to
run the correct vc*.bat files to have the paths setup and optional
software rarely adds the correct paths to LIB and INCLUDE.

The compiler also won't help with the problem Sean originally
pointed to: building software on systems that can run both
32-bit and 64-bit and finding the right set of libs to
link at.

Another problem is finding the paths to the right version of a
library (both include files and corresponding libraries).

While it would be great to have a system tool take care of setting
things up correctly, I don't know of any such tool, so searching
paths and inspecting files using REs appears to be the only way
to build a general purpose detection scheme.

mxSetup.py (included in egenix-mx-base) uses such a scheme, distutils
has one too.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1294959
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14674] Add link to RFC 4627 from json documentation

2012-05-15 Thread Chris Rebert

Chris Rebert pyb...@rebertia.com added the comment:

New revision per Éric's Rietveld feedback.

Sidenote: Is there any way to get notified of these reviews? I only saw it 
because I happened to click the review link on a lark.

--
Added file: http://bugs.python.org/file25594/json.rst.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14674
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14674] Add link to RFC 4627 from json documentation

2012-05-15 Thread Chris Rebert

Chris Rebert pyb...@rebertia.com added the comment:

The import jsons were left for uniformity with the other code samples in the 
module's docs.


Also, here's what the pedantically-strict recipes might look like:

def _reject_inf_nan(string):
if string in {'-Infinity', 'Infinity', 'NaN'}:
raise ValueError(JSON does not allow infinite or NaN number values)

def _reject_dupe_keys(pairs):
obj = {}
for key, value in pairs:
if key in pairs:
raise ValueError(Name %s repeated in an object % repr(key))
obj[key] = value
return obj

def strict_loads(string):
result = loads(string, parse_constant=_reject_inf_nan, 
object_pairs_hook=_reject_dupe_keys)
if not isinstance(result, (dict, list)):
raise ValueError(The top-level entity of the JSON text was not an 
object or an array)
return result


def strict_dumps(obj):
if not isinstance(obj, (dict, list)):
raise TypeError(The top-level object of a JSON text must be a dict or 
a list)
return dumps(obj, allow_nan=False)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14674
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14674] Add link to RFC 4627 from json documentation

2012-05-15 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Thanks for the patch, I left more comments on the review page.

IMHO it would be better to list the differences in a bullet list and expand 
later, rather than having a section for the parser and one for the generator.
AFAIU the differences are:
 * top-level scalar values are accepted/generated;
 * inf and nan are accepted/generated;
 * unicode strings (rather than utf-8) are produced/consumed;
 * duplicate keys are accepted, and the only the last one is used;

You can then add examples and explain workarounds, either inline or after the 
list (I don't think it's necessary to add the snippets you posted in the last 
message though).


 Sidenote: Is there any way to get notified of these reviews?

In theory you should get notifications, in practice it doesn't always work.  We 
are still working on make it better.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14674
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14674] Add link to RFC 4627 from json documentation

2012-05-15 Thread Chris Rebert

Chris Rebert pyb...@rebertia.com added the comment:

Further copyediting.

--
Added file: http://bugs.python.org/file25595/json.rst.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14674
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14674] Link to explain deviations from RFC 4627 in json module docs

2012-05-15 Thread Chris Rebert

Chris Rebert pyb...@rebertia.com added the comment:

Reflect broader scope

--
title: Add link to RFC 4627 from json documentation - Link to  explain 
deviations from RFC 4627 in json module docs

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14674
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

There is no traceback.  Here is the text of the Syntax error.

d:\my\im\infilesc:\python32\python.exe d:\my\py\t33a.py -h
  File d:\my\py\t33a.py, line 2
SyntaxError: Non-UTF-8 code starting with '\xc3' in file d:\my\py\t33a.py on 
line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for 
details

My understanding is Python 3 uses utf-8 as the default encoding for source 
files -- unless there is an encoding line; and I've set my emacs to save all 
.py files as utf-8-unix (meaning with no CR, if you aren't an emacs user).

I verified with a hex dump that the encoding in the file is UTF-8, but you are 
welcome to also, that is the file I uploaded.

So your testing would seem to indicate it is a platform specific bug.  Try 
running it on Windows, then.

Further, if it were the platform default encoding, adding a space wouldn't cure 
it... the encoding of the file would still be UTF-8, and the platform default 
encoding would still be the same whatever you think it might be (but I think it 
is UTF-8 for source text), so adding a space would not effect an encoding 
mismatch.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14805] Support display of both __cause__ and __context__

2012-05-15 Thread Patrick Westerhoff

Changes by Patrick Westerhoff patrickwesterh...@gmail.com:


--
nosy: +poke

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14805
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14674] Add link to RFC 4627 from json documentation

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

 for key, value in pairs:
 if key in pairs:

if key in obj:?

--
title: Link to  explain deviations from RFC 4627 in json module docs - Add 
link to RFC 4627 from json documentation

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14674
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14674] Add link to RFC 4627 from json documentation

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

IMHO, it would be sufficient to have a simple bullet list of differences
and notes or warnings in places where Python can generate non-standard
JSON (top-level scalars, inf and nan, non-utf8 encoded strings).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14674
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14803] Enhanced command line features for the runpy module

2012-05-15 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 As Ned notes, to cover *implicit* creation of Python subprocesses an
 environment based solution would be needed to ensure the subprocesses
 adopt the desired settings.

So why aren't you proposing an environment-based solution instead? :)
To use the -C option, you have to modify all places which launch a
Python subprocess.

--
title: Add feature to allow code execution prior to __main__ invocation - 
Enhanced command line features for the runpy module

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14803
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

You are right, file system encoding was platform dependent, not file encoding.

This space-after-parentheses trigger is odd; I'm adding the Windows guys to the 
ticket. Please tell us also your exact version of Windows.

--
components:  -Interpreter Core
nosy: +brian.curtin, tim.golden
type: compile error - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-05-15 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Because I was thinking about a specific case where I *could* configure how the 
subprocesses were invoked (launching a test server for a web application). It 
took Ned's comment to remind me of the original use case (i.e. coverage 
statistics for a subprocesses created by an arbitrary application, *not* a 
custom test harness).

What this would allow is the elimination of a whole class of ad hoc feature 
requests - any process global configuration setting with a Python API would 
automatically also receive a command line API (via -C) and an environment API 
(via PYTHONRUNFIRST).

Some existing options (like -Xfaulthandler) may never have been added if -C was 
available.

That's why I changed the issue title (and am now updating the specific 
suggestion).

--
title: Enhanced command line features for the runpy module - Add feature to 
allow code execution prior to __main__ invocation

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14803
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-05-15 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Actually, there's another use case for you:

export PYTHONRUNFIRST=import faulthandler; faulthandler.enable()
application.py

All subprocesses launched by the application will now have faulthandler 
enabled, *without* modifying the application. Doing this in a shell session 
means that faulthandler will be enabled for all Python processes you launch.

Obviously, care would need to be taken to ensure PYTHONRUNFIRST is ignored for 
setuid scripts (and it would respect -E as with any other environment variable).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14803
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14813] Can't build under VS2008 anymore

2012-05-15 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

I tried to build PC/VS9.0/pcbuild.sln using Visual Studio 2008, but it failed:

1-- Build started: Project: make_buildinfo, Configuration: Release Win32 
--
2-- Build started: Project: kill_python, Configuration: Debug x64 --
2Compiling...
1Compiling...
2kill_python.c
1make_buildinfo.c
2c1 : fatal error C1083: Cannot open source file: '.\kill_python.c': No such 
file or directory
1c1 : fatal error C1083: Cannot open source file: '.\make_buildinfo.c': No 
such file or directory
2Build log was saved at 
file://Z:\default\PC\VS9.0\x64-temp-Debug\kill_python\BuildLog.htm
2kill_python - 1 error(s), 0 warning(s)
1Build log was saved at 
file://Z:\default\PC\VS9.0\Win32-temp-Release\make_buildinfo\BuildLog.htm
1make_buildinfo - 1 error(s), 0 warning(s)
3-- Build started: Project: make_versioninfo, Configuration: Debug Win32 
--
4-- Build started: Project: w9xpopen, Configuration: Debug x64 --
3Compiling...
4Compiling...
3make_versioninfo.c
4w9xpopen.c
3c1 : fatal error C1083: Cannot open source file: '..\PC\make_versioninfo.c': 
No such file or directory
4c1 : fatal error C1083: Cannot open source file: '..\PC\w9xpopen.c': No such 
file or directory
3Build log was saved at 
file://Z:\default\PC\VS9.0\Win32-temp-Debug\make_versioninfo\BuildLog.htm
3make_versioninfo - 1 error(s), 0 warning(s)
4Build log was saved at 
file://Z:\default\PC\VS9.0\x64-temp-Debug\w9xpopen\BuildLog.htm
4w9xpopen - 1 error(s), 0 warning(s)
5-- Build started: Project: pythoncore, Configuration: Debug x64 --
5Compiling...
5traceback.c
5c1 : fatal error C1083: Cannot open source file: '..\Python\traceback.c': No 
such file or directory
5thread.c
5c1 : fatal error C1083: Cannot open source file: '..\Python\thread.c': No 
such file or directory
5sysmodule.c
[etc.]

--
assignee: brian.curtin
components: Build
messages: 160704
nosy: brian.curtin, loewis, pitrou
priority: release blocker
severity: normal
status: open
title: Can't build under VS2008 anymore
type: compile error
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14813
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I tried to reproduce but failed to compile a Windows Python - see issue14813.

--
components: +Windows
nosy: +pitrou
versions: +Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

I can reproduce it on Linux. Minimal example:

$ ./python -c open('longline.py', 'w').write('#' + repr('\u00A1' * 4096) + 
'\n')
$ ./python longline.py
  File longline.py, line 1
SyntaxError: Non-UTF-8 code starting with '\xc2' in file longline.py on line 1, 
but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

--
nosy: +storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14810] Bug in tarfile

2012-05-15 Thread Lars Gustäbel

Lars Gustäbel l...@gustaebel.de added the comment:

This issue is related to issue13158 which deals with a GNU tar specific 
extension to the original tar format. In that issue a negative number in the 
uid/gid fields caused problems. In your case the problem is a negative mtime 
field.

Reading these particular number fields was fixed in Python 3.2. You might be 
able to read the archive in question with that version. You should definitely 
try that.

Besides that, I was unable to reproduce the error you report. I just did some 
tests and could not even open my test archive, because it was not recognized as 
a tar file. I didn't come as far as the os.utime() call.

--
nosy: +lars.gustaebel

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14810
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

And for Python 2.7 too.

--
versions: +Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

Function decoding_fgets (Parser/tokenizer.c) reads line in buffer of fixed size 
8192 (line truncated to size 8191) and then fails because line is cut in the 
middle of a multibyte UTF-8 character.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14811] Syntax error on long UTF-8 lines

2012-05-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
title: compile fails - UTF-8 character decoding - Syntax error on long UTF-8 
lines

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

For faulthandler and coverage would be more convenient option -M (run
module with __name__='__premain__' (or something of the sort) and
continue command line processing).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14803
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14813] Can't build under VS2008 anymore

2012-05-15 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Building with VS 2008 isn't officially supported anymore. If users want to 
continue to use VS 2008, they need to contribute patches. Preferably, the 
project files would be generated from the VS2010 project files, but for the 
moment, manually editing to make them work again might be fine as well.

Unassigning Brian for now - Brian, if you want to work on this, feel free to 
assign yourself again.

--
assignee: brian.curtin - 
priority: release blocker - normal

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14813
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14810] Bug in tarfile

2012-05-15 Thread Hans Werner May

Hans Werner May nc-may...@netcologne.de added the comment:

Out of curiosity: where did you get a file that was last modified in 1956?

No idea, this was a jpeg file, probably downloaded from internet. Btw, on Linux 
you can manipulate the creation date with the touch command, so it is possible 
to create a tarball with a member which has creation date 1956, but it is not 
possible to extract it with the extractall method.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14810
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-05-15 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

No, that increases complexity and coupling, because it would only work for 
modules that were designed to work that way. Execution of a simple statement 
will work for any global state that can be modified from pure Python code 
(including invocation of more complex configuration settings from a custom 
Python module).

For a mature application, you wouldn't do it this way because you'd have other 
more polished mechanisms in place, but for debugging, experimentation and 
dealing with recalcitrant third party software, it could help deal with various 
problems without having to edit the code.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14803
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-15 Thread Thomas Kluyver

Thomas Kluyver tak...@gmail.com added the comment:

I've submitted the contributor agreement, though I've not yet heard anything 
back about it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14777
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14813] Can't build under VS2008 anymore

2012-05-15 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Building with VS 2008 isn't officially supported anymore. If users
 want to continue to use VS 2008, they need to contribute patches.

Well, VS 2010 is probably a multi-GB download and install. Besides,
having to juggle between two different VS versions will quickly become
confusing.

Speaking as a non-native Windows developer, there are enough hoops I
must jump through to do occasional testing under a Windows VM. So I
might simply stop caring.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14813
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-15 Thread Thomas Kluyver

Thomas Kluyver tak...@gmail.com added the comment:

...And mere minutes after I said I hadn't heard anything, I've got the 
confirmation email. :-)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14777
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14809] Add HTTP status codes introduced by RFC 6585

2012-05-15 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

EungYun,

After further research I've found two issue which you should fix before it can 
be checked in:

 - The multi-line strings are missing spaces at their line break (429 and 431).
 - The error codes are documented at 
http://hg.python.org/cpython/file/26b8ec8a7800/Doc/library/http.client.rst#l180 
, so you should add the new ones there.
 - You should mention the new RFC at Lib/http/server.py#l576 .

Would you like to update your patch?

--
stage: patch review - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14809
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

 ...And mere minutes after I said I hadn't heard anything, I've got the 
 confirmation email. :-)

Congratulations!

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14777
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-05-15 Thread Nick Coghlan

New submission from Nick Coghlan ncogh...@gmail.com:

This issue tracks the incorporation of the ipaddress module into Python 3.3.

Tasks to be completed:
- add Lib/ipaddress.py from [1]
- add Lib/test_ipaddress.py from [1]
- create module reference docs from docstrings in [1]
- add Doc/library/ipaddress.py and link from index
- create howto guide from wiki page [2]
- add Doc/howto/ipaddress.rst and link from index

[1] https://code.google.com/p/ipaddress-py/source/browse/

[2] https://code.google.com/p/ipaddr-py/wiki/Using3144

--
components: Library (Lib)
messages: 160719
nosy: ncoghlan
priority: release blocker
severity: normal
stage: needs patch
status: open
title: Implement PEP 3144 (the ipaddress module)
type: enhancement
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14814
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13952] mimetypes doesn't recognize .csv

2012-05-15 Thread Paul Cauchon

Changes by Paul Cauchon paulcauc...@gmail.com:


--
nosy: +Paul.Cauchon

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13952
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14815] random_seed uses only 32-bits of hash on Win64

2012-05-15 Thread Martin v . Löwis

New submission from Martin v. Löwis mar...@v.loewis.de:

random_seed has this code:

  long hash = PyObject_Hash(arg);

On Win64, Py_hash_t is a 64-bit type, yet long is a 32-bit type, so this 
truncates. I think the computation should be done in Py_ssize_t.

--
messages: 160720
nosy: loewis
priority: normal
severity: normal
status: open
title: random_seed uses only 32-bits of hash on Win64

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14815] random_seed uses only 32-bits of hash on Win64

2012-05-15 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +rhettinger

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14816] compilation failed on Ubuntu shared buildbot

2012-05-15 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

See http://www.python.org/dev/buildbot/all/builders/x86%20Ubuntu%20Shared%203.x

First failing build is 
http://www.python.org/dev/buildbot/all/builders/x86%20Ubuntu%20Shared%203.x/builds/5955

--
components: Build
messages: 160721
nosy: benjamin.peterson, db3l, pitrou
priority: release blocker
severity: normal
status: open
title: compilation failed on Ubuntu shared buildbot
type: crash
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14816
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-15 Thread Andrew Svetlov

Andrew Svetlov andrew.svet...@gmail.com added the comment:

I'm ok with last patch version.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14777
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14804] Wrong defaults args notation in docs

2012-05-15 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Yes.  Close as duplicate?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14804
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14804] Wrong defaults args notation in docs

2012-05-15 Thread Petri Lehtinen

Petri Lehtinen pe...@digip.org added the comment:

This issue is about documentation style of function signatures, not about 
missing keyword arguments in C functions.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14804
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14494] __future__.py and its documentation claim absolute imports became mandatory in 2.7, but they didn't

2012-05-15 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


--
nosy: +petri.lehtinen

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14494
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14773] fwalk breaks on dangling symlinks

2012-05-15 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

I just realized it doesn't really make sense because if a file disappears for 
real, we'll get another FileNotFoundException when checking whether it's a 
symlink and the continue is never reached.

So behold v3. :)

This time, I have tested it by injecting a

if name == 'tmp4':
import os
os.unlinkat(topfd, name)

right before the S_ISDIR in fwalk.

Some tests failed because said tmp4 was obviously missing – the old code threw 
FileNotFoundExceptions. After restoration the whole test suite passes in 
regression mode.

--
stage: commit review - patch review
Added file: http://bugs.python.org/file25596/fwalk.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14773
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14807] Move tarfile.filemode() into stat module

2012-05-15 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 492e6c6a01bb by Giampaolo Rodola' in branch 'default':
#14807: move undocumented tarfile.filemode() to stat.filemode(). Add 
tarfile.filemode alias with deprecation warning.
http://hg.python.org/cpython/rev/492e6c6a01bb

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14807
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14807] Move tarfile.filemode() into stat module

2012-05-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14807
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14800] stat.py constant comments + docstrings

2012-05-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
assignee:  - giampaolo.rodola
keywords: +easy -patch
stage:  - committed/rejected
status: open - closed
type:  - enhancement

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14800
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14807] Move tarfile.filemode() into stat module

2012-05-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
assignee:  - giampaolo.rodola

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14807
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11959] smtpd cannot be used without affecting global state

2012-05-15 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

 If asyncore and asynchat are (mostly?) supporting an alternate
 socket map, why is it necessary to copy create_socket?
 Shouldn't we be fixing create_socket in asyncore instead?

Well, I don't see how this can be done along with keeping existing behaviour, 
since if you currently pass a map to the dispatcher constructor, it's not 
passed to set_socket; fixing it in asyncore would mean changing this fact, and 
so in theory could break existing code.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11959
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11959] smtpd cannot be used without affecting global state

2012-05-15 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Changing it in asyncore is fine.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11959
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14804] Wrong defaults args notation in docs

2012-05-15 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Indeed.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14804
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14773] fwalk breaks on dangling symlinks

2012-05-15 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
stage: patch review - commit review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14773
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-05-15 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe tshep...@gmail.com:


--
nosy: +tshepang

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14814
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14773] fwalk breaks on dangling symlinks

2012-05-15 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset cbe7560d4443 by Hynek Schlawack in branch 'default':
#14773: Fix os.fwalk() failing on dangling symlinks
http://hg.python.org/cpython/rev/cbe7560d4443

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14773
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12541] Accepting Badly formed headers in urllib HTTPBasicAuth

2012-05-15 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 3e10d0148f79 by Senthil Kumaran in branch '2.7':
Issue #12541: Be lenient with quotes around Realm field with HTTP Basic 
Authentation in urllib2.
http://hg.python.org/cpython/rev/3e10d0148f79

New changeset bb94fec5c5ab by Senthil Kumaran in branch '3.2':
Issue #12541: Be lenient with quotes around Realm field of HTTP Basic 
Authentation in urllib2.
http://hg.python.org/cpython/rev/bb94fec5c5ab

New changeset bf20564296aa by Senthil Kumaran in branch 'default':
merge from 3.2 - Issue #12541: Be lenient with quotes around Realm field of 
HTTP Basic Authentation in urllib2.
http://hg.python.org/cpython/rev/bf20564296aa

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12541
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14809] Add HTTP status codes introduced by RFC 6585

2012-05-15 Thread EungJun Yi

Changes by EungJun Yi semtlen...@gmail.com:


Added file: http://bugs.python.org/file25597/rfc6585.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14809
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14809] Add HTTP status codes introduced by RFC 6585

2012-05-15 Thread EungJun Yi

EungJun Yi semtlen...@gmail.com added the comment:

Hynek, I have fixed them and upload the patch, rfc6585-rev2.patch.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14809
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11959] smtpd cannot be used without affecting global state

2012-05-15 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

But it is create_socket you want to change.  So if we add a map argument to 
that and only pass it to socket if it is non-None, wouldn't that maintain 
backward compatibility with current asyncore behavior?  Neither asyncore nor 
asynchat calls create_socket, as far as I can see.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11959
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14813] Can't build under VS2008 anymore

2012-05-15 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 Well, VS 2010 is probably a multi-GB download and install. Besides,
 having to juggle between two different VS versions will quickly become
 confusing.

Sure. However, it is not feasible to keep the build systems for many
VS versions up-to-date, just because contributors are shy of installing
the current version. Tracking two build systems (autoconf and VS) is
already difficult enough.

 Speaking as a non-native Windows developer, there are enough hoops I
 must jump through to do occasional testing under a Windows VM. So I
 might simply stop caring.

This is free software. If you don't want to care, you don't have to.
It's the same as switching from Subversion to Mercurial: we probably
lost some contributors who never bothered to learn Mercurial. That
didn't stop us from switching. I expect that most occasional contributors
will find it easier to use VS 2010 than VS 2008.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14813
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14072] urlparse on tel: URI-s misses the scheme in some cases

2012-05-15 Thread Senthil Kumaran

Senthil Kumaran sent...@uthcode.com added the comment:

Hi Ezio,

The patch is fine and the check is correct. I was thinking if by removing int() 
based verification are we missing out anything on port number check. But looks 
like we wont as the int() previously is done to find the proper scheme and url 
part for the applicable cases.

In addition to changes in the patch, I think, it would helpful to add 'tel' to 
uses_netloc in the classification at the top of the module.

Thanks!

--
assignee: orsenthil - ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14072
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14809] Add HTTP status codes introduced by RFC 6585

2012-05-15 Thread Senthil Kumaran

Changes by Senthil Kumaran sent...@uthcode.com:


--
nosy: +orsenthil

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14809
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14133] improved PEP 409 implementation

2012-05-15 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

2012/5/15 Georg Brandl rep...@bugs.python.org:

 Georg Brandl ge...@python.org added the comment:

 I hope you're not disappointed when that PEP doesn't show up in the release 
 notes :)

It gives me more peace of mind than any release note ever could. :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14133
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14072] urlparse on tel: URI-s misses the scheme in some cases

2012-05-15 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 it would helpful to add 'tel' to uses_netloc

How so?  The tel scheme does not use a netloc.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14072
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-05-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14814
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14813] Can't build under VS2008 anymore

2012-05-15 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 This is free software. If you don't want to care, you don't have to.

Of course. I'm just pointing this out in relation with the fact that we
don't have many Windows-based developers :-)

 I expect that most occasional contributors
 will find it easier to use VS 2010 than VS 2008.

Are there any features which make VS 2010 easier to use for us?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14813
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12541] Accepting Badly formed headers in urllib HTTPBasicAuth

2012-05-15 Thread Senthil Kumaran

Senthil Kumaran sent...@uthcode.com added the comment:

this issue is taken care. Both in accepting unquoted Realm for basic auth 
leniently and then raising a UserWarning when encountering this case.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12541
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >