PyPy Gothenburg Post-Easter Sprint April 25 - May 1 2011

2011-04-05 Thread Laura Creighton
PyPy Göteborg Post-Easter Sprint April 25 - May 1 2011 == The next PyPy sprint will be in Gothenburg, Sweden. It is a public sprint, very suitable for newcomers. We'll focus on making the 1.5 release (if it hasn't already happened) and

Toronto PyCamp 2011

2011-04-05 Thread Chris Calloway
The University of Toronto Department of Physics brings PyCamp to Toronto on Monday, June 27 through Thursday, June 30, 2011. Register today at http://trizpug.org/boot-camp/torpy11/ For beginners, this ultra-low-cost Python Boot Camp makes you productive so you can get your work done quickly.

Thinking and Analysis based on Marxism Literature

2011-04-05 Thread Mukunda Lohani
For getting good knowledge about Marxism and Literature, Marx his Opinions to sharpen thinking analytically, don't forget to click on the website given below:- www.analyzethink.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

News

2011-04-05 Thread Mukunda Lohani
For getting the effective information on the News, please click on this website: www.ml97712.blogspot.com This website will provide you the knowledge about the best news. -- http://mail.python.org/mailman/listinfo/python-list

Jobs

2011-04-05 Thread Mukunda Lohani
If you want to get the innovative information on the Job job Market, please click on this website: www.111jobs.blogspot.com This website is based on the job technique and idea. -- http://mail.python.org/mailman/listinfo/python-list

Re: running Python2 Python3 parallel concurrent

2011-04-05 Thread rusi
On Mar 31, 6:05 am, harrismh777 harrismh...@charter.net wrote: Greetings,      The purpose of this communique is to document a process for installing python2.7.1 in parallel with python3.2 on a concurrent desktop with independent idle and python path structure. Not sure if this is

Re: Testing for performance regressions

2011-04-05 Thread geremy condra
On Mon, Apr 4, 2011 at 10:25 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Mon, 04 Apr 2011 20:59:52 -0700, geremy condra wrote: On Mon, Apr 4, 2011 at 7:45 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: * The disclaimers about timing code snippets that

replace regex in file using a dictionary

2011-04-05 Thread Martin De Kauwe
Hi, So i want to replace multiple lines in a text file and I have reasoned the best way to do this is with a dictionary. I have simplified my example and broadly I get what I want however I am now printing my replacement string and part of the original expression. I am guessing that I will need

Re: XML header with lxml

2011-04-05 Thread Stefan Behnel
Jabba Laci, 04.04.2011 18:54: I want to construct an XML file with lxml but I don't find how to add the '?xml version=1.0?' header. This is not required. According to the XML spec, the default is: ?xml version=1.0 encoding=utf-8 standalone=false? So, unless you diverge from these values,

Re: XML header with lxml

2011-04-05 Thread Stefan Behnel
Chroma Key, 04.04.2011 21:49: On 2011-04-04 18:54:40 +0200, Jabba Laci said: I want to construct an XML file with lxml but I don't find how to add the '?xml version=1.0?' header. from lxml import etree as ET html = ET.Element(html) print ET.tostring(html) Add the xml_declaration=True as an

Re: replace regex in file using a dictionary

2011-04-05 Thread Vlastimil Brom
2011/4/5 Martin De Kauwe mdeka...@gmail.com: Hi, So i want to replace multiple lines in a text file and I have reasoned the best way to do this is with a dictionary. I have simplified my example and broadly I get what I want however I am now printing my replacement string and part of the

3D subfigures in matplotlib?

