[issue19092] ExitStack.__exit__ incorrectly suppresses exceptions in __exit__ callbacks of inner context managers

2013-09-26 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: Nick, thanks for the review. Do you need me to write the patch for the test suite along with the original patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19092

[issue19092] ExitStack.__exit__ incorrectly suppresses exceptions in __exit__ callbacks of inner context managers

2013-09-26 Thread Nick Coghlan
Nick Coghlan added the comment: That would be very helpful! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19092 ___ ___ Python-bugs-list

[issue19087] bytearray front-slicing not optimized

2013-09-26 Thread STINNER Victor
STINNER Victor added the comment: Mercurial has another implementation strategy for a similar thing: http://selenic.com/repo/hg/file/50d721553198/mercurial/util.py#l935 I found an interesting comment in the following issue: I think the trouble we get into is chunkbuffer() creates new large

[issue19087] bytearray front-slicing not optimized

2013-09-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: @Antoine: Do you know if your patch may reduce the memory fragmentation on bytearray front-slicing? It reduces the number of allocations so, yes, it can reduce memory fragmentation. We cannot really use a list of chunks for bytearray since it is supposed to

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-26 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19094 ___ ___

[issue19095] Document SSLSocket.getpeercert always returns None without do_handshake

2013-09-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: To be honest I'd rather have it raise an exception in that case. None isn't helpful as it could mean other things. -- nosy: +christian.heimes, giampaolo.rodola, janssen, pitrou ___ Python tracker

[issue19083] IDNA prefix should be case insensitive

2013-09-26 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +haypo, loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19083 ___ ___ Python-bugs-list

[issue19096] multiprocessing.Pool._terminate_pool restarts workers during shutdown

2013-09-26 Thread Edward Catmur
New submission from Edward Catmur: There is a race condition in multiprocessing.Pool._terminate_pool that can result in workers being restarted during shutdown (process shutdown or pool.terminate()). worker_handler._state = TERMINATE# race from here

[issue19096] multiprocessing.Pool._terminate_pool restarts workers during shutdown

2013-09-26 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19096 ___ ___ Python-bugs-list mailing list

[issue19016] autospecced namedtuples should be truthy by default

2013-09-26 Thread Shawn Krisman
Shawn Krisman added the comment: This fix is actually backwards compatible. This is a more powerful patch too because not only does it provide a better default for truthiness, but it also provides a better default for length. I also fixed a spelling mistake involving the word calculate.

[issue19096] multiprocessing.Pool._terminate_pool restarts workers during shutdown

2013-09-26 Thread Edward Catmur
Edward Catmur added the comment: Suggested patch: https://bitbucket.org/ecatmur/cpython/compare/19096-multiprocessing-race..#diff Move the worker_handler.join() to immediately after setting the worker handler thread state to TERMINATE. This is a safe change as nothing in the moved-over code

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: This is the preliminary patch to raise TypeError in that situation. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file31876/urljoin_throws_type_error.patch ___ Python tracker

[issue19095] Document SSLSocket.getpeercert always returns None without do_handshake

2013-09-26 Thread Dariusz Suchojad
Dariusz Suchojad added the comment: None isn't helpful as it could mean other things. This is another story but yes, it's true. API-wise, None should be returned in one situation only - we're on server side, ca_certs is non-CERT_NONE, do_handshake has been called yet there is no client

[issue19083] IDNA prefix should be case insensitive

2013-09-26 Thread Martin v . Löwis
Martin v. Löwis added the comment: Pepijn: Can you please submit the contributor form? http://www.python.org/psf/contrib/contrib-form/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19083

[issue19083] IDNA prefix should be case insensitive

2013-09-26 Thread STINNER Victor
STINNER Victor added the comment: Could you also add a test using a IDNA domain not starting with XN--, but with XN-- in the middle? Example: self.assertEqual(str(bbugs.XN--pythn-mua.org., idna), bugs.pyth\xf6n.org.) And maybe also with mixed cases: Xn-- and xN-- prefixes. --

[issue1185124] pydoc doesn't find all module doc strings

