[issue15805] Add stdout redirection tool to contextlib

2013-07-20 Thread Nick Coghlan
Nick Coghlan added the comment: +1 for io as an intuitive home for a basic version that redirects the current process output only (and is documented as doing so). While I like the idea of offering a more sophisticated version that affects subprocesses as well, I think that would be a very

[issue18513] test.cmath fails on OS/X with gcc-4.8 in non-debug build

2013-07-20 Thread Raymond Hettinger
New submission from Raymond Hettinger: == FAIL: test_specific_values (__main__.CMathTests) -- Traceback (most recent call last): File

[issue18511] random.shuffle could be faster

2013-07-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Both versions loop over the exact same iterator, so both loops run at the same speed once they are started up. Your timeit code isn't measuring shuffle(). Instead, it measures list() which knows how to extract a useful length hint from xrange() but not

[issue17998] internal error in regular expression engine

2013-07-20 Thread Doug Hellmann
Changes by Doug Hellmann doug.hellm...@gmail.com: -- nosy: +doughellmann ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17998 ___ ___

[issue18327] swapped arguments in compatible_for_assignment()?

2013-07-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset a65856044ad4 by Christian Heimes in branch 'default': Issue #18327: Fix argument order in call to compatible_for_assignment(oldto, newto, attr). http://hg.python.org/cpython/rev/a65856044ad4 -- nosy: +python-dev

[issue18327] swapped arguments in compatible_for_assignment()?

2013-07-20 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18327 ___

[issue18514] Unreachable Py_DECREF() in ctypes's PyCData_FromBaseObj()

2013-07-20 Thread Christian Heimes
New submission from Christian Heimes: http://hg.python.org/cpython/file/a65856044ad4/Modules/_ctypes/_ctypes.c#l2673 Coverity analysis: 2672} else { /* copy contents of adr */ 2673if (-1 == PyCData_MallocBuffer(cmem, dict)) { 2674return NULL; CID 715381:

[issue18512] sys.stdout.write does not allow bytes in Python 3.x

2013-07-20 Thread R. David Murray
R. David Murray added the comment: The fundamental behavior here is not going to change, as maintaining a bright line between bytes and strings is central to Python3's design. The question is, does the method for achieving your goal need better documentation? -- assignee: -

[issue18515] zipfile._ZipDecryptor generates wasteful crc32 table on import

2013-07-20 Thread Daniel Holth
New submission from Daniel Holth: http://hg.python.org/cpython/file/e7305517260b/Lib/zipfile.py#l460 I noticed this table taking up time on import. I'd guess that it pre-dates zlib.crc32 which is imported at the top of the file. I also suspect that most of the time this table isn't even used

[issue18515] zipfile._ZipDecryptor generates wasteful crc32 table on import

2013-07-20 Thread Daniel Holth
Daniel Holth added the comment: Someone who has a better understanding of zipfile may be able to get zlib.crc32(bytes[ch], running_crc) to work correctly. This patch that passes the zipfile tests generates the crctable only when _ZipDecrypter() is instantiated. -- Added file:

[issue18513] test.cmath fails on OS/X with gcc-4.8 in non-debug build

2013-07-20 Thread Mark Dickinson
Mark Dickinson added the comment: Hmm. Looks similar to issue #15477, but that one was fixed (we added a local workaround and reported the OS bug to Apple). And it was with clang rather than gcc. Raymond: from the title, can I assume that you don't see this failure on a debug build? That

[issue18515] zipfile._ZipDecryptor generates wasteful crc32 table on import

2013-07-20 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- components: +Library (Lib) nosy: +alanmcintyre, loewis, serhiy.storchaka stage: - patch review type: - performance ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18515

[issue18515] zipfile._ZipDecryptor generates wasteful crc32 table on import

2013-07-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: How much time take it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18515 ___ ___ Python-bugs-list mailing

[issue18513] test.cmath fails on OS/X with gcc-4.8 in non-debug build

2013-07-20 Thread Mark Dickinson
Mark Dickinson added the comment: I can't reproduce this here on OS 10.6 (I don't have access to anything later), but I think I can guess what's happening: I suspect that gcc 4.8 is optimizing the pair of 'cos' and 'sin' calls into a single call to 'cexp'. And then the OS X library

[issue18513] test.cmath fails on OS/X with gcc-4.8 in non-debug build

2013-07-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset ce771c2d0220 by Mark Dickinson in branch '3.3': Issue #18513: Add workaround for OS X 10.8 cexp bug that leads to wrong cmath.rect(0.0,-0.0) results. http://hg.python.org/cpython/rev/ce771c2d0220 New changeset ae769deb45b2 by Mark Dickinson in

[issue18513] test.cmath fails on OS/X with gcc-4.8 in non-debug build

2013-07-20 Thread Mark Dickinson
Mark Dickinson added the comment: Should be fixed now. -- resolution: - fixed stage: - committed/rejected status: open - closed versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18513

[issue14103] argparse: add ability to create a bash completion script