2011-04-05 Thread MATLABdude
How can I make maybe 3D subfigures with Python and matplotlib? I found the following example (http://matplotlib.sourceforge.net/ examples/mplot3d/subplot3d_demo.html), but it doesn't work. --- from mpl_toolkits.mplot3d.axes3d import Axes3D import matplotlib.pyplot as plt # imports specific to

Re: replace regex in file using a dictionary

2011-04-05 Thread Yashwin Kanchan
How about creating a new string instead of replacing the original. def replace_keys(text, replacements_dict): text_list = text.split('\n') new_text = '' for line in text_list: key=line.split('=')[0] if key.strip() in replacements_dict: new_text = new_text +

Python benefits over Cobra

2011-04-05 Thread Brendan Simon (eTRIX)
I just came across the Cobra language, which appears to be heavily influenced by Python (and other languages). The pitch sounds great. It's supposed to have: 1. Quick, expressive coding 2. Fast execution 3. Static and dynamic binding 4. Language level support for quality

Re: Python benefits over Cobra

2011-04-05 Thread Colin J. Williams
On 05-Apr-11 06:22 AM, Brendan Simon (eTRIX) wrote: I just came across the Cobra language, which appears to be heavily influenced by Python (and other languages). The pitch sounds great. It's supposed to have: 1. Quick, expressive coding 2. Fast execution 3. Static and dynamic binding

is python 3 better than python 2?

2011-04-05 Thread neil
what are the advantages? if it wasn't for python 3 breaking backwards compatibility would it be the better choice? -- http://mail.python.org/mailman/listinfo/python-list

python fighting game?(like street fighter)

2011-04-05 Thread neil harper
are there any good fighting games in the style of street fighter or guilty gear? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python benefits over Cobra

2011-04-05 Thread Boris FELD
Cobra seems interessant, open-source, but the dependance on Mono and .Net annoy me a bit. Otherwise, cobra have good ideas, a syntax similar to python. One thing i really love is the How-To and the Samples pages on it's website, i think it's a very good thing for beginners. FELD Boris 2011/4/5

Suggest some exercises on Python

2011-04-05 Thread Jins Thomas
Hi all, I'm a new bie. I have just started learning Python (3.0), finished with official tutorial. I would like to have your opinion on some 1. Good books (for an intermediate in programming) with lot's of exercise i can try it out. For example when i started with Perl i was going through a book

Re: Fun python 3.2 one-liner

2011-04-05 Thread Daniel Fetchinson
what is the character limit on a one liner :P. For PEP 8 compliance, 80 characters. :-) Yeah, but we don't live in the 80's or 90's anymore and our screens can support xterms (or let alone IDE widows) much wider than 80 characters. I'm using 140 for python these days. Seriously, who would want

Re: proposal to allow to set the delimiter in str.format to something other than curly bracket

2011-04-05 Thread Neil Cerutti
On 2011-04-04, Alia Khouri alia_kho...@yahoo.com wrote: Nice! I didn't think of that. I guess I could get some additional performance by taking the re.compile step out of the function. Thanks for the tip! I recommend The Pragmatic Programmer, (Hunt, Thomas) ISBN 978-0201616224 and The Practice

Re: running Python2 Python3 parallel concurrent

2011-04-05 Thread harrismh777
rusi wrote: Not sure if this is relevant... python-mode (emacs mode for python development) is broken for python 3 I submitted a 1-line patch which makes python-mode work for 2.x and 3.x Its relevant to Mac OSX, but not so much for what I'm doing in Linux, here. On the other hand, I can't see

Re: is python 3 better than python 2?

2011-04-05 Thread Mel
neil wrote: what are the advantages? if it wasn't for python 3 breaking backwards compatibility would it be the better choice? IMHO the killer app for Python 3 is in more reasonable support for foreign character sets (no matter where your are, at least one out of the hundred-odd Unicode

How to program in Python to run system commands in 1000s of servers

2011-04-05 Thread Babu
Here is my problem: Want to program in python to run sysadmin commands across 1000s of servers and gather the result in one place. Many times the commands need to be run as root. We cannot use ssh as root remote connectivity as well. What are the different ways of programming in python to

Re: Fun python 3.2 one-liner

2011-04-05 Thread Steven D'Aprano
On Tue, 05 Apr 2011 15:38:28 +0200, Daniel Fetchinson wrote: what is the character limit on a one liner :P. For PEP 8 compliance, 80 characters. :-) Yeah, but we don't live in the 80's or 90's anymore and our screens can support xterms (or let alone IDE widows) much wider than 80

