[issue13585] Add contextlib.CleanupManager

2011-12-13 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Thanks Nick. You're awesome. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13585 ___

[issue13516] Gzip old log files in rotating handlers

2011-12-13 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: See this for the proposed resolution: http://plumberjack.blogspot.com/2011/12/improved-flexibility-for-log-file.html -- ___ Python tracker rep...@bugs.python.org

[issue13592] repr(regex) doesn't include actual regex

2011-12-13 Thread Martin Häcker
New submission from Martin Häcker spamfaen...@gmx.de: When calling repr() on a compiled regex pattern like this: import re repr(re.compile('foo')) you don't get the pattern of the regex out of the compiled form. Also all my research has shown no getter to allow this. I noticed this in my

[issue13592] repr(regex) doesn't include actual regex

2011-12-13 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: I'm not sure having the pattern in the repr will make it more readable, since the regex might even be very long. You can use the .pattern attribute if you want to see the pattern. -- nosy: +ezio.melotti status: open - pending

[issue13585] Add contextlib.CleanupManager

2011-12-13 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: And the backport: http://contextlib2.readthedocs.org/ I haven't tested on anything other than 2.7 as yet - I have an account request in train with the Shining Panda folks, so I'll set up multi-version CI for this project (along with a couple

[issue13577] __qualname__ is not present on builtin methods and functions

2011-12-13 Thread sbt
sbt shibt...@gmail.com added the comment: sbt, have you been running the test suite before submitting patches? If not, then please do. I ran it after I submitted. Sorry. Here is another patch. It also makes sure that __self__ is reported as None when METH_STATIC. -- Added file:

[issue13549] Incorrect nested list comprehension documentation

2011-12-13 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 132158b287d7 by Ezio Melotti in branch '2.7': #13549: improve tutorial section about listcomps. http://hg.python.org/cpython/rev/132158b287d7 New changeset ad5c70296c7b by Ezio Melotti in branch '3.2': #13549:

[issue13549] Incorrect nested list comprehension documentation

2011-12-13 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Fixed. On a side note, using: [x, x**2 for x in range(6)] File stdin, line 1 [x, x**2 for x in range(6)] ^ SyntaxError: invalid syntax In the 3.x docs seems to break the hightlight. With 'File stdin, line 1, in ?' the

[issue6570] Tutorial clarity: section 4.7.2, parameters and arguments

2011-12-13 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset d60856651139 by Ezio Melotti in branch '2.7': #6570: clarify tutorial section about keyword arguments. http://hg.python.org/cpython/rev/d60856651139 New changeset 44ca4264dc88 by Ezio Melotti in branch '3.2': #6570:

[issue6570] Tutorial clarity: section 4.7.2, parameters and arguments

2011-12-13 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- resolution: - fixed stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6570 ___

[issue13593] importlib needs to be updated for __qualname__

2011-12-13 Thread Meador Inge
New submission from Meador Inge mead...@gmail.com: I was recently reading the 'importlib' code and noticed that the utility decorators have not been updated for '__qualname__': def f(): pass ... importlib.util.set_loader(f) function set_loader.locals.wrapper at 0x7f4b323f1f60

[issue13394] Patch to increase aifc lib test coverage

2011-12-13 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Thanks for splitting the patch. I tried to apply the patch to 3.2 and I have 3 comments: 1) you changed a commented-out assertEqual with an assertNotEqual, because ULAW is lossy compression, so frames *may* not match. Does it mean that

[issue13593] importlib needs to be updated for __qualname__

2011-12-13 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +pitrou stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13593 ___

[issue13540] Document the Action API in argparse

2011-12-13 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com added the comment: You're right. The documentation isn't incorrect, if you're splitting hairs. But it's not super friendly either. Questions that the documentation should answer: 1) Does the action always need to be a subclass of an Action, or is that

[issue13591] import_module potentially imports a module twice

2011-12-13 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: I can reproduce this on tip. What happens is that 'importlib.import_module(my_lib.bar)' is effectively computed as: import my_lib import bar by '_bootstrap._gcd_import'. When '_gcd_import' goes to do the import of 'bar' it does *not*

[issue13585] Add contextlib.CleanupManager

