From report at bugs.python.org Sun Jan 1 09:22:32 2012 From: report at bugs.python.org (Devin Jeanpierre) Date: Sun, 01 Jan 2012 08:22:32 +0000 Subject: [New-bugs-announce] [issue13691] pydoc help (or help('help')) claims to run a help utility; does nothing Message-ID: <1325406152.03.0.315132806833.issue13691@psf.upfronthosting.co.za> New submission from Devin Jeanpierre : What follows is a copy-paste of a shell session. Notice that at the end, rather than being inside the online help utility, I'm still in the interactive interpreter. I was able to duplicate this on python3.2, python2.7, and python2.6 (verifying it on other versions would have required installing them). Reading the source in trunk, there is nothing that looks like it actually should run this interactive help session. It's just missing. I guess nobody used this, eh? I've attached a patch that should fix it. I'm not sure how you want to handle adding a test for this, so please advise me on that. ----- >>> help('help') Welcome to Python 3.2! This is the online help utility. If this is your first time using Python, you should definitely check out the tutorial on the Internet at http://docs.python.org/tutorial/. Enter the name of any module, keyword, or topic to get help on writing Python programs and using Python modules. To quit this help utility and return to the interpreter, just type "quit". To get a list of available modules, keywords, or topics, type "modules", "keywords", or "topics". Each module also comes with a one-line summary of what it does; to list the modules whose summaries contain a given word such as "spam", type "modules spam". >>> ---------- components: Library (Lib) files: r74214.diff keywords: patch messages: 150427 nosy: Devin Jeanpierre priority: normal severity: normal status: open title: pydoc help (or help('help')) claims to run a help utility; does nothing versions: Python 2.6, Python 2.7, Python 3.2 Added file: http://bugs.python.org/file24121/r74214.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 1 13:03:31 2012 From: report at bugs.python.org (Henrik Holmboe) Date: Sun, 01 Jan 2012 12:03:31 +0000 Subject: [New-bugs-announce] [issue13692] 2to3 mangles from . import frobnitz Message-ID: <1325419411.86.0.637139477325.issue13692@psf.upfronthosting.co.za> New submission from Henrik Holmboe : It seems that 2to3 mangles:: from . import frobnitz into:: from ... import frobnitz This was noticed in the port of ipython to py3k. See https://github.com/ipython/ipython/issues/1197 ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 150430 nosy: holmbie priority: normal severity: normal status: open title: 2to3 mangles from . import frobnitz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 1 18:25:00 2012 From: report at bugs.python.org (kxroberto) Date: Sun, 01 Jan 2012 17:25:00 +0000 Subject: [New-bugs-announce] [issue13693] email.Header.Header incorrect/non-smart on international charset address fields Message-ID: <1325438700.75.0.319524788564.issue13693@psf.upfronthosting.co.za> New submission from kxroberto : the email.* package seems to over-encode international charset address fields - resulting even in display errors in the receivers reader - , when message header composition is done as recommended in http://docs.python.org/library/email.header.html Python 2.7.2 >>> e=email.Parser.Parser().parsestr(getcliptext()) >>> e['From'] '=?utf-8?q?Martin_v=2E_L=C3=B6wis?= ' # note the par >>> email.Header.decode_header(_) [('Martin v. L\xc3\xb6wis', 'utf-8'), ('', None)] # unfortunately there is no comfortable function for this: >>> u='Martin v. L\xc3\xb6wis'.decode('utf8') + ' ' >>> u u'Martin v. L\xf6wis ' >>> msg=email.Message.Message() >>> msg['From']=u >>> msg.as_string() 'From: =?utf-8?b?TWFydGluIHYuIEzDtndpcyA8cmVwb3J0QGJ1Z3MucHl0aG9uLm9yZz4=?=\n\n' >>> msg['From']=str(u) >>> msg.as_string() 'From: =?utf-8?b?TWFydGluIHYuIEzDtndpcyA8cmVwb3J0QGJ1Z3MucHl0aG9uLm9yZz4=?=\nFrom: Martin v. L\xf6wis \n\n' >>> msg['From']=email.Header.Header(u) >>> msg.as_string() 'From: =?utf-8?b?TWFydGluIHYuIEzDtndpcyA8cmVwb3J0QGJ1Z3MucHl0aG9uLm9yZz4=?=\nFrom: Martin v. L\xf6wis \nFrom: =?utf-8?b?TWFydGluIHYuIEzDtndpcyA8cmVwb3J0QGJ1Z3MucHl0aG9uLm9yZz4=?=\n\n' >>> (BTW: strange is that multiple msg['From']=... _assignments_ end up as multiple additions !??? also msg renders 8bit header lines without warning/error or auto-encoding, while it does auto on unicode!??) Whats finally arriving at the receiver is typically like: From: "=?utf-8?b?TWFydGluIHYuIEzDtndpcyA8cmVwb3J0QGJ1Z3MucHl0aG9uLm9yZz4=?=" because the servers seem to want the address open, they extract the address and _add_ it (duplicating) as ASCII. => error I have not found any emails in my archives where address header fields are so over-encoded like python does. Even in non-address fields mostly only those words/groups are encoded which need it. I assume the sophisticated/high-level looking email.* package doesn't expect that the user fiddles things together low-level? with parseaddr, re.search, make_header Header.encode , '.join ... Or is it indeed (undocumented) so? IMHO it should be auto-smart enough. Note: there is a old deprecated function mimify.mime_encode_header which seemed to try to cautiously auto-encode correct/sparsely (but actually fails too on all examples tried). ---------- components: Library (Lib) messages: 150434 nosy: kxroberto priority: normal severity: normal status: open title: email.Header.Header incorrect/non-smart on international charset address fields type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 2 03:15:16 2012 From: report at bugs.python.org (Matt Joiner) Date: Mon, 02 Jan 2012 02:15:16 +0000 Subject: [New-bugs-announce] [issue13694] asynchronous connect in asyncore.dispatcher does not set addr Message-ID: <1325470516.27.0.519900720027.issue13694@psf.upfronthosting.co.za> New submission from Matt Joiner : Patch attached ---------- components: Library (Lib) files: dispatcher_connect_addr.patch keywords: patch messages: 150449 nosy: anacrolix priority: normal severity: normal status: open title: asynchronous connect in asyncore.dispatcher does not set addr type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24124/dispatcher_connect_addr.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 2 06:48:10 2012 From: report at bugs.python.org (=?utf-8?q?Bo=C5=A1tjan_Mejak?=) Date: Mon, 02 Jan 2012 05:48:10 +0000 Subject: [New-bugs-announce] [issue13695] "type specific" to "type-specific" Message-ID: <1325483290.25.0.872020961031.issue13695@psf.upfronthosting.co.za> New submission from Bo?tjan Mejak : Please visit the following link and fix the below text: http://docs.python.org/library/unittest.html#unittest.TestCase.assertEqual Changed in version 2.7: Added the automatic calling of >>>type-specific<<< equality function. Just add the hyphen. Thanks. ---------- assignee: docs at python components: Documentation messages: 150451 nosy: Retro, docs at python priority: normal severity: normal status: open title: "type specific" to "type-specific" versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 2 19:40:30 2012 From: report at bugs.python.org (CRicky) Date: Mon, 02 Jan 2012 18:40:30 +0000 Subject: [New-bugs-announce] [issue13696] [urllib.request.HTTPRedirectHandler.http_error_302] Relative Redirect issue Message-ID: <1325529630.8.0.473539706261.issue13696@psf.upfronthosting.co.za> New submission from CRicky : I had an HTTP redirection that worked perfectly on version 3.1. On version 3.2, I get a HTTP error 302. In this redirection, I actually have 2 redirections. The last one does not work because it is a relative redirection, so urlparts.scheme is empty. Some lines have been added in version 3.2 for security reason, but it also blocks relative links in 302 return. To correct, I have added empty scheme in check: if not urlparts.scheme in ('http', 'https', 'ftp', ''): With that, it works correctly. I don't make you any for 3 new chars. ;) Best regards, CRicky ---------- components: Library (Lib) messages: 150473 nosy: CRicky priority: normal severity: normal status: open title: [urllib.request.HTTPRedirectHandler.http_error_302] Relative Redirect issue type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 2 22:13:13 2012 From: report at bugs.python.org (Robert Collins) Date: Mon, 02 Jan 2012 21:13:13 +0000 Subject: [New-bugs-announce] [issue13697] python RLock implementation unsafe with signals Message-ID: <1325538793.4.0.376965160112.issue13697@psf.upfronthosting.co.za> New submission from Robert Collins : This affects the python implementation of RLock only. If a signal occurs during RLock.acquire() or release() and then operates on the same lock to acquire() or release() it, process hangs or assertions can be triggered. The attached test script demonstrates the issue on Python 2.6 and 3.2, and code inspection suggests this is still valid for 2.7 and 3.4. To use it, run the script and then 'kill -SIGUSR2' the process id it prints out. Keep sending SIGUSR2 until you get bored or: - a traceback occurs - the process stops printing out '.'s We found this debugging application server hangs during log rotation (https://bugs.launchpad.net/launchpad/+bug/861742) where if the thread that the signal is received in was about to log a message the deadlock case would crop up from time to time. Of course, this wasn't ever safe code, and we're changing it (to have the signal handler merely set a integer flag that the logging handler can consult without locking). However, I wanted to raise this upstream, and I note per issue #3618 that the 3.x IO module apparently includes a minimal version of the Python RLock implementation (or just uses RLock itself). Either way this bug probably exists for applications simply doing IO, either when there is no C RLock implementation available, or all the time (depending on exactly what the IO module is doing nowadays). ---------- components: Library (Lib) files: hang.py messages: 150477 nosy: rbcollins priority: normal severity: normal status: open title: python RLock implementation unsafe with signals versions: Python 2.7, Python 3.4 Added file: http://bugs.python.org/file24126/hang.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 2 22:46:27 2012 From: report at bugs.python.org (endolith) Date: Mon, 02 Jan 2012 21:46:27 +0000 Subject: [New-bugs-announce] [issue13698] Should not use mboxo format Message-ID: <1325540787.88.0.149207146949.issue13698@psf.upfronthosting.co.za> New submission from endolith : The documentation states: "Several variations of the mbox format exist to address perceived shortcomings in the original. In the interest of compatibility, mbox implements the original format, which is sometimes referred to as mboxo." http://docs.python.org/dev/library/mailbox.html#mailbox.mbox But this format is fundamentally broken, corrupting lines that start with ">From ", and I can't find any justification for using it in Python. In fact, all four links included in that section argue against this format. If only one mbox format is used, it should be mboxrd. Otherwise, include support for all the variants, with mboxrd as the default. ---------- components: Library (Lib) messages: 150478 nosy: endolith priority: normal severity: normal status: open title: Should not use mboxo format type: behavior versions: Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 3 00:19:01 2012 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 02 Jan 2012 23:19:01 +0000 Subject: [New-bugs-announce] [issue13699] test_gdb has recently started failing Message-ID: <1325546341.52.0.130827872784.issue13699@psf.upfronthosting.co.za> New submission from Vinay Sajip : test_gdb has started failing recently on my Ubuntu Natty system: vinay at eta-natty:~/tools/cpython$ ./python Lib/test/regrtest.py -v test_gdb == CPython 3.3.0a0 (default:3ed5a6030c9b, Jan 2 2012, 23:04:11) [GCC 4.5.2] == Linux-2.6.38-13-generic-i686-with-debian-squeeze-sid little-endian == /home/vinay/tools/cpython/build/test_python_14449 Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0) [1/1] test_gdb [successful tests snipped] ====================================================================== FAIL: test_print_after_up (test.test_gdb.PyPrintTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vinay/tools/cpython/Lib/test/test_gdb.py", line 670, in test_print_after_up r".*\nlocal 'c' = 3\nlocal 'b' = 2\nlocal 'a' = 1\n.*") File "/home/vinay/tools/cpython/Lib/test/test_gdb.py", line 171, in assertMultilineMatches self.fail(msg='%r did not match %r' % (actual, pattern)) AssertionError: 'Breakpoint 1 at 0x80ad5c6: file Python/bltinmodule.c, line 951.\n[Thread debugging using libthread_db enabled]\n\nBreakpoint 1, builtin_id (self=, v=42) at Python/bltinmodule.c:951\n951\t return PyLong_FromVoidPtr(v);\n#6 (unable to read python frame information)\nUnable to read information on python frame\nUnable to read information on python frame\nUnable to read information on python frame\n' did not match ".*\\nlocal 'c' = 3\\nlocal 'b' = 2\\nlocal 'a' = 1\\n.*" ====================================================================== FAIL: test_locals_after_up (test.test_gdb.PyLocalsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vinay/tools/cpython/Lib/test/test_gdb.py", line 702, in test_locals_after_up r".*\na = 1\nb = 2\nc = 3\n.*") File "/home/vinay/tools/cpython/Lib/test/test_gdb.py", line 171, in assertMultilineMatches self.fail(msg='%r did not match %r' % (actual, pattern)) AssertionError: 'Breakpoint 1 at 0x80ad5c6: file Python/bltinmodule.c, line 951.\n[Thread debugging using libthread_db enabled]\n\nBreakpoint 1, builtin_id (self=, v=42) at Python/bltinmodule.c:951\n951\t return PyLong_FromVoidPtr(v);\n#6 (unable to read python frame information)\nUnable to read information on python frame\n' did not match '.*\\na = 1\\nb = 2\\nc = 3\\n.*' ---------------------------------------------------------------------- Ran 42 tests in 13.809s FAILED (failures=2, skipped=11) test test_gdb failed 1 test failed: test_gdb vinay at eta-natty:~/tools/cpython$ ./python Python 3.3.0a0 (default:3ed5a6030c9b, Jan 2 2012, 23:04:11) [GCC 4.5.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sysconfig >>> sysconfig.get_config_vars()['PY_CFLAGS'] '-Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' >>> vinay at eta-natty:~/tools/cpython$ gdb --version GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-linux-gnu". For bug reporting instructions, please see: . vinay at eta-natty:~/tools/cpython$ gcc --version gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. vinay at eta-natty:~/tools/cpython$ uname -a Linux eta-natty 2.6.38-13-generic #53-Ubuntu SMP Mon Nov 28 19:23:39 UTC 2011 i686 i686 i386 GNU/Linux Marking haypo as nosy since it might be related to recent changes for #13628. In earlier tests (conducted on 12 Dec, before the #13628 fix was checked in) test_gdb did not fail on the same system. ---------- components: Library (Lib) messages: 150484 nosy: haypo, vinay.sajip priority: normal severity: normal status: open title: test_gdb has recently started failing type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 3 02:11:29 2012 From: report at bugs.python.org (Erno Tukia) Date: Tue, 03 Jan 2012 01:11:29 +0000 Subject: [New-bugs-announce] [issue13700] imaplib.IMAP4.authenticate authobject fails with PLAIN mechanism Message-ID: <1325553089.14.0.504978991098.issue13700@psf.upfronthosting.co.za> New submission from Erno Tukia : >>> import imaplib >>> imap = imaplib.IMAP4_SSL("imap.example.com") >>> authcb = lambda resp: "{0}\x00{0}\x00{1}".format("username","password") >>> imap.authenticate("PLAIN", authcb) Traceback (most recent call last): File "", line 1, in imap.authenticate("PLAIN", authcb) File "/usr/lib/python3.1/imaplib.py", line 361, in authenticate typ, dat = self._simple_command('AUTHENTICATE', mech) File "/usr/lib/python3.1/imaplib.py", line 1075, in _simple_command return self._command_complete(name, self._command(name, *args)) File "/usr/lib/python3.1/imaplib.py", line 889, in _command literal = literator(self.continuation_response) File "/usr/lib/python3.1/imaplib.py", line 1238, in process return self.encode(ret) File "/usr/lib/python3.1/imaplib.py", line 1257, in encode e = binascii.b2a_base64(t) TypeError: must be bytes or buffer, not str ... and ... >>> authcb = lambda resp: "{0}\x00{0}\x00{1}".format("username","password").encode() >>> imap.authenticate("PLAIN", authcb) Traceback (most recent call last): File "", line 1, in imap.authenticate("PLAIN", authcb) File "/usr/lib/python3.1/imaplib.py", line 361, in authenticate typ, dat = self._simple_command('AUTHENTICATE', mech) File "/usr/lib/python3.1/imaplib.py", line 1075, in _simple_command return self._command_complete(name, self._command(name, *args)) File "/usr/lib/python3.1/imaplib.py", line 889, in _command literal = literator(self.continuation_response) File "/usr/lib/python3.1/imaplib.py", line 1238, in process return self.encode(ret) File "/usr/lib/python3.1/imaplib.py", line 1259, in encode oup = oup + e[:-1] TypeError: Can't convert 'bytes' object to str implicitly ---------- components: Library (Lib) messages: 150489 nosy: etukia priority: normal severity: normal status: open title: imaplib.IMAP4.authenticate authobject fails with PLAIN mechanism type: behavior versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 3 04:01:46 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Tue, 03 Jan 2012 03:01:46 +0000 Subject: [New-bugs-announce] [issue13701] Remove Decimal Python 2.3 Compatibility Message-ID: <1325559706.07.0.31676641509.issue13701@psf.upfronthosting.co.za> New submission from Ramchandra Apte : Decimal has compatibility for Python 2.3 (such as not using decorators) as mentioned in comments in the source code for it. This compatibility should be removed in Python 3.3 and if possible, in Python 3.2. ---------- components: Library (Lib) messages: 150495 nosy: ramchandra.apte priority: normal severity: normal status: open title: Remove Decimal Python 2.3 Compatibility versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 3 17:42:43 2012 From: report at bugs.python.org (Patrick von Reth) Date: Tue, 03 Jan 2012 16:42:43 +0000 Subject: [New-bugs-announce] [issue13702] relative symlinks in tarfile.extract broken Message-ID: <1325608963.69.0.695216553795.issue13702@psf.upfronthosting.co.za> New submission from Patrick von Reth : when extracting http://www.openssl.org/source/openssl-1.0.0d.tar.gz with python3.2 on windows 7 extraction fails with File "C:\python32\lib\tarfile.py", line 2175, in extract set_attrs=set_attrs) File "C:\python32\lib\tarfile.py", line 2259, in _extract_member self.makelink(tarinfo, targetpath) File "C:\python32\lib\tarfile.py", line 2359, in makelink targetpath) File "C:\python32\lib\tarfile.py", line 2251, in _extract_member self.makefile(tarinfo, targetpath) File "C:\python32\lib\tarfile.py", line 2292, in makefile target = bltn_open(targetpath, "wb") IOError: [Errno 22] Invalid argument: 'R:\\tmp\\os\\openssl-1.0.0d\\apps\\md4.c' the reason is that the symlink is broken R:\>dir R:\tmp\os\openssl-1.0.0d\apps\md4.c Volume in drive R has no label. Volume Serial Number is E8F0-7223 Directory of R:\tmp\os\openssl-1.0.0d\apps 02.01.2012 20:13 md4.c [../crypto/md4/md4.c] it must be backslashes instead of front slashes and that's why python cant access the file the symlink is pointing to. ---------- components: Windows messages: 150512 nosy: Patrick.von.Reth priority: normal severity: normal status: open title: relative symlinks in tarfile.extract broken type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 3 20:36:50 2012 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 03 Jan 2012 19:36:50 +0000 Subject: [New-bugs-announce] [issue13703] Hash collision security issue Message-ID: <1325619410.45.0.862265945379.issue13703@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : This is already publicly known and in deep discussion on python-dev. The proper fix is still TBD. Essentially, hash collisions can be exploited to DoS a web framework that automatically parses input forms into dictionaries. Start here: http://mail.python.org/pipermail/python-dev/2011-December/115116.html ---------- components: Interpreter Core messages: 150522 nosy: barry, benjamin.peterson, georg.brandl priority: release blocker severity: normal status: open title: Hash collision security issue type: security versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 3 21:24:33 2012 From: report at bugs.python.org (Christian Heimes) Date: Tue, 03 Jan 2012 20:24:33 +0000 Subject: [New-bugs-announce] [issue13704] Random number generator in Python core Message-ID: <1325622273.87.0.90076525746.issue13704@psf.upfronthosting.co.za> New submission from Christian Heimes : All proposed fixes for a randomized hashing function raise and fall with a good random number generator to feed the random seed. The seed must be created very early in the startup phase of the interpreter, preferable before the basic types are initialized. CPython already have multiple sources for random data (win32_urandom in Modules/posixmodule.c, urandom in Lib/os.py, Mersenne twister in Modules/_randommodule.c). However we can't use them because they are wrapped inside Python modules which require infrastructure like initialized base types. Discussion at http://mail.python.org/pipermail/python-dev/2012-January/115263.html My proposed changes are implemented in my feature fork but not yet well tested. Windows build files needs modification, too. ---------- assignee: christian.heimes hgrepos: 98 messages: 150527 nosy: barry, benjamin.peterson, christian.heimes, georg.brandl, gvanrossum, pitrou priority: release blocker severity: normal stage: patch review status: open title: Random number generator in Python core type: enhancement versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 3 23:13:08 2012 From: report at bugs.python.org (Sinisa Segvic) Date: Tue, 03 Jan 2012 22:13:08 +0000 Subject: [New-bugs-announce] [issue13705] Raising exceptions from finally works better than advertised in the documentation Message-ID: <1325628788.79.0.655122317093.issue13705@psf.upfronthosting.co.za> New submission from Sinisa Segvic : Hi, The documentation says: """ If the finally clause raises another exception (...) the saved exception is lost. """ This does not appear to be true. In the example below the backtrace shows both exceptions. >>> import math >>> try: ... 1/0 ... finally: ... math.sqrt(-1) ... Traceback (most recent call last): File "", line 2, in ZeroDivisionError: division by zero During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 4, in ValueError: math domain error Cheers, Sini?a ---------- assignee: docs at python components: Documentation messages: 150544 nosy: docs at python, ssegvic priority: normal severity: normal status: open title: Raising exceptions from finally works better than advertised in the documentation type: enhancement versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 3 23:36:25 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 03 Jan 2012 22:36:25 +0000 Subject: [New-bugs-announce] [issue13706] Unicode fill characters no longer work in numeric formatting Message-ID: <1325630185.42.0.0487894537415.issue13706@psf.upfronthosting.co.za> New submission from Stefan Krah : It used to be possible to specify Unicode fill characters in numeric formatting: Python 3.3.0a0 (default:1dd6908df8f5, Jul 16 2011, 11:16:00) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> format(1234, "\u2007<7") '1234\u2007\u2007\u2007' [64682 refs] >>> Now it doesn't work: Python 3.3.0a0 (default:65ac469d30e6, Jan 3 2012, 23:23:07) [GCC 4.4.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> format(1234, "\u2007<7") Traceback (most recent call last): File "", line 1, in ValueError: fill character too large ---------- components: Interpreter Core messages: 150548 nosy: eric.smith, haypo, loewis, mark.dickinson, skrah priority: normal severity: normal status: open title: Unicode fill characters no longer work in numeric formatting type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 4 01:40:53 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 04 Jan 2012 00:40:53 +0000 Subject: [New-bugs-announce] [issue13707] Clarify hash() lifetime Message-ID: <1325637653.51.0.0128051850964.issue13707@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Current 3.2.2 docs: id(object) Return the ?identity? of an object. This is an integer which is guaranteed to be unique and constant for this object during its lifetime. [model] hash(object) Return the hash value of the object (if it has one). Hash values are integers. They are used to quickly compare dictionary keys Suggestion: change "Hash values are integers. They ..." to "This should be an integer which is constant for this object during its lifetime. Hash values ..." Rationale: For builtin class instances, hash values are guaranteed to be constant that long, and only that long, as the default hash(ob) for object() instances is currently, for my win7, 64 bit, 3.2.2 CPython, id(ob) // 16 (the minimum object size). User class instance hashes (with custom __hash__) *should* have the same lifetime. But since Python cannot enforce that, I did not say 'guaranteed'. User code should *not* depend on a longer lifetime, just as for id() output. It seems worth implying that, as for id(), because (based on recent pydev discussion) people seems to be prone to over-generalize the current longer-term stability of number and string hashes, which itself may disappear in future releases. (see #13703) ---------- assignee: docs at python components: Documentation messages: 150561 nosy: docs at python, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Clarify hash() lifetime type: enhancement versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 4 03:33:29 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Wed, 04 Jan 2012 02:33:29 +0000 Subject: [New-bugs-announce] [issue13708] Document ctypes.wintypes Message-ID: <1325644409.99.0.366875630851.issue13708@psf.upfronthosting.co.za> Changes by Ramchandra Apte : ---------- nosy: ramchandra.apte priority: normal severity: normal status: open title: Document ctypes.wintypes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 4 03:46:43 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Wed, 04 Jan 2012 02:46:43 +0000 Subject: [New-bugs-announce] [issue13709] Capitalization mistakes in the documentation for ctypes Message-ID: <1325645203.91.0.562347938508.issue13709@psf.upfronthosting.co.za> New submission from Ramchandra Apte : In section 15.17.1.17 in the ctypes documentation, the documentation says "It is funny to see that on linux the sort function seems to work much more efficiently, it is doing less comparisons" "It is quite interesting to see that the Windows qsort() function needs more comparisons than the linux version!" "linux" should be capitalized in both these sentences. ---------- assignee: docs at python components: Documentation messages: 150574 nosy: docs at python, ramchandra.apte priority: normal severity: normal status: open title: Capitalization mistakes in the documentation for ctypes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 4 05:58:50 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Wed, 04 Jan 2012 04:58:50 +0000 Subject: [New-bugs-announce] [issue13710] hash() on string containing only null characters returns the length of the string Message-ID: <1325653130.87.0.569297022599.issue13710@psf.upfronthosting.co.za> New submission from Ramchandra Apte : If you run hash on strings containing only null characters it returns the length of the string >>> hash("\0") 1 >>> hash("\0\0") 2 >>> hash("\0"*1000) 1000 This behaviour is not like proper hash functions. The hashes of these strings should exhibit the avalanche effect like in a proper hash function. ---------- components: Interpreter Core messages: 150587 nosy: ramchandra.apte priority: normal severity: normal status: open title: hash() on string containing only null characters returns the length of the string type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 4 14:26:47 2012 From: report at bugs.python.org (=?utf-8?q?Manuel_B=C3=A4renz?=) Date: Wed, 04 Jan 2012 13:26:47 +0000 Subject: [New-bugs-announce] [issue13711] html.parser.HTMLParser doesn't parse tags in comments in scripts correctly Message-ID: <1325683607.39.0.829837031313.issue13711@psf.upfronthosting.co.za> New submission from Manuel B?renz : I've attached a script which demonstrates the bug. When feeding a