Re: Suggest some exercises on Python

2011-04-05 Thread neil harper
On Tue, 2011-04-05 at 18:43 +0530, Jins Thomas wrote: Hi all, I'm a new bie. I have just started learning Python (3.0), finished with official tutorial. I would like to have your opinion on some 1. Good books (for an intermediate in programming) with lot's of exercise i can try it out.

Re: Fun python 3.2 one-liner

2011-04-05 Thread Chris Angelico
On Wed, Apr 6, 2011 at 1:07 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Tue, 05 Apr 2011 15:38:28 +0200, Daniel Fetchinson wrote: Seriously, who would want to limit him/herself to 80 characters in 2011? Seriously, or is that a rhetorical question? People who like to

Re: Fun python 3.2 one-liner

2011-04-05 Thread Tim Wintle
On Tue, 2011-04-05 at 15:38 +0200, Daniel Fetchinson wrote: Yeah, but we don't live in the 80's or 90's anymore and our screens can support xterms (or let alone IDE widows) much wider than 80 characters. I'm using 140 for python these days. Seriously, who would want to limit him/herself to 80

Re: replace regex in file using a dictionary

2011-04-05 Thread nn
On Apr 5, 3:59 am, Martin De Kauwe mdeka...@gmail.com wrote: Hi, So i want to replace multiple lines in a text file and I have reasoned the best way to do this is with a dictionary. I have simplified my example and broadly I get what I want however I am now printing my replacement string and

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-05 Thread Robert Kern
On 4/4/11 7:05 PM, Robert Kern wrote: On 4/4/11 3:20 PM, John Ladasky wrote: However, at least in Python 2.7, multiprocessing seems to have a C extension module defining the Connection objects. Unfortunately, it looks like this C extension just imports the regular pickler that is not aware of

Re: is python 3 better than python 2?

2011-04-05 Thread Terry Reedy
On 4/5/2011 8:42 AM, neil wrote: what are the advantages? Py3 complete many transitions begun in Py2. In some cases, that means deleting old obsolete stuff, such as old-style classes. if it wasn't for python 3 breaking backwards compatibility would it be the better choice? Assuming

Re: is python 3 better than python 2?

2011-04-05 Thread Gnarlodious
On Apr 5, 6:42 am, neil neilharper300...@gmail.com wrote: what are the advantages? if it wasn't for python 3 breaking backwards compatibility would it be the better choice? I adopted Py3 because of support of OrderedDict and many new features. Since mine was a new project using no existing

Re: How to program in Python to run system commands in 1000s of servers

2011-04-05 Thread geremy condra
On Tue, Apr 5, 2011 at 7:51 AM, Babu bab...@gmail.com wrote: Here is my problem:  Want to program in python to run sysadmin commands across 1000s of servers and gather the result in one place. Many times the commands need to be run as root.  We cannot use ssh as root remote connectivity as

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-05 Thread John Ladasky
Hi Philip, Thanks for the reply. On Apr 4, 4:34 pm, Philip Semanchuk phi...@semanchuk.com wrote: So if you're going to use multiprocessing, you're going to use pickle, and you need pickleable objects. OK, that's good to know. Pickling is still a pretty vague progress to me, but I can see

Re: Suggest some exercises on Python

2011-04-05 Thread Terry Reedy
On 4/5/2011 9:13 AM, Jins Thomas wrote: I'm a new bie. I have just started learning Python (3.0), Please download, install, and use 3.2. finished with official tutorial. I would like to have your opinion on some 1. Good books (for an intermediate in programming) with lot's of ... 2.

Re: Suggest some exercises on Python

2011-04-05 Thread Steven D'Aprano
On Tue, 05 Apr 2011 13:18:19 -0400, Terry Reedy wrote: On 4/5/2011 9:13 AM, Jins Thomas wrote: I'm a new bie. I have just started learning Python (3.0), Please download, install, and use 3.2. To elaborate further: Python 3.0 is not supported, and is buggy and slow. You should avoid it.