2011-12-13 Thread Sven Marnach
Sven Marnach s...@marnach.net added the comment: I think that the fact that Nick got the code to close multiple files wrong underlines that it is difficult to get right currently. Nick's code try: files = [open(fname) for fname in names] # ... finally: for f in

[issue13593] importlib needs to be updated for __qualname__

2011-12-13 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Looks ok to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13593 ___ ___ Python-bugs-list

[issue13591] import_module potentially imports a module twice

2011-12-13 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13591 ___ ___ Python-bugs-list

[issue13592] repr(regex) doesn't include actual regex

2011-12-13 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I'm not sure having the pattern in the repr will make it more readable, since the regex might even be very long. Hmm, I think it's a reasonable feature request myself. Oops, I meant enhancement, not feature request :) -- nosy:

[issue13592] repr(regex) doesn't include actual regex

2011-12-13 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- components: +Regular Expressions nosy: +mrabarnett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13592 ___

[issue13592] repr(regex) doesn't include actual regex

2011-12-13 Thread Matthew Barnett
Matthew Barnett pyt...@mrabarnett.plus.com added the comment: In reply to Ezio, the repr of a large string, list, tuple or dict is also long. The repr of a compiled regex should probably also show the flags, but should it just be the numeric value? --

[issue13592] repr(regex) doesn't include actual regex

2011-12-13 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: ISTM that .pattern is the one way to do it. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13592 ___

[issue13592] repr(regex) doesn't include actual regex

2011-12-13 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: ISTM that .pattern is the one way to do it. To me this is like saying the repr() of functions should not show their name since .__name__ is the one way to do it. repr() is useful for debugging and logging, why not make it more useful?

[issue13505] Bytes objects pickled in 3.x with protocol =2 are unpickled incorrectly in 2.x

2011-12-13 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 14695b4825dc by Alexandre Vassalotti in branch '3.2': Issue #13505: Make pickling of bytes object compatible with Python 2. http://hg.python.org/cpython/rev/14695b4825dc -- nosy: +python-dev

[issue13505] Bytes objects pickled in 3.x with protocol =2 are unpickled incorrectly in 2.x

2011-12-13 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Fixed. Thanks for the patch! -- assignee: - alexandre.vassalotti resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker

[issue4028] Problem compiling the multiprocessing module on sunos5

2011-12-13 Thread Craig Foster
Craig Foster foster.cr...@gmail.com added the comment: I can confirm that the compile completes with a multiprocessing module where it hasn't before--at least in SunOS 5.9. -- nosy: +fosterremy ___ Python tracker rep...@bugs.python.org

[issue13594] Aifc markers write fix

2011-12-13 Thread Oleg Plakhotnyuk
New submission from Oleg Plakhotnyuk oleg...@gmail.com: 1. Markers serialization test coverage improved. 2. Marker name changed from string to bytes, because _write_string function uses bytes. 3. Check for closed file handle moved to 'close' method, because otherwise I caught 'attempt to

[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)

2011-12-13 Thread Nam Nguyen
Changes by Nam Nguyen bits...@gmail.com: -- nosy: +Nam.Nguyen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13241 ___ ___ Python-bugs-list mailing

[issue13595] Weird behavior with generators with self-referencing output.

2011-12-13 Thread Pyry Pakkanen
New submission from Pyry Pakkanen frostb...@suomi24.fi: The following self-referencing generator has incorrect output: def ab_combinations(): #'', 'a', 'b', 'aa', 'ab', 'ba', 'bb', 'aaa', ... def _deferred_output(): yield tees = tee(output) #This definition

[issue13394] Patch to increase aifc lib test coverage

2011-12-13 Thread Oleg Plakhotnyuk
Changes by Oleg Plakhotnyuk oleg...@gmail.com: Removed file: http://bugs.python.org/file23934/test_aifc.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13394 ___

[issue13394] Patch to increase aifc lib test coverage

2011-12-13 Thread Oleg Plakhotnyuk
Oleg Plakhotnyuk oleg...@gmail.com added the comment: The split is in progress. There will be at least two more patches. Regarding your comments: 1) Sorry for my english :-) It is fully determined by the input. With this particular test input the assertNotEqual will always pass. So I've removed

[issue13394] Patch to increase aifc lib test coverage

