[issue17408] second python execution fails when embedding

2013-05-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Should be fixed in 7de9852cdc0e, sorry. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17408

[issue17809] FAIL: test_expanduser when $HOME ends with /

2013-05-05 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - ezio.melotti stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17809 ___

[issue17894] Edits to descriptor howto

2013-05-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: in contrast to an authoritative document closely tied to the actually implementation details I fail to understand why a HOWTO should be an authoritative document closely tied to implementation details. If you don't want this document to be

[issue17809] FAIL: test_expanduser when $HOME ends with /

2013-05-05 Thread koobs
koobs added the comment: Thanks Antoine, I'm removing the 'Library' component on this one given the proposed resolution. Additionally, given the trivial nature and isolation of the change strictly to the test, I'd like to request this go into 3.2 as well. For any future security fixes to

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-05 Thread Charles-François Natali
Charles-François Natali added the comment: I'd slightly prefer the name iterdir_stat(), as that almost makes the (name, stat) return values explicit in the name. But that's kind of bikeshedding -- scandir() works too. I find iterdir_stat() ugly :-) I like the scandir name, which has some

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-05 Thread Ben Hoyt
Ben Hoyt added the comment: I find iterdir_stat() ugly :-) I like the scandir name, which has some precedent with POSIX. Fair enough. I'm cool with scandir(). scandir() cannot return (name, stat), because on POSIX, readdir() only returns d_name and d_type (the type of the entry): to

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-05 Thread Nick Coghlan
Nick Coghlan added the comment: I think os.scandir is a case where we *want* a low level call that exposes everything we can retrieve efficiently about the directory entries given the underlying platform - not everything written in Python is written to be portable, especially when it comes to

[issue1545463] New-style classes fail to cleanup attributes

2013-05-05 Thread Armin Rigo
Changes by Armin Rigo ar...@users.sourceforge.net: -- nosy: -arigo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1545463 ___ ___ Python-bugs-list

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-05 Thread Charles-François Natali
Charles-François Natali added the comment: We could document any platform-specific stuff, and places you'd users could get bitten. But can you give me an example of where the stat_result-with-st_mode-or-None approach falls over completely? Well, that's easy: size = 0 for name, st in

[issue17908] Unittest runner needs an option to call gc.collect() after each test

2013-05-05 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17908 ___ ___

[issue1545463] New-style classes fail to cleanup attributes

2013-05-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is an updated patch after the latest changes on default. -- Added file: http://bugs.python.org/file30129/gcshutdown2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1545463

[issue17908] Unittest runner needs an option to call gc.collect() after each test