Re: Light weight IDE like pywin for os x 10.6

2011-04-05 Thread Detlev Offenbach
python wrote: I have looked a while for this answer. Sorry if it right before me. I have move from Windows to os x. The thing I miss most is pywin. I know you can purchase or download full IDE's for python or even use Eclipse. I really liked the ability to switch from interactive

Re: Suggest some exercises on Python

2011-04-05 Thread geremy condra
On Tue, Apr 5, 2011 at 6:13 AM, Jins Thomas jinstho...@gmail.com wrote: Hi all, I'm a new bie. I have just started learning Python (3.0), finished with official tutorial. I would like to have your opinion on some 1. Good books (for an intermediate in programming) with lot's of exercise i

Re: Fun python 3.2 one-liner

2011-04-05 Thread Steven D'Aprano
On Wed, 06 Apr 2011 01:19:06 +1000, Chris Angelico wrote: On Wed, Apr 6, 2011 at 1:07 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Tue, 05 Apr 2011 15:38:28 +0200, Daniel Fetchinson wrote: Seriously, who would want to limit him/herself to 80 characters in 2011?

Re: Fun python 3.2 one-liner

2011-04-05 Thread Daniel Fetchinson
what is the character limit on a one liner :P. For PEP 8 compliance, 80 characters. :-) Yeah, but we don't live in the 80's or 90's anymore and our screens can support xterms (or let alone IDE widows) much wider than 80 characters. I'm using 140 for python these days. Seriously, who would

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-05 Thread Philip Semanchuk
On Apr 5, 2011, at 12:58 PM, John Ladasky wrote: Hi Philip, Thanks for the reply. On Apr 4, 4:34 pm, Philip Semanchuk phi...@semanchuk.com wrote: So if you're going to use multiprocessing, you're going to use pickle, and you need pickleable objects. OK, that's good to know. But as

Indentation levels and line lengths (was Re: Fun python 3.2 one-liner)

2011-04-05 Thread Chris Angelico
On Wed, Apr 6, 2011 at 3:48 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: and has on occasion gone as far as 12-16. I would consider anything more than four indents a code smell. That is, four is unexceptional; five would make me look over the code to see if it could be

Re: Suggest some exercises on Python

2011-04-05 Thread Blockheads Oi Oi
On 05/04/2011 18:24, Steven D'Aprano wrote: On Tue, 05 Apr 2011 13:18:19 -0400, Terry Reedy wrote: On 4/5/2011 9:13 AM, Jins Thomas wrote: I'm a new bie. I have just started learning Python (3.0), Please download, install, and use 3.2. To elaborate further: Python 3.0 is not supported,

Re: is python 3 better than python 2?

2011-04-05 Thread John Nagle
On 4/5/2011 7:46 AM, Mel wrote: neil wrote: what are the advantages? if it wasn't for python 3 breaking backwards compatibility would it be the better choice? IMHO the killer app for Python 3 is in more reasonable support for foreign character sets (no matter where your are, at least one out

a better way to invert a list?

2011-04-05 Thread scattered
Greetings, I've been playing around (in Python 3.1) with permutations of 0,1,...,n-1, represented by lists, p, of length n, where p[i] = the image of i under the permutation. I wanted to be able to calculate the inverse of such a permutation, and came up with the following succint but not quite

Re: a better way to invert a list?

2011-04-05 Thread Ian Kelly
On Tue, Apr 5, 2011 at 3:17 PM, scattered tooscatte...@gmail.com wrote: Greetings, I've been playing around (in Python 3.1) with permutations of 0,1,...,n-1, represented by lists, p, of length n, where p[i] = the image of i under the permutation. I wanted to be able to calculate the inverse

Re: replace regex in file using a dictionary

2011-04-05 Thread Martin De Kauwe
yes thanks both work nicely, I will ponder the suggestions. -- http://mail.python.org/mailman/listinfo/python-list