2011-12-13 Thread Oleg Plakhotnyuk
Oleg Plakhotnyuk oleg...@gmail.com added the comment: Third patch goes to issue 13594 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13394 ___

[issue13596] Only recompile Lib/_sysconfigdata.py when needed

2011-12-13 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@haypocalc.com: Attached patch fixes Makefile.pre.in to only recompile Lib/_sysconfigdata.py when needed. -- files: sysconfigdata.patch keywords: patch messages: 149406 nosy: haypo, pitrou priority: normal severity: normal status: open

[issue13596] Only recompile Lib/_sysconfigdata.py when needed

2011-12-13 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- components: +Build ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13596 ___ ___

[issue13588] Change name of internal closure functions in importlib

2011-12-13 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file23947/issue13588_v1.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13588 ___

[issue13592] repr(regex) doesn't include actual regex

2011-12-13 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: If you change the repr, it should at least eval-able, so be sure to capture the flags and whatnot. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13592

[issue13597] Improve documentation of stdout/stderr buffering in Python 3.x

2011-12-13 Thread Geoffrey Bache
New submission from Geoffrey Bache gjb1...@users.sourceforge.net: The default buffering of standard output and standard error has changed in Python 3.x with respect to Python 2.x, and I have been unable to find decent documentation of either the current behaviour, or the change. (See also

[issue13592] repr(regex) doesn't include actual regex

2011-12-13 Thread Matthew Barnett
Matthew Barnett pyt...@mrabarnett.plus.com added the comment: Actually, one possibility that occurs to me is to provide the flags within the pattern. The .pattern attribute gives the original pattern, but repr could give the flags in-line at the start of the pattern: # Assuming Python 3. r

[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)

2011-12-13 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: The bug in the 'gcc' command is still present when using Xcode 4.2.1 (that is, the attached unicode.c miscompiles with gcc -O3). Clang (again from Xcode 4.2.1) compiles the file correctly, but fails to do a proper build the last few

[issue13503] improved efficiency of bytearray pickling by using bytes type instead of str

2011-12-13 Thread Irmen de Jong
Irmen de Jong ir...@razorvine.net added the comment: Alexandre: the existing test_bytes already performs byte array pickle tests. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13503 ___

[issue13595] Weird behavior with generators with self-referencing output.

2011-12-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This is expected, and is due to the late binding of the label variable in the item+label expression. Look at the example below: l = [lambda item: item + label for label in ab] f1, f2 = l print f1(''), f2('') b b For the lambda

[issue9116] test_capi.test_no_FatalError_infinite_loop crash on Windows

2011-12-13 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: I just tried out http://www.bitvise.com/winsshd , which is free for personal and noncommercial use. If you run the tests via an ssh connection, WinSSHD automatically translates pop-ups into error messages:

[issue13582] IDLE and pythonw.exe stderr problem

2011-12-13 Thread Roger Serwy
Roger Serwy roger.se...@gmail.com added the comment: Here is a list of open issues that describe IDLE suddenly crashing, which can be traced back to pythonw.exe: #4765, #5707, #6257, #6739, #9404, #9925, #10365, #11437, #12274, #12988, #13052, #13071, #13078, #13153 This patch does not fix

[issue13597] Improve documentation of stdout/stderr buffering in Python 3.x

2011-12-13 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: We could force sys.stderr to be always line-buffered if that's better than the current settings. -- components: +IO nosy: +benjamin.peterson, pitrou, stutzbach versions: -Python 3.1, Python 3.4 ___

[issue13595] Weird behavior with generators with self-referencing output.

2011-12-13 Thread Pyry Pakkanen
Pyry Pakkanen frostb...@suomi24.fi added the comment: Oh, I was sure it had to do with binding issues. I just couldn't put my finger on it because the behavior seemed so counterintuitive. Thanks for clearing things up. I can now work around this feature. --

[issue4625] IDLE won't open anymore, .idlerc unaccessible

2011-12-13 Thread Roger Serwy
Roger Serwy roger.se...@gmail.com added the comment: A quick test on Linux would be: chmod -w ~/.idlerc/recent-files.lst IDLE will give a traceback and not start. This should not be a fatal error. The provided patch will present an error dialog if the recent files list can not be written.

[issue13532] In IDLE, sys.stdout and sys.stderr can write any pickleable object

2011-12-13 Thread maniram maniram
Changes by maniram maniram maniandra...@gmail.com: -- title: In IDLE, sys.stdout.write and sys.stderr can write any pickleable object - In IDLE, sys.stdout and sys.stderr can write any pickleable object ___ Python tracker rep...@bugs.python.org

[issue9404] IDLE won't launch on XP

2011-12-13 Thread Roger Serwy
Roger Serwy roger.se...@gmail.com added the comment: This is a duplicate of #4625. -- nosy: +serwy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9404 ___

[issue13597] Improve documentation of stdout/stderr buffering in Python 3.x

2011-12-13 Thread Philip Jenvey
Philip Jenvey pjen...@underboss.org added the comment: I'm surprised to hear that stderr is line buffered by default. Historically stderr is never buffered (at least on POSIX) and for good reason: errors should be seen immediately Was this an oversight in migrating stdin/out/err to the new io

[issue13598] string.Formatter doesn't support empty curly braces {}

2011-12-13 Thread maniram maniram
New submission from maniram maniram maniandra...@gmail.com: string.Formatter doesn't support empty curly braces {} unlike str.format . import string a = string.Formatter() a.format({},test) Traceback (most recent call last): File pyshell#2, line 1, in module a.format({},hello) File

[issue13591] import_module potentially imports a module twice

2011-12-13 Thread Ryan Twitchell
Ryan Twitchell metatheo...@gmail.com added the comment: Confirmed that this patch fixes the behavior shown in my original example, with 3.2. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13591

[issue13540] Document the Action API in argparse

2011-12-13 Thread Jason R. Coombs
Changes by Jason R. Coombs jar...@jaraco.com: -- hgrepos: +95 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13540 ___ ___ Python-bugs-list mailing

[issue13540] Document the Action API in argparse

2011-12-13 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com added the comment: I've attached a repository and patch with the recommended changes. I created an additional section that includes the documentation for the Action class (specifically the __init__ and __call__ signatures). I believe this addresses the issues

[issue13540] Document the Action API in argparse

2011-12-13 Thread Jason R. Coombs
Changes by Jason R. Coombs jar...@jaraco.com: -- keywords: +patch Added file: http://bugs.python.org/file23949/956c6d33a57d.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13540 ___

[issue13540] Document the Action API in argparse

2011-12-13 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: My guess from the way the docs are written now is that subclassing from Action and over-riding just the __call__ method is the intended way, not just the recommended. If so, Action is a quasi-private class, only exposed so it could be

[issue13598] string.Formatter doesn't support empty curly braces {}

2011-12-13 Thread maniram maniram
maniram maniram maniandra...@gmail.com added the comment: Attached is patch to fix this issue. -- keywords: +patch type: - behavior Added file: http://bugs.python.org/file23950/issue13598.diff ___ Python tracker rep...@bugs.python.org

[issue13598] string.Formatter doesn't support empty curly braces {}

2011-12-13 Thread maniram maniram
Changes by maniram maniram maniandra...@gmail.com: -- components: +Library (Lib) versions: +Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13598 ___

[issue13591] import_module potentially imports a module twice

2011-12-13 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Updated patch with tests. -- Added file: http://bugs.python.org/file23951/issue13591-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13591

[issue13598] string.Formatter doesn't support empty curly braces {}

2011-12-13 Thread maniram maniram
maniram maniram maniandra...@gmail.com added the comment: Sorry, the patch has an mistake. ValueErro should be ValueError. -- Added file: http://bugs.python.org/file23952/issue13598.diff ___ Python tracker rep...@bugs.python.org

[issue13598] string.Formatter doesn't support empty curly braces {}

2011-12-13 Thread maniram maniram
Changes by maniram maniram maniandra...@gmail.com: Removed file: http://bugs.python.org/file23950/issue13598.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13598 ___

[issue13582] IDLE and pythonw.exe stderr problem

2011-12-13 Thread Ned Deily
Ned Deily n...@acm.org added the comment: IDLE.app on OS X also has the issue of stderr messages not being presented to users unless you know to look in the system log where they get written. So writing to stderr is not fatal but displaying them in a popup would be an improvement.