2013-05-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: OTOH it's a useful option to have in case you're tracking down something that happens (or doesn't happen) when an object is collected IMO this is a good reason to implement your specific tearDown method (or call addCleanup if you prefer), possibly in a

[issue17906] JSON should accept lone surrogates

2013-05-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: After investigating the problem deeper, I see that new parameter is not needed. RFC 4627 does not make exceptions for the range 0xD800-0xDFFF, and the decoder must accept lone surrogates, both escaped and unescaped. Non-BMP characters may be represented as

[issue17906] JSON should accept lone surrogates

2013-05-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file30131/json_decode_lone_surrogates-2.7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17906 ___

[issue995907] memory leak with threads and enhancement of the timer class

2013-05-05 Thread Yael
Yael added the comment: Can you please review the patch? thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue995907 ___ ___ Python-bugs-list

[issue17907] Deprecate imp.new_module() in favour of types.ModuleType

2013-05-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: If so, then at least the constructor should be documented. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17907 ___

[issue15902] imp.load_module won't accept None for the file argument for a C extension

2013-05-05 Thread Brett Cannon
Brett Cannon added the comment: http://hg.python.org/cpython/rev/996a937cdf81 also applies to this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15902 ___

[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2013-05-05 Thread Brett Cannon
Brett Cannon added the comment: Don't be distracted when trying to write tests is the lesson learned. Fixed basic and rebinding and just deleted indirect. -- Added file: http://bugs.python.org/file30132/import_from_tests.diff ___ Python tracker

[issue17909] Autodetecting JSON encoding

2013-05-05 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: RFC 4627 specifies a method to determine an encoding (one of UTF-8, UTF-16(BE|LE) or UTF-32(BE|LE)) of encoded JSON text. The proposed preliminary patch (it doesn't include the documentation yet) allows load() and loads() functions accept bytes data when

[issue17909] Autodetecting JSON encoding

2013-05-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- dependencies: +UTF-16 and UTF-32 codecs should reject (lone) surrogates, disallow the surrogatepass handler for non utf-* encodings ___ Python tracker rep...@bugs.python.org

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-05 Thread STINNER Victor
STINNER Victor added the comment: I really like scandir() - (name: str, stat: stat structure using None for unknown fields). I expect that this API to optimize use cases like: - glob.glob(*.jpg) in a big directory with few JPEG picture - os.walk(.) in a directory with many files: should reduce

[issue12634] Random Remarks in class documentation

2013-05-05 Thread Yogesh Chaudhari
Yogesh Chaudhari added the comment: Similar changes for 2.7 branch -- hgrepos: +188 Added file: http://bugs.python.org/file30135/issue12634-27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12634

[issue12634] Random Remarks in class documentation

2013-05-05 Thread Yogesh Chaudhari
Yogesh Chaudhari added the comment: Based on Teery's comments, this patch makes the changes to the random remarks section of the class documentation -- keywords: +patch nosy: +Yogesh.Chaudhari Added file: http://bugs.python.org/file30134/issue12634.patch

[issue17732] distutils.cfg Can Break venv

2013-05-05 Thread Nick Sloan
Nick Sloan added the comment: Just checking to see if anything else is needed from me on this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17732 ___

[issue17798] IDLE: can not edit new file names when using -e

2013-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset c8cdc2400643 by Roger Serwy in branch '3.3': #17798: Allow IDLE to edit new files when specified on command line. http://hg.python.org/cpython/rev/c8cdc2400643 New changeset a64a3da996ed by Roger Serwy in branch 'default': #17798: merge with 3.3.

[issue17798] IDLE: can not edit new file names when using -e

2013-05-05 Thread Roger Serwy
Roger Serwy added the comment: I'm closing this issue as fixed. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17798

[issue17903] Python launcher for windows should search path for #!/usr/bin/env

2013-05-05 Thread Paul Moore
Paul Moore added the comment: There is a patch for this (against the standalone pylauncher project) at https://bitbucket.org/pmoore/pylauncher. -- keywords: +patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17903

[issue17858] Different documentation for identical methods

2013-05-05 Thread Andriy Mysyk
Andriy Mysyk added the comment: Made changes suggested by Ezio Melotti in the attached patch. -- Added file: http://bugs.python.org/file30136/issue17858.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17858

[issue17908] Unittest runner needs an option to call gc.collect() after each test

2013-05-05 Thread Guido van Rossum
Guido van Rossum added the comment: On Sun, May 5, 2013 at 4:29 AM, Antoine Pitrou rep...@bugs.python.org wrote: Antoine Pitrou added the comment: OTOH it's a useful option to have in case you're tracking down something that happens (or doesn't happen) when an object is collected IMO this

[issue17094] sys._current_frames() reports too many/wrong stack frames

2013-05-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is an updated patch which doesn't hold the lock while calling PyThreadState_Clear(). It looks like it should be ok. Also, I've added some comments. -- Added file: http://bugs.python.org/file30137/tstates-afterfork2.patch

[issue16518] add buffer protocol to glossary

2013-05-05 Thread Ezio Melotti
Ezio Melotti added the comment: Updated patch to include getargs.c too. -- stage: patch review - commit review Added file: http://bugs.python.org/file30138/issue16518-4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16518

[issue9682] socket.create_connection error message for domain subpart with invalid length is very confusing

2013-05-05 Thread Mike Milkin
Mike Milkin added the comment: Moved the conditional logic out of the method. There are no tests for ToASCII function and I was not comfortable making changes to it without adding tests. -- Added file: http://bugs.python.org/file30139/Issue9682-5513.patch

[issue15528] Better support for finalization with weakrefs

2013-05-05 Thread Richard Oudkerk
Richard Oudkerk added the comment: Here is an updated patch. It is only really the example in the docs which is different, plus a note about daemon threads. Antoine, do think this is ready to be committed? -- Added file: http://bugs.python.org/file30140/finalize.patch

[issue17883] Fix buildbot testing of Tkinter

2013-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3c58fa7dc7f1 by Ezio Melotti in branch '2.7': #17883: Fix buildbot testing of Tkinter on Windows. Patch by Zachary Ware. http://hg.python.org/cpython/rev/3c58fa7dc7f1 -- nosy: +python-dev ___ Python

[issue15528] Better support for finalization with weakrefs

2013-05-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, assuming there are no significant changes in the code (I haven't checked), +1 for committing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15528

[issue16741] `int()`, `float()`, etc think python strings are null-terminated

2013-05-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch based on Matthew's patch. It is smaller (+35 lines vs +59) but fixes error messages for more cases: int(b'123\0') -- bytes string with null without base. int(b'123\xbd') -- non-utf-8 bytes string. int('123\ud800') -- lone surrogate in unicode

[issue16741] `int()`, `float()`, etc think python strings are null-terminated

2013-05-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16741 ___ ___

[issue15528] Better support for finalization with weakrefs

2013-05-05 Thread Richard Oudkerk
Richard Oudkerk added the comment: The only (non-doc, non-comment) changes were the two one-liners you suggested in msg172077. So I will commit. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15528

[issue15809] IDLE console uses incorrect encoding.

2013-05-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Good catch. Thank you, Roger. -- stage: patch review - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15809 ___

[issue17910] Usage error in multiprocessing documentation

2013-05-05 Thread Andriy Mysyk
New submission from Andriy Mysyk: As mentioned above, when doing concurrent programming it is usually best to avoid using shared state as far as possible should say as much as possible in multiprocessing.rst. -- assignee: docs@python components: Documentation messages: 188461 nosy:

[issue17910] Usage error in multiprocessing documentation

2013-05-05 Thread Andriy Mysyk
Andriy Mysyk added the comment: patch attached -- keywords: +patch Added file: http://bugs.python.org/file30142/issue17910.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17910 ___

[issue16741] `int()`, `float()`, etc think python strings are null-terminated

2013-05-05 Thread STINNER Victor
STINNER Victor added the comment: int_from_str.patch: +strobj = PySequence_GetSlice(u, 0, 200); +if (strobj != NULL) { +PyErr_Format(PyExc_ValueError, + invalid literal for int() with base %d: %R, + base, strobj); +

[issue17883] Fix buildbot testing of Tkinter

2013-05-05 Thread Ezio Melotti
Ezio Melotti added the comment: The buildbots run the tests and seem happy. Thanks for the report and the patch! -- assignee: - ezio.melotti resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker

[issue15528] Better support for finalization with weakrefs

2013-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2e446e87ac5b by Richard Oudkerk in branch 'default': Issue #15528: Add weakref.finalize to support finalization using http://hg.python.org/cpython/rev/2e446e87ac5b -- nosy: +python-dev ___ Python tracker

[issue15528] Better support for finalization with weakrefs

2013-05-05 Thread STINNER Victor
STINNER Victor added the comment: The changeset 2e446e87ac5b broke some buildbots at compile step. ./python -E -S -m sysconfig --generate-posix-vars Could not find platform dependent libraries exec_prefix Consider setting $PYTHONHOME to prefix[:exec_prefix] Fatal Python error: Py_Initialize:

[issue17911] Extracting tracebacks does too much work

2013-05-05 Thread Guido van Rossum
New submission from Guido van Rossum: For Tulip I may have to extract tracebacks and store the extracted data, in order to avoid cycles created by the frames referenced in the traceback. I'll be extracting the traceback every time an exception is raised, and in most cases I won't be using

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-05 Thread Ben Hoyt
Ben Hoyt added the comment: Yeah, I very much agree with what Nick says -- we really want a way to expose what the platform provides. It's less important (though still the ideal), to expose that in a platform-independent way. Today the only way to get access to opendir/readdir on Linux and

[issue17094] sys._current_frames() reports too many/wrong stack frames

2013-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 847692b9902a by Antoine Pitrou in branch 'default': Issue #17094: Clear stale thread states after fork(). http://hg.python.org/cpython/rev/847692b9902a -- nosy: +python-dev ___ Python tracker

[issue17094] sys._current_frames() reports too many/wrong stack frames

2013-05-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've committed after the small change suggested by Charles-François. Hopefully there aren't any applications relying on the previous behaviour. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed versions: -Python

[issue17912] thread states should use a doubly-linked list

2013-05-05 Thread Antoine Pitrou
New submission from Antoine Pitrou: Thread states are stored in a singly linked list, which makes some operations more cumbersome than they should be. Since memory consumption is far from critical here, it would be easier to handle them with a doubly linked list. -- components:

[issue17910] Usage error in multiprocessing documentation

2013-05-05 Thread Richard Oudkerk
Richard Oudkerk added the comment: I don't see any difference in meaning: http://idioms.thefreedictionary.com/as+far+as+possible -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17910

[issue17883] Fix buildbot testing of Tkinter

2013-05-05 Thread Ezio Melotti
Ezio Melotti added the comment: Actually one buildbot is failing: http://buildbot.python.org/all/builders/x86%20Windows%20Server%202003%20%5BSB%5D%202.7/builds/427/steps/test/logs/stdio -- status: closed - open ___ Python tracker

[issue15528] Better support for finalization with weakrefs

2013-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 186cf551dae5 by Richard Oudkerk in branch 'default': Issue #15528: Add weakref.finalize to support finalization using http://hg.python.org/cpython/rev/186cf551dae5 -- ___ Python tracker

[issue17289] readline.set_completer_delims() doesn't play well with others

2013-05-05 Thread Bradley Froehle
Bradley Froehle added the comment: Patch attached. I implemented this by adding a 'static char *' which holds the memory we allocate. I did not use the PyState machinery. -- keywords: +patch Added file: http://bugs.python.org/file30143/readline_completer_state.patch

[issue7330] PyUnicode_FromFormat: implement width and precision for %s, %S, %R, %V, %U, %A

2013-05-05 Thread STINNER Victor
STINNER Victor added the comment: New version of my patch taking Serhiy's remarks into account: - add a check_format() function to cleanup unit tests - only call _PyUnicodeWriter_Prepare() once per formatted argument: compute the length and maximum character. Be more optimistic about

[issue7330] PyUnicode_FromFormat: implement width and precision for %s, %S, %R, %V, %U, %A

2013-05-05 Thread STINNER Victor
STINNER Victor added the comment: I didn't add the following optimization (proposed by Serhiy in his review) because I'm not convinced that it's faster, and it's unrelated to this issue: if (width (PY_SSIZE_T_MAX - 9) / 10 width (PY_SSIZE_T_MAX - ((int)*f - '0')) / 10) { ... }

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-05 Thread STINNER Victor
STINNER Victor added the comment: size = 0 for name, st in scandir(path): if st.st_mode is None or st.st_size is None: st = os.stat(os.path.join(path, name)) if stat.S_ISREG(st.st_mode): size += st.st_size It would be safer to use dir_fd parameter when supported, but I

[issue15528] Better support for finalization with weakrefs

2013-05-05 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15528 ___

[issue17910] Usage error in multiprocessing documentation

2013-05-05 Thread Andriy Mysyk
Andriy Mysyk added the comment: I found the use of as far (as opposed to as much) but Richard has a good point. Let's close the issue. -- resolution: - works for me status: open - closed ___ Python tracker rep...@bugs.python.org

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

2013-05-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Reopening this one because there is a size issue, not just speed. My clients are bumping into this issue repeatedly. There is a reasonable expectation that pickling a bytearray will result in a pickle about the same size as the bytearray (not a 50% to

[issue15392] Create a unittest framework for IDLE

2013-05-05 Thread Todd Rovito
Todd Rovito added the comment: This issue appears like it is making progress. For a very small contribution I tested JayKrish's patch and it seems to work on my Mac. The results are documented below. Any comment from Python Core Developers on what needs to happen to get it committed? It

[issue17862] itertools.chunks(iterable, size, fill=None)

2013-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 763d260414d1 by Raymond Hettinger in branch '2.7': Issue 17862: Improve the signature of itertools grouper() recipe. http://hg.python.org/cpython/rev/763d260414d1 -- nosy: +python-dev ___ Python tracker

[issue17862] itertools.chunks(iterable, size, fill=None)

2013-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6383d0c8140d by Raymond Hettinger in branch '3.3': Issue 17862: Improve the signature of itertools grouper() recipe. http://hg.python.org/cpython/rev/6383d0c8140d -- ___ Python tracker

[issue16518] add buffer protocol to glossary

2013-05-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: At first-reading, it looks like matters were made more confusing with bytes-like object as a defined term. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16518

[issue16518] add buffer protocol to glossary

2013-05-05 Thread Ezio Melotti
Ezio Melotti added the comment: Can you elaborate? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16518 ___ ___ Python-bugs-list mailing list

[issue13495] IDLE: Regressions - Two ColorDelegator instances loaded

2013-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset fef7f212fe76 by Roger Serwy in branch '3.3': #13495: Avoid loading the color delegator twice in IDLE. http://hg.python.org/cpython/rev/fef7f212fe76 New changeset 588fcf36c975 by Roger Serwy in branch 'default': #13495: merge with 3.3.

[issue13495] IDLE: Regressions - Two ColorDelegator instances loaded

2013-05-05 Thread Roger Serwy
Roger Serwy added the comment: I'm closing this issue as fixed. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13495

[issue17883] Fix buildbot testing of Tkinter

2013-05-05 Thread Terry J. Reedy
Terry J. Reedy added the comment: I wonder if there is something special about the environment on that Snakebite machine. At the top, it says PATH=C:\Perl\site\bin;C:\Perl\bin;E:\apps\activestate-python-2.7.2.5-x86\;E:\apps\activestate-python-2.7.2.5-x86\Scripts;... Could the presence of

[issue17883] Fix buildbot testing of Tkinter

2013-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset b1abc5800e2b by Terry Jan Reedy in branch '2.7': Issue17883: Update to assertIn to see why test fails on one buildbot. http://hg.python.org/cpython/rev/b1abc5800e2b -- ___ Python tracker

[issue5492] Error on leaving IDLE with quit() or exit() under Linux

2013-05-05 Thread Roger Serwy
Roger Serwy added the comment: Terry, the SystemExit traceback from clicking cancel is expected given how Lib/site.py's Quitter first closes sys.stdin and then raises SystemExit. Closing sys.stdin causes the dialog, the raised exception just gets printed. We could change the behavior such