Re: a better way to invert a list?

2011-04-05 Thread scattered
On Apr 5, 5:46 pm, Ian Kelly ian.g.ke...@gmail.com wrote: On Tue, Apr 5, 2011 at 3:17 PM, scattered tooscatte...@gmail.com wrote: Greetings, I've been playing around (in Python 3.1) with permutations of 0,1,...,n-1, represented by lists, p, of length n, where p[i] = the image of i under

Re: a better way to invert a list?

2011-04-05 Thread Raymond Hettinger
[Ian Kelly] Which is O(n).  If that is too verbose, you could also use a dictionary: def invert(p):     return dict(map(reversed, enumerate(p))) def inv(p): return dict(zip(p, itertools.count())) Raymond -- http://mail.python.org/mailman/listinfo/python-list

Re: Fun python 3.2 one-liner

2011-04-05 Thread Raymond Hettinger
On Apr 5, 6:38 am, Daniel Fetchinson fetchin...@googlemail.com wrote: what is the character limit on a one liner :P. For PEP 8 compliance, 80 characters. :-) Yeah, but we don't live in the 80's or 90's anymore and our screens can support xterms (or let alone IDE widows) much wider than 80

Re: 3D subfigures in matplotlib?

2011-04-05 Thread eryksun ()
On Tuesday, April 5, 2011 6:17:34 AM UTC-4, MATLABdude wrote: How can I make maybe 3D subfigures with Python and matplotlib? I found the following example (http://matplotlib.sourceforge.net/ examples/mplot3d/subplot3d_demo.html), but it doesn't work. [snip] I am using Python 2.6.6., and

Re: How to program in Python to run system commands in 1000s of servers

2011-04-05 Thread Roy Smith
In article mailman.52.1302022780.9059.python-l...@python.org, geremy condra debat...@gmail.com wrote: On Tue, Apr 5, 2011 at 7:51 AM, Babu bab...@gmail.com wrote: Here is my problem:  Want to program in python to run sysadmin commands across 1000s of servers and gather the result in one

Sandboxed Python: memory limits?

2011-04-05 Thread Chris Angelico
Is it possible, and if so is it easy, to limit the amount of memory an embedded Python interpreter is allowed to allocate? I don't want to ulimit/rlimit the process if I don't have to (or rather, I want the process's limit to be high, and the Python limit much lower), but just to force Python to

Standard config file format

2011-04-05 Thread Vincent Davis
I am working on a program to monitor directory file changes and am would like a configuration file. This file would specify email addresses, file and directory locations.. Is there a preferred format to use with python? -- Thanks Vincent Davis --

Re: Standard config file format

2011-04-05 Thread Chris Rebert
On Tue, Apr 5, 2011 at 7:16 PM, Vincent Davis vinc...@vincentdavis.net wrote: I am working on a program to monitor directory file changes and am would like a configuration file. This file would specify email addresses, file and directory locations.. Is there a preferred format to use with

Re: Fun python 3.2 one-liner

2011-04-05 Thread Ben Finney
Raymond Hettinger pyt...@rcn.com writes: On Apr 5, 6:38 am, Daniel Fetchinson fetchin...@googlemail.com wrote: Yeah, but we don't live in the 80's or 90's anymore and our screens can support xterms (or let alone IDE widows) much wider than 80 characters. I'm using 140 for python these

Re: Python benefits over Cobra

2011-04-05 Thread Brendan Simon
On 05-Apr-11 06:22 AM, Brendan Simon (eTRIX) wrote: Any other arguments where Python has benefits over Cobra ?? Cheers, Brendan. Two questions: 1. Is Cobra Open Source? 2. The blog ended on October, did he run out of steam? I liked the '.', in place of '.self', but

How to debug c libraries on python?

2011-04-05 Thread yuan zheng
Hi, everyone: I encouter a problem: I invoke some c libraries in python through the api CDLL.Possibly, there is sth. wrong in my c libraries. It would appear segment fault when executing some func in c libraries which invoked through CDLL. How can I debug? I attempted to debug it with

Re: is python 3 better than python 2?

2011-04-05 Thread Terry Reedy
On 4/5/2011 4:42 PM, John Nagle wrote: Well, actually Unicode support went in back around Python 2.4. Even earlier, I think, but there were and still are problems with unicode in 2.x. Some were and will only be fixed in 3.x. In 3.x, ASCII strings went away, but that was more of a removal.

[issue11734] Add half-float (16-bit) support to struct module

2011-04-05 Thread Eli Stevens
Eli Stevens wickedg...@gmail.com added the comment: I see the distinction about the rounding error now. Thanks for clarifying; I've added more tests as suggested. Looking at _struct.c, line 2085: /* Skip float and double, could be unknown float

[issue11734] Add half-float (16-bit) support to struct module

2011-04-05 Thread Eli Stevens
Eli Stevens wickedg...@gmail.com added the comment: More questions: The current _PyFloat_Pack4 doesn't round to even: fbits = (unsigned int)(f + 0.5); /* Round */ Is the mismatch going to be a problem? Should I change the _PyFloat_Pack4 implementation while I'm in there? --

[issue11725] httplib and urllib2 failed ssl connection httplib.BadStatusLine

2011-04-05 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: Ned: we could work around this platform issue by including openssl 1.0d in the OSX installer. I'm not sure if that's acceptable for a bugfix release though. -- ___ Python tracker

[issue11747] unified_diff function product incorrect range information

2011-04-05 Thread ysj.ray
ysj.ray ysj@gmail.com added the comment: Since if one of the two comparing files is empty, gnu diff regards the beginning line of differences as line 0 (there is not any lines), but difflib regards it as line 1(there is a line, but empty). Not sure weather is correct since the practice

[issue11764] inspect.getattr_static code execution w/ class body as non dict

2011-04-05 Thread ysj.ray
Changes by ysj.ray ysj@gmail.com: -- nosy: +ysj.ray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11764 ___ ___ Python-bugs-list mailing list

[issue2736] datetime needs an epoch method

2011-04-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Just to add another data point to this discussion: mxDateTime, which in large parts inspired the Python datetime module, has had a .ticks() method (for local time) and a .gmticks() method (for UTC) for more than a decade now and so far, I

[issue2736] datetime needs an epoch method

2011-04-05 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Marc, could you maybe write a new patching taking care of the DST and maybe also the timezone? It looks like you have a long experience in timestamps :-) -- ___ Python tracker

[issue11703] Bug in python = 2.7 with urllib2 fragment

2011-04-05 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11703 ___ ___

[issue11707] Create C version of functools.cmp_to_key()

2011-04-05 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset a03fb2fc3ed8 by Raymond Hettinger in branch 'default': Issue #11707: Fast C version of functools.cmp_to_key() http://hg.python.org/cpython/rev/a03fb2fc3ed8 -- nosy: +python-dev ___ Python

[issue2736] datetime needs an epoch method

2011-04-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: Marc, could you maybe write a new patching taking care of the DST and maybe also the timezone? It looks like you have a long experience in timestamps

[issue11707] Create C version of functools.cmp_to_key()

2011-04-05 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Thanks for the patch Filip. Closing this. If anyone wants to lobby the RM for a 3.2 backport, feel free to re-open and assign to the release manager for consideration. -- status: open - closed

[issue11734] Add half-float (16-bit) support to struct module

2011-04-05 Thread Eli Stevens
Eli Stevens wickedg...@gmail.com added the comment: Made the _PyFloat_Pack2 match the algo in _PyFloat_Pack4, and did similar for Unpack. This should work on platforms that don't have IEEE 754 floats except for situations where an INF or NAN is unpacked (this is the same as the Unpack4

[issue11707] Create C version of functools.cmp_to_key()

2011-04-05 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 76ed6a061ebe by Victor Stinner in branch 'default': Issue #11707: Fix compilation errors with Visual Studio http://hg.python.org/cpython/rev/76ed6a061ebe -- ___ Python tracker

[issue11707] Create C version of functools.cmp_to_key()

2011-04-05 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: functools_cmp_to_key() doesn't check that the argument is a callable. table=list(range(3)) table.sort(key=functools.cmp_to_key(3)) Traceback (most recent call last): File stdin, line 1, in module TypeError: 'int' object is not

[issue11766] test_multiprocessing failure (test_pool_worker_lifetime)

2011-04-05 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11766 ___ ___

[issue11707] Create C version of functools.cmp_to_key()

2011-04-05 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: functools_cmp_to_key() doesn't check that the argument is a callable. I don't think that is necessary; it will fail with a TypeError when the attempt is made to call it. This is the approach we take elsewhere (look at the

[issue11277] test_zlib.test_big_buffer crashes under BSD (Mac OS X and FreeBSD)

2011-04-05 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- title: test_zlib crashes under Snow Leopard buildbot - test_zlib.test_big_buffer crashes under BSD (Mac OS X and FreeBSD) ___ Python tracker rep...@bugs.python.org

[issue11757] test_subprocess.test_communicate_timeout_large_ouput failure on select(): negative timeout?

2011-04-05 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- title: test_subprocess failure - test_subprocess.test_communicate_timeout_large_ouput failure on select(): negative timeout? ___ Python tracker rep...@bugs.python.org

[issue11770] inspect.dir_static

2011-04-05 Thread Michael Foord
New submission from Michael Foord mich...@voidspace.org.uk: A version of dir that returns all the members that can be seen by getattr_static. -- assignee: michael.foord components: Library (Lib) messages: 133017 nosy: michael.foord priority: low severity: normal stage: needs patch

[issue11757] test_subprocess.test_communicate_timeout_large_ouput failure on select(): negative timeout?

2011-04-05 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 3664fc29e867 by Victor Stinner in branch 'default': Issue #11757: subprocess ensures that select() and poll() timeout = 0 http://hg.python.org/cpython/rev/3664fc29e867 -- nosy: +python-dev

[issue9390] Error in sys.excepthook on windows when redirecting output of the script

2011-04-05 Thread Michal Molhanec
Michal Molhanec molha...@gmail.com added the comment: I've got the same problem with 2.7.1 (both 32bit and 64bit versions) under W7 SP1 64bit. Under WXP SP3 32bit it works OK. What's worse the output file is empty. 3.2 (tested 64bit version) behaves even worse -- it does not print the error

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2011-04-05 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1692335 ___ ___

[issue11734] Add half-float (16-bit) support to struct module

2011-04-05 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: There's no disagreement, since they're different cases. [...] What he said. Should I change the _PyFloat_Pack4 implementation while I'm in there? No; let's keep the patch as simple as possible. We can open a separate issue for fixing

[issue11771] hashlib object cannot be pickled

2011-04-05 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@haypocalc.com: $ ./python Python 3.3a0 (default:76ed6a061ebe, Apr 5 2011, 12:25:00) import hashlib, pickle hash=hashlib.new('md5') pickle.dumps(hash) Traceback (most recent call last): File stdin, line 1, in module _pickle.PicklingError:

[issue11605] EMail generator.flatten() disintegrates over non-ascii multipart/alternative

2011-04-05 Thread ysj.ray
Changes by ysj.ray ysj@gmail.com: -- nosy: +ysj.ray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11605 ___ ___ Python-bugs-list mailing list

[issue11771] hashlib object cannot be pickled

2011-04-05 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Oh, I don't know if it is possible to serialize a OpenSSL hash object (EVP_MD_CTX)... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11771

[issue9592] Limitations in objects returned by multiprocessing Pool

2011-04-05 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: 1) A multiprocessing worker can not return (return, not raise!) an Exception. (...) raise an error if multiple arguments are required: TypeError: ('__init__() takes exactly 2 arguments (1 given)', class '__main__.MyException',

[issue11734] Add half-float (16-bit) support to struct module

2011-04-05 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Is the failure to round-to-even only for legacy formats, or is it for IEEE formats as well? Ah; I see it's just for the non-IEEE formats, so not really an issue. When the float format is known, the code just depends on a (float) cast

[issue11734] Add half-float (16-bit) support to struct module

2011-04-05 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I'd also suggest adding some more to the test suite here to verify that ties are rounding to the nearest even properly. And I second this suggestion. -- ___ Python tracker

[issue10977] Concrete object C API needs abstract path for subclasses of builtin types

2011-04-05 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I may have found another use case for this functionality. Currently, the Python code in heapq.py accepts arbitrary sequences (that are sufficiently compatible with the Sequence ABC), but the C code in _heapq only permits use of a concrete

[issue10977] Concrete object C API needs abstract path for subclasses of builtin types

2011-04-05 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I added a few commments on Daniel's draft patch. However, I'm getting nervous about the performance impact of all these extra pointer comparisons. We should probably hold off on this until more of the macro benchmark suite runs on Py3k so we

[issue975330] Inconsistent newline handling in email module

2011-04-05 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Well, it's two years later, but I did look at this during the sprints at PyCon, though I didn't get as far as posting it then (I only just now rediscovered the patch on my laptop). Python3 no longer has a binary flag on

[issue11772] email header wrapping edge case failure

2011-04-05 Thread R. David Murray
New submission from R. David Murray rdmur...@bitdance.com: I discovered the attached failure case in the process of investigating another issue. The bug (a continuation line with no leading white space) doesn't exist in 2.7, but in 2.7 the extra whitespace is not preserved (that is, the

[issue11771] hashlib object cannot be pickled

2011-04-05 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Why on Earth would you want to serialize a hashlib object? It makes as much sense as serializing, say, a JSONEncoder. -- nosy: +gregory.p.smith, pitrou ___ Python tracker rep...@bugs.python.org

[issue11767] Maildir iterator leaks file descriptors by default

2011-04-05 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11767 ___ ___ Python-bugs-list

[issue10963] subprocess can raise OSError (EPIPE) when communicating with short-lived processes

2011-04-05 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset c10d55c51d81 by Ross Lagerwall in branch '2.7': Issue #10963: Ensure that subprocess.communicate() never raises EPIPE. http://hg.python.org/cpython/rev/c10d55c51d81 New changeset 158495d49f58 by Ross Lagerwall in branch '3.1': Issue

[issue10977] Concrete object C API needs abstract path for subclasses of builtin types

2011-04-05 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: I find this extremely ugly. The correct way to handle this is to use the generic methods themselves. Really, the type-specific names should only be used when you have just created the type or done PyXXX_CheckExact() yourself on it.

[issue10963] subprocess can raise OSError (EPIPE) when communicating with short-lived processes

2011-04-05 Thread Ross Lagerwall
Ross Lagerwall rosslagerw...@gmail.com added the comment: Committed, thanks. -- assignee: - rosslagerwall resolution: - fixed stage: patch review - committed/rejected status: open - closed type: feature request - behavior ___ Python tracker

[issue11652] urlib{, 2} returns a pair of integers as the content-length value

2011-04-05 Thread James Whisnant
James Whisnant jwhisn...@gmail.com added the comment: Varnish on the sourceforge server has been upgraded and/or reconfigured (yesterday) to fix the issue that was happening with this file (and others). Just an FYI that you will no longer be able to re-create the triggering error.

[issue6040] bdist_msi does not deal with pre-release version

2011-04-05 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: Metadata can be automatically figured out using regexp matching like ^\d+(\.\d+){2,3}, but for explicit handling there should be should some callback or msi-specific version property in metadata. In the end it is pretty logical if

[issue6040] bdist_msi does not deal with pre-release version

2011-04-05 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: Wrong code. The last line in the bdist_msi_version_hack override should be: self.distribution.metadata.version = saved -- ___ Python tracker rep...@bugs.python.org

  1   2   >