2013-07-20 Thread Jan Pokorný
Changes by Jan Pokorný pokorny_...@seznam.cz: -- nosy: +jpokorny ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14103 ___ ___ Python-bugs-list

[issue9146] Segfault in hashlib in OpenSSL FIPS mode using non-FIPS-compliant hashes, if ssl imported before hashlib

2013-07-20 Thread Jan Pokorný
Changes by Jan Pokorný pokorny_...@seznam.cz: -- nosy: +jpokorny ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9146 ___ ___ Python-bugs-list

[issue9216] FIPS support for hashlib

2013-07-20 Thread Jan Pokorný
Changes by Jan Pokorný pokorny_...@seznam.cz: -- nosy: +jpokorny ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9216 ___ ___ Python-bugs-list

[issue9177] ssl.read/write on closed socket raises AttributeError

2013-07-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset eda7e86bf03c by Antoine Pitrou in branch 'default': Issue #9177: Calling read() or write() now raises ValueError, not AttributeError, on a closed SSL socket. http://hg.python.org/cpython/rev/eda7e86bf03c -- nosy: +python-dev

[issue18515] zipfile._ZipDecryptor generates wasteful crc32 table on import

2013-07-20 Thread Daniel Holth
Daniel Holth added the comment: It takes 706 microseconds. On my machine %timeit import sys; del sys.modules['zipfile']; import zipfile import zipfile takes 2.51 ms without the patch and 1.7 ms with the patch. On Sat, Jul 20, 2013, at 12:13 PM, Serhiy Storchaka wrote: Serhiy Storchaka

[issue9177] ssl.read/write on closed socket raises AttributeError

2013-07-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, I tweaked the error message a bit: _sslobj can also be None when unwrap() has been called on the socket. Thank you for contribution! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed

[issue18513] test.cmath fails on OS/X with gcc-4.8 in non-debug build

2013-07-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 91374660355a by Raymond Hettinger in branch '2.7': Issue #18513: Add workaround for OS X 10.8 cexp bug that leads to wrong cmath.rect(0.0,-0.0) results. http://hg.python.org/cpython/rev/91374660355a --

[issue18513] test.cmath fails on OS/X with gcc-4.8 in non-debug build

2013-07-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks Mark. test_cmath passed now. I've also applied this to Python2.7. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18513 ___

[issue18513] test.cmath fails on OS/X with gcc-4.8 in non-debug build

2013-07-20 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks, Raymond. Postscript: I had a feeling of deja vu about this, and I've just been searching through old emails. It turns out I filed an OS X bug (#6466807 ) for this exact issue back in 2008; cexp was broken in 10.5, fixed in 10.6, and clearly is

[issue17532] IDLE: Always include Options menu on MacOSX

2013-07-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset f8df7c50132f by Ned Deily in branch '2.7': Issue #17532: Prevent exception when changing key sets if Options menu is empty. http://hg.python.org/cpython/rev/f8df7c50132f New changeset db6a22943a3f by Ned Deily in branch '3.3': Issue #17532: Prevent

[issue18515] zipfile._ZipDecryptor generates wasteful crc32 table on import

2013-07-20 Thread Daniel Holth
Daniel Holth added the comment: I tried it on a raspberry pi. zipfile takes 36 ms to import and 10 ms if it does not generate the crctable. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18515

[issue15905] Copy to fixed size buffer w/o check in sys_update_path

2013-07-20 Thread Christian Heimes
Christian Heimes added the comment: Here is a patch for 3.3 and tip that replaces wcscpy() with wcsncpy() and adds a proper NUL terminator at MAXPATHLEN. -- keywords: +patch stage: needs patch - patch review versions: -Python 3.2 Added file:

[issue18233] SSLSocket.getpeercertchain()

2013-07-20 Thread Derek Wilson
Changes by Derek Wilson jderekwil...@gmail.com: -- nosy: +Derek.Wilson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18233 ___ ___

[issue18233] SSLSocket.getpeercertchain()

2013-07-20 Thread Christian Heimes
Christian Heimes added the comment: From Rietveld review: --- http://bugs.python.org/review/18233/diff/8422/Modules/_ssl.c#newcode1203 Modules/_ssl.c:1203: chain = X509_STORE_CTX_get1_chain(store_ctx); This isn't appropriate for this method. Specifically, you are asking for the peer cert chain,

[issue18516] Typos in Lib/email/generator.py and Lib/email/architecture.rst

2013-07-20 Thread Vajrasky Kok
New submission from Vajrasky Kok: [sky@localhost cpython]$ grep -n boudary Lib/email/generator.py 352:# _make_boudary = Generator._make_boundary [sky@localhost cpython]$ grep -n fuzy Lib/email/architecture.rst 27:This division is intentionally a bit fuzy; the API described by this

[issue18516] Typos in Lib/email/generator.py and Lib/email/architecture.rst

2013-07-20 Thread R. David Murray
R. David Murray added the comment: The tuple pluralization looks correct to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18516 ___ ___