2013-09-26 Thread Sunny
Sunny added the comment: Added patch for 2.7. Please review. -- Added file: http://bugs.python.org/file31877/pydoc_2.7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1185124 ___

[issue19087] bytearray front-slicing not optimized

2013-09-26 Thread STINNER Victor
STINNER Victor added the comment: Could you please add unit tests for check that ob_start is used instead of memmove()? I didn't find a function for that in _testcapi. I tried to test it using sys.getsizeof(), but the size is not reliable (the bytearray buffer is not always shrinked, it

[issue19095] Document SSLSocket.getpeercert always returns None without do_handshake

2013-09-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: But the current behavior of returning None is documented and people depend on it so straightening it out would break backward compatibility - it's up to you to decide. I wouldn't mind it personally. I'm not sure people depend on getpeercert() returning None

[issue19087] bytearray front-slicing not optimized

2013-09-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: Could you please add unit tests for check that ob_start is used instead of memmove()? How would I do that? Most of the time we don't unit-test performance improvements (i.e. there are no tests that list.append() is O(1), for example). --

[issue19095] Document SSLSocket.getpeercert always returns None without do_handshake

2013-09-26 Thread Dariusz Suchojad
Dariusz Suchojad added the comment: I'm not sure people depend on getpeercert() returning None before the handshake is done, or perhaps by accident? Ah, no, I meant that people may depend on the documented behaviour of .getpeercert's returning an empty dict (which I mixed up with returning

[issue19082] Lib/xmlrpc/client.py demo code points to the dead server

2013-09-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: What test_xmlrpc_net tests (especially the one with time.xmlrpc.com) have been tested in test_xmlrpc except for connecting to server with dotted_attribute feature and receiving datetime instance over the network. That test is not that hard to be migrated to

[issue19082] Lib/xmlrpc/client.py demo code points to the dead server

2013-09-26 Thread R. David Murray
R. David Murray added the comment: Yeah, a new issue is probably a good idea. If the dotted attribute feature is not tested by test_xmlrpc, then the test is probably worth migrating. I'm not sure what to do about the docs, and that should be a separate issue as well. --

[issue19009] Enhance HTTPResponse.readline() performance

2013-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Kristján, did you notice my comments on Rietveld? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19009 ___

[issue19009] Enhance HTTPResponse.readline() performance

2013-09-26 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Ah no actually. Thanks . I'll respond soon. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19009 ___

[issue19083] IDNA prefix should be case insensitive

2013-09-26 Thread Pepijn de Vos
Pepijn de Vos added the comment: Ok, I signed the agreement and included a few more tests. -- Added file: http://bugs.python.org/file31878/upper-idna.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19083

[issue15964] SyntaxError in asdl when building 2.7 with system Python 3

2013-09-26 Thread Eli Bendersky
Eli Bendersky added the comment: Did anyone ended up updating the devguide about this? I can't find anything related in there. -- nosy: +eli.bendersky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15964

[issue13477] tarfile module should have a command line

2013-09-26 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the rebase, Antoine. Here is an updated patch: - Adressed Serhiy's comments. I didn't add a directory parameter to the create command to keep the CLI simple. - Added a test for dotless files - Returned proper exit codes -- components:

[issue17473] -m is not universally applicable

2013-09-26 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17473 ___ ___

[issue17473] -m is not universally applicable

2013-09-26 Thread Claudiu.Popa
Changes by Claudiu.Popa pcmantic...@gmail.com: -- nosy: +Claudiu.Popa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17473 ___ ___ Python-bugs-list

[issue15869] IDLE: Include .desktop file and icon

2013-09-26 Thread Hendrik Knackstedt
Hendrik Knackstedt added the comment: For the correct icon to appear you have to copy the provided .xpm file to the given location: /usr/share/pixmaps/python.xpm This is still an issue for the current version of python 3.3. This is really easy to fix. Simply include the files already

[issue17473] -m is not universally applicable

2013-09-26 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17473 ___ ___ Python-bugs-list mailing

[issue17473] -m is not universally applicable

2013-09-26 Thread Nick Coghlan
Nick Coghlan added the comment: runpy needs to be refactored at least a bit before this will be practical. Issue 9325 is an existing issue for the same idea that discusses some of the problems to be resolved (it's a good idea, just a fair bit of work). -- resolution: - duplicate

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2013-09-26 Thread Nick Coghlan
Nick Coghlan added the comment: Issue 17473 had a longer list of relevant modules: pdb profile doctest trace modulefinder tabnanny pyclbr dis -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9325

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2013-09-26 Thread Nick Coghlan
Nick Coghlan added the comment: Also, the ModuleSpec PEP (PEP 451)should make the proposed refactoring much simpler, since the code runner could just expose data from the module spec. -- ___ Python tracker rep...@bugs.python.org

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-26 Thread Jason R. Coombs
Jason R. Coombs added the comment: Thanks Vajraski for the patch (especially the tests). A colleague reminded me of an aphorism by Raymond Hettinger from the recent PyCon paraphrased: duck typing is superior to isinstance. Maybe instead consider something like this: diff -r 7f13d5ecf71f

[issue14365] argparse: subparsers, argument abbreviations and ambiguous option

2013-09-26 Thread paul j3
paul j3 added the comment: Steven's patch (subparse_optionals.diff) run with jakub's test case (argparse_subparses_ambiguous_bug.py) works. But if the input string is print(parser.parse_args('--foo baz'.split())) produces Namespace(cmd=None, foo='baz', foo1=None, foo2=None) (I

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2013-09-26 Thread Guido van Rossum
New submission from Guido van Rossum: Check out http://stackoverflow.com/questions/9327597/python-get-does-not-evaluate-to-true-even-though-there-is-an-object It turns out a cgi.FieldStorage object may consider itself False even when it has data. This happens when the initialization

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2013-09-26 Thread Guido van Rossum
Guido van Rossum added the comment: PS. Simple repro: import cgi; bool(cgi.FieldStorage('logo', u'tux.png')) This reveals it's been fixed in Python 3 -- it raises TypeError there as it should. (But __nonzero__ should be deleted, and if someone adds __bool__ they should make sure it raises

[issue9325] Add an option to pdb/trace/profile to run library module as a script

2013-09-26 Thread Eric Snow
Eric Snow added the comment: Soon, my precious, soon... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9325 ___ ___ Python-bugs-list mailing

[issue3982] support .format for bytes

2013-09-26 Thread nlev...@gmail.com
Changes by nlev...@gmail.com nlev...@gmail.com: -- nosy: +nlev...@gmail.com ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3982 ___ ___

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2013-09-26 Thread Guido van Rossum
Changes by Guido van Rossum gu...@python.org: -- versions: +Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19097 ___ ___

[issue19098] sys.setrecursionlimit(2**30) breaks interactive shell

2013-09-26 Thread Arfrever Frehtes Taifersar Arahesis
New submission from Arfrever Frehtes Taifersar Arahesis: sys.setrecursionlimit(2**30) breaks interactive shell in Python =3.3. This bug does not occur during non-interactive execution of scripts / modules. This bug does not occur in versions of Python older than 3.3. This bug occurs only for

[issue19098] sys.setrecursionlimit(2**30) breaks interactive shell

2013-09-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset c3df31cbcd0a by Benjamin Peterson in branch '3.3': don't scale compiler stack frames if the recursion limit is huge (closes #19098) http://hg.python.org/cpython/rev/c3df31cbcd0a New changeset 9a7ec433bf59 by Benjamin Peterson in branch 'default':

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: What about this one? urljoin(['a'], []) ['a'] urljoin(['a'], ['b']) . omitted .. AttributeError: 'list' object has no attribute 'decode' Is this desirable? Both patches missed this case. Should we only accept str and bytes? --

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-26 Thread Stefan Behnel
Stefan Behnel added the comment: Here's the obvious minimal patch that removes the non-public 'root' attribute. Please apply it for Py3.4 and then set the version tag of this ticket to Py3.5 (instead of closing it, because it's not resolved yet). As I said, the expected thing to do (and what