From report at bugs.python.org Sun Aug 1 00:09:26 2010 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 31 Jul 2010 22:09:26 +0000 Subject: [New-bugs-announce] [issue9443] Use newer unittest methods throughout tests In-Reply-To: <1280614166.98.0.962440088026.issue9443@psf.upfronthosting.co.za> Message-ID: <1280614166.98.0.962440088026.issue9443@psf.upfronthosting.co.za> New submission from ?ric Araujo : unittest provides new methods like assertIn and assertLess that provide more useful error messages in case of failure. Some names like assertEquals are also deprecated. The test suite should be updated to benefit from the new goodness and stop using obsolete names. ---------- components: None messages: 112217 nosy: merwok priority: normal severity: normal status: open title: Use newer unittest methods throughout tests versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 00:20:28 2010 From: report at bugs.python.org (Doug Hellmann) Date: Sat, 31 Jul 2010 22:20:28 +0000 Subject: [New-bugs-announce] [issue9444] argparse does not honor prefix_chars when adding default options In-Reply-To: <1280614828.04.0.896226806914.issue9444@psf.upfronthosting.co.za> Message-ID: <1280614828.04.0.896226806914.issue9444@psf.upfronthosting.co.za> New submission from Doug Hellmann : If an ArgumentParser is created with a prefix_chars string that does not include '-', the default options created for showing help (-h and --help) and the version (-v and --version) are invalid and generate an exception. ---------- components: Library (Lib) files: argparse_prefix_chars_bug.py messages: 112219 nosy: doughellmann priority: normal severity: normal status: open title: argparse does not honor prefix_chars when adding default options versions: Python 2.7 Added file: http://bugs.python.org/file18292/argparse_prefix_chars_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 03:52:56 2010 From: report at bugs.python.org (Brian Curtin) Date: Sun, 01 Aug 2010 01:52:56 +0000 Subject: [New-bugs-announce] [issue9445] Fix undefined symbol errors on VS8.0 build In-Reply-To: <1280627576.04.0.298775706484.issue9445@psf.upfronthosting.co.za> Message-ID: <1280627576.04.0.298775706484.issue9445@psf.upfronthosting.co.za> New submission from Brian Curtin : Raymond informed me that #1578269 introduced breakage to compilation under Visual Studio 2005 due to three undefined symbols. I'm not currently setup to build under 2005, so I just offer this patch which defines the values as they are seen in VS 2008. ---------- assignee: rhettinger components: Build, Windows files: undefined_symbols.diff keywords: needs review, patch, patch messages: 112252 nosy: brian.curtin, rhettinger priority: normal severity: normal stage: patch review status: open title: Fix undefined symbol errors on VS8.0 build type: compile error versions: Python 3.2 Added file: http://bugs.python.org/file18296/undefined_symbols.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 12:30:13 2010 From: report at bugs.python.org (Guandalino) Date: Sun, 01 Aug 2010 10:30:13 +0000 Subject: [New-bugs-announce] [issue9446] urllib2 tests fail when offline In-Reply-To: <1280658613.57.0.546595644566.issue9446@psf.upfronthosting.co.za> Message-ID: <1280658613.57.0.546595644566.issue9446@psf.upfronthosting.co.za> New submission from Guandalino : urllib2 tests fail when internet connection is not available. $ cd ~/sandbox/2.7/lib/python2.7/test $ python test_urllib2.py other output, [cut] ====================================================================== ERROR: test_file (__main__.HandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_urllib2.py", line 711, in test_file h.file_open, Request(url)) File "/home/redt/sandbox/2.7/lib/python2.7/unittest/case.py", line 456, in assertRaises callableObj(*args, **kwargs) File "/home/redt/sandbox/2.7/lib/python2.7/urllib2.py", line 1269, in file_open return self.open_local_file(req) File "/home/redt/sandbox/2.7/lib/python2.7/urllib2.py", line 1301, in open_local_file (not port and socket.gethostbyname(host) in self.get_names()): gaierror: [Errno -5] No address associated with hostname ---------------------------------------------------------------------- Ran 34 tests in 0.414s FAILED (errors=1) The issue verifies using ubuntu 8.04 LTS having this /etc/hosts: 127.0.0.1 localhost localhost.localdomain speedy ::1 localhost speedy ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts Note that when connected to internet all the tests pass. Further details can be found in a thread I started on comp.lang.python. http://bit.ly/9x9Umu. I can't guarantee a quick answer but let me know if other info are required, I'll be glad to provide them asap. Thank you. ---------- components: Installation, Library (Lib), Tests files: offline.log messages: 112307 nosy: benjamin.peterson, ezio.melotti, guandalino, orsenthil, tjreedy priority: normal severity: normal status: open title: urllib2 tests fail when offline type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file18306/offline.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 14:12:22 2010 From: report at bugs.python.org (Tobias Klausmann) Date: Sun, 01 Aug 2010 12:12:22 +0000 Subject: [New-bugs-announce] [issue9447] Python 3.1.2 test suite segfaults on the alpha architecture In-Reply-To: <1280664742.46.0.0239388130626.issue9447@psf.upfronthosting.co.za> Message-ID: <1280664742.46.0.0239388130626.issue9447@psf.upfronthosting.co.za> New submission from Tobias Klausmann : During testing for inclusion in the Gentoo distribution, we ran into a test failure (actually a SEGV) when running the test suite on the alpha architecture. Log of test failure and backtrace in gdb is here: http://dev.gentoo.org/~klausman/python-3.1.2-testrun.log and also attached to this bug report. gcc is 4.4.3 glibc is 2.11.2 Kernel is 2.6.33 If more info or access to an alpha machine is needed, feel free to contact me or the alpha arch team at gentoo (alpha at gentoo.org) ---------- components: Tests files: python-3.1.2-testrun.log messages: 112319 nosy: klausman priority: normal severity: normal status: open title: Python 3.1.2 test suite segfaults on the alpha architecture type: crash versions: Python 3.2 Added file: http://bugs.python.org/file18308/python-3.1.2-testrun.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 17:53:16 2010 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 01 Aug 2010 15:53:16 +0000 Subject: [New-bugs-announce] [issue9448] test_io leaks memory In-Reply-To: <1280677996.0.0.904375353988.issue9448@psf.upfronthosting.co.za> Message-ID: <1280677996.0.0.904375353988.issue9448@psf.upfronthosting.co.za> New submission from Mark Dickinson : regrest -L detects a memory leak in test_io, on OS X 10.6.4. newton:py3k dickinsm$ ./python.exe Lib/test/regrtest.py -L test_io test_io Testing large file ops skipped on darwin. It requires 2147483648 bytes and a long time. Use 'regrtest.py -u largefile test_io' to run it. Testing large file ops skipped on darwin. It requires 2147483648 bytes and a long time. Use 'regrtest.py -u largefile test_io' to run it. 1 test OK. leaks Report Version: 2.0 Process: python.exe [71362] Path: /Users/dickinsm/python/svn/py3k/python.exe Load Address: 0x100000000 Identifier: python.exe Version: ??? (???) Code Type: X86-64 (Native) Parent Process: bash [18674] Date/Time: 2010-08-01 16:51:50.332 +0100 OS Version: Mac OS X 10.6.4 (10F569) Report Version: 6 Process 71362: 6679 nodes malloced for 14021 KB Process 71362: 16 leaks for 2048 total leaked bytes. Leak: 0x10138bb40 size=128 zone: DefaultMallocZone_0x1002f7000 0x00000000 0x00000000 0x434f4e44 0x00000000 ........DNOC.... 0x00000000 0x80000000 0x00000000 0x00000000 ................ 0x00000000 0x00000000 0x00000000 0x00000000 ................ 0x00000000 0x00000000 0x4d555458 0x00000000 ........XTUM.... 0x00000000 0x00000060 0x00000000 0x00000000 ....`........... 0x00000000 0x00000000 0x00000000 0x00000000 ................ 0x00000000 0x00000000 0x00000000 0x00000000 ................ 0x00000000 0x00000000 0xdbdbdbdb 0x0008dbdb ................ (15 blocks of similar output omitted) I'm investigating further... ---------- assignee: ronaldoussoren components: Extension Modules, Macintosh, Tests messages: 112348 nosy: mark.dickinson, ronaldoussoren priority: normal severity: normal stage: needs patch status: open title: test_io leaks memory type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 18:41:03 2010 From: report at bugs.python.org (Nikolaus Rath) Date: Sun, 01 Aug 2010 16:41:03 +0000 Subject: [New-bugs-announce] [issue9449] glibc detected *** /usr/bin/python: corrupted double-linked list In-Reply-To: <1280680863.06.0.649816134014.issue9449@psf.upfronthosting.co.za> Message-ID: <1280680863.06.0.649816134014.issue9449@psf.upfronthosting.co.za> New submission from Nikolaus Rath : $ python --version Python 2.6.5 $ pylint --version pylint 0.21.1, astng 0.20.1, common 0.50.3 Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] $ pylint pylint_crasher.py ************* Module pylint_crasher R0903: 62:Config: Too few public methods (0/2) [....] Global evaluation ----------------- Your code has been rated at 7.33/10 *** glibc detected *** /usr/bin/python: corrupted double-linked list: 0x09f611d8 *** [Program hangs here] Since pylint seems to ship with only .py files, I suppose this has to be a bug in the Python interpreter. ---------- components: Interpreter Core files: pylint_crasher.py messages: 112352 nosy: Nikratio priority: normal severity: normal status: open title: glibc detected *** /usr/bin/python: corrupted double-linked list type: crash versions: Python 2.6 Added file: http://bugs.python.org/file18312/pylint_crasher.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 20:13:37 2010 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 01 Aug 2010 18:13:37 +0000 Subject: [New-bugs-announce] [issue9450] readline.replace_history_item leaks memory. In-Reply-To: <1280686417.34.0.822614940004.issue9450@psf.upfronthosting.co.za> Message-ID: <1280686417.34.0.822614940004.issue9450@psf.upfronthosting.co.za> New submission from Mark Dickinson : Some functions in the readline module appear to leak memory; readline.replace_history_item is one of these: Test code: import readline readline.clear_history() readline.add_history("first line") readline.add_history("second line") while True: readline.replace_history_item(0, "replaced item") This is on OS X 10.6.4, with a 64-bit debug build of Python, and the readline module linked against a local build of GNU readline version 6.1. ---------- components: Extension Modules messages: 112363 nosy: mark.dickinson priority: normal severity: normal stage: needs patch status: open title: readline.replace_history_item leaks memory. type: resource usage versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 00:53:50 2010 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 01 Aug 2010 22:53:50 +0000 Subject: [New-bugs-announce] [issue9451] Strengthen __*__ system name warning In-Reply-To: <1280703230.07.0.461844472434.issue9451@psf.upfronthosting.co.za> Message-ID: <1280703230.07.0.461844472434.issue9451@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Current" 2.3.2. Reserved classes of identifiers "__*__ System-defined names. These names are defined by the interpreter and its implementation (including the standard library); applications should not expect to define additional names using this convention. The set of names of this class defined by Python may be extended in future versions. See section Special method names." Current pydev thread,Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?, Guido said; "But yes, the docs should clarify that *any* use of __*__ names, in any* context, that does not follow explicitly documented use, is subject to breakage without warning." I think I would replace the current "applications ... convention" with Guido's sentence, starting with "*Any* use", though I might put it at the end as the second most important sentence of the paragraph. Until this thread, I did not understand the import of 'expect to' in that middle sentence. Apparently, it means that if a definition works now, it may become invalid in the future if it becomes not just a system word, but a reserved word like __debug__ did. Guido's sentence covers this case and all others, so the current sentence would no longer be needed. ---------- assignee: docs at python components: Documentation messages: 112395 nosy: docs at python, tjreedy priority: normal severity: normal status: open title: Strengthen __*__ system name warning versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 02:31:16 2010 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2010 00:31:16 +0000 Subject: [New-bugs-announce] [issue9452] configparser support for reading from strings and dictionaries In-Reply-To: <1280709076.78.0.0624402875371.issue9452@psf.upfronthosting.co.za> Message-ID: <1280709076.78.0.0624402875371.issue9452@psf.upfronthosting.co.za> New submission from ?ukasz Langa : Overview -------- It's a fairly common need in configuration parsing to take configuration from a string or a Python data structure (most commonly, a dictionary). The attached patch introduces two new methods to RawConfigParser that serve this purpose: readstring and readdict. In the process, two behavioral bugs were detected and fixed. Detailed information about the patch ------------------------------------ Source changes: * added readstring and readdict methods * fixed a bug in SafeConfigParser.set when setting a None value would raise an exception (the code tried to remove interpolation escapes from None) * added a new exception DuplicateOptionError, raised when during parsing a single file, string or a dictionary the same option occurs twice. This catches mispellings and case-sensitivity errors (parsers are by default case-insensitive in regard to options). * added checking for option duplicates described above in _read Test changes: * self.fromstring is using readstring now * self.cf removed because it was bad design, now config parser instances are explicit everywhere ** changed definition of get_error and parse_error * split test_basic into two parts: config parser building and the actual test ** introduced config parser built from the dictionary * added a duplicate option checking case for string and dictionary based reading Documentation changes: * documented readstring and readdict * documented DuplicateOptionError * explicit remark about the case-insensitivity * corrected remark about leading whitespace being removed from values (also trailing whitespace is, and for keys as well) ---------- components: Library (Lib) messages: 112409 nosy: lukasz.langa priority: normal severity: normal status: open title: configparser support for reading from strings and dictionaries type: feature request versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:49:18 2010 From: report at bugs.python.org (Mark Smith) Date: Mon, 02 Aug 2010 10:49:18 +0000 Subject: [New-bugs-announce] [issue9453] pulldom.SAX2DOM Doesn't support processing instructions before the root element In-Reply-To: <1280746158.2.0.563581992561.issue9453@psf.upfronthosting.co.za> Message-ID: <1280746158.2.0.563581992561.issue9453@psf.upfronthosting.co.za> New submission from Mark Smith : pulldom.SAX2DOM raises a TypeError if it encounters a processing instruction before the root element of an XML document. It is valid to have a processing instruction before the root node of a document (and SAX2DOM's superclass, PullDOM supports this), so this behaviour is invalid. I've encountered this bug while writing unit tests for pulldom (#9373), so I've added this as an @expectedFailure, to be submitted as a patch for that ticket. ---------- components: XML messages: 112442 nosy: mark.smith priority: normal severity: normal status: open title: pulldom.SAX2DOM Doesn't support processing instructions before the root element type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:43:28 2010 From: report at bugs.python.org (Mark Smith) Date: Mon, 02 Aug 2010 12:43:28 +0000 Subject: [New-bugs-announce] [issue9454] unittest.expectedFailure decorator does not maintain target function's docstring. In-Reply-To: <1280753008.47.0.113036105001.issue9454@psf.upfronthosting.co.za> Message-ID: <1280753008.47.0.113036105001.issue9454@psf.upfronthosting.co.za> New submission from Mark Smith : When running tests with -v, the test runner prints out the docstring of each test method, if present, and falls back to the method name if it's not present. Test methods wrapped with @expectedFailure do not print out their docstring, so it looks like the docstring is not copied to the wrapper function. Failing test coming soon, hopefully followed by a patch to fix :) ---------- components: Tests messages: 112457 nosy: mark.smith priority: normal severity: normal status: open title: unittest.expectedFailure decorator does not maintain target function's docstring. type: performance versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 21:13:56 2010 From: report at bugs.python.org (Bill Janssen) Date: Mon, 02 Aug 2010 19:13:56 +0000 Subject: [New-bugs-announce] [issue9455] platform test borked in 2.7 branch on Power PC In-Reply-To: <1280776436.51.0.34473715368.issue9455@psf.upfronthosting.co.za> Message-ID: <1280776436.51.0.34473715368.issue9455@psf.upfronthosting.co.za> New submission from Bill Janssen : Looks like some test borked the 2.7 tests on the buildbots. Here's the offending test: test test_platform failed -- Traceback (most recent call last): File "/Users/buildbot/buildarea/2.7.parc-leopard-1/build/Lib/test/test_platform.py", line 196, in test_mac_ver self.assertEquals(res[2], 'PowerPC') AssertionError: 'Power Macintosh' != 'PowerPC' Re-running test 'test_platform' in verbose mode test_architecture (test.test_platform.PlatformTest) ... ok test_architecture_via_symlink (test.test_platform.PlatformTest) ... [17052 refs] [17052 refs] ok test_dist (test.test_platform.PlatformTest) ... ok test_java_ver (test.test_platform.PlatformTest) ... ok test_libc_ver (test.test_platform.PlatformTest) ... ok test_mac_ver (test.test_platform.PlatformTest) ... FAIL test_mac_ver_with_fork (test.test_platform.PlatformTest) ... ok test_machine (test.test_platform.PlatformTest) ... ok test_node (test.test_platform.PlatformTest) ... ok test_parse_release_file (test.test_platform.PlatformTest) ... ok test_platform (test.test_platform.PlatformTest) ... ok test_processor (test.test_platform.PlatformTest) ... ok test_release (test.test_platform.PlatformTest) ... ok test_sys_version (test.test_platform.PlatformTest) ... ok test_system (test.test_platform.PlatformTest) ... ok test_system_alias (test.test_platform.PlatformTest) ... ok test_uname (test.test_platform.PlatformTest) ... ok test_uname_win32_ARCHITEW6432 (test.test_platform.PlatformTest) ... skipped 'windows only test' test_version (test.test_platform.PlatformTest) ... ok test_win32_ver (test.test_platform.PlatformTest) ... ok ====================================================================== FAIL: test_mac_ver (test.test_platform.PlatformTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/2.7.parc-leopard-1/build/Lib/test/test_platform.py", line 196, in test_mac_ver self.assertEquals(res[2], 'PowerPC') AssertionError: 'Power Macintosh' != 'PowerPC' ---------------------------------------------------------------------- Ran 20 tests in 6.468s FAILED (failures=1, skipped=1) test test_platform failed -- Traceback (most recent call last): File "/Users/buildbot/buildarea/2.7.parc-leopard-1/build/Lib/test/test_platform.py", line 196, in test_mac_ver self.assertEquals(res[2], 'PowerPC') AssertionError: 'Power Macintosh' != 'PowerPC' ---------- assignee: ronaldoussoren components: Library (Lib), Tests messages: 112516 nosy: janssen, ronaldoussoren priority: normal severity: normal status: open title: platform test borked in 2.7 branch on Power PC type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 22:45:43 2010 From: report at bugs.python.org (Zachary Blair) Date: Mon, 02 Aug 2010 20:45:43 +0000 Subject: [New-bugs-announce] [issue9456] Apparent memory leak in PC/bdist_wininst/install.c In-Reply-To: <1280781943.93.0.297912103498.issue9456@psf.upfronthosting.co.za> Message-ID: <1280781943.93.0.297912103498.issue9456@psf.upfronthosting.co.za> New submission from Zachary Blair : >From inspecting the code in install.c's DeleteRegistryValue() and DeleteRegistryKey() functions, it appears as though there can be a small memory leak in the event that either function is passed an invalid argument. This patch corrects this issue by making sure to free any allocated memory before returning, even when an invalid argument is passed in. ---------- components: Windows files: install_c.diff keywords: patch messages: 112541 nosy: Zachary.Blair priority: normal severity: normal status: open title: Apparent memory leak in PC/bdist_wininst/install.c versions: Python 3.1 Added file: http://bugs.python.org/file18331/install_c.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 22:57:18 2010 From: report at bugs.python.org (Uli Kunitz) Date: Mon, 02 Aug 2010 20:57:18 +0000 Subject: [New-bugs-announce] [issue9457] Wrong URL in Python-3.2a1/README In-Reply-To: <1280782638.63.0.373315662844.issue9457@psf.upfronthosting.co.za> Message-ID: <1280782638.63.0.373315662844.issue9457@psf.upfronthosting.co.za> New submission from Uli Kunitz : The URL http://docs.python.org/dev/3.2/whatsnew/3.2.html is wrong. It should be replaced with http://docs.python.org/dev/whatsnew/3.2.html. ---------- assignee: docs at python components: Documentation messages: 112548 nosy: docs at python, kune priority: normal severity: normal status: open title: Wrong URL in Python-3.2a1/README versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 23:02:05 2010 From: report at bugs.python.org (Uli Kunitz) Date: Mon, 02 Aug 2010 21:02:05 +0000 Subject: [New-bugs-announce] [issue9458] xml.etree.ElementTree.write(): encoding handling problems In-Reply-To: <1280782925.67.0.136452249646.issue9458@psf.upfronthosting.co.za> Message-ID: <1280782925.67.0.136452249646.issue9458@psf.upfronthosting.co.za> New submission from Uli Kunitz : If one wants to use the encoding parameter of ElementTree.write() the file must be opened with "wb". Without encoding parameter normal files can be used, but the should be opened with the encoding "UTF-8", because otherwise this may create an error. Probably comparable problems exist with the parser side of things. ---------- components: XML messages: 112550 nosy: kune priority: normal severity: normal status: open title: xml.etree.ElementTree.write(): encoding handling problems versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 18:21:58 2010 From: report at bugs.python.org (R. David Murray) Date: Tue, 03 Aug 2010 16:21:58 +0000 Subject: [New-bugs-announce] [issue9495] argparse unittest tracebacks are confusing if an error is raised when not expected In-Reply-To: <1280852518.56.0.709280463518.issue9495@psf.upfronthosting.co.za> Message-ID: <1280852518.56.0.709280463518.issue9495@psf.upfronthosting.co.za> New submission from R. David Murray : In python3 if an error is raised from ErrorRaisingArgumentParser that is not caught by an assertRaises, unittest prints out the traceback, which is a chained traceback including the SystemExit that the argparse test suite catches in order to produce the ArgumentParserError that is actually of interest. I think the argparse test suite should break that chain to make the tracebacks when failures happen more on-point. ---------- components: Tests keywords: easy messages: 112625 nosy: r.david.murray priority: low severity: normal stage: needs patch status: open title: argparse unittest tracebacks are confusing if an error is raised when not expected type: behavior versions: Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 19:29:59 2010 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Tue, 03 Aug 2010 17:29:59 +0000 Subject: [New-bugs-announce] [issue9496] Unittests for Lib/rlcompleter.py In-Reply-To: <1280856599.43.4.18005844749e-05.issue9496@psf.upfronthosting.co.za> Message-ID: <1280856599.43.4.18005844749e-05.issue9496@psf.upfronthosting.co.za> New submission from Michele Orr? : The attached patch tests Lib/rlcompleter.py. ---------- components: Tests files: testrlcompleter.patch keywords: patch messages: 112636 nosy: ezio.melotti, maker priority: normal severity: normal status: open title: Unittests for Lib/rlcompleter.py type: feature request versions: Python 3.2 Added file: http://bugs.python.org/file18347/testrlcompleter.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 19:50:12 2010 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 03 Aug 2010 17:50:12 +0000 Subject: [New-bugs-announce] [issue9497] test_ssl memory leak In-Reply-To: <1280857812.89.0.163190953835.issue9497@psf.upfronthosting.co.za> Message-ID: <1280857812.89.0.163190953835.issue9497@psf.upfronthosting.co.za> New submission from Mark Dickinson : On OS X 10.6, with a 64-bit build of Python, regrtest -L is showing leaks from test_ssl. Here are the first few lines of the output; I've also attached the full output. newton:py3k dickinsm$ ./python.exe -m test.regrtest -L test_ssl [1/1] test_ssl 1 test OK. leaks Report Version: 2.0 Process: python.exe [36421] Path: /Users/dickinsm/python/svn/py3k/python.exe Load Address: 0x100000000 Identifier: python.exe Version: ??? (???) Code Type: X86-64 (Native) Parent Process: bash [80529] Date/Time: 2010-08-03 18:48:10.072 +0100 OS Version: Mac OS X 10.6.4 (10F569) Report Version: 6 Process 36421: 8194 nodes malloced for 15049 KB Process 36421: 106 leaks for 4080 total leaked bytes. Leak: 0x10173df50 size=272 zone: DefaultMallocZone_0x1002f7000 string '/C=US/ST=Delaware/L=Wilmington/O=Python Software Foundation/OU=SSL/CN=somemachine.python.org' Leak: 0x10171c0c0 size=192 zone: DefaultMallocZone_0x1002f7000 0x31898130 0x0609300b 0x06045503 0x53550213 0..1.0...U....US 0x0f301131 0x04550306 0x44081308 0x77616c65 1.0...U....Delaw 0x31657261 0x06113013 0x07045503 0x69570a13 are1.0...U....Wi 0x6e696d6c 0x6e6f7467 0x21302331 0x04550306 lmington1#0!..U. 0x501a130a 0x6f687479 0x6f53206e 0x61777466 ...Python Softwa 0x46206572 0x646e756f 0x6f697461 0x300c316e re Foundation1.0 0x5503060a 0x03130b04 0x314c5353 0x061d301f ...U....SSL1.0.. 0x03045503 0x6f731613 0x616d656d 0x6e696863 .U....somemachin ... Leak: 0x10171e7a0 size=192 zone: DefaultMallocZone_0x1002f7000 0x31898130 0x0609300b 0x06045503 0x53550213 0..1.0...U....US 0x0f301131 0x04550306 0x44081308 0x77616c65 1.0...U....Delaw 0x31657261 0x06113013 0x07045503 0x69570a13 are1.0...U....Wi 0x6e696d6c 0x6e6f7467 0x21302331 0x04550306 lmington1#0!..U. 0x501a130a 0x6f687479 0x6f53206e 0x61777466 ...Python Softwa 0x46206572 0x646e756f 0x6f697461 0x300c316e re Foundation1.0 0x5503060a 0x03130b04 0x314c5353 0x061d301f ...U....SSL1.0.. 0x03045503 0x6f731613 0x616d656d 0x6e696863 .U....somemachin ... ---------- files: test_ssl_leak_report.txt messages: 112637 nosy: janssen, mark.dickinson priority: normal severity: normal stage: needs patch status: open title: test_ssl memory leak type: resource usage versions: Python 3.2 Added file: http://bugs.python.org/file18348/test_ssl_leak_report.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 22:37:34 2010 From: report at bugs.python.org (Yitz Gale) Date: Tue, 03 Aug 2010 20:37:34 +0000 Subject: [New-bugs-announce] [issue9498] stdtypes.rst should refer to sys.float_info In-Reply-To: <1280867854.52.0.518299717843.issue9498@psf.upfronthosting.co.za> Message-ID: <1280867854.52.0.518299717843.issue9498@psf.upfronthosting.co.za> New submission from Yitz Gale : Library docs section 5.4 "Numeric Types" states about floating point numbers that "all bets on their precision are off unless you happen to know the machine you are working with." That has not been true since Python 2.6, when sys.float_info was added. There should be a reference to that here instead of that statement. In addition, that paragraph mentions that both float and complex are "implemented using double in C". There is no longer any special reason to mention how those are implemented in C, any more than anything else in Python. Everything you need to know about the implementation is in sys.float_info. (Well, almost everything, see #9192.) The attached patch is for the Python 3.2 branch. ---------- assignee: docs at python components: Documentation files: stdtypes_float_info.patch keywords: patch messages: 112670 nosy: docs at python, ygale priority: normal severity: normal status: open title: stdtypes.rst should refer to sys.float_info type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18353/stdtypes_float_info.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 00:12:14 2010 From: report at bugs.python.org (Campbell Barton) Date: Tue, 03 Aug 2010 22:12:14 +0000 Subject: [New-bugs-announce] [issue9499] Python C/API Execution namespace undocumented. (patch included) In-Reply-To: <1280873534.19.0.920563075759.issue9499@psf.upfronthosting.co.za> Message-ID: <1280873534.19.0.920563075759.issue9499@psf.upfronthosting.co.za> New submission from Campbell Barton : Some parts of the python api expect __main__ module dictionary to be the namespace when executing a script, this is true when running a python script from the python binary but NOT true when running a compiled script from the C/API which can lead to bugs which are not easy to solve unless the C/API author knows this. ---------- assignee: docs at python components: Documentation files: doc_py3_main_mod.diff keywords: patch messages: 112706 nosy: docs at python, ideasman42 priority: normal severity: normal status: open title: Python C/API Execution namespace undocumented. (patch included) type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file18357/doc_py3_main_mod.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 00:20:46 2010 From: report at bugs.python.org (guest) Date: Tue, 03 Aug 2010 22:20:46 +0000 Subject: [New-bugs-announce] [issue9500] urllib2: Content-Encoding In-Reply-To: <1280874046.96.0.44632804656.issue9500@psf.upfronthosting.co.za> Message-ID: <1280874046.96.0.44632804656.issue9500@psf.upfronthosting.co.za> New submission from guest : urllib2 doesn't support any real-world Content-Encoding scheme. "gzip" and "deflate" are standard compression schemes for HTTP and expected to be implemented by all clients. None of the default urllib2 handlers implements it. Common workarounds are available on the Google. Many people resort to fixing up HTTP responses within their application logic (=not good) due to lack of library support. And some wrote proper urllib2 handlers. Here's one for gzip support with deflate/zlib (HTTP spec is unclear on zlib vs. raw deflate format, hence some buggy servers) hacked on: # http://techknack.net/python-urllib2-handlers/ from gzip import GzipFile from StringIO import StringIO class ContentEncodingProcessor(urllib2.BaseHandler): """A handler to add gzip capabilities to urllib2 requests """ # add headers to requests def http_request(self, req): req.add_header("Accept-Encoding", "gzip, deflate") return req # decode def http_response(self, req, resp): old_resp = resp # gzip if resp.headers.get("content-encoding") == "gzip": gz = GzipFile( fileobj=StringIO(resp.read()), mode="r" ) resp = urllib2.addinfourl(gz, old_resp.headers, old_resp.url, old_resp.code) resp.msg = old_resp.msg # deflate if resp.headers.get("content-encoding") == "deflate": gz = StringIO( deflate(resp.read()) ) resp = urllib2.addinfourl(gz, old_resp.headers, old_resp.url, old_resp.code) # 'class to add info() and resp.msg = old_resp.msg return resp # deflate support import zlib def deflate(data): # zlib only provides the zlib compress format, not the deflate format; try: # so on top of all there's this workaround: return zlib.decompress(data, -zlib.MAX_WBITS) except zlib.error: return zlib.decompress(data) ---------- components: Library (Lib) messages: 112707 nosy: guest priority: normal severity: normal status: open title: urllib2: Content-Encoding versions: Python 2.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 00:39:41 2010 From: report at bugs.python.org (Martin) Date: Tue, 03 Aug 2010 22:39:41 +0000 Subject: [New-bugs-announce] [issue9501] Logging shutdown regressions with weakrefs In-Reply-To: <1280875181.95.0.557870097374.issue9501@psf.upfronthosting.co.za> Message-ID: <1280875181.95.0.557870097374.issue9501@psf.upfronthosting.co.za> New submission from Martin : With the logging change to using weakrefs for handler cleanup done by the follow-on patch in issue 6615 exceptions may now be thrown during module teardown. There are two distinct problem cases: 1) The new `_removeHandlerRef` function may run during teardown (when module globals are being set to None) but uses the module globals `_acquireLock`, `_releaseLock`, and `_handlerList`. 2) The `Handler.close` method no longer removes the instance from the module global list, this means if the caller then closes the underlying file but keeps a reference to the handler, the `shutdown` function will attempt to flush the already-closed file. It may be that this new way of doing things is preferred and the response to closing underlying files or holding on to handler references is Don't Do That Then, but this seems like an accidental regression. ---------- components: Library (Lib) messages: 112713 nosy: flox, gz, vinay.sajip priority: normal severity: normal status: open title: Logging shutdown regressions with weakrefs type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 03:18:44 2010 From: report at bugs.python.org (Ricky Huang) Date: Wed, 04 Aug 2010 01:18:44 +0000 Subject: [New-bugs-announce] [issue9502] Bus error on OS X while unittest'ing QT app In-Reply-To: <1280884724.85.0.0838521688383.issue9502@psf.upfronthosting.co.za> Message-ID: <1280884724.85.0.0838521688383.issue9502@psf.upfronthosting.co.za> New submission from Ricky Huang : Not sure if this is the right place, please redirect me if this is the wrong place to log this bug. In my unittest I am testing a PyQt GUI app. It brings up the app window, runs a few tests, then quit. On quit I get a "Python quit unexpectedly while using the QtGui plugin" crash, below is a partial report from OS X: --- Process: Python [69112] Path: /System/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python Identifier: org.python.python.app Version: 2.6 (2.6) Build Info: python-440100~6 Code Type: X86 (Native) Parent Process: bash [63500] PlugIn Path: /Library/Frameworks/QtGui.framework/Versions/4/QtGui PlugIn Identifier: QtGui PlugIn Version: 4.6.3 (compatibility 4.6.0) [...] Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000024 Crashed Thread: 0 Dispatch queue: com.apple.main-thread Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 QtGui 0x028aecc0 QWidgetPrivate::qt_widget_event(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 32 1 com.apple.HIToolbox 0x955acf2f DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1567 2 com.apple.HIToolbox 0x955ac1f6 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 411 3 com.apple.HIToolbox 0x955ac055 SendEventToEventTargetWithOptions + 58 4 com.apple.HIToolbox 0x955c72b7 HIView::SendOwningWindowChanged(unsigned long, OpaqueWindowPtr*, OpaqueWindowPtr*) + 315 5 com.apple.HIToolbox 0x955c7142 HIView::NotifySubtreeWindowChanged(OpaqueWindowPtr*, OpaqueWindowPtr*, unsigned char) + 90 6 com.apple.HIToolbox 0x9567f1c0 HIViewRemoveFromSuperview + 58 7 QtGui 0x028a6731 qt_mac_destructView(OpaqueControlRef*) + 17 8 QtGui 0x028a8f02 QWidget::destroy(bool, bool) + 546 9 QtGui 0x0295e7c1 QWidget::~QWidget() + 449 [...] --- Thanks in advance. ---------- assignee: ronaldoussoren components: Macintosh, Tests messages: 112734 nosy: Ricky.Huang, ronaldoussoren priority: normal severity: normal status: open title: Bus error on OS X while unittest'ing QT app versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 09:34:16 2010 From: report at bugs.python.org (rgpitts) Date: Wed, 04 Aug 2010 07:34:16 +0000 Subject: [New-bugs-announce] [issue9503] print statement hangs Windows service In-Reply-To: <1280907256.09.0.953862220014.issue9503@psf.upfronthosting.co.za> Message-ID: <1280907256.09.0.953862220014.issue9503@psf.upfronthosting.co.za> New submission from rgpitts : OS: Windows 2003 Server R2 x64 Standard Edition Python: 2.6.5 MSVC: 9.0 Application Description: Windows service calling Python C API to run algorithm written in Python. I've been encountering a random application hang when calling the Python C API function PyObject_CallMethod to call a function on a class instance. I've discovered that the C function fwrite in string_print in stringobject.c is blocking after being called multiple times due to print statements in Python code. My application as a Windows service does not have a stdout and fwrite is buffering data before attempting to write it to a non-existent stdout, thus blocking and hanging the service. This isn't an issue when the application has a console window because stdout is available. We are in the process changing the print statements to write to file. Ideally a Python exception needs raising if print cannot write to stdout. ---------- components: Interpreter Core messages: 112768 nosy: rgpitts priority: normal severity: normal status: open title: print statement hangs Windows service type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 10:33:56 2010 From: report at bugs.python.org (Alan Wilter) Date: Wed, 04 Aug 2010 08:33:56 +0000 Subject: [New-bugs-announce] [issue9504] signal.signal/signal.alarm not working as expected In-Reply-To: <1280910836.88.0.645209486589.issue9504@psf.upfronthosting.co.za> Message-ID: <1280910836.88.0.645209486589.issue9504@psf.upfronthosting.co.za> New submission from Alan Wilter : I have this example code to illustrate a problem I am having with python3. It works fine with python 2.6 and 2.7 but does not with python 3.1. from __future__ import print_function import os, subprocess, signal def signal_handler( signum, frame ): print( "PID: %s" % pid ) print( "Timed out! Process %s killed, max exec time (%ss) exceeded" % (pid, timeTol ) ) os.kill( int( pid ), 15 ) raise Exception( "Taking too long to finish... aborting!" ) if __name__ == '__main__': timeTol = 5 cmd = 'find /' signal.signal(signal.SIGALRM, signal_handler) signal.alarm(timeTol) p = subprocess.Popen(cmd, shell=True, stderr = subprocess.STDOUT, stdout = subprocess.PIPE) pid = p.pid out = str( p.communicate()[0].decode() ) print(out) Executing it: time python3.1 timout.py PID: 27687 Timed out! Process 27687 killed, max exec time (5s) exceeded Traceback (most recent call last): File "timout.py", line 23, in out = str( p.communicate()[0].decode() ) File "/sw/lib/python3.1/subprocess.py", line 719, in communicate stdout = self.stdout.read() File "timout.py", line 9, in signal_handler raise Exception( "Taking too long to finish... aborting!" ) Exception: Taking too long to finish... aborting! python3.1 timout.py 0.52s user 3.88s system 19% cpu 22.841 total #### It prints essentially the same thing with a *very* *big* difference it takes 22 seconds and actually the alarm only works when the whole task ('find /') is finished. ---------- messages: 112771 nosy: alanwilter priority: normal severity: normal status: open title: signal.signal/signal.alarm not working as expected type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 12:25:16 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 04 Aug 2010 10:25:16 +0000 Subject: [New-bugs-announce] [issue9505] User code should not be able to rebind gc.garbage In-Reply-To: <1280917516.21.0.771660979533.issue9505@psf.upfronthosting.co.za> Message-ID: <1280917516.21.0.771660979533.issue9505@psf.upfronthosting.co.za> New submission from Antoine Pitrou : User code is currently allowed to rebind the gc.garbage attribute, while the "real" garbage list in the GC module actually remains the same. This is counter-intuitive and allows to write apparently correct code such as: gc.garbage = [] while it should really be: gc.garbage[:] = [] ---------- components: Library (Lib) messages: 112785 nosy: pitrou, tim_one priority: normal severity: normal stage: needs patch status: open title: User code should not be able to rebind gc.garbage type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:29:03 2010 From: report at bugs.python.org (Kurt Schwehr) Date: Wed, 04 Aug 2010 11:29:03 +0000 Subject: [New-bugs-announce] [issue9506] sqlite3 mogrify - return query string In-Reply-To: <1280921343.13.0.231831121556.issue9506@psf.upfronthosting.co.za> Message-ID: <1280921343.13.0.231831121556.issue9506@psf.upfronthosting.co.za> New submission from Kurt Schwehr : Psycopg2 has a mogrify method on the cursor that returns the string that would be sent to the database for an execute. Any chance that could be added to pysqlite? It's definitely helpful for debugging and is a fantastic tool when teaching people databases. ---------- components: Extension Modules messages: 112790 nosy: goatbar priority: normal severity: normal status: open title: sqlite3 mogrify - return query string type: feature request versions: Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:48:15 2010 From: report at bugs.python.org (Paul Giannaros) Date: Wed, 04 Aug 2010 11:48:15 +0000 Subject: [New-bugs-announce] [issue9507] namedtuple should not hardcode the class name in __repr__ In-Reply-To: <1280922495.27.0.868058296674.issue9507@psf.upfronthosting.co.za> Message-ID: <1280922495.27.0.868058296674.issue9507@psf.upfronthosting.co.za> New submission from Paul Giannaros : collections.namedtuple hardcodes the class name which is reported in the new type's __repr__. This is irritating when subclassing a namedtuple: A = collections.namedtuple('A', '') class B(A): pass print B() # shows 'A()' It might not be often that they're subclassed, but it can be a useful way to add extra methods, properties, and documentation. Other classes often use the current instance's class name in the repr (e.g. collections.OrderedDict). The attached patch changes namedtuple to do this, includes a testcase, and updates the documentation. ---------- components: Library (Lib) files: collections-namedtuple-repr.diff keywords: patch messages: 112792 nosy: PAG priority: normal severity: normal status: open title: namedtuple should not hardcode the class name in __repr__ type: behavior versions: Python 2.6, Python 2.7, Python 3.3 Added file: http://bugs.python.org/file18377/collections-namedtuple-repr.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:07:02 2010 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 04 Aug 2010 13:07:02 +0000 Subject: [New-bugs-announce] [issue9508] python3.2 reversal of distutils reintrocud macos9 support In-Reply-To: <1280927222.45.0.841645452377.issue9508@psf.upfronthosting.co.za> Message-ID: <1280927222.45.0.841645452377.issue9508@psf.upfronthosting.co.za> New submission from Ronald Oussoren : Distutils in the py3k trunk was reverted to the version in the 31-maint branch a couple of weeks back. This reintroduced some macos9 support code that was removed in the trunk but not the maint branches. All code reverting to sys.platform == 'mac' should be removed again. ---------- assignee: tarek components: Distutils, Macintosh messages: 112797 nosy: ronaldoussoren, tarek priority: normal severity: normal status: open title: python3.2 reversal of distutils reintrocud macos9 support type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:08:07 2010 From: report at bugs.python.org (Doug Hellmann) Date: Wed, 04 Aug 2010 13:08:07 +0000 Subject: [New-bugs-announce] [issue9509] argparse FileType raises ugly exception for missing file In-Reply-To: <1280927287.23.0.0771144110186.issue9509@psf.upfronthosting.co.za> Message-ID: <1280927287.23.0.0771144110186.issue9509@psf.upfronthosting.co.za> New submission from Doug Hellmann : Most of the argparse type converters handle exceptions with a single line error message explaining the problem. For example, if an argument -i is declared as an int, but the value given ('a') cannot be converted to an int, the message is something like "argument -i: invalid int value: 'a'". On the other hand, FileType raises an IOError, which isn't being caught and converted to the simpler error message. Instead, a full traceback is printed. To be consistent, the IOError should be trapped and a single error message printed. ---------- components: Library (Lib) files: argparse_filetype_error.py messages: 112798 nosy: doughellmann priority: normal severity: normal status: open title: argparse FileType raises ugly exception for missing file versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file18380/argparse_filetype_error.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:18:12 2010 From: report at bugs.python.org (Nick Craig-Wood) Date: Wed, 04 Aug 2010 13:18:12 +0000 Subject: [New-bugs-announce] [issue9510] sqlite3.Warning isnt a subclass of exceptions.Warning In-Reply-To: <1280927892.96.0.292259619194.issue9510@psf.upfronthosting.co.za> Message-ID: <1280927892.96.0.292259619194.issue9510@psf.upfronthosting.co.za> New submission from Nick Craig-Wood : sqlite3.Warning isnt a subclass of exceptions.Warning This causes this problem when trying to filter warnings >>> import sqlite3 as DB >>> from warnings import filterwarnings >>> filterwarnings("always", category=DB.Warning) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.6/warnings.py", line 56, in filterwarnings assert issubclass(category, Warning), "category must be a Warning subclass" AssertionError: category must be a Warning subclass >>> Other databases do this correctly, eg >>> import MySQLdb as DB >>> from warnings import filterwarnings >>> filterwarnings("always", category=DB.Warning) >>> ---------- components: Library (Lib) files: sqlite3-warning-fix.patch keywords: patch messages: 112800 nosy: ncw priority: normal severity: normal status: open title: sqlite3.Warning isnt a subclass of exceptions.Warning type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file18383/sqlite3-warning-fix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:58:52 2010 From: report at bugs.python.org (=?utf-8?q?Peter_Bostr=C3=B6m?=) Date: Wed, 04 Aug 2010 13:58:52 +0000 Subject: [New-bugs-announce] [issue9511] CharacterEncoderError when reading from sys.stdin from piped input in cmd.exe In-Reply-To: <1280930332.3.0.143681677902.issue9511@psf.upfronthosting.co.za> Message-ID: <1280930332.3.0.143681677902.issue9511@psf.upfronthosting.co.za> New submission from Peter Bostr?m : When reading from piped stdin, python has trouble decoding some special characters. To reproduce, run the following command from cmd.exe: echo ? | C:\Python31\python.exe pycat.py UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 0: character maps to I've been able to reproduce this in a German version of Windows Vista, which I use at work. I detected this error when trying to pipe (and parse) output from the ping command, which contains non-simple characters. If I don't pipe and just type into the program, it works just fine, even with "strange" characters. ---------- components: Windows files: pycat.py messages: 112810 nosy: pbos priority: normal severity: normal status: open title: CharacterEncoderError when reading from sys.stdin from piped input in cmd.exe versions: Python 3.1 Added file: http://bugs.python.org/file18385/pycat.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 17:38:59 2010 From: report at bugs.python.org (=?utf-8?b?RnJpw7ByaWsgTcOhciBKw7Nuc3Nvbg==?=) Date: Wed, 04 Aug 2010 15:38:59 +0000 Subject: [New-bugs-announce] [issue9512] logging.handlers.RotatingFileHandler - mode argument not respected In-Reply-To: <1280936339.01.0.442982035042.issue9512@psf.upfronthosting.co.za> Message-ID: <1280936339.01.0.442982035042.issue9512@psf.upfronthosting.co.za> New submission from Fri?rik M?r J?nsson : It seems to me that the ``mode`` keyword argument of ``logging.handlers.RotatingFileHandler`` is not respected. Here is an example of opening a nonexistent file:: Python 2.7 (r27:82500, Aug 4 2010, 15:10:49) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import logging.handlers >>> handler = logging.handlers.RotatingFileHandler('nonexistent.log', ... mode='a+', maxBytes=1000, backupCount=2) >>> handler.mode 'a' >>> handler.stream The docs do not mention any deviations from the behavior I expected (``handler.stream`` having the mode specified as an argument to ``RotatingFileHandler``); only that "If mode is not specified, 'a' is used." I've confirmed the same behavior on 2.5.2 and 2.6.2. This happens regardless of whether the file is being created or already exists. ---------- components: Library (Lib) messages: 112821 nosy: fridrik priority: normal severity: normal status: open title: logging.handlers.RotatingFileHandler - mode argument not respected type: behavior versions: Python 2.5, Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 17:41:16 2010 From: report at bugs.python.org (Brian Curtin) Date: Wed, 04 Aug 2010 15:41:16 +0000 Subject: [New-bugs-announce] [issue9513] test_multiprocessing skipped on Windows In-Reply-To: <1280936476.46.0.733484980862.issue9513@psf.upfronthosting.co.za> Message-ID: <1280936476.46.0.733484980862.issue9513@psf.upfronthosting.co.za> New submission from Brian Curtin : I just realized test_multiprocessing is being skipped on Windows because a few relative imports of _multiprocessing are failing in win32 specific code blocks. Attached is a trivial patch to remove the relative import, enabling the tests to run and succeed on both dev and installed environments. Jesse: There don't appear to be any side effects here, but I get the feeling I might be overlooking some reason this might have been done. ---------- assignee: brian.curtin components: Library (Lib), Windows files: test_mp.diff keywords: patch messages: 112822 nosy: brian.curtin, jnoller priority: high severity: normal stage: patch review status: open title: test_multiprocessing skipped on Windows type: behavior versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18387/test_mp.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 19:47:49 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 04 Aug 2010 17:47:49 +0000 Subject: [New-bugs-announce] [issue9514] platform.linux_distribution() under Ubuntu returns ('debian', 'squeeze/sid', '') In-Reply-To: <1280944069.64.0.760525549047.issue9514@psf.upfronthosting.co.za> Message-ID: <1280944069.64.0.760525549047.issue9514@psf.upfronthosting.co.za> New submission from Antoine Pitrou : At least on one of the buildbots: Re-running test 'test_ssl' in verbose mode test_ssl: testing with 'OpenSSL 0.9.8o 01 Jun 2010' (0, 9, 8, 15, 15) under Linux ('debian', 'squeeze/sid', '') at the bottom of http://www.python.org/dev/buildbot/builders/i386%20Ubuntu%203.x/builds/1788/steps/test/logs/stdio Someone on IRC pointed out that on their machine, the system Python returned ('Ubuntu', '10.04', 'lucid'). ---------- components: Library (Lib) messages: 112839 nosy: barry, doko, hodgestar, lemburg, pitrou priority: normal severity: normal status: open title: platform.linux_distribution() under Ubuntu returns ('debian', 'squeeze/sid', '') type: behavior versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 20:39:47 2010 From: report at bugs.python.org (Dan L) Date: Wed, 04 Aug 2010 18:39:47 +0000 Subject: [New-bugs-announce] [issue9515] vars() dictionary access to generate variables In-Reply-To: <1280947187.21.0.503447106682.issue9515@psf.upfronthosting.co.za> Message-ID: <1280947187.21.0.503447106682.issue9515@psf.upfronthosting.co.za> New submission from Dan L : Perhaps it's assumed that you should know about this by knowing about how the vars dictionary is implemented, but to someone unfamiliar like me it seems like the builtin functions documentation for vars() should mention that you can create a variable name from a string using vars()['string_containing_variable_name'] = value, i.e. >>> vars()['hi']=3 >>> hi 3 >>> Just to include text for a possible fix (to be appended to the existing description): "You can create a variable name from a string using vars()['string_containing_variable_name'] = value, i.e. >>> vars()['hi']=3 >>> hi 3 >>>" ---------- assignee: docs at python components: Documentation messages: 112857 nosy: docs at python, jdan priority: normal severity: normal status: open title: vars() dictionary access to generate variables versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 22:59:51 2010 From: report at bugs.python.org (Sridhar Ratnakumar) Date: Wed, 04 Aug 2010 20:59:51 +0000 Subject: [New-bugs-announce] [issue9516] sysconfig: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.3" but "10.5" during configure In-Reply-To: <1280955591.23.0.0206270993017.issue9516@psf.upfronthosting.co.za> Message-ID: <1280955591.23.0.0206270993017.issue9516@psf.upfronthosting.co.za> New submission from Sridhar Ratnakumar : I cannot find correct repro steps for this, but: /Library/Frameworks/Python.framework/Versions/2.7/bin/python" -B -s -c "import sys;print('%d.%d' % tuple(sys.version_info)[:2]) Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 558, in main() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 540, in main known_paths = addusersitepackages(known_paths) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 264, in addusersitepackages user_site = getusersitepackages() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 239, in getusersitepackages user_base = getuserbase() # this will also set USER_BASE File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 229, in getuserbase USER_BASE = get_config_var('userbase') File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 518, in get_config_var return get_config_vars().get(name) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 421, in get_config_vars _init_posix(_CONFIG_VARS) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 300, in _init_posix raise IOError(msg) IOError: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.3" but "10.5" during configure Python was built on a Snow Leopard machine with MACOSX_DEPLOYMENT_TARGET=10.5 environment variable. But on the user's 10.6 machine, no such environment variable is necessarily set. Why is this check required? Shouldn't it be restricted to building modules using distutils, and not happen during an innocuous "import site" that happens in interpreter startup? ---------- assignee: tarek components: Distutils messages: 112892 nosy: srid, tarek priority: normal severity: normal status: open title: sysconfig: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.3" but "10.5" during configure versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 00:50:47 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 04 Aug 2010 22:50:47 +0000 Subject: [New-bugs-announce] [issue9517] Make test.script_helper more comprehensive, and use it in the test suite In-Reply-To: <1280962247.74.0.724550733964.issue9517@psf.upfronthosting.co.za> Message-ID: <1280962247.74.0.724550733964.issue9517@psf.upfronthosting.co.za> New submission from Antoine Pitrou : test.script_helper has a couple of dedicated functions to launch a Python interpreter instance in a subprocess. Unfortunately, it is little used and most test modules use their own ad hoc calls to subprocess instead. Remedying the situation would require: - adding functions to script_helper (currently, the available functions merge stdout and stderr together, which is clearly undesireable) - perhaps improve the existing functions (kill_python() does a strange dance instead of calling communicate() on the subprocess.Popen object, is there a reason for that?) - convert most uses of subprocess.([sys.executable, ...]) in the test suite to use script_helper instead This was suggested by Nick in issue477863. ---------- components: Tests messages: 112917 nosy: ezio.melotti, ncoghlan, pitrou priority: normal severity: normal status: open title: Make test.script_helper more comprehensive, and use it in the test suite type: feature request versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 01:43:32 2010 From: report at bugs.python.org (Dave Malcolm) Date: Wed, 04 Aug 2010 23:43:32 +0000 Subject: [New-bugs-announce] [issue9518] PyModuleDef_HEAD_INIT does not explicitly initial all fields of m_base In-Reply-To: <1280965412.21.0.0751804906986.issue9518@psf.upfronthosting.co.za> Message-ID: <1280965412.21.0.0751804906986.issue9518@psf.upfronthosting.co.za> New submission from Dave Malcolm : Attempting to compile Python 3 extension modules on GCC with "-Wmissing-field-initializers" enabled leads to warnings from the PyModuleDef_HEAD_INIT macro Seen attempting to build SELinux python bindings against python 3.1 with "-W -Werror", the "-W" implies "-Wmissing-field-initializers": > cc -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn > > -Wmissing-format-attribute -I../include -I/usr/include -D_GNU_SOURCE > > -D_FILE_OFFSET_BITS=64 -I/usr/include/python3.1 -fPIC -DSHARED -c -o > > audit2why.lo audit2why.c > > cc1: warnings being treated as errors > > audit2why.c:439: error: missing initializer > > audit2why.c:439: error: (near initialization for ?moduledef.m_base.m_init?) > > make: *** [audit2why.lo] Error 1 The PyModuleDef_HEAD_INIT is intended to initialize m_base within a PyModuleDef, but only explicitly initializes the PyObject_HEAD fields: #define PyModuleDef_HEAD_INIT {PyObject_HEAD_INIT(NULL)} typedef struct PyModuleDef_Base { PyObject_HEAD PyObject* (*m_init)(void); Py_ssize_t m_index; PyObject* m_copy; } PyModuleDef_Base; typedef struct PyModuleDef{ PyModuleDef_Base m_base; const char* m_name; const char* m_doc; Py_ssize_t m_size; PyMethodDef *m_methods; inquiry m_reload; traverseproc m_traverse; inquiry m_clear; freefunc m_free; } PyModuleDef; The attached patch extends it to also explicitly zero the other m_base fields. ---------- components: Extension Modules files: py3k-initialize-all-of-m_base.patch keywords: patch, patch messages: 112926 nosy: dmalcolm priority: normal severity: normal stage: patch review status: open title: PyModuleDef_HEAD_INIT does not explicitly initial all fields of m_base type: compile error versions: Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file18396/py3k-initialize-all-of-m_base.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 02:07:53 2010 From: report at bugs.python.org (Robert Buckley) Date: Thu, 05 Aug 2010 00:07:53 +0000 Subject: [New-bugs-announce] [issue9519] IDLE cannot do example 4.1 in tutorial (if statements) In-Reply-To: <1280966873.86.0.616393330289.issue9519@psf.upfronthosting.co.za> Message-ID: <1280966873.86.0.616393330289.issue9519@psf.upfronthosting.co.za> New submission from Robert Buckley : In both Python 2.7 and 3.1 the IDLE is unable to handle example 4.1 in the tutorial (if statements). Works OK with the command line shell, but not the IDLE shell. ---------- messages: 112930 nosy: drbuckle priority: normal severity: normal status: open title: IDLE cannot do example 4.1 in tutorial (if statements) type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 02:59:23 2010 From: report at bugs.python.org (Dmitry Chichkov) Date: Thu, 05 Aug 2010 00:59:23 +0000 Subject: [New-bugs-announce] [issue9520] Add Patricia Trie high performance container (python's defaultdict(int) is unusable on datasets with 10, 000, 000+ keys.) In-Reply-To: <1280969963.37.0.950740145402.issue9520@psf.upfronthosting.co.za> Message-ID: <1280969963.37.0.950740145402.issue9520@psf.upfronthosting.co.za> New submission from Dmitry Chichkov : On large data sets (10-100 million keys) the default python dictionary implementation fails to meet memory and performance constraints. It also apparently fails to keep O(1) complexity (after just 1M keys). As such, there is a need for good, optimized, practical implementation of a high-performance container that can store such datasets. One of the alternatives is a regular Patricia Trie data structure. It can meet performance requirements on such datasets. Criteria: * strictly O(1); * works well on large datasets (~100M keys); memory efficient; * same or better performance as dict(); * supports regular dict | counter interface; * supports unicode keys; * supports any characters in the keys; * persistent (can be pickled); * in-memory library; There are a few existing implementations available: * BioPython trie - http://biopython.org/ * py-radix - http://www.mindrot.org/projects/py-radix/ * PyPi trie - http://pypi.python.org/pypi/trie A few other relevant alternatives/implementations: * NIST trie - http://www.itl.nist.gov/div897/sqg/dads/HTML/patriciatree.html * C++ Trie Library - http://wikipedia-clustering.speedblue.org/trie.php * PyAvl trie - http://pypi.python.org/pypi/pyavl/1.12_1 * PyJudy tree - http://www.dalkescientific.com/Python/PyJudy.html * Redis - http://code.google.com/p/redis/ * Memcached - http://memcached.org/ An alternative to a basic Patricia Trie could be some state-of-the-art approach from some modern research (i.e. http://www.aclweb.org/anthology/W/W09/W09-1505.pdf ), The best existing implementation I've been able to find so far is one in the BioPython. Compared to defaultdict(int) on the task of counting words. Dataset 123,981,712 words (6,504,484 unique), 1..21 characters long: * bio.tree - 459 Mb/0.13 Hours, good O(1) behavior * defaultdict(int) - 693 Mb/0.32 Hours, poor, almost O(N) behavior At 8,000,0000 keys python defaultdict(int) starts showing almost O(N) behavior and gets unusable with 10,000,000+ unique keys. A few usage/installatio notes on BioPython trie: $ sudo apt-get install python-biopython >>> from Bio import trie >>> trieobj = trie.trie() >>> trieobj["hello"] = 5 >>> trieobj["hello"] += 1 >>> print trieobj["hello"] >>> print trieobj.keys() More examples at: http://python-biopython.sourcearchive.com/documentation/1.54/test__triefind_8py-source.html ---------- components: Library (Lib) messages: 112937 nosy: dmtr priority: normal severity: normal status: open title: Add Patricia Trie high performance container (python's defaultdict(int) is unusable on datasets with 10,000,000+ keys.) type: performance versions: Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 11:25:43 2010 From: report at bugs.python.org (Mark Summerfield) Date: Thu, 05 Aug 2010 09:25:43 +0000 Subject: [New-bugs-announce] [issue9521] xml.etree.ElementTree strips XML declaration and procesing instructions In-Reply-To: <1281000343.34.0.102578281876.issue9521@psf.upfronthosting.co.za> Message-ID: <1281000343.34.0.102578281876.issue9521@psf.upfronthosting.co.za> New submission from Mark Summerfield : If you read in an XML file using xml.etree.ElementTree.parse() and then write it out again using xml.etree.ElementTree.write() what is written may not be the same as what was read. In particular any XML declaration and processing instructions are stripped. It seems to me that the parser should at least preserve any declaration and processing instructions so that reading and writing match up. Here's an example: Python 3.1.2 (r312:79147, Jul 15 2010, 10:56:05) [GCC 4.4.4] on linux2 Type "copyright", "credits" or "license()" for more information. >>> file = "control-center.xml" >>> open(file).read()[:500] '\n\n]>\n
\n \n \n \n The GNOME Control Centre provides a central place for the user to setup their GNOME experience. It can let you configure anything from the behaviour of your window borders to the default font type.\n ' >>> import xml.etree.ElementTree as etree >>> xml = etree.parse(file) >>> temp = "temp.xml" >>> xml.write("temp.xml", encoding="utf-8") >>> open(temp).read()[:500] '
\n \n \n \n The GNOME Control Centre provides a central place for the user to setup their GNOME experience. It can let you configure anything from the behaviour of your window borders to the default font type.\n \n Control Centre\n \n \n\tKevinBreit\n \n \n \n >> ---------- components: Library (Lib) messages: 112961 nosy: mark priority: normal severity: normal status: open title: xml.etree.ElementTree strips XML declaration and procesing instructions type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 11:32:10 2010 From: report at bugs.python.org (Mark Summerfield) Date: Thu, 05 Aug 2010 09:32:10 +0000 Subject: [New-bugs-announce] [issue9522] xml.etree.ElementTree forgets the encoding In-Reply-To: <1281000730.31.0.804989593298.issue9522@psf.upfronthosting.co.za> Message-ID: <1281000730.31.0.804989593298.issue9522@psf.upfronthosting.co.za> New submission from Mark Summerfield : If you read in an XML file that specifies its encoding and then later on use xml.etree.ElementTree.write(), it is always written using US-ASCII. I think the behaviour should be different: (1) If the XML that was read included an encoding, that encoding should be remembered and used when writing. (2) If there is no encoding the default for writing should be UTF-8 (which is the standard for XML files). (3) For non-XML files use US-ASCII. Naturally, any of these could be overridden using an encoding argument to the write() method. ---------- components: Library (Lib) messages: 112962 nosy: mark priority: normal severity: normal status: open title: xml.etree.ElementTree forgets the encoding type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 17:23:57 2010 From: report at bugs.python.org (Ray.Allen) Date: Thu, 05 Aug 2010 15:23:57 +0000 Subject: [New-bugs-announce] [issue9523] Improve dbm module In-Reply-To: <1281021837.96.0.764638089257.issue9523@psf.upfronthosting.co.za> Message-ID: <1281021837.96.0.764638089257.issue9523@psf.upfronthosting.co.za> New submission from Ray.Allen : During the patching work of issue8634, I found several problems about the module dbm.gnu and dbm.ndbm, I feel it's better to address them on a separate issue. 1. As issue8634 said, the dbm.gnu, dbm.ndbm and dbm.dumb should have the similar interface, since they are intended to use the general dbm module as a common interface. If some methods only appears in one or two of them, like the "get()" method, it will be not convenient for users. Making all the three ones follow the collections.MutableMapping interface could be a better choice. Since the dbm.dumb is already collections.MutableMapping, I implemented missing methods of collections.MutableMapping in dbm.gnu and dbm.ndbm, and register the dbm object type in dbm.gnu and dbm.ndbm to the ABC. The missing methods mainly include get(), values(), items(), pop(), popitem(), clear() 2. I fix the dbm_contains() function which implement the "in" operator to accept all buffer object, just like the dbm_subscript() fuction which implment the "[]" slice operator. I feel it's wearied that if "dbm['a']" yields the expected result but at the same time "'a' in dbm" raises TypeError. 3. The type of dbm object in dbm.gnu is not iterable, and there is no way to iterate on it sufficiently because the only way we can iterate over it is to get all the keys first using keys() and then iter on the keys list. So I implemented a iterator type for dbm.gnu. Besides the dbm object in dbm.ndbm is also not iterable, and I implemented its tp_iter by get an iterator from its keys list instead of implementing a "real" iterator since the ndbm c api for get all the keys one by one is thread specific and I could not found a way to implement a real iterator to avoid the problem which occurred in the case we get tow iterators from one db object in the same thread and iterate over both at the same time. The patch contains also unittest and doc. ---------- files: issue8634.diff keywords: patch messages: 112989 nosy: ysj.ray priority: normal severity: normal status: open title: Improve dbm module Added file: http://bugs.python.org/file18402/issue8634.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 20:21:47 2010 From: report at bugs.python.org (Valentine Gogichashvili) Date: Thu, 05 Aug 2010 18:21:47 +0000 Subject: [New-bugs-announce] [issue9524] CTRL_C_EVENT and CTRL_BREAK_EVENT cannot be registered by signal.signal() method on windows In-Reply-To: <1281032507.28.0.881221183962.issue9524@psf.upfronthosting.co.za> Message-ID: <1281032507.28.0.881221183962.issue9524@psf.upfronthosting.co.za> New submission from Valentine Gogichashvili : When executing the following code on Windows 7 64-bit :: import sys import signal import time print 'Version:' print sys.executable or sys.platform, sys.version print print def h(s, f): print s signal.signal(signal.CTRL_BREAK_EVENT, h) we get the following output:: Version: C:\Python27\python.exe 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] Traceback (most recent call last): File "signal_ctrl_break_event.py", line 14, in signal.signal(signal.CTRL_BREAK_EVENT, h) RuntimeError: (0, 'Error') When trying to register a handler for a signal.CTRL_C_EVENT the exception is as follows:: File "signal_ctrl_c_event.py", line 6, in signal.signal(signal.CTRL_C_EVENT, h) ValueError: signal number out of range ---------- components: Library (Lib), Windows messages: 113005 nosy: valgog priority: normal severity: normal status: open title: CTRL_C_EVENT and CTRL_BREAK_EVENT cannot be registered by signal.signal() method on windows type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 21:55:12 2010 From: report at bugs.python.org (=?utf-8?q?Filip_Gruszczy=C5=84ski?=) Date: Thu, 05 Aug 2010 19:55:12 +0000 Subject: [New-bugs-announce] [issue9525] webbrowser: open new tab in unobtrusive way In-Reply-To: <1281038112.98.0.544015088878.issue9525@psf.upfronthosting.co.za> Message-ID: <1281038112.98.0.544015088878.issue9525@psf.upfronthosting.co.za> New submission from Filip Gruszczy?ski : webbrowser module doesn't allow to open url in an unobtrusive way. Right now if browser is minimized it is brought to the top. Furthermore if you browser is already in the top, new tab is opened and user is moved to this top. It would be useful, if tab could be opened in background (just like when you open a link in chrome in new tab, new tab is created, but you stay in current window). ---------- components: Library (Lib) messages: 113034 nosy: gruszczy priority: normal severity: normal status: open title: webbrowser: open new tab in unobtrusive way type: feature request versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 04:20:54 2010 From: report at bugs.python.org (Martin Frith) Date: Fri, 06 Aug 2010 02:20:54 +0000 Subject: [New-bugs-announce] [issue9526] 2 GB limit in array module In-Reply-To: <1281061254.05.0.356539300127.issue9526@psf.upfronthosting.co.za> Message-ID: <1281061254.05.0.356539300127.issue9526@psf.upfronthosting.co.za> New submission from Martin Frith : The array module does not seem to work for arrays > 2 GB. >>> import sys, array >>> sys.maxsize 9223372036854775807 >>> x = array.array('c', ('a' for i in xrange(300000000))) (seems to work OK) >>> x = array.array('c', ('a' for i in xrange(3000000000))) (runs forever: memory usage increases to 2GB and then stops) I think the cause is: casting to int in arraymodule.c, in array_iter_extend() and array_append(). My uname -a: Linux c016 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux ---------- components: Extension Modules messages: 113061 nosy: mcfrith priority: normal severity: normal status: open title: 2 GB limit in array module type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 05:48:20 2010 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 06 Aug 2010 03:48:20 +0000 Subject: [New-bugs-announce] [issue9527] Add aware local time support to datetime module In-Reply-To: <1281066500.35.0.441616276688.issue9527@psf.upfronthosting.co.za> Message-ID: <1281066500.35.0.441616276688.issue9527@psf.upfronthosting.co.za> New submission from Alexander Belopolsky : See python-dev post for motivation. http://mail.python.org/pipermail/python-dev/2010-August/102842.html I am attaching a patch implementing the proposed method in datetime.py. I will also paste the code below. Note that this is only prototype. Real implementation will use tm_zone and tm_gmtoff components of tm structure on platforms that supply them. @classmethod def localtime(cls, t=None, isdst=-1): """Return local time as an aware datetime object. If called without arguments, return current time. Otherwise *t* is converted to local time zone according to the system time zone database. If *t* is naive (i.e. t.tzinfo is None), it is assumed to be in local time. In this case, a positive or zero value for *isdst* causes localtime to presume initially that summer time (for example, Daylight Saving Time) is or is not (respectively) in effect for the specified time. A negative value for *isdst* causes the localtime() function to attempt to divine whether summer time is in effect for the specified time. """ if t is None: t = _time.time() else: if t.tzinfo is None: tm = t.timetuple()[:-1] + (isdst,) t = _time.mktime(tm) else: delta = t - datetime(1970, 1, 1, tzinfo=timezone.utc) t = delta.total_seconds() tm = _time.localtime(t) if _time.daylight: if tm.tm_isdst: offset = _time.altzone tzname = _time.tzname[1] else: offset = _time.timezone tzname = _time.tzname[0] tz = timezone(timedelta(seconds=-offset), tzname) return cls.fromtimestamp(t, tz) ---------- assignee: belopolsky components: Extension Modules, Library (Lib) files: datetime-localtime-proto.diff keywords: patch messages: 113067 nosy: belopolsky priority: normal severity: normal status: open title: Add aware local time support to datetime module type: feature request versions: Python 3.2 Added file: http://bugs.python.org/file18410/datetime-localtime-proto.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 06:33:23 2010 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 06 Aug 2010 04:33:23 +0000 Subject: [New-bugs-announce] [issue9528] Add pure Python implementation of time module to CPython In-Reply-To: <1281069203.79.0.816772507809.issue9528@psf.upfronthosting.co.za> Message-ID: <1281069203.79.0.816772507809.issue9528@psf.upfronthosting.co.za> New submission from Alexander Belopolsky : The original RFE at issue 7989 was: """ After discussion on numerous issues, python-dev, and here at the PyCon sprints, it seems to be a good idea to move timemodule.c to _timemodule.c and convert as much as possible into pure Python. The same change seems good for datetime.c as well. """ See msg99774. I have changed issue 7989 to cover datetime only because I argued that as a thin wrapper around C library calls, this module is an exception to the general rule that pure python implementations are a good idea. See msg107303. No I realize that in order to break circular dependency between time and datetime modules, it will be helpful to create an _time module that would provide lower than time module access to system facilities and datetime and time modules would be use _time module to implement higher level interfaces either in C or in Python. I believe _time module should become the home of the gettimeofday() method and pure python implementation of time.time() will be def time() s, us = _time.gettimeofday() return s + 1e-6 * us Similarly time.sleep() can be implemented in terms of lower level POSIX nanosleep() method. Lower level localtime() function can provide access to tm_zone and tm_gmtoff members of struct tm (where available) without concerns about backward compatibility. ---------- assignee: belopolsky components: Extension Modules, Library (Lib) messages: 113073 nosy: amaury.forgeotdarc, belopolsky, brett.cannon, brian.curtin, davidfraser, durban, giampaolo.rodola, haypo, lemburg, mark.dickinson, merwok, pitrou, r.david.murray, rhettinger, techtonik, tim_one priority: normal severity: normal status: open title: Add pure Python implementation of time module to CPython type: feature request versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 07:41:04 2010 From: report at bugs.python.org (MizardX) Date: Fri, 06 Aug 2010 05:41:04 +0000 Subject: [New-bugs-announce] [issue9529] Converge re.findall and re.finditer In-Reply-To: <1281073264.71.0.30355123146.issue9529@psf.upfronthosting.co.za> Message-ID: <1281073264.71.0.30355123146.issue9529@psf.upfronthosting.co.za> New submission from MizardX : re.findall and re.finditer has very different signature. One iterates over match objects, the other returns a list of tuples. I can think of two ways to make them more similar: 1) Make match objects iterable over their captures. With this, you could write something like the following: for key,value in re.finditer(r'(\w+):(\w+)', text): data[key] = value 2) Make re.findall return an iterator over tuples. This would decrease the memory footprint. ---------- components: Regular Expressions messages: 113074 nosy: MizardX priority: normal severity: normal status: open title: Converge re.findall and re.finditer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:16:26 2010 From: report at bugs.python.org (John Regehr) Date: Fri, 06 Aug 2010 06:16:26 +0000 Subject: [New-bugs-announce] [issue9530] integer undefined behaviors In-Reply-To: <1281075386.13.0.164742828093.issue9530@psf.upfronthosting.co.za> Message-ID: <1281075386.13.0.164742828093.issue9530@psf.upfronthosting.co.za> New submission from John Regehr : I ran "make test" for today's Python3k snapshot under a tool which detects math operations that the C language considers to have undefined behavior. This was on x86 Linux. The list of undefined behaviors is attached. Hopefully they are self-explanatory, but please let me know if more details are needed. ---------- files: python-errors.txt messages: 113079 nosy: regehr priority: normal severity: normal status: open title: integer undefined behaviors type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file18412/python-errors.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 09:05:25 2010 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 06 Aug 2010 07:05:25 +0000 Subject: [New-bugs-announce] [issue9531] test_complex.py fails In-Reply-To: <1281078325.63.0.509083627436.issue9531@psf.upfronthosting.co.za> Message-ID: <1281078325.63.0.509083627436.issue9531@psf.upfronthosting.co.za> New submission from Eli Bendersky : eliben at eliben-desktop:~/python_src/svn-27-maint/Lib/test$ py27 regrtest.py test_complex.py test_complex test test_complex failed -- Traceback (most recent call last): File "/home/eliben/python_src/27-maint/Lib/test/test_complex.py", line 563, in test_format self.assertEqual(format(z, '-'), str(z)) AssertionError: '(+3j)' != '3j' 1 test failed: test_complex [36603 refs] ---------- messages: 113081 nosy: eli.bendersky priority: normal severity: normal status: open title: test_complex.py fails versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 11:30:12 2010 From: report at bugs.python.org (denny) Date: Fri, 06 Aug 2010 09:30:12 +0000 Subject: [New-bugs-announce] [issue9532] pipe.read hang, when calling commands.getstatusoutput in multi-threading code of python 2.4 In-Reply-To: <1281087012.75.0.995842004424.issue9532@psf.upfronthosting.co.za> Message-ID: <1281087012.75.0.995842004424.issue9532@psf.upfronthosting.co.za> New submission from denny : Hi all My environment is python 2.4.4 on linux. I am encountering hang of pipe.read() in commands.getstatusoutput for multi-threading code. I have spawned several threads which will call commands.getstatusoutput to run cli. However, pipe.read may hang sometimes. >From lsof, we know some pipe handles are not closed in the parent process, after the child process is stopped. ;; -------------------------- Reproduce steps -------------------------- Below are reproduce steps. # Create a python script of /tmp/hang.py, whose content is given below. # Run "service crond stop; python /tmp/hang.py" several times. # The script may probably hang. From lsof of main.py and crond service, we may find one pipe existing in both processes. # If we stop crond to close the pipe, the hang of hang.py will be resolved. ;; -------------------------- Code of hang.py -------------------------- #!/usr/bin/python import commands import datetime import time import os import thread import threading def thread_run1(): cmd = "hostname" print "begin to run command:%s" % (cmd) status, output = commands.getstatusoutput(cmd) print "pid:%d, name:%s, status:%d, output:%s" % \ (os.getpid(), threading.currentThread().getName(), status, output) cmd = "ifconfig eth0" print "begin to run command:%s" % (cmd) status, output = commands.getstatusoutput(cmd) print "pid:%d, name:%s, status:%d, output:%s" % \ (os.getpid(), threading.currentThread().getName(), status, output) cmd = "ifconfig eth1" print "begin to run command:%s" % (cmd) status, output = commands.getstatusoutput(cmd) print "pid:%d, name:%s, status:%d, output:%s" % \ (os.getpid(), threading.currentThread().getName(), status, output) # cmd = "sh /tmp/subprocess.sh" cmd = "echo here1; sleep 2; echo here2; sleep 5" print "begin to run command:%s" % (cmd) status, output = commands.getstatusoutput(cmd) print "pid:%d, name:%s, status:%d, output:%s" % \ (os.getpid(), threading.currentThread().getName(), status, output) def thread_run2(): cmd = "service crond start" print "begin to run command:%s" % (cmd) status, output = commands.getstatusoutput(cmd) print "pid:%d, name:%s, status:%d, output:%s" % \ (os.getpid(), threading.currentThread().getName(), status, output) if __name__=='__main__': print "main function begins." thread_list = [] for i in xrange(1, 10): my_thread = threading.Thread(target = thread_run1) thread_list.append(my_thread) my_thread = threading.Thread(target = thread_run2) thread_list.append(my_thread) for t in thread_list: t.start() time.sleep(10) for t in thread_list: t.join() print "main function ends." ---------- components: Library (Lib) messages: 113086 nosy: denny priority: normal severity: normal status: open title: pipe.read hang, when calling commands.getstatusoutput in multi-threading code of python 2.4 type: behavior versions: 3rd party _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 12:33:39 2010 From: report at bugs.python.org (Roald de Vries) Date: Fri, 06 Aug 2010 10:33:39 +0000 Subject: [New-bugs-announce] [issue9533] metaclass can't derive from ABC In-Reply-To: <1281090819.15.0.255356922996.issue9533@psf.upfronthosting.co.za> Message-ID: <1281090819.15.0.255356922996.issue9533@psf.upfronthosting.co.za> New submission from Roald de Vries : Exception raised:: Traceback (most recent call last): File "bug.py", line 5, in class derived(type, Sized): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/abc.py", line 85, in __new__ for name in getattr(base, "__abstractmethods__", set()): TypeError: Error when calling the metaclass bases 'getset_descriptor' object is not iterable ---------- files: bug.py messages: 113094 nosy: roalddevries priority: normal severity: normal status: open title: metaclass can't derive from ABC type: compile error versions: Python 2.6 Added file: http://bugs.python.org/file18414/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 13:48:06 2010 From: report at bugs.python.org (Valentine Gogichashvili) Date: Fri, 06 Aug 2010 11:48:06 +0000 Subject: [New-bugs-announce] [issue9534] OrderedDict.__del__ destructor throws AttributeError when process ends up with the exception trace In-Reply-To: <1281095286.81.0.328749516858.issue9534@psf.upfronthosting.co.za> Message-ID: <1281095286.81.0.328749516858.issue9534@psf.upfronthosting.co.za> New submission from Valentine Gogichashvili : When the process is dying with the exception trace dump, I am getting the following notification from the destructor of the OrderedDict class:: Exception AttributeError: "'NoneType' object has no attribute 'print_exc'" in ignored In the source of the OrderedDict the only operation that is not included in the try..catch is the dict.clear(self) actually. So I suppose that this problem is in dict.clear() implementation... ---------- components: Library (Lib), Windows messages: 113096 nosy: valgog priority: normal severity: normal status: open title: OrderedDict.__del__ destructor throws AttributeError when process ends up with the exception trace type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:43:15 2010 From: report at bugs.python.org (Greg Brockman) Date: Fri, 06 Aug 2010 14:43:15 +0000 Subject: [New-bugs-announce] [issue9535] Pending signals are inherited by child processes In-Reply-To: <1281105795.17.0.408658965128.issue9535@psf.upfronthosting.co.za> Message-ID: <1281105795.17.0.408658965128.issue9535@psf.upfronthosting.co.za> New submission from Greg Brockman : Upon os.fork(), pending signals are inherited by the child process. This can be demonstrated by pressing C-c in the middle of the following program: """ import os, sys, time, threading def do_fork(): while True: if not os.fork(): print 'hello from child' sys.exit(0) time.sleep(0.5) t = threading.Thread(target=do_fork) t.start() t.join() """ Right after os.fork(), each child will raise a KeyboardInterrupt exception. This behavior is different from the semantics of POSIX fork(), where child processes do not inherit their parents' pending signals. Attached is a first stab at a patch to fix this issue. Please let me know what you think! ---------- components: Extension Modules files: signals.patch keywords: patch messages: 113104 nosy: gdb priority: normal severity: normal status: open title: Pending signals are inherited by child processes type: behavior versions: Python 2.5, Python 2.6, Python 2.7 Added file: http://bugs.python.org/file18416/signals.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:55:28 2010 From: report at bugs.python.org (John Posner) Date: Fri, 06 Aug 2010 14:55:28 +0000 Subject: [New-bugs-announce] [issue9536] defaultdict doc makes incorrect reference to __missing__ method In-Reply-To: <1281106528.37.0.0435364267174.issue9536@psf.upfronthosting.co.za> Message-ID: <1281106528.37.0.0435364267174.issue9536@psf.upfronthosting.co.za> New submission from John Posner : The documentation for collections.defaultdict is confusing with respect to the __missing__ method. The fact is that a programmer using defaultdict does not need to know anything about __missing__. The attached patch contains a rewrite of the entire section (but not the "defaultdict Examples" section, which is fine. ---------- assignee: docs at python components: Documentation files: defaultdict.patch keywords: patch messages: 113105 nosy: docs at python, jjposner priority: normal severity: normal status: open title: defaultdict doc makes incorrect reference to __missing__ method versions: Python 2.7 Added file: http://bugs.python.org/file18417/defaultdict.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 21:31:33 2010 From: report at bugs.python.org (Denver Coneybeare) Date: Fri, 06 Aug 2010 19:31:33 +0000 Subject: [New-bugs-announce] [issue9537] argparse: use OrderedDict to store subparsers In-Reply-To: <1281123093.44.0.485972410524.issue9537@psf.upfronthosting.co.za> Message-ID: <1281123093.44.0.485972410524.issue9537@psf.upfronthosting.co.za> New submission from Denver Coneybeare : Currently, when a subparser is added to an argparse.ArgumentParser the list of subparsers are stored in the built-in dict type. When these subparsers are listed when -h is given on the command line they are showed in the order returned from the dictionary's keys() method, which is undefined order. Instead of showing them in undefined order, it would be preferred to show them at least in the order in which they were added. This can be done trivially be replacing the dict with a collections.OrderedDict. A patch is attached. ---------- components: Library (Lib) files: argparse.patch keywords: patch messages: 113124 nosy: benjamin.peterson, denversc priority: normal severity: normal status: open title: argparse: use OrderedDict to store subparsers type: behavior versions: Python 2.7, Python 3.3 Added file: http://bugs.python.org/file18418/argparse.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 22:04:39 2010 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 07 Aug 2010 20:04:39 +0000 Subject: [New-bugs-announce] [issue9538] Replace confusing pseudoname 'object' in special methods section. In-Reply-To: <1281211479.21.0.733519342396.issue9538@psf.upfronthosting.co.za> Message-ID: <1281211479.21.0.733519342396.issue9538@psf.upfronthosting.co.za> New submission from Terry J. Reedy : In 3.3. Special method names, 'object' is used as a pseudo class name to prefix all the special method entries. This conflicts with the usual two Python meanings. 1. 'object' is the name of a specific class. So the entry for object.__getattribute__(self, name) says to avoid circularity by calling object.__getattribute__(self, name), which looks circular and requires a bit a mental work by the reader to properly understand. Ditto for object.__setattr__(self, name, value) calling object.__setattr__(self, name, value) 2. Non-specifically, 'object' is usually understood to mean any Python object, not just a class. But the signatures as written require that 'object' specifically be a class and 'object' does not convey that. So for both reasons, I propose that the pseudoname 'object' be replaces with 'class' or 'someclass' ---------- assignee: docs at python components: Documentation messages: 113194 nosy: docs at python, georg.brandl, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Replace confusing pseudoname 'object' in special methods section. versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 01:13:15 2010 From: report at bugs.python.org (Valeo de Vries) Date: Sat, 07 Aug 2010 23:13:15 +0000 Subject: [New-bugs-announce] [issue9539] python-2.6.4: test failure in test_distutils due to linking to system libpython2.6 In-Reply-To: <1281222795.64.0.211558756173.issue9539@psf.upfronthosting.co.za> Message-ID: <1281222795.64.0.211558756173.issue9539@psf.upfronthosting.co.za> New submission from Valeo de Vries : I'm under the impression that this is issue is known about, however I couldn't find an existing bug, so I'm creating a new one for the following test failure: test_distutils /usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lpython2.6 collect2: ld returned 1 exit status test test_distutils failed -- Traceback (most recent call last): File "/var/tmp/paludis/build/dev-lang-python-2.6.4-r1/work/Python-2.6.4/Lib/distutils/tests/test_build_ext.py", line 258, in test_get_outputs cmd.run() File "/var/tmp/paludis/build/dev-lang-python-2.6.4-r1/work/Python-2.6.4/Lib/distutils/command/build_ext.py", line 340, in run self.build_extensions() File "/var/tmp/paludis/build/dev-lang-python-2.6.4-r1/work/Python-2.6.4/Lib/distutils/command/build_ext.py", line 449, in build_extensions self.build_extension(ext) File "/var/tmp/paludis/build/dev-lang-python-2.6.4-r1/work/Python-2.6.4/Lib/distutils/command/build_ext.py", line 531, in build_extension target_lang=language) File "/var/tmp/paludis/build/dev-lang-python-2.6.4-r1/work/Python-2.6.4/Lib/distutils/ccompiler.py", line 848, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File "/var/tmp/paludis/build/dev-lang-python-2.6.4-r1/work/Python-2.6.4/Lib/distutils/unixccompiler.py", line 265, in link raise LinkError, msg LinkError: command 'i686-pc-linux-gnu-gcc' failed with exit status 1 Perhaps I'm missing something here, but surely trying to link against the system (i.e. already installed, pre-existing) libpython2.6 defeats the purpose of having a testsuite, if you're not actually going to be testing what you're actually installing? Any enlightenment here would be appreciated. ---------- components: Tests messages: 113217 nosy: valeo priority: normal severity: normal status: open title: python-2.6.4: test failure in test_distutils due to linking to system libpython2.6 versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 03:26:45 2010 From: report at bugs.python.org (=?utf-8?q?Michael=2EElsd=C3=B6rfer?=) Date: Sun, 08 Aug 2010 01:26:45 +0000 Subject: [New-bugs-announce] [issue9540] argparse: combine subparsers with global positional args In-Reply-To: <1281230805.22.0.0952279078785.issue9540@psf.upfronthosting.co.za> Message-ID: <1281230805.22.0.0952279078785.issue9540@psf.upfronthosting.co.za> New submission from Michael.Elsd?rfer : >>> parser = argparse.ArgumentParser() >>> subparsers = parser.add_subparsers(title="commands") >>> subparser = subparsers.add_parser('make') >>> parser.add_argument('jobs', nargs='*') >>> parser.print_help() usage: [-h] {make} ... [jobs [jobs ...]] While the printed usage looks innocuous enough, argparser isn't actually able to parse this the way I expect: The positional argument never get's to handle any jobs given, as apparently everything after the command is handled by the subparser: >>> parser.parse_args(['make', 'something']) usage: make [-h] make: error: unrecognized arguments: something It seems that argparse, upon determining that the subparser can't handle a positional argument, could break out of the subparser, and let the parent parser continue. If necessary, as further help for argparse on how to resolve such situations, a parameter could be added to add_subparsers() which would allow the user to indicate that this group of subparsers should not support positional arguments. The usage string should then print as: >>> parser.print_help() usage: [-h] {make} [jobs [jobs ...]] That is, without the "..." after the command. Finally, if it is decided that the feature will not be added, argparse should not allow the user to add positional arguments after a subparser. ---------- components: Library (Lib) messages: 113229 nosy: elsdoerfer priority: normal severity: normal status: open title: argparse: combine subparsers with global positional args type: feature request versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 06:08:19 2010 From: report at bugs.python.org (Joe Amenta) Date: Sun, 08 Aug 2010 04:08:19 +0000 Subject: [New-bugs-announce] [issue9541] node.pre_order() does not do preorder traversal In-Reply-To: <1281240499.35.0.988494777631.issue9541@psf.upfronthosting.co.za> Message-ID: <1281240499.35.0.988494777631.issue9541@psf.upfronthosting.co.za> New submission from Joe Amenta : In Lib/lib2to3/pytree.py, Node.pre_order() calls the post_order() method of its children, instead of pre_order(). As a result, the only difference between the two orderings is that pre_order() yields the original node first, whereas post_order() yields the original node last. It seems highly unlikely to me that any code would depend on this behavior. The fix, of course, is trivial: change the call to child.post_order() on line 289 into a call to child.pre_order(). ---------- components: 2to3 (2.x to 3.0 conversion tool) messages: 113233 nosy: joe.amenta priority: normal severity: normal status: open title: node.pre_order() does not do preorder traversal type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 01:56:49 2010 From: report at bugs.python.org (STINNER Victor) Date: Sun, 08 Aug 2010 23:56:49 +0000 Subject: [New-bugs-announce] [issue9542] Create PyUnicode_FSDecoder() function In-Reply-To: <1281311809.81.0.46043022196.issue9542@psf.upfronthosting.co.za> Message-ID: <1281311809.81.0.46043022196.issue9542@psf.upfronthosting.co.za> New submission from STINNER Victor : For my work on #9425 (Rewrite import machinery to work with unicode paths), I need a PyArg_Parse converter converting bytes and str to str. PyUnicode_FSConverter() is the opposite because it encodes str to bytes. To handle (input) filenames in a function, we have 3 choices: 1/ use bytes: that's the current choice for most Python functions. It gives full unicode support for POSIX OSes (FS using a bytes API), but it is not enough for Windows (Windows uses mbcs encoding which is a very small subset of Unicode) 2/ use str with the PEP 383 (surrogateescape): it begins to be used in Python 3.1, and more seriously in Python 3.2. It offers full unicode support on all OSes (POSIX and Windows) 3/ use the native type for each OS (bytes on POSIX, str on Windows): I dislike this solution because it implies code duplication PyUnicode_FSConverter() is the converter for solution (1). PyUnicode_FSDecoder() will be the converter for the solution (2). ---------- components: Interpreter Core, Unicode files: PyUnicode_FSDecoder.patch keywords: patch messages: 113352 nosy: haypo, lemburg, loewis priority: normal severity: normal status: open title: Create PyUnicode_FSDecoder() function versions: Python 3.2 Added file: http://bugs.python.org/file18447/PyUnicode_FSDecoder.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 03:35:24 2010 From: report at bugs.python.org (David I. Lehn) Date: Mon, 09 Aug 2010 01:35:24 +0000 Subject: [New-bugs-announce] [issue9543] 2.6.6 rc1 socket.py flush() calls del on unbound 'view' variable In-Reply-To: <1281317724.88.0.544391829079.issue9543@psf.upfronthosting.co.za> Message-ID: <1281317724.88.0.544391829079.issue9543@psf.upfronthosting.co.za> New submission from David I. Lehn : An error was introduced in 2.6.6 rc1 in the socket flush() call where del is called on the unbound 'view' variable. Associated commit and diff: http://svn.python.org/view?view=rev&revision=83624 http://svn.python.org/view/python/tags/r266rc1/Lib/socket.py?r1=81488&r2=83624 Tail end of the runtime stack trace: File "/usr/lib/python2.6/socket.py", line 318, in write self.flush() File "/usr/lib/python2.6/socket.py", line 302, in flush del view, data # explicit free UnboundLocalError: local variable 'view' referenced before assignment ---------- components: Library (Lib) messages: 113357 nosy: dil priority: normal severity: normal status: open title: 2.6.6 rc1 socket.py flush() calls del on unbound 'view' variable type: crash versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 07:51:26 2010 From: report at bugs.python.org (Paul Arnold) Date: Mon, 09 Aug 2010 05:51:26 +0000 Subject: [New-bugs-announce] [issue9544] xdrlib.Packer().pack_fstring throws a TypeError when called with a str() In-Reply-To: <1281333086.43.0.820305754452.issue9544@psf.upfronthosting.co.za> Message-ID: <1281333086.43.0.820305754452.issue9544@psf.upfronthosting.co.za> New submission from Paul Arnold : In Python 3.1, xdrlib.Packer().pack_fstring() throws a TypeError if called with a str() (an encoded string bytes() works just fine). >>> xdrlib.Packer().pack_fstring(6, "foobar") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.1/xdrlib.py", line 81, in pack_fstring data = data + (n - len(data)) * b'\0' TypeError: Can't convert 'bytes' object to str implicitly ---------- components: None messages: 113386 nosy: arnoldp priority: normal severity: normal status: open title: xdrlib.Packer().pack_fstring throws a TypeError when called with a str() type: crash versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 09:01:25 2010 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 09 Aug 2010 07:01:25 +0000 Subject: [New-bugs-announce] [issue9545] Adding _collections to static build In-Reply-To: <1281337285.37.0.116366194764.issue9545@psf.upfronthosting.co.za> Message-ID: <1281337285.37.0.116366194764.issue9545@psf.upfronthosting.co.za> New submission from Senthil Kumaran : As a fix for issue9396 in r83874, functools was included in re module and this caused a build failure. This was reverted in r83875, with the following message by Raymond: The problem is that the re module is imported by sysconfig and re needs functools which uses collections.OrderedDict() but the _collectionsmodule.c code is not yet constructed at this point in the build. The likely best solution will be to include _collections as part of the static build before the rest of the boot-strapping. We discussed it in IRC, I am including the _collections module to the static build. After this the r83874 can be reapplied. ---------- files: _collections.patch keywords: patch messages: 113392 nosy: orsenthil priority: normal severity: normal status: open title: Adding _collections to static build type: crash Added file: http://bugs.python.org/file18450/_collections.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 14:51:30 2010 From: report at bugs.python.org (Florent Xicluna) Date: Mon, 09 Aug 2010 12:51:30 +0000 Subject: [New-bugs-announce] [issue9546] buildbot: if a compile error occurs, the "clean" step is skipped In-Reply-To: <1281358290.29.0.0758314656394.issue9546@psf.upfronthosting.co.za> Message-ID: <1281358290.29.0.0758314656394.issue9546@psf.upfronthosting.co.za> New submission from Florent Xicluna : When the buildbot fails to compile, the "clean" step is not run. http://www.python.org/dev/buildbot/builders/i386%20Ubuntu%203.x/builds/1838/ This is a problem for issue #9545 where the Modules/Setup.dist cannot be copied to Modules/Setup on next run (file already exist). Normally, "clean" step takes care to remove "Modules/Setup": http://www.python.org/dev/buildbot/builders/i386%20Ubuntu%203.x/builds/1820/steps/clean/logs/stdio ---------- components: Tests keywords: buildbot messages: 113409 nosy: flox, orsenthil, pitrou, rhettinger priority: normal severity: normal status: open title: buildbot: if a compile error occurs, the "clean" step is skipped type: resource usage versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 18:16:01 2010 From: report at bugs.python.org (=?utf-8?q?Alexandru_Mo=C8=99oi?=) Date: Mon, 09 Aug 2010 16:16:01 +0000 Subject: [New-bugs-announce] [issue9547] iterator length In-Reply-To: <1281370561.47.0.585215134028.issue9547@psf.upfronthosting.co.za> Message-ID: <1281370561.47.0.585215134028.issue9547@psf.upfronthosting.co.za> New submission from Alexandru Mo?oi : Sometimes it's useful to get the number of elements yield by an iterator. For example (if ilen is the name of the function): def pi(n): return ilen(for e in xrange(n) if isprime(e)) def count_pred(pred, iterator): return ilen(itertools.ifilter(pred, iterator)) Two notable solutions are discussed here http://stackoverflow.com/questions/3393431/how-to-counting-not-0-elements-in-an-iterable 1) sum(1 for e in iterator) 2) len(list(iterator)) First solution is slow, the second solution uses O(N) extra memory. I propose the addition of a new function ilen() which is functionally equivalent to: def ilen(iterator): return sum(1 for e in iterator) This function should be different from len() because it's time complexity is O(N) (most people assume that len() takes O(1)) and it consumes the iterator. ---------- messages: 113421 nosy: Alexandru.Mo?oi priority: normal severity: normal status: open title: iterator length type: feature request versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 21:09:31 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 09 Aug 2010 19:09:31 +0000 Subject: [New-bugs-announce] [issue9548] locale can be imported at startup but relies on too many library modules In-Reply-To: <1281380971.62.0.695264636628.issue9548@psf.upfronthosting.co.za> Message-ID: <1281380971.62.0.695264636628.issue9548@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Consider the two following commands, from an SVN working copy: $ ./python -c 'import heapq; print(heapq.heapify)' $ cat | ./python -c 'import heapq; print(heapq.heapify)' In the second case, the "from _heapq import *" in heapq fails silently. The reason was a bit difficult to find, but it goes as following: - when run from a non-pty, initializing the standard streams imports Lib/locale.py - Lib/locale.py import collections which import heapq - heapq tries to import _heapq but, at this point, the build dir (such as "build/lib.linux-x86_64-3.2/") hasn't been added to sys.path, since site.py does it: the import fails - heapq silences the ImportError, and this early loaded copy of the module is then made available to all subsequent consumers of heapq, without C accelerators The issue might seem rather exotic, but it is a more general symptom of the problem that importing Lib/locale.py when initializing std{in,out,err} brings too many import dependencies. A possible solution is to define a subset of locale.py that is used for bootstrap and rely on as little modules as possible. ---------- components: Library (Lib) messages: 113457 nosy: haypo, pitrou priority: normal severity: normal status: open title: locale can be imported at startup but relies on too many library modules type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 21:50:53 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 09 Aug 2010 19:50:53 +0000 Subject: [New-bugs-announce] [issue9549] Remove sys.setdefaultencoding() In-Reply-To: <1281383453.04.0.233452795116.issue9549@psf.upfronthosting.co.za> Message-ID: <1281383453.04.0.233452795116.issue9549@psf.upfronthosting.co.za> New submission from Antoine Pitrou : The use of sys.setdefaultencoding() has always been discouraged, and it has become a no-op in py3k (the encoding is hard-wired to utf-8 and changing it raises an error). It is time to remove this function entirely. The state of PyUnicode_SetDefaultEncoding() should be also considered, since it has become useless for the same reasons. ---------- components: Interpreter Core, Library (Lib) messages: 113461 nosy: pitrou priority: low severity: normal stage: needs patch status: open title: Remove sys.setdefaultencoding() type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 00:09:00 2010 From: report at bugs.python.org (Jason V. Miller) Date: Mon, 09 Aug 2010 22:09:00 +0000 Subject: [New-bugs-announce] [issue9550] BufferedReader may issue additional read, may cause hang when backed by blocking socket In-Reply-To: <1281391740.65.0.539097127829.issue9550@psf.upfronthosting.co.za> Message-ID: <1281391740.65.0.539097127829.issue9550@psf.upfronthosting.co.za> New submission from Jason V. Miller : While reading, BufferedReader can cause an additional read() to the underlying I/O object after the entire upper-layer byte count has been satisfied. This is unnecessary and troublesome in some cases. In the event that the BufferedReader sits on top of a blocking socket (see the included test case,) certain network protocols (HTTP) can cause the server to hang in recv/recvfrom trying to read more data than will be available, causing a hang. I first ran into this issue running bottle on top of the core Python wsgi server. It looks as though this may be present in 2.x as well, however an associate of mine wasn't able to trigger the issue in 2.x (even after implementing the makefile() code from 3.x) To run the test case, start the server and then run the client against it. bufio.py server bufio.py client I successfully patched this issue locally with the following: --- Modules/_io/bufferedio.c: self->pos = 0; self->raw_pos = 0; self->read_end = 0; + if ( remaining == 0 ) + return res; + while (self->read_end < self->buffer_size) { --- Which aborts execution of the second loop in the event that the last block-sized read satisfied the upper layer call exactly. ---------- components: IO files: bufio.py messages: 113489 nosy: jvmiller priority: normal severity: normal status: open title: BufferedReader may issue additional read, may cause hang when backed by blocking socket type: behavior versions: Python 3.1 Added file: http://bugs.python.org/file18459/bufio.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 00:13:40 2010 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2010 22:13:40 +0000 Subject: [New-bugs-announce] [issue9551] ConfigParser.SafeConfigParser.set fails when no value provided In-Reply-To: <1281392020.18.0.197979738235.issue9551@psf.upfronthosting.co.za> Message-ID: <1281392020.18.0.197979738235.issue9551@psf.upfronthosting.co.za> New submission from ?ukasz Langa : Title says it all. ---------- assignee: fdrake files: ConfigParser.diff keywords: easy, needs review, patch, patch messages: 113490 nosy: fdrake, lukasz.langa priority: normal severity: normal stage: patch review status: open title: ConfigParser.SafeConfigParser.set fails when no value provided type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file18460/ConfigParser.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 01:04:52 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 09 Aug 2010 23:04:52 +0000 Subject: [New-bugs-announce] [issue9552] ssl build under Windows always rebuilds OpenSSL In-Reply-To: <1281395092.02.0.0478122711499.issue9552@psf.upfronthosting.co.za> Message-ID: <1281395092.02.0.0478122711499.issue9552@psf.upfronthosting.co.za> New submission from Antoine Pitrou : The build steps for _ssl and _hashlib under Windows always rebuild the same intermediate files, even if no change was recorded since the last build. This makes building the whole project longer than it should be. Here is the (trimmed) log: ------ D?but de la g?n?ration?: Projet?: _ssl, Configuration?: Debug Win32 ------ Ex?cution d'un ?v?nement avant g?n?ration... Found a working perl at 'C:\Perl\bin\perl.exe' Found an SSL directory at '..\..\openssl-1.0.0a' Executing ssl makefiles: nmake /nologo -f "ms\nt.mak" Building OpenSSL copy ".\crypto\buildinf.h" "tmp32\buildinf.h" 1 fichier(s) copi?(s). copy ".\crypto\opensslconf.h" "inc32\openssl\opensslconf.h" 1 fichier(s) copi?(s). nasmw -f win32 -o tmp32\x86cpuid.obj tmp32\x86cpuid.asm nasmw -f win32 -o tmp32\md5-586.obj tmp32\md5-586.asm [... snip many asm files ...] nasmw -f win32 -o tmp32\wp-mmx.obj tmp32\wp-mmx.asm lib /nologo /out:out32\libeay32.lib @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nm92.tmp link /nologo /subsystem:console /opt:ref /debug /out:out32\md4test.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nm97.tmp IF EXIST out32\md4test.exe.manifest mt -nologo -manifest out32\md4test.exe.manifest -outputresource:out32\md4test.exe;1 link /nologo /subsystem:console /opt:ref /debug /out:out32\md5test.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nm99.tmp IF EXIST out32\md5test.exe.manifest mt -nologo -manifest out32\md5test.exe.manifest -outputresource:out32\md5test.exe;1 link /nologo /subsystem:console /opt:ref /debug /out:out32\shatest.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nm9B.tmp [... snip many exe files ...] IF EXIST out32\openssl.exe.manifest mt -nologo -manifest out32\openssl.exe.manifest -outputresource:out32\openssl.exe;1 [44763 refs] Compilation en cours... _ssl.c ..\Modules\_ssl.c(583) : warning C4090: '='?: qualificateurs 'const' diff?rents ..\Modules\_ssl.c(930) : warning C4090: '='?: qualificateurs 'const' diff?rents ?dition des liens en cours... Cr?ation de la biblioth?que Z:\py3k\__svn__\PCbuild\\_ssl_d.lib et de l'objet Z:\py3k\__svn__\PCbuild\\_ssl_d.exp Le journal de g?n?ration a ?t? enregistr? ? l'emplacement "file://Z:\py3k\__svn__\PCbuild\Win32-temp-Debug\_ssl\BuildLog.htm" _ssl - 0 erreur(s), 2 avertissement(s) ---------- components: Build, Windows messages: 113497 nosy: brian.curtin, loewis, pitrou, tim.golden priority: low severity: normal status: open title: ssl build under Windows always rebuilds OpenSSL type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 04:03:22 2010 From: report at bugs.python.org (Denver Coneybeare) Date: Tue, 10 Aug 2010 02:03:22 +0000 Subject: [New-bugs-announce] [issue9553] test_argparse.py: 80 failures if COLUMNS env var set to a value other than 80 In-Reply-To: <1281405802.56.0.0746900619959.issue9553@psf.upfronthosting.co.za> Message-ID: <1281405802.56.0.0746900619959.issue9553@psf.upfronthosting.co.za> New submission from Denver Coneybeare : If the COLUMNS environment variable is set to a value other than 80 then test_argparse.py yields 80 failures. The value of the COLUMNS environment variable affects line wrapping of the help output and the test cases assume line wraps at 80 columns. So setting COLUMNS=160, for example, then running the tests will reproduce the failures. The fix is to invoke: os.environ["COLUMNS"] = "80". A proposed patch for py3k/Lib/test/test_argparse.py is attached (test_argparse.py.COLUMNS.patch) ---------- components: Tests files: test_argparse.py.COLUMNS.patch keywords: patch messages: 113504 nosy: benjamin.peterson, bethard, denversc, eric.smith priority: normal severity: normal status: open title: test_argparse.py: 80 failures if COLUMNS env var set to a value other than 80 versions: Python 3.3 Added file: http://bugs.python.org/file18462/test_argparse.py.COLUMNS.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 04:53:47 2010 From: report at bugs.python.org (Denver Coneybeare) Date: Tue, 10 Aug 2010 02:53:47 +0000 Subject: [New-bugs-announce] [issue9554] test_argparse.py: use new unittest features In-Reply-To: <1281408827.47.0.183260667114.issue9554@psf.upfronthosting.co.za> Message-ID: <1281408827.47.0.183260667114.issue9554@psf.upfronthosting.co.za> New submission from Denver Coneybeare : Some of the unit testing code in test_argparse.py could be modified to take advantage of the new unittest features in Python 2.7 and 3.x. My suggested changes are attached in the patch file test_argparse.py.unittest2.patch One big one is that assertEquals() now prints a "diff" when multi-line strings compare unequal, so the manual "diffing" logic from the unit tests can be removed. Also, assertIsNone() is slightly better than assertEquals(None, x). Finally, there is a tiny fix where parse_args() was expected to throw ArgumentParserError but the test would not fail if it threw no exceptions. ---------- components: Tests files: test_argparse.py.unittest2.patch keywords: patch messages: 113505 nosy: benjamin.peterson, bethard, denversc, eric.smith priority: normal severity: normal status: open title: test_argparse.py: use new unittest features type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file18463/test_argparse.py.unittest2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 12:33:43 2010 From: report at bugs.python.org (Florent Xicluna) Date: Tue, 10 Aug 2010 10:33:43 +0000 Subject: [New-bugs-announce] [issue9555] transient crashes on "x86 XP-4" buildbot: test_file, test_file2k, test_bsddb3 In-Reply-To: <1281436423.56.0.916363064932.issue9555@psf.upfronthosting.co.za> Message-ID: <1281436423.56.0.916363064932.issue9555@psf.upfronthosting.co.za> New submission from Florent Xicluna : There's frequent crashes on the "x86 XP-4" buildbot. On 2.6: 83915: # something crashed: test_file 83913: success 83743: # something crashed: test_file 83738: success 83721: success 83718: # something crashed: test_file 83704: success 83691: # something crashed: test_file 83688: # something crashed: test_file 83687: # something crashed: test_file 83674: # something crashed: test_file 83657: # something crashed: test_file 83656: # 1 failed: test_os 83648: # 2 failed: test_os test_struct 83642: # something crashed: test_bsddb3 83637: # 1 failed: test_struct 83634: # 1 failed: test_struct 83632: success 83628: success 83627: # something crashed: test_bsddb3 83626: # something crashed: test_file 83625: # 1 failed: test_builtin 83624: # 1 failed: test_builtin 83623: success 83539: # something crashed: test_bsddb3 83532: success 83520: success 83519: # something crashed: test_file 83518: # something crashed: test_file 83517: # something crashed: test_file 83515: success 83512: # something crashed: test_file 83502: ? something crashed: test_file 83487: success 83443: ? exception clean 83420: # something crashed: test_file 83414: ? exception svn 83382: success 83379: # something crashed: test_file 83377: # something crashed: test_file 83242: success 83200: # something crashed: test_file 83194: success 83147: success 83136: # something crashed: test_file 83128: # something crashed: test_file 83119: success On 2.7: 83928: # something crashed: test_bsddb3 83925: success 83920: success 83917: success 83909: success 83907: success 83893: # 1 failed: test_bsddb3 83879: success 83873: ? exception svn 83858: success 83856: # something crashed: test_bsddb3 83836: # hung for 20 min: test_file2k 83832: # something crashed: test_file2k 83824: ? exception svn 83820: # something crashed: test_file2k 83806: success 83782: # something crashed: test_bsddb3 83773: success 83769: success 83765: ? exception svn 83760: # something crashed: test_file2k 83757: # failed slave lost 83749: # something crashed: test_file2k 83746: success 83737: # something crashed: test_bsddb3 83734: ? exception svn The test is interrupted on the "crash", and the last message is: - program finished with exit code -1073741819 elapsedTime=184.398000 - program finished with exit code -1073741819 elapsedTime=383.852000 - program finished with exit code -1073741819 elapsedTime=1003.798000 - program finished with exit code -1073741819 elapsedTime=453.802000 (reports created with bbreport) ---------- components: Tests keywords: buildbot messages: 113522 nosy: flox priority: normal severity: normal status: open title: transient crashes on "x86 XP-4" buildbot: test_file, test_file2k, test_bsddb3 type: crash versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 13:57:37 2010 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 10 Aug 2010 11:57:37 +0000 Subject: [New-bugs-announce] [issue9556] Specifying the time a TimedRotatingFileHandler rotates In-Reply-To: <1281441457.15.0.524451784963.issue9556@psf.upfronthosting.co.za> Message-ID: <1281441457.15.0.524451784963.issue9556@psf.upfronthosting.co.za> New submission from Ronald Oussoren : The logging module contains a TimedRotatingFileHandler that automaticly rotates the logfile after a specified interval. This class misses an important feature: it is not possible to specify at what time the file should be rotated, unless that time is midnight. My usecase: one of our customers works night shifts which means that rotating logfiles at midnight means that files get rotated halfway through a shift instead of at the end of one. We'd like to be able to specify that logfiles get rotated at a specific time (such as 7:00AM). ---------- components: Library (Lib) messages: 113527 nosy: ronaldoussoren priority: normal severity: normal stage: needs patch status: open title: Specifying the time a TimedRotatingFileHandler rotates type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 15:46:11 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 10 Aug 2010 13:46:11 +0000 Subject: [New-bugs-announce] [issue9557] test_mailbox failure under a Windows VM In-Reply-To: <1281447971.09.0.314164589839.issue9557@psf.upfronthosting.co.za> Message-ID: <1281447971.09.0.314164589839.issue9557@psf.upfronthosting.co.za> New submission from Antoine Pitrou : I get this failure in test_mailbox under Windows XP running in a qemu virtual machine: ====================================================================== FAIL: test_reread (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "Z:\py3k\debug\lib\test\test_mailbox.py", line 764, in test_reread assert not refreshed() AssertionError ---------------------------------------------------------------------- ---------- assignee: akuchling components: Library (Lib), Tests messages: 113538 nosy: akuchling, pitrou priority: low severity: normal status: open title: test_mailbox failure under a Windows VM type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 16:35:35 2010 From: report at bugs.python.org (Hirokazu Yamamoto) Date: Tue, 10 Aug 2010 14:35:35 +0000 Subject: [New-bugs-announce] [issue9558] build_ext fails on VS8.0 In-Reply-To: <1281450935.69.0.209009694295.issue9558@psf.upfronthosting.co.za> Message-ID: <1281450935.69.0.209009694295.issue9558@psf.upfronthosting.co.za> New submission from Hirokazu Yamamoto : test_build_ext fails on VS8.0. ====================================================================== ERROR: test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "e:\python-dev\release26-maint\lib\distutils\tests\test_build_ext.py", li ne 58, in test_build_ext cmd.run() File "e:\python-dev\release26-maint\lib\distutils\command\build_ext.py", line 340, in run self.build_extensions() File "e:\python-dev\release26-maint\lib\distutils\command\build_ext.py", line 449, in build_extensions self.build_extension(ext) File "e:\python-dev\release26-maint\lib\distutils\command\build_ext.py", line 531, in build_extension target_lang=language) File "e:\python-dev\release26-maint\lib\distutils\ccompiler.py", line 769, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File "e:\python-dev\release26-maint\lib\distutils\msvc9compiler.py", line 648, in link raise LinkError(msg) LinkError: command '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\link.exe" ' failed with exit status 1104 ---------- assignee: tarek components: Distutils, Windows files: py3k_distutils_build_ext_on_VS8.patch keywords: easy, patch messages: 113541 nosy: ocean-city, tarek priority: release blocker severity: normal stage: patch review status: open title: build_ext fails on VS8.0 versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18467/py3k_distutils_build_ext_on_VS8.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 18:40:08 2010 From: report at bugs.python.org (Chris Green) Date: Tue, 10 Aug 2010 16:40:08 +0000 Subject: [New-bugs-announce] [issue9559] mailbox.mbox creates new file when adding message to mbox In-Reply-To: <1281458408.75.0.432136903483.issue9559@psf.upfronthosting.co.za> Message-ID: <1281458408.75.0.432136903483.issue9559@psf.upfronthosting.co.za> New submission from Chris Green : When you call mailbox.mbox.add() the old mbox file is copied, the new file is modified and then renamed to the name of the'old' mbox file. This breaks the way that many MUAs detect and manage new mail in an mbox, in particular I discovered this with mutt. If the python process writing the mbox and mutt are on the same system writing a local file then you get the message "Mailbox was externally modified. Flags may be wrong." from mutt (and various odd things can happen). If mutt is reading the mbox over NFS then you get a "Stale NFS file handle" error. This should be strongly noted in the documentation for mailbox.mbox, in addition it would be really nice if there was a mailbox.mbox.append() method which *really* appends the data to the end of the mbox rather than changing it completely. Most MDAs (all?) do just append new mail to the end of the mbox and I feel that python should really try and do the same. ---------- components: Library (Lib) messages: 113547 nosy: chrisisbd priority: normal severity: normal status: open title: mailbox.mbox creates new file when adding message to mbox type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 19:21:34 2010 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Aug 2010 17:21:34 +0000 Subject: [New-bugs-announce] [issue9560] platform.py: use -b option for file command in _syscmd_file() In-Reply-To: <1281460894.18.0.756161940799.issue9560@psf.upfronthosting.co.za> Message-ID: <1281460894.18.0.756161940799.issue9560@psf.upfronthosting.co.za> New submission from STINNER Victor : Lib/platform.py was created 7 years ago by r32391. _syscmd_file() docstring was never changed whereas it is inconsistent with the implementation: --- def _syscmd_file(target,default=''): """ Interface to the system's file command. The function uses the -b option of the file command to have it ommit the filename in its output and if possible the -L option to have the command follow symlinks. It returns default in case the command should fail. """ ... target = _follow_symlinks(target).replace('"', '\\"') ... f = os.popen('file "%s" 2> %s' % (target, DEV_NULL)) ... --- It doesn't use -L option but use Python to follow the link, and use an regex to remove the filename. Attached patch enables -b option to avoid problem with non-ascii filenames but ascii locale encoding (see #8611 and #9425) and updates the docstring. -- To fix the non-ascii problem, I tried a different approach by using subprocess API which gives a bytes version of stdout and so avoid the encoding issue. But I commited the patch on python trunk (2.7) which had a bootstrap issue. py3k had no bootstrap issue, but the new patch (use -b option) is simpler. Commits: r80166 (trunk), r80167 (py3k). Reverted: r80171+r80189 (trunk) and r80190 (py3k). More details in the following mail thread: http://mail.python.org/pipermail/python-checkins/2010-April/092092.html ---------- files: _syscmd_file.patch keywords: patch messages: 113549 nosy: haypo, lemburg, pitrou priority: normal severity: normal status: open title: platform.py: use -b option for file command in _syscmd_file() versions: Python 3.2 Added file: http://bugs.python.org/file18470/_syscmd_file.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 19:51:39 2010 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Aug 2010 17:51:39 +0000 Subject: [New-bugs-announce] [issue9561] distutils: set encoding to utf-8 for input and output files In-Reply-To: <1281462699.26.0.0348702049008.issue9561@psf.upfronthosting.co.za> Message-ID: <1281462699.26.0.0348702049008.issue9561@psf.upfronthosting.co.za> New submission from STINNER Victor : While working on #9425 (support non-ascii characters in python directory name with ascii locale), I wrote a patch for distutils.file_util(): set encoding to utf-8 and errors to surrogateescape. See the patch with comments at: http://codereview.appspot.com/1874048/patch/1/9 (the patch is not enough, it should also patch *all* functions reading files) I discussed with takek who told me that it is documented that distutils files have to be utf-8. I didn't found the documentation. I checked read_manifest() in sdist command: in Python2 and Python3, it uses open(name) syntax. It means that Python2 uses the binary API (bytes), whereas Python3 uses the text API (unicode characters) and Python3 relies on open() (TextIOWrapper) heuristic to *guess* the file encoding. I think that it will be better to specify the encoding in Python3, and maybe use the text API in Python2. Anyway, before going futher (work on patches), I would like the approval of distutils maintainer(s). ---------- assignee: tarek components: Distutils, Distutils2, Unicode messages: 113552 nosy: haypo, merwok, tarek priority: normal severity: normal status: open title: distutils: set encoding to utf-8 for input and output files versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 22:50:03 2010 From: report at bugs.python.org (Mitchell Model) Date: Tue, 10 Aug 2010 20:50:03 +0000 Subject: [New-bugs-announce] [issue9562] Slightly misleading wording in documentation of dict.update In-Reply-To: <1281473403.13.0.50491902338.issue9562@psf.upfronthosting.co.za> Message-ID: <1281473403.13.0.50491902338.issue9562@psf.upfronthosting.co.za> New submission from Mitchell Model : The documentation of dict.update says that it "accepts either another dictionary object or an iterable of key/value pairs (as a tuple or other iterable of length two)" The parenthesized phrase is slightly misleading in that it could be interpreted as requiring the argument to be an iterable of length two, whereas the argument should be an iterable of iterables of length 2 (if not a dictionary). Suggest rewriting in the plural: (as tuples or other iterables of length two) ---------- assignee: docs at python components: Documentation messages: 113557 nosy: MLModel, docs at python priority: normal severity: normal status: open title: Slightly misleading wording in documentation of dict.update versions: Python 2.6, Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 23:25:28 2010 From: report at bugs.python.org (Gwendal LE BIHAN) Date: Tue, 10 Aug 2010 21:25:28 +0000 Subject: [New-bugs-announce] [issue9563] bad exception handling when giving no value to an option requiring one In-Reply-To: <1281475528.51.0.829723304896.issue9563@psf.upfronthosting.co.za> Message-ID: <1281475528.51.0.829723304896.issue9563@psf.upfronthosting.co.za> New submission from Gwendal LE BIHAN : Having created the parser this way: optparser=OptionParser() optparser.add_option("--share-dir",dest="share_dir",default="/usr/share") options,args=optparser.parse_args() And calling the program this way: appname --share-dir I get the following exception, which is not caught: options,args=optparser.parse_args() File "/usr/lib/python2.6/optparse.py", line 1394, in parse_args stop = self._process_args(largs, rargs, values) File "/usr/lib/python2.6/optparse.py", line 1434, in _process_args self._process_long_opt(rargs, values) File "/usr/lib/python2.6/optparse.py", line 1509, in _process_long_opt option.process(opt, value, values, self) UnboundLocalError: local variable 'value' referenced before assignment ---------- components: Library (Lib) messages: 113560 nosy: Gwendal.LE.BIHAN priority: normal severity: normal status: open title: bad exception handling when giving no value to an option requiring one type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 00:06:51 2010 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 10 Aug 2010 22:06:51 +0000 Subject: [New-bugs-announce] [issue9564] Test issue. In-Reply-To: <1281478011.71.0.148947311328.issue9564@psf.upfronthosting.co.za> Message-ID: <1281478011.71.0.148947311328.issue9564@psf.upfronthosting.co.za> New submission from Mark Dickinson : Testing autonosy. Please close as invalid. ---------- assignee: tarek components: Distutils messages: 113562 nosy: mark.dickinson, merwok, tarek priority: normal severity: normal status: open title: Test issue. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 00:56:05 2010 From: report at bugs.python.org (Hasan) Date: Tue, 10 Aug 2010 22:56:05 +0000 Subject: [New-bugs-announce] [issue9565] socket : accept() method not working In-Reply-To: <1281480965.46.0.164319565216.issue9565@psf.upfronthosting.co.za> Message-ID: <1281480965.46.0.164319565216.issue9565@psf.upfronthosting.co.za> New submission from Hasan : hi, i am use the socket module in python. But accept() method not working and its not give me an error about this problem. for example i run the my scipt. When it comes to accept() method line, python is locks. i use the ubuntu os. and python 2.6.5 pls, help me. ---------- components: IDLE files: server.py messages: 113567 nosy: cmuse priority: normal severity: normal status: open title: socket : accept() method not working versions: Python 2.6 Added file: http://bugs.python.org/file18471/server.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 01:59:46 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 10 Aug 2010 23:59:46 +0000 Subject: [New-bugs-announce] [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> New submission from Antoine Pitrou : A 64-bit build under Windows produces many compilation warnings, mostly related to lossy conversions between different int sizes. Some of these warnings appear harmless after analysis (are MS 64 bit compilers pickier than their 32 bit counterparts?). It would probably be spammy to open a separate issue per file. 5>..\Python\pythonrun.c(1210) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3403) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3409) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3439) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3445) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3498) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3504) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3608) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3614) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3633) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3639) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3699) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3705) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3724) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3730) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3771) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3777) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3796) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3802) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3855) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3861) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3892) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(3898) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4016) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4022) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4041) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4047) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4092) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4098) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4117) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4123) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4167) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4173) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4192) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4198) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4253) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4259) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4326) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4332) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4351) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4357) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4376) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4382) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4414) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4420) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4439) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4445) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4510) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4516) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4559) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4565) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4607) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4613) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4643) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4649) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4791) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4797) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(4998) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5004) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5023) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5029) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5059) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5065) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5108) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5114) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5157) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5163) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5219) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5225) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5269) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5275) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5341) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5347) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5366) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5372) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5419) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5425) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5444) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5450) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5753) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5759) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5802) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5808) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5979) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(5985) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(6356) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(6362) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(6456) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(6462) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(6508) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(6514) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(6555) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(6561) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(6602) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(6608) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(6627) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\Python-ast.c(6633) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\dtoa.c(1529) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data 5>..\Python\dtoa.c(1539) : warning C4244: '-=' : conversion from '__int64' to 'int', possible loss of data 5>..\Python\dtoa.c(1545) : warning C4244: '+=' : conversion from '__int64' to 'int', possible loss of data 5>..\Python\pystrtod.c(902) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\pystrtod.c(1023) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\peephole.c(84) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data 5>..\Python\peephole.c(184) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data 5>..\Python\peephole.c(237) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data 5>..\Python\peephole.c(309) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data 5>..\Python\peephole.c(352) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\peephole.c(403) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data 5>..\Python\peephole.c(418) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data 5>..\Python\peephole.c(459) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\peephole.c(544) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\peephole.c(555) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data 5>..\Python\peephole.c(587) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\peephole.c(601) : warning C4244: '-=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\peephole.c(632) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\peephole.c(661) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data 5>..\Python\peephole.c(671) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data 5>..\Python\getargs.c(390) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\getargs.c(502) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\getargs.c(876) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\getargs.c(931) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\getargs.c(939) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\getargs.c(983) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\getargs.c(1133) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\getargs.c(1476) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\getargs.c(1477) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\python\../Objects/stringlib/formatter.h(984) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\python\../Objects/stringlib/formatter.h(1161) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\python\../Objects/stringlib/formatter.h(1165) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\compile.c(339) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data 5>..\Python\compile.c(384) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data 5>..\Python\compile.c(479) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\compile.c(533) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\compile.c(947) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data 5>..\Python\compile.c(962) : warning C4244: 'return' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\compile.c(1254) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\compile.c(1399) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\compile.c(3678) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\compile.c(3704) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\compile.c(3730) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\compile.c(3898) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\compile.c(3902) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\compile.c(3942) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\compile.c(3949) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\ceval.c(3967) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Python\ceval.c(4155) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\PC\winreg.c(769) : warning C4267: '=' : conversion from 'size_t' to 'DWORD', possible loss of data 5>..\PC\winreg.c(801) : warning C4267: '+=' : conversion from 'size_t' to 'DWORD', possible loss of data 5>..\PC\winreg.c(851) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'DWORD', possible loss of data 5>..\PC\winreg.c(1186) : warning C4133: '=' : incompatible types - from 'wchar_t *' to 'BYTE *' 5>..\PC\_subprocess.c(345) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\PC\_subprocess.c(368) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\PC\_subprocess.c(369) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\PC\_subprocess.c(371) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data 5>..\PC\_subprocess.c(373) : warning C4244: 'initializing' : conversion from '__int64' to 'int', possible loss of data 5>..\Parser\tokenizer.c(658) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data 5>..\Parser\tokenizer.c(689) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data 5>..\Parser\parsetok.c(199) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data 5>..\Parser\grammar.c(66) : warning C4244: 'return' : conversion from '__int64' to 'int', possible loss of data 5>..\Parser\grammar.c(108) : warning C4244: 'return' : conversion from '__int64' to 'int', possible loss of data 5>..\Objects\typeobject.c(6173) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\setobject.c(743) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'long', possible loss of data 5>..\Objects\setobject.c(772) : warning C4244: '*=' : conversion from 'Py_ssize_t' to 'long', possible loss of data 5>..\Objects\setobject.c(819) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data 5>..\Objects\obmalloc.c(904) : warning C4244: '=' : conversion from '__int64' to 'unsigned int', possible loss of data 5>..\Objects\funcobject.c(633) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\funcobject.c(634) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\funcobject.c(634) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\frameobject.c(480) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\frameobject.c(513) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\frameobject.c(871) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\frameobject.c(872) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\frameobject.c(918) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\frameobject.c(919) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\fileobject.c(401) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned int', possible loss of data 5>..\Objects\descrobject.c(891) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data 5>..\Objects\codeobject.c(495) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\codeobject.c(517) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\bytesobject.c(786) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\bytesobject.c(795) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\bytesobject.c(1755) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\bytesobject.c(1947) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\bytesobject.c(2620) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'char', possible loss of data 5>..\Objects\bytesobject.c(2641) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'char', possible loss of data 5>..\Objects\bytesobject.c(2696) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'char', possible loss of data 5>..\Objects\bytearrayobject.c(1222) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\bytearrayobject.c(1231) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Objects\bytes_methods.c(454) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'char', possible loss of data 5>..\Modules\_io\fileio.c(483) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned int', possible loss of data 5>..\Modules\_io\fileio.c(566) : warning C4267: 'function' : conversion from 'size_t' to 'unsigned int', possible loss of data 5>..\Modules\_io\fileio.c(622) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned int', possible loss of data 5>..\Modules\_io\fileio.c(662) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned int', possible loss of data 5>..\Modules\zlibmodule.c(127) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\zlibmodule.c(211) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\zlibmodule.c(217) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data 5>..\Modules\zlibmodule.c(271) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data 5>..\Modules\zlibmodule.c(422) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\zlibmodule.c(434) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data 5>..\Modules\zlibmodule.c(451) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data 5>..\Modules\zlibmodule.c(505) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\zlibmodule.c(526) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data 5>..\Modules\zlibmodule.c(556) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data 5>..\Modules\zlibmodule.c(935) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data 5>..\Modules\zlibmodule.c(938) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data 5>..\Modules\zlibmodule.c(963) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data 5>..\Modules\zlibmodule.c(966) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data 5>..\Modules\sha512module.c(558) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\sha512module.c(710) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\sha512module.c(751) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\sha256module.c(492) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\sha256module.c(644) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\sha256module.c(685) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\sha1module.c(399) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned long', possible loss of data 5>..\Modules\sha1module.c(520) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned long', possible loss of data 5>..\Modules\posixmodule.c(394) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data 5>..\Modules\posixmodule.c(3708) : warning C4133: 'function' : incompatible types - from 'int *' to 'Py_ssize_t *' 5>..\Modules\posixmodule.c(4886) : warning C4244: 'function' : conversion from 'Py_intptr_t' to 'long', possible loss of data 5>..\Modules\posixmodule.c(5593) : warning C4267: 'function' : conversion from 'size_t' to 'unsigned int', possible loss of data 5>..\Modules\mmapmodule.c(881) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'char', possible loss of data 5>..\Modules\md5module.c(423) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned long', possible loss of data 5>..\Modules\md5module.c(544) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned long', possible loss of data 5>..\Modules\binascii.c(667) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data 5>..\Modules\audioop.c(332) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(354) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(376) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(398) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(423) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(632) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(687) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(737) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(763) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(810) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(868) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(928) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(984) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(1018) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(1053) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(1284) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(1316) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(1353) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(1385) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(1424) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\audioop.c(1530) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\modules\_sre.c(1898) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\modules\_sre.c(1901) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\modules\_sre.c(1935) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\modules\_sre.c(1938) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\modules\_sre.c(2082) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\modules\_sre.c(2085) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\modules\_sre.c(2212) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\modules\_sre.c(2215) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\modules\_sre.c(2364) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\modules\_sre.c(2367) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\modules\_sre.c(3753) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\modules\_sre.c(3756) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\modules\_sre.c(3786) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>z:\py3k\__svn__\modules\_sre.c(3789) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\_pickle.c(284) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\_pickle.c(301) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\_pickle.c(461) : warning C4244: '+=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\_pickle.c(628) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'long', possible loss of data 5>..\Modules\_pickle.c(647) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data 5>..\Modules\_pickle.c(1320) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\_pickle.c(1558) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\_pickle.c(1806) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\_csv.c(971) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\_csv.c(1100) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\_csv.c(1105) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\_csv.c(1133) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 5>..\Modules\_collectionsmodule.c(1124) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data ---------- components: Extension Modules, Interpreter Core messages: 113573 nosy: pitrou priority: low severity: normal status: open title: Compilation warnings under x64 Windows type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 04:37:15 2010 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 11 Aug 2010 02:37:15 +0000 Subject: [New-bugs-announce] [issue9567] Add attribute pointing to wrapped function to partial objects In-Reply-To: <1281494235.56.0.666889184643.issue9567@psf.upfronthosting.co.za> Message-ID: <1281494235.56.0.666889184643.issue9567@psf.upfronthosting.co.za> New submission from ?ric Araujo : Raymond in #9396: ?I was just about to propose that functools.wraps add a standard attribute to point at the underlying function (on the theory that objects should be introspectable). This would allow a standard way to get to the underlying unwrapped functions.? ---------- components: Library (Lib) messages: 113579 nosy: eric.araujo, r.david.murray, rhettinger priority: normal severity: normal stage: unit test needed status: open title: Add attribute pointing to wrapped function to partial objects type: feature request versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 10:11:36 2010 From: report at bugs.python.org (Ned Deily) Date: Wed, 11 Aug 2010 08:11:36 +0000 Subject: [New-bugs-announce] [issue9568] test_urllib2_localnet fails on OS X 10.3 In-Reply-To: <1281514296.56.0.121028925935.issue9568@psf.upfronthosting.co.za> Message-ID: <1281514296.56.0.121028925935.issue9568@psf.upfronthosting.co.za> New submission from Ned Deily : Issue8455 documents a problem which resulted in test_urllib2_libnet failing on OS X with "Connection refused" errors. r82150, r82280, r82281, and r82282 eliminated the test failures for all active branches when running on OS X 10.4 through 10.6. However, the fixes overlooked a different code path which is only used on OS X 10.3. The attached one-line patches for 2.6/2.7 and for py3k/3.1 correct that problem for 10.3 as well. Since the patch is low-risk and corrects a failing test case, I recommend that it be applied for the 2.6.6 release. ---------- assignee: ronaldoussoren components: Macintosh files: issue-proxy-10-3-27-26.txt messages: 113592 nosy: barry, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: test_urllib2_localnet fails on OS X 10.3 versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18475/issue-proxy-10-3-27-26.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 20:11:40 2010 From: report at bugs.python.org (David Watson) Date: Wed, 11 Aug 2010 18:11:40 +0000 Subject: [New-bugs-announce] [issue9569] Add tests for posix.mknod() and posix.mkfifo() In-Reply-To: <1281550300.21.0.724215266655.issue9569@psf.upfronthosting.co.za> Message-ID: <1281550300.21.0.724215266655.issue9569@psf.upfronthosting.co.za> New submission from David Watson : Attaching simple tests for these functions, which aren't currently tested. ---------- components: Extension Modules files: test-mknod-mkfifo-3.x.diff keywords: patch messages: 113609 nosy: baikie priority: normal severity: normal status: open title: Add tests for posix.mknod() and posix.mkfifo() type: feature request Added file: http://bugs.python.org/file18478/test-mknod-mkfifo-3.x.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 20:16:28 2010 From: report at bugs.python.org (David Watson) Date: Wed, 11 Aug 2010 18:16:28 +0000 Subject: [New-bugs-announce] [issue9570] PEP 383: os.mknod() and os.mkfifo() do not accept surrogateescape arguments In-Reply-To: <1281550588.4.0.722092515628.issue9570@psf.upfronthosting.co.za> Message-ID: <1281550588.4.0.722092515628.issue9570@psf.upfronthosting.co.za> New submission from David Watson : These functions still use the "s" format for their arguments; the attached patch fixes them to use PyUnicode_FSConverter() in 3.2. Some simple tests for these functions (not for PEP 383 behaviour) are at issue #9569. ---------- components: Extension Modules files: mknod-mkfifo-pep383-3.2.diff keywords: patch messages: 113611 nosy: baikie priority: normal severity: normal status: open title: PEP 383: os.mknod() and os.mkfifo() do not accept surrogateescape arguments type: behavior versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18480/mknod-mkfifo-pep383-3.2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 21:21:27 2010 From: report at bugs.python.org (=?utf-8?q?Michael=2EElsd=C3=B6rfer?=) Date: Wed, 11 Aug 2010 19:21:27 +0000 Subject: [New-bugs-announce] [issue9571] argparse: Allow the use of -- to break out of nargs and into subparser In-Reply-To: <1281554487.14.0.725527410465.issue9571@psf.upfronthosting.co.za> Message-ID: <1281554487.14.0.725527410465.issue9571@psf.upfronthosting.co.za> New submission from Michael.Elsd?rfer : argparse already seems to support -- to indicate that what follows are positional arguments. However, I would like to parse something like: ./script.py --ignore one two -- COMMAND I.e., --ignore is an nargs='+' argument, and I need a way to break out of --ignore and have argparse consider what follows on it's own merits. If COMMAND in the above example refers to a subparser, this won't work: error: invalid choice: '--' (choose from 'command1', 'command2', 'command3') I'm not sure what's the best solution here. Allowing -- here would change the semantics of forcing everything that follows to be positional arguments, since the subparser might have flags. I'm not sure if that is what is required by Unix conventions, but if not, then I think it makes sense to allow -- to be followed by a subparser. ---------- components: Library (Lib) messages: 113616 nosy: elsdoerfer priority: normal severity: normal status: open title: argparse: Allow the use of -- to break out of nargs and into subparser type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 22:09:15 2010 From: report at bugs.python.org (Florent Xicluna) Date: Wed, 11 Aug 2010 20:09:15 +0000 Subject: [New-bugs-announce] [issue9572] IOError in test_multiprocessing In-Reply-To: <1281557355.31.0.33043228103.issue9572@psf.upfronthosting.co.za> Message-ID: <1281557355.31.0.33043228103.issue9572@psf.upfronthosting.co.za> New submission from Florent Xicluna : This error occurred on "x86 Ubuntu 3.x" buildbot. This is the 1st test on this run. http://www.python.org/dev/buildbot/all/builders/x86%20Ubuntu%203.x/builds/1699/steps/test/logs/stdio ./python -Wd -E -bb ./Lib/test/regrtest.py -uall -rwW -l == CPython 3.2a1+ (py3k:83951, Aug 11 2010, 15:26:40) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu4)] == Linux-2.6.31.5-linode21-i686-with-debian-lenny-sid little-endian == /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/build/test_python_8258 Using random seed 426296 [ 1/346] test_multiprocessing Process Process-22: Traceback (most recent call last): File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/process.py", line 233, in _bootstrap self.run() File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/process.py", line 88, in run self._target(*self._args, **self._kwargs) File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_multiprocessing.py", line 1253, in _putter manager.connect() File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/managers.py", line 478, in connect dispatch(conn, None, 'dummy') File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/managers.py", line 79, in dispatch kind, result = c.recv() File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/connection.py", line 408, in recv s = self._conn.recv_bytes() EOFError test test_multiprocessing failed -- Traceback (most recent call last): File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/importlib/_bootstrap.py", line 486, in set_data with _closing(_io.FileIO(path, 'wb')) as file: IOError: [Errno 2] No such file or directory: '/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/xmlrpc/__pycache__/__init__.cpython-32.pyc' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_multiprocessing.py", line 1266, in test_rapid_restart queue = manager.get_queue() File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/managers.py", line 644, in temp token, exp = self._create(typeid, *args, **kwds) File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/managers.py", line 542, in _create conn = self._Client(self._address, authkey=self._authkey) File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/connection.py", line 427, in XmlClient import xmlrpc.client as xmlrpclib File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/importlib/_bootstrap.py", line 450, in load_module return self._load_module(fullname) File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/importlib/_bootstrap.py", line 155, in decorated return fxn(self, module, *args, **kwargs) File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/importlib/_bootstrap.py", line 344, in _load_module code_object = self.get_code(name) File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/importlib/_bootstrap.py", line 437, in get_code self.set_data(bytecode_path, data) File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/importlib/_bootstrap.py", line 498, in set_data _os.mkdir(directory) OSError: [Errno 17] File exists: '/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/xmlrpc/__pycache__' Re-running test test_multiprocessing in verbose mode ... ---------------------------------------------------------------------- Ran 127 tests in 34.091s OK (skipped=9) ---------- components: Library (Lib), Tests keywords: buildbot messages: 113626 nosy: flox priority: normal severity: normal status: open title: IOError in test_multiprocessing type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 01:42:04 2010 From: report at bugs.python.org (Alex Roitman) Date: Wed, 11 Aug 2010 23:42:04 +0000 Subject: [New-bugs-announce] [issue9573] imporing a module that executes fork() raises RuntimeError In-Reply-To: <1281570124.9.0.596338600617.issue9573@psf.upfronthosting.co.za> Message-ID: <1281570124.9.0.596338600617.issue9573@psf.upfronthosting.co.za> New submission from Alex Roitman : Importing the module with the following contents results in RuntimeError: ================== import os pid = os.fork() if pid == 0: print "In the child" else: print "In the parent" print "Done\n" ================== Running the same module as main works just fine, so it seems to be a purely import issue. I looked into the 2.6.6rc1 source. This is what I think happens in Python/import.c file: 1. After the fork() call, _PyImport_ReInitLock() is run. It sets import_lock_thread to -1 in the child, line 310. 2. In _PyImport_ReleaseLock() line 290 compares import_loc_thread to the current thread id, and if they are not the same then -1 is returned, which results in RuntimeError in PyImport_ImportModuleLevel (line 2186-2189) So this is guaranteed to happen in the child, every time fork() is executed inside the module being imported. If I change line 290 to be: if (import_lock_thread != me && import_lock_thread != -1) then import proceeds fine, although I'm not sure this is a proper solution. This happens on Linux, Darwin, and Cygwin, with python 2.6.5 and higher. I'd be happy to assist solving this, please let me know how I can help. ---------- components: Interpreter Core messages: 113643 nosy: Alex.Roitman priority: normal severity: normal status: open title: imporing a module that executes fork() raises RuntimeError type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 09:12:42 2010 From: report at bugs.python.org (Jervis Whitley) Date: Thu, 12 Aug 2010 07:12:42 +0000 Subject: [New-bugs-announce] [issue9574] complex does not parse strings containing decimals In-Reply-To: <1281597162.74.0.823446392009.issue9574@psf.upfronthosting.co.za> Message-ID: <1281597162.74.0.823446392009.issue9574@psf.upfronthosting.co.za> New submission from Jervis Whitley : complex() raises ValueError when parsing a string argument containing both real and imaginary where one of the real or imaginary is a decimal. To reproduce: >>> complex("1.1 + 2.1j") ValueError: complex() arg is a malformed string >>> complex("2.1j") 2.1j >>> complex("1.1 + 2j") ValueError: complex() arg is a malformed string >>> complex("1 + 2.1j") ValueError: complex() arg is a malformed string Expected results: >>> complex("1.1 + 2.1j") (1.1 + 2.1j) >>> complex("2.1j") 2.1j >>> complex("1.1 + 2j") (1.1 + 2j) >>> complex("1 + 2.1j") (1 + 2.1j) This affects all versions up to Python 3.1.2. I haven't tested any of the development builds. Tests were conducted on a Windows XP 32 bit machine. ---------- components: Interpreter Core messages: 113661 nosy: jdwhitley priority: normal severity: normal status: open title: complex does not parse strings containing decimals type: behavior versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 13:02:38 2010 From: report at bugs.python.org (Heejin) Date: Thu, 12 Aug 2010 11:02:38 +0000 Subject: [New-bugs-announce] [issue9575] os.listdir() crashes on some long and deep paths in Windows 7 In-Reply-To: <1281610958.98.0.583662665804.issue9575@psf.upfronthosting.co.za> Message-ID: <1281610958.98.0.583662665804.issue9575@psf.upfronthosting.co.za> New submission from Heejin : As far as I have seen, this bug only appears in Windows 7. I tested with Python 2.5, 2.6, and 2.7 and they all seem to have this bug. I tested with Windows 7 Korean version. I'm not sure if other language versions have the same problem. Reproduction steps: 1. Run a command shell 'cmd'. 2. Run following commands in order: cd c:\ mkdir rpcc\build cd rpcc\build mkdir customs\llvm2dre\llvm-2.6\tools\clang\test\CXX\over\over.match\over.match.best\over.best.ics\over.ics.ellipsis\.svn\tmp\prop-base 3. Create a python script file temp.py with the contents below import os path = 'customs\\llvm2dre\\llvm-2.6\\tools\\clang\\test\\CXX\\over\\over.match\\over.match.best\\over.best.ics\\over.ics.ellipsis\\.svn\\tmp\\prop-base' os.listdir(path) (I attached this file in this post) 4. Run the script. python temp.py 5. Then you can see it crashes. ---------- components: Library (Lib), Windows files: temp.py messages: 113672 nosy: aheejin priority: normal severity: normal status: open title: os.listdir() crashes on some long and deep paths in Windows 7 type: crash versions: Python 2.5, Python 2.6, Python 2.7 Added file: http://bugs.python.org/file18483/temp.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 17:44:53 2010 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Thu, 12 Aug 2010 15:44:53 +0000 Subject: [New-bugs-announce] [issue9576] logging.addLevelName in file-based configurations In-Reply-To: <1281627893.73.0.657800338781.issue9576@psf.upfronthosting.co.za> Message-ID: <1281627893.73.0.657800338781.issue9576@psf.upfronthosting.co.za> New submission from Tarek Ziad? : It's not possible to use a custom level in a file-based configuration unless you programatically call logging.addLevelName('LEVEL', VALUE) It would be nice to be able to declare new levels in config files ---------- assignee: vinay.sajip components: Library (Lib) messages: 113686 nosy: tarek, vinay.sajip priority: normal severity: normal status: open title: logging.addLevelName in file-based configurations versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 17:53:05 2010 From: report at bugs.python.org (Arman) Date: Thu, 12 Aug 2010 15:53:05 +0000 Subject: [New-bugs-announce] [issue9577] html parser bug related with CDATA sections In-Reply-To: <1281628385.29.0.0117705176523.issue9577@psf.upfronthosting.co.za> Message-ID: <1281628385.29.0.0117705176523.issue9577@psf.upfronthosting.co.za> New submission from Arman : When HTMLParser reaches CDATA element it enters cdata mode by calling set_cdata_mode (file html/parser.py line 270). this method assigns self.interesting member new value r'<(/|\Z)'. But this is not correct. Consider following case matches with r'<(/|\Z)' and parser gets confused and produce wrong results. You can see such real htmls in www.ahram.org.eg www.chefkoch.de www.chemieonline.de www.eip.gov.eg www.rezepte.li www.scienceworld.com The solution can be to keep interesting_cdata_script = re.compile(r'<(/|\z)script') interesting_cdata_style = re.compile(r'<(/|\z)style') instead of interesting_cdata = re.compile(r'<(/|\Z)') and depending on what tag is begins (script or style) set_cdata_mode can assign correct regexp to self.interesting member. Please contact with me via email if you need more details. arman.hunanyan at gmail.com ---------- components: Library (Lib) messages: 113688 nosy: Hunanyan priority: normal severity: normal status: open title: html parser bug related with CDATA sections type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 19:52:38 2010 From: report at bugs.python.org (Alexander Belopolsky) Date: Thu, 12 Aug 2010 17:52:38 +0000 Subject: [New-bugs-announce] [issue9578] int() raises UnicodeDecodeError when called on malformed string In-Reply-To: <1281635558.42.0.560480502776.issue9578@psf.upfronthosting.co.za> Message-ID: <1281635558.42.0.560480502776.issue9578@psf.upfronthosting.co.za> New submission from Alexander Belopolsky : >>> int('\xA11') Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'utf8' codec can't decode byte 0xa1 in position 0: invalid start byte This is inconsistent with other number types' behavior: >>> float(b'\xA1') Traceback (most recent call last): File "", line 1, in ValueError: could not convert string to float: ? ---------- messages: 113694 nosy: belopolsky, mark.dickinson priority: normal severity: normal status: open title: int() raises UnicodeDecodeError when called on malformed string _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 21:12:14 2010 From: report at bugs.python.org (David Watson) Date: Thu, 12 Aug 2010 19:12:14 +0000 Subject: [New-bugs-announce] [issue9579] In 3.x, os.confstr() returns garbage if value is longer than 255 bytes In-Reply-To: <1281640334.52.0.33251169247.issue9579@psf.upfronthosting.co.za> Message-ID: <1281640334.52.0.33251169247.issue9579@psf.upfronthosting.co.za> New submission from David Watson : It may be hard to find a configuration string this long, but you can see the problem if you apply the attached confstr-reduce-bufsize.diff to reduce the size of the local array buffer that posix_confstr() uses. With it applied: >>> import os >>> print(ascii(os.confstr("CS_PATH"))) '\x00\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb\ucbcb' The problem arises because the code first tries to receive the configuration string into the local buffer (char buffer[256], reduced to char buffer[1] above), but then tries to receive it directly into a string object if it doesn't fit. You can see what's gone wrong by comparing the working code in 2.x: if ((unsigned int)len >= sizeof(buffer)) { result = PyString_FromStringAndSize(NULL, len-1); if (result != NULL) confstr(name, PyString_AS_STRING(result), len); } else result = PyString_FromStringAndSize(buffer, len-1); with the code in 3.x: if ((unsigned int)len >= sizeof(buffer)) { result = PyUnicode_FromStringAndSize(NULL, len-1); if (result != NULL) confstr(name, _PyUnicode_AsString(result), len); } else result = PyUnicode_FromStringAndSize(buffer, len-1); Namely, that in 3.x it tries to receive the string into the bytes object returned by _PyUnicode_AsString(), not the str object it has just allocated (which has the wrong format anyway - Py_UNICODE as opposed to char). The attached confstr-long-result.diff fixes this by allocating a separate buffer when necessary to receive the result, before creating the string object from it. By putting the confstr() call and allocation in a loop, it also handles the possibility that the value's length might change between calls. ---------- components: Extension Modules files: confstr-reduce-bufsize.diff keywords: patch messages: 113699 nosy: baikie priority: normal severity: normal status: open title: In 3.x, os.confstr() returns garbage if value is longer than 255 bytes type: behavior versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18486/confstr-reduce-bufsize.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 21:16:56 2010 From: report at bugs.python.org (David Watson) Date: Thu, 12 Aug 2010 19:16:56 +0000 Subject: [New-bugs-announce] [issue9580] os.confstr() doesn't decode result according to PEP 383 In-Reply-To: <1281640616.02.0.101199550238.issue9580@psf.upfronthosting.co.za> Message-ID: <1281640616.02.0.101199550238.issue9580@psf.upfronthosting.co.za> New submission from David Watson : The attached patch applies on top of the patch from issue #9579 to make it use PyUnicode_DecodeFSDefaultAndSize(). (You could use it in the existing code, but until that issue is fixed, there is sometimes nothing to decode!) ---------- components: Extension Modules files: confstr-pep383.diff keywords: patch messages: 113700 nosy: baikie priority: normal severity: normal status: open title: os.confstr() doesn't decode result according to PEP 383 type: behavior versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18488/confstr-pep383.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 22:47:22 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 12 Aug 2010 20:47:22 +0000 Subject: [New-bugs-announce] [issue9581] PosixGroupsTester fails as root In-Reply-To: <1281646042.28.0.438449918806.issue9581@psf.upfronthosting.co.za> Message-ID: <1281646042.28.0.438449918806.issue9581@psf.upfronthosting.co.za> New submission from Antoine Pitrou : I get the following test_posix failures when run as root (Mandriva Linux): ====================================================================== ERROR: test_initgroups (test.test_posix.PosixGroupsTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/antoine/py3k/__svn__/Lib/test/test_posix.py", line 418, in test_initgroups g = g2 + 1 UnboundLocalError: local variable 'g2' referenced before assignment ====================================================================== FAIL: test_setgroups (test.test_posix.PosixGroupsTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/antoine/py3k/__svn__/Lib/test/test_posix.py", line 428, in test_setgroups self.assertListEqual(groups, posix.getgroups()) AssertionError: First sequence is not a list: range(0, 16) Under 2.6, there's another failure: ====================================================================== ERROR: test_setgroups (test.test_posix.PosixGroupsTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/antoine/cpython/26/Lib/test/test_posix.py", line 356, in test_setgroups self.assertListEqual(groups, posix.getgroups()) AttributeError: 'PosixGroupsTester' object has no attribute 'assertListEqual' ---------- assignee: ronaldoussoren components: Tests messages: 113705 nosy: exarkun, pitrou, ronaldoussoren priority: normal severity: normal stage: needs patch status: open title: PosixGroupsTester fails as root type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 00:03:42 2010 From: report at bugs.python.org (Robert Mohr) Date: Thu, 12 Aug 2010 22:03:42 +0000 Subject: [New-bugs-announce] [issue9582] documentation line needs rewording In-Reply-To: <1281650622.86.0.310513887463.issue9582@psf.upfronthosting.co.za> Message-ID: <1281650622.86.0.310513887463.issue9582@psf.upfronthosting.co.za> New submission from Robert Mohr : The last line of http://docs.python.org/faq/programming.html#is-there-a-scanf-or-sscanf-equivalent is not proper English: For more complicated input parsing, regular expressions more powerful than C?s sscanf() and better suited for the task. This also shows up in the 3.2 docs. ---------- assignee: docs at python components: Documentation messages: 113711 nosy: docs at python, mohrr priority: normal severity: normal status: open title: documentation line needs rewording versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 00:54:29 2010 From: report at bugs.python.org (Buck Golemon) Date: Thu, 12 Aug 2010 22:54:29 +0000 Subject: [New-bugs-announce] [issue9583] PYTHONOPTIMIZE = 0 is not honored In-Reply-To: <1281653669.29.0.363654611831.issue9583@psf.upfronthosting.co.za> Message-ID: <1281653669.29.0.363654611831.issue9583@psf.upfronthosting.co.za> New submission from Buck Golemon : In our environment, we have a wrapper which enables optimization by default (-OO). Most commandline tools which have a mode-changing flag such as this, also have a flag to do the opposite ( see: ls -t -U, wget -nv -v, ). I'd like to implement one or both of: 1) Add a -D option which is the opposite of -O. python -OO -D gives an optimization level of 1. 2) Honor PYTHONOPTIMIZE = 0. At the least, the man page needs to describe how these two methods interact. ---------- components: Interpreter Core messages: 113717 nosy: bukzor priority: normal severity: normal status: open title: PYTHONOPTIMIZE = 0 is not honored type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 10:36:53 2010 From: report at bugs.python.org (Mathieu Bridon) Date: Fri, 13 Aug 2010 08:36:53 +0000 Subject: [New-bugs-announce] [issue9584] Allow curly braces in fnmatch In-Reply-To: <1281688613.27.0.00233773234268.issue9584@psf.upfronthosting.co.za> Message-ID: <1281688613.27.0.00233773234268.issue9584@psf.upfronthosting.co.za> New submission from Mathieu Bridon : The attached patch allows for shell curly braces with fnmatch.filter(). This makes the following possible: >>> import fnmatch >>> import os >>> >>> for file in os.listdir('.'): ... if fnmatch.fnmatch(file, '*.{txt,csv}'): ... print file ... file.csv file.txt foo.txt This is especially convenient with the glob module: >>> import glob >>> glob.glob('*.{txt,csv}') ['file.csv', 'file.txt', 'foo.txt'] Hopefully, this makes fnmatch match better the behavior that people expect from a shell-style pattern matcher. Please note: I attached a patch that applies on the Python trunk, but only tested it on Python 2.5 on Windows. However, the fnmatch module doesn't seem to have changed substantially in between. ---------- components: Library (Lib) files: curly-fnmatch.patch keywords: patch messages: 113750 nosy: bochecha priority: normal severity: normal status: open title: Allow curly braces in fnmatch type: feature request Added file: http://bugs.python.org/file18497/curly-fnmatch.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 14:15:10 2010 From: report at bugs.python.org (David Austin) Date: Fri, 13 Aug 2010 12:15:10 +0000 Subject: [New-bugs-announce] [issue9585] Largefile detection in configure fails In-Reply-To: <1281701710.49.0.222431192126.issue9585@psf.upfronthosting.co.za> Message-ID: <1281701710.49.0.222431192126.issue9585@psf.upfronthosting.co.za> New submission from David Austin : On a Linux Xeon server (x86_64) largefile support is (incorrectly) not included. configure determines: checking size of int... 4 checking size of long... 8 checking size of void *... 8 checking size of short... 2 checking size of float... 4 checking size of double... 8 . . . checking size of off_t... 8 but gets it wrong: checking whether to enable large file support... no To me it seems that the logic sizeof_off_t > sizeof_long is wrong. (I changed to comparison off_t > int and it built with largefile support and works fine.) $ uname -a Linux cpu3 2.6.31-14-server #48-Ubuntu SMP Fri Oct 16 15:07:34 UTC 2009 x86_64 GNU/Linux Ubuntu Lucid ---------- components: Build messages: 113757 nosy: David.Austin priority: normal severity: normal status: open title: Largefile detection in configure fails type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 14:43:48 2010 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 13 Aug 2010 12:43:48 +0000 Subject: [New-bugs-announce] [issue9586] "warning: comparison between pointer and integer" in multiprocessing build on PPC/Tiger In-Reply-To: <1281703428.64.0.285019462814.issue9586@psf.upfronthosting.co.za> Message-ID: <1281703428.64.0.285019462814.issue9586@psf.upfronthosting.co.za> New submission from Mark Dickinson : The PPC Tiger buildbot build output shows (e.g., for 2.7): /Users/buildbot/buildarea/2.7.parc-tiger-1/build/Modules/_multiprocessing/semaphore.c:421: warning: initialization makes pointer from integer without a cast /Users/buildbot/buildarea/2.7.parc-tiger-1/build/Modules/_multiprocessing/semaphore.c:441: warning: comparison between pointer and integer /Users/buildbot/buildarea/2.7.parc-tiger-1/build/Modules/_multiprocessing/semaphore.c:454: warning: comparison between pointer and integer /Users/buildbot/buildarea/2.7.parc-tiger-1/build/Modules/_multiprocessing/semaphore.c:476: warning: comparison between pointer and integer This looks as though it should be investigated; these comparisons are almost certainly doing the wrong thing. Including Antoine in the nosy because he was the last person to touch this code (I think). ---------- assignee: ronaldoussoren components: Build, Extension Modules, Macintosh messages: 113759 nosy: jnoller, mark.dickinson, pitrou, ronaldoussoren priority: normal severity: normal status: open title: "warning: comparison between pointer and integer" in multiprocessing build on PPC/Tiger versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 16:57:44 2010 From: report at bugs.python.org (Denver Coneybeare) Date: Fri, 13 Aug 2010 14:57:44 +0000 Subject: [New-bugs-announce] [issue9587] unittest.assertRaises() return the raised exception In-Reply-To: <1281711464.19.0.685530938413.issue9587@psf.upfronthosting.co.za> Message-ID: <1281711464.19.0.685530938413.issue9587@psf.upfronthosting.co.za> New submission from Denver Coneybeare : It would be great if unittest.assertRaises() returned the raised exception when it passes. This allows the caller to easily perform further checks on the exception, such as its attribute values. Currently assertRaises() returns None (when it doesn't return a context manager) so changing the return value should not break backwards compatibility. I see that this was already discussed in issue6275 but I'd like to resurrect the discussion since this is a common scenario in my unit tests, and I assume others. Revisions r76238 and r78110 added the ability to get the exception from the context manager (good) but sometimes using the context manager approach adds unnecessary bloat to already long-winded unit tests. I've attached a possible patch for the py3k branch (unittest.assertRaises.returnex.v1.patch). Thank you for (re)considering this topic :) Also, thank you Michael Foord for your recent improvements to unittest... the new features are very much appreciated! ---------- components: Library (Lib) files: unittest.assertRaises.returnex.v1.patch keywords: patch messages: 113781 nosy: denversc, krisvale, michael.foord priority: normal severity: normal status: open title: unittest.assertRaises() return the raised exception type: feature request versions: Python 3.2 Added file: http://bugs.python.org/file18501/unittest.assertRaises.returnex.v1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 18:33:10 2010 From: report at bugs.python.org (Brian Curtin) Date: Fri, 13 Aug 2010 16:33:10 +0000 Subject: [New-bugs-announce] [issue9588] Skip subprocess shell tests on Windows per file association setup In-Reply-To: <1281717190.24.0.68069123173.issue9588@psf.upfronthosting.co.za> Message-ID: <1281717190.24.0.68069123173.issue9588@psf.upfronthosting.co.za> New submission from Brian Curtin : The fix for #2304 causes issues on Windows if you have file associations setup that aren't Python interpters. In my case I have an association setup to open .py files in gvim, which causes the shell tests to hang until I quit the editor, then it fails because the output from gvim (nothing) doesn't match what it would when run through an interpreter. CommandsWithSpaces.test_shell_* tests should have a skip condition which checks file associations before running. The info is stored somewhere in the registry, so it should be easy to see that, e.g., gvim.exe isn't a valid Python interpreter. This issue only affects me at the moment, but it could affect other users who have tweaked file associations. ---------- assignee: brian.curtin components: Tests, Windows messages: 113794 nosy: brian.curtin, tim.golden priority: low severity: normal stage: needs patch status: open title: Skip subprocess shell tests on Windows per file association setup type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 19:31:17 2010 From: report at bugs.python.org (Florent Xicluna) Date: Fri, 13 Aug 2010 17:31:17 +0000 Subject: [New-bugs-announce] [issue9589] test_heapq: AttributeError: 'int' object has no attribute 'pop' In-Reply-To: <1281720677.01.0.254091973526.issue9589@psf.upfronthosting.co.za> Message-ID: <1281720677.01.0.254091973526.issue9589@psf.upfronthosting.co.za> New submission from Florent Xicluna : Various buildbots show a failure on test_heapq. * "x86 FreeBSD 3.x" failed on revision r83882 (r83869 was OK) http://www.python.org/dev/buildbot/all/builders/x86%20FreeBSD%203.x/builds/492 and next runs were OK, too * "PPC (Leopard|Tiger) 3.x" and "x86 Tiger 3.x" fail consistently from r83889 onwards. * all "gentoo 3.x" and "Ubuntu 3.x" fail on r83981 http://www.python.org/dev/buildbot/all/builders/x86%20gentoo%203.x/builds/2816 http://www.python.org/dev/buildbot/all/builders/x86%20Ubuntu%203.x/builds/1707 ---------- components: Library (Lib), Tests keywords: buildbot messages: 113798 nosy: flox, haypo priority: normal severity: normal stage: needs patch status: open title: test_heapq: AttributeError: 'int' object has no attribute 'pop' type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 20:05:29 2010 From: report at bugs.python.org (Anthony Long) Date: Fri, 13 Aug 2010 18:05:29 +0000 Subject: [New-bugs-announce] [issue9590] __init__ TypeError reverses expected vs received args In-Reply-To: <1281722729.75.0.301168748146.issue9590@psf.upfronthosting.co.za> Message-ID: <1281722729.75.0.301168748146.issue9590@psf.upfronthosting.co.za> New submission from Anthony Long : import unittest from selenium import selenium class SetupSomething(unittest.TestCase): def setUp(self, URL): self.selenium = selenium("localhost", 4444, "*firefox", self.URL) def tearDown(self): pass class TestSomething(SetupSomething): def __init__(): print "bug." def setUp(self): self.URL = "http://google.com/" def tearDown(self): pass def test_tester(self): self.selenium.open('/') print "no" unittest.main() ---- TypeError: '__init__() takes no arguments (2 given)' ---------- messages: 113802 nosy: antlong priority: normal severity: normal status: open title: __init__ TypeError reverses expected vs received args versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 20:47:25 2010 From: report at bugs.python.org (Volodymyr Kostyrko) Date: Fri, 13 Aug 2010 18:47:25 +0000 Subject: [New-bugs-announce] [issue9591] kqueu not reporting EOF under certain circumstances In-Reply-To: <1281725245.42.0.301580096416.issue9591@psf.upfronthosting.co.za> Message-ID: <1281725245.42.0.301580096416.issue9591@psf.upfronthosting.co.za> New submission from Volodymyr Kostyrko : This one is BSD related. FreeBSD 8.1. This works: # cat test.py | ./test.py -1 684 32768 0 0 # This hangs: # ./test.py < file -1 684 0 0 0 The difference is that in second case popped kevent lacks any data on EOF. ---------- components: Library (Lib) files: test.py messages: 113811 nosy: Volodymyr.Kostyrko priority: normal severity: normal status: open title: kqueu not reporting EOF under certain circumstances type: behavior versions: Python 3.1 Added file: http://bugs.python.org/file18506/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 21:02:48 2010 From: report at bugs.python.org (Freek Dijkstra) Date: Fri, 13 Aug 2010 19:02:48 +0000 Subject: [New-bugs-announce] [issue9592] Limitations in objects returned by multiprocessing Pool In-Reply-To: <1281726168.11.0.648826556363.issue9592@psf.upfronthosting.co.za> Message-ID: <1281726168.11.0.648826556363.issue9592@psf.upfronthosting.co.za> New submission from Freek Dijkstra : I came across three limitation in the multiprocessing module that were not handled correctly. Attached is a file that reproduces the errors in minimal code. I tested them with Python 2.6.5 and 3.1.2. Expected result: multiprocessing.Pool's promises a map function where each result is returned transparently to the main process (despite that the calculation was done in a subprocess) Actual result: Not all values returned by a subprocess are returned transparently. I expected multiprocessing to handle these cases gracefully by yielding an Exception in the Main process. The cases I found are: 1) A multiprocessing worker can not return (return, not raise!) an Exception. If this is attempted, the result handler thread in the Pool calls the exception with no arguments, which might raise an error if multiple arguments are required: TypeError: ('__init__() takes exactly 2 arguments (1 given)', , ()) 2) A multiprocessing worker can not return an hashlib Object. If this is attempted, pickle returns an error: PicklingError: Can't pickle : attribute lookup _hashlib.HASH failed 3) A multiprocessing worker can not return an Object which overrides __getattr__, and accesses a variable from self in __getattr__. If this is attempted, Python 2.6 crashes with a bus error: Program terminated by uncaught signal #10 after 1.56 seconds. Python 3.1 yields the error: RuntimeError: maximum recursion depth exceeded while calling a Python object ---------- components: Library (Lib) files: multiprocessingbugs.py messages: 113816 nosy: macfreek priority: normal severity: normal status: open title: Limitations in objects returned by multiprocessing Pool type: crash versions: Python 2.6, Python 3.1 Added file: http://bugs.python.org/file18507/multiprocessingbugs.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 21:27:03 2010 From: report at bugs.python.org (Joseph Copenhaver) Date: Fri, 13 Aug 2010 19:27:03 +0000 Subject: [New-bugs-announce] [issue9593] utf8 codec readlines error after "\x85 " In-Reply-To: <1281727623.94.0.00268299366408.issue9593@psf.upfronthosting.co.za> Message-ID: <1281727623.94.0.00268299366408.issue9593@psf.upfronthosting.co.za> New submission from Joseph Copenhaver : The IO readlines() facility incorrectly processes utf8 files for some unknown reason. Specifically, the call generates too many entries in the lines array result after a character sequence "\x85 blah" which gets cut as ("\x85 ","blah") according the the resultant array. My workaround for this issue is not elegant, especially since I need the newline characters: #BEGIN: WTF a_str_whole = fs_in.read() fs_in.close() a_str_lines = a_str_whole.split("\n") for idx in range(0,len(a_str_lines)-1): a_str_lines[idx]+="\n" #END: WTF Attached is an example script that defines the problem clearly. ---------- components: IO, Interpreter Core, Regular Expressions, Unicode files: ErrorProof-utf8-x85.py messages: 113818 nosy: jcope priority: normal severity: normal status: open title: utf8 codec readlines error after "\x85 " type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file18508/ErrorProof-utf8-x85.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 23:34:36 2010 From: report at bugs.python.org (Sridhar Ratnakumar) Date: Fri, 13 Aug 2010 21:34:36 +0000 Subject: [New-bugs-announce] [issue9594] typo on Mac/Makefile.in? s/pythonw/python/ In-Reply-To: <1281735276.23.0.449873150799.issue9594@psf.upfronthosting.co.za> Message-ID: <1281735276.23.0.449873150799.issue9594@psf.upfronthosting.co.za> New submission from Sridhar Ratnakumar : >From Mac/Makefile.in: [...] ifneq ($(LIPO_32BIT_FLAGS),) lipo $(LIPO_32BIT_FLAGS) -output $(DESTDIR)$(prefix)/bin/python$(VERSION)-32 pythonw lipo $(LIPO_32BIT_FLAGS) -output $(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-32 pythonw ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python-32" ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw-32" endif [...] Shouldn't the last word in the first line be `python` instead of `pythonw`? http://svn.python.org/view/python/trunk/Mac/Makefile.in?annotate=77031#l55 ---------- assignee: ronaldoussoren components: Build, Macintosh messages: 113836 nosy: ronaldoussoren, srid priority: normal severity: normal status: open title: typo on Mac/Makefile.in? s/pythonw/python/ type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 23:47:29 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 13 Aug 2010 21:47:29 +0000 Subject: [New-bugs-announce] [issue9595] PC/getpathp.c unused? Message-ID: <1281736049.14.0.316671320549.issue9595@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: pitrou priority: normal severity: normal status: open title: PC/getpathp.c unused? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 23:48:18 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 13 Aug 2010 21:48:18 +0000 Subject: [New-bugs-announce] [issue9596] PC/getpathp.c unused? In-Reply-To: <1281736098.81.0.874478612531.issue9596@psf.upfronthosting.co.za> Message-ID: <1281736098.81.0.874478612531.issue9596@psf.upfronthosting.co.za> New submission from Antoine Pitrou : PC/getpathp.c claims it is ?Used by DOS, OS/2, Windows 3.1, Windows 95/98, Windows NT?, but Modules/getpath.c already tries to be cross-platform. It is not obvious whether the former is used at all. ---------- components: Interpreter Core messages: 113839 nosy: loewis, pitrou priority: low severity: normal status: open title: PC/getpathp.c unused? type: resource usage versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 00:29:01 2010 From: report at bugs.python.org (Sridhar Ratnakumar) Date: Fri, 13 Aug 2010 22:29:01 +0000 Subject: [New-bugs-announce] [issue9597] mac: Install 2to3 in /usr/local/bin In-Reply-To: <1281738541.55.0.960534882511.issue9597@psf.upfronthosting.co.za> Message-ID: <1281738541.55.0.960534882511.issue9597@psf.upfronthosting.co.za> New submission from Sridhar Ratnakumar : According to Mac/Makefile.in, scripts like pydoc, idle, smtpd.py and so on gets symlinked in /usr/local/bin but there is none for 2to3. Perhaps this was forgotten? ---------- assignee: ronaldoussoren components: 2to3 (2.x to 3.0 conversion tool), Build, Macintosh messages: 113845 nosy: ronaldoussoren, srid priority: normal severity: normal status: open title: mac: Install 2to3 in /usr/local/bin type: feature request versions: Python 2.6, Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 01:06:14 2010 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 13 Aug 2010 23:06:14 +0000 Subject: [New-bugs-announce] [issue9598] untabify.py fails on files that contain non-ascii characters In-Reply-To: <1281740774.41.0.842761146652.issue9598@psf.upfronthosting.co.za> Message-ID: <1281740774.41.0.842761146652.issue9598@psf.upfronthosting.co.za> New submission from Alexander Belopolsky : For example: $ ./python.exe Tools/scripts/untabify.py Modules/_heapqmodule.c Traceback (most recent call last): ... (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf8' codec can't decode byte 0xe7 in position 173: invalid continuation byte I am not sure what relevant C standard has to say about using non-ascii characters in comments, but the checking tool should not fail with a traceback in such situation. ---------- components: Demos and Tools messages: 113849 nosy: belopolsky priority: normal severity: normal status: open title: untabify.py fails on files that contain non-ascii characters type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 03:20:50 2010 From: report at bugs.python.org (STINNER Victor) Date: Sat, 14 Aug 2010 01:20:50 +0000 Subject: [New-bugs-announce] [issue9599] Add PySys_FormatStdout and PySys_FormatStderr functions In-Reply-To: <1281748850.03.0.226661002254.issue9599@psf.upfronthosting.co.za> Message-ID: <1281748850.03.0.226661002254.issue9599@psf.upfronthosting.co.za> New submission from STINNER Victor : For my work #9425 (Rewrite import machinery to work with unicode paths), I need a function to write unicode strings to sys.stderr (especially to write messages on import in verbose mode). Attached patch creates PySys_FormatStdout() and PySys_FormatStderr(). It's the same idea than the new function PyErr_WarnFormat() vs PyErr_WarnEx() (added by r83976): similar API but use PyUnicode_FromFormatV(). PySys_FormatStdout() and PySys_FormatStderr() don't truncate the output message. PySys_WriteStdout() and PySys_WriteStderr() truncate the output because they use a static buffer of 1001 bytes, but I don't know if it is an implementation choice (to avoid bugs?) or just a limitation of the implementation. About the patch: - rename mywrite() to sys_write() to use a less generic name (it helps debugging) - in sys_write(): don't call PyErr_Clear() if the second call to sys_pyfile_write() fails, because it is useless. fputs() doesn't care to Python exceptions and the exception state is restored just after the call to fputs() - sys_format() encodes the message to utf-8 on sys_pyfile_write_unicode() failure because utf-8 is able to encode all unicode characters (except unicode surrogates). Use an error handler to escape surrogates may avoid encode errors, but it's not important here because sys_pyfile_write_unicode() should not fail. sys_pyfile_write_unicode() knows better how to handle surrogate characters (sys.stderr uses backslashreplace error handler by default). For #9425, I only need PySys_FormatStderr(), but I added also PySys_FormatStdout() just to be consistent with PySys_Write*() and because it only costs a few line of code. ---------- components: Interpreter Core, Unicode files: pysys_formatstderr.patch keywords: patch messages: 113861 nosy: haypo priority: normal severity: normal status: open title: Add PySys_FormatStdout and PySys_FormatStderr functions versions: Python 3.2 Added file: http://bugs.python.org/file18518/pysys_formatstderr.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 05:30:33 2010 From: report at bugs.python.org (cipater) Date: Sat, 14 Aug 2010 03:30:33 +0000 Subject: [New-bugs-announce] [issue9600] multiprocessing Pool instantiation crashes on 64 bit 2.6.6rc1 under Windows 7 In-Reply-To: <1281756633.5.0.731443815924.issue9600@psf.upfronthosting.co.za> Message-ID: <1281756633.5.0.731443815924.issue9600@psf.upfronthosting.co.za> New submission from cipater : I'm running 2.6.6rc1 64 bit on Windows 7 I get the following error when I try to instantiate a Pool: >>> import multiprocessing >>> p = Pool(processes = 2) Traceback (most recent call last): File "", line 1, in File "c:\Python26\lib\multiprocessing\__init__.py", line 227, in Pool return Pool(processes, initializer, initargs) File "c:\Python26\lib\multiprocessing\pool.py", line 84, in __init__ self._setup_queues() File "c:\Python26\lib\multiprocessing\pool.py", line 130, in _setup_queues from .queues import SimpleQueue File "c:\Python26\lib\multiprocessing\queues.py", line 22, in from multiprocessing.synchronize import Lock, BoundedSemaphore, Semaphore, Condition File "c:\Python26\lib\multiprocessing\synchronize.py", line 22, in from multiprocessing.forking import assert_spawning, Popen File "c:\Python26\lib\multiprocessing\forking.py", line 153, in from ._multiprocessing import win32, Connection, PipeConnection ImportError: No module named _multiprocessing >>> ---------- components: Extension Modules messages: 113864 nosy: cipater priority: normal severity: normal status: open title: multiprocessing Pool instantiation crashes on 64 bit 2.6.6rc1 under Windows 7 type: crash versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 05:41:59 2010 From: report at bugs.python.org (alphablue52) Date: Sat, 14 Aug 2010 03:41:59 +0000 Subject: [New-bugs-announce] [issue9601] ftplib should accept 250 on MKD In-Reply-To: <1281757319.27.0.238549854575.issue9601@psf.upfronthosting.co.za> Message-ID: <1281757319.27.0.238549854575.issue9601@psf.upfronthosting.co.za> New submission from alphablue52 : I try to use ftplib for a Webspace running on a Windows Server machine. The server responses 250 instead of 257 (which would be correct according to RFC959, ftp) It would be nice if ftplib could also tolerate the 250 "Requested file ation okay, completed" code, since I cannot change the server (or beat that M$ programmer). Thanks! ---------- components: Library (Lib) messages: 113866 nosy: alphablue52 priority: normal severity: normal status: open title: ftplib should accept 250 on MKD versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 15:42:32 2010 From: report at bugs.python.org (STINNER Victor) Date: Sat, 14 Aug 2010 13:42:32 +0000 Subject: [New-bugs-announce] [issue9602] PyObject_AsCharBuffer() should only accept read-only objects In-Reply-To: <1281793352.06.0.62940034279.issue9602@psf.upfronthosting.co.za> Message-ID: <1281793352.06.0.62940034279.issue9602@psf.upfronthosting.co.za> New submission from STINNER Victor : mmap, buffer, bytearray, string and unicode objects set the char buffer callback (bf_getcharbuffer). The bytearray object sets also the release buffer callback (bf_releasebuffer). In Python 2.7, PyObject_AsCharBuffer() accepts bytearray objects, whereas the "t#" format of PyArg_Parse functions rejects byte bytearray objects (expect an "pinned buffer object"). In Python 3.2, PyObject_AsCharBuffer() releases the buffer. PyObject_AsCharBuffer() documentation (in 2.7 and 3.2) says that the function only accepts read-only objects. Something is wrong here. If the caller doesn't hold a kind of lock, the object cannot be protected against futher modifications. The caller has to ensure that the object is not modifiable until it finishs to use the char* pointer. I think that it would be safer to respect the documentation: PyObject_AsCharBuffer() should only accept read-only objects. The most important change is that functions using PyObject_AsCharBuffer() will not accept bytearray objects anymore. Attached patch (for Python 2.7) changes PyObject_AsCharBuffer() to reject modifiable objects. It removes also the character buffer callback from the bytearray type. To avoid breaking compatibility too much, I patched int(), long() and float() to still support bytearray objects. Examples of functions rejecting bytearray with the patch: - int(), long(), float(), complex() - many str methods: split, partition, rpartition, rsplit, index, find, count, translate, replace, startswith, endswith - writelines() of file objects (eg. sys.stdout.writelines) - writelines() method of a bz2 file -- My patch breaks backward compatibility, and I don't know that it is acceptable in Python 2.7. I will write a similar patch for Python 3.2. ---------- components: Interpreter Core files: PyObject_AsCharBuffer-2.7.patch keywords: patch messages: 113895 nosy: haypo, pitrou priority: normal severity: normal status: open title: PyObject_AsCharBuffer() should only accept read-only objects versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file18523/PyObject_AsCharBuffer-2.7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 21:09:13 2010 From: report at bugs.python.org (David Watson) Date: Sat, 14 Aug 2010 19:09:13 +0000 Subject: [New-bugs-announce] [issue9603] os.ttyname() and os.ctermid() don't decode result according to PEP 383 In-Reply-To: <1281812953.3.0.0625643381437.issue9603@psf.upfronthosting.co.za> Message-ID: <1281812953.3.0.0625643381437.issue9603@psf.upfronthosting.co.za> New submission from David Watson : These functions each return the path to a terminal, so they should use PyUnicode_DecodeFSDefault(). Patch attached. ---------- components: Extension Modules files: ttyname-ctermid-pep383.diff keywords: patch messages: 113920 nosy: baikie priority: normal severity: normal status: open title: os.ttyname() and os.ctermid() don't decode result according to PEP 383 type: behavior versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18529/ttyname-ctermid-pep383.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 21:11:30 2010 From: report at bugs.python.org (David Watson) Date: Sat, 14 Aug 2010 19:11:30 +0000 Subject: [New-bugs-announce] [issue9604] os.initgroups() doesn't accept PEP 383 usernames returned by pwd module In-Reply-To: <1281813090.71.0.270641843019.issue9604@psf.upfronthosting.co.za> Message-ID: <1281813090.71.0.270641843019.issue9604@psf.upfronthosting.co.za> New submission from David Watson : The pwd module decodes usernames using PyUnicode_DecodeFSDefault(), so initgroups() should use PyUnicode_FSConverter() for the username. Patch attached. ---------- components: Extension Modules files: initgroups-pep383.diff keywords: patch messages: 113921 nosy: baikie priority: normal severity: normal status: open title: os.initgroups() doesn't accept PEP 383 usernames returned by pwd module type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file18530/initgroups-pep383.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 21:13:54 2010 From: report at bugs.python.org (David Watson) Date: Sat, 14 Aug 2010 19:13:54 +0000 Subject: [New-bugs-announce] [issue9605] os.getlogin() should use PEP 383 decoding to match the pwd module In-Reply-To: <1281813234.71.0.460155631473.issue9605@psf.upfronthosting.co.za> Message-ID: <1281813234.71.0.460155631473.issue9605@psf.upfronthosting.co.za> New submission from David Watson : The pwd module decodes usernames with PyUnicode_DecodeFSDefault(), and the LOGNAME environment variable (suggested as an alternative to getlogin()) is decoded the same way. Attaching a patch to use PyUnicode_DecodeFSDefault() in getlogin(). ---------- components: Extension Modules files: getlogin-pep383.diff keywords: patch messages: 113922 nosy: baikie priority: normal severity: normal status: open title: os.getlogin() should use PEP 383 decoding to match the pwd module type: behavior versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18531/getlogin-pep383.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 23:38:24 2010 From: report at bugs.python.org (Nikolaus Rath) Date: Sat, 14 Aug 2010 21:38:24 +0000 Subject: [New-bugs-announce] [issue9606] logging filter is ignored when added to root handler In-Reply-To: <1281821904.42.0.0351548448859.issue9606@psf.upfronthosting.co.za> Message-ID: <1281821904.42.0.0351548448859.issue9606@psf.upfronthosting.co.za> New submission from Nikolaus Rath : I believe the following should print only one log message, not two: import logging class Filter(object): def filter(self, record): return record.name == 'foo' logger = logging.getLogger() formatter = logging.Formatter('%(message)s') handler = logging.StreamHandler() handler.setFormatter(formatter) logger.addFilter(Filter()) logger.addHandler(handler) logging.getLogger('foo').warn('foo!') logging.getLogger('bar').warn('bar!') If the filter is added to the handler instead of the logger, everything works as expected. If this is desired behaviour, please consider this a bug against the documentation. In that case I propose to extend the documentation of Logger.addFilter() as follows: "Note that the filter will act only on log messages that are generated by this logger, and not on messages that have been generated by descendant loggers." ---------- components: Library (Lib) messages: 113932 nosy: Nikratio priority: normal severity: normal status: open title: logging filter is ignored when added to root handler type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 07:15:48 2010 From: report at bugs.python.org (Greg Malcolm) Date: Sun, 15 Aug 2010 05:15:48 +0000 Subject: [New-bugs-announce] [issue9607] Test file 'test_keyword.py' submission for use with keyword.py In-Reply-To: <1281849348.53.0.810648733764.issue9607@psf.upfronthosting.co.za> Message-ID: <1281849348.53.0.810648733764.issue9607@psf.upfronthosting.co.za> New submission from Greg Malcolm : 'keyword.py' didn't have any tests, so I wrote some. Most of the tests are are for the main() method, which self-populates the keywords section of keyword.py with keywords taken from a grammar file, 'Python/graminit.c'. The main() method allows you to choose the grammar file and the target file, so I've written the tests such that the actual keyword.py does not have to modify itself. Most of the tests generate dummy keyword.py and graminit.c files for parsing. They are all deleted in the tearUp() stages of each test. I've timed the tests. In total they take approximately 3 seconds so you may want to tag some of them as "slow". Also I've only tested on the mac, so someone may want to check it runs ok on Windows. Most of the patch was written at the PyOhio 2010 Sprints. Thanks go to David Murray for advice given while working on it. ---------- components: Tests files: test_keyword.patch keywords: patch messages: 113942 nosy: gregmalcolm, r.david.murray priority: normal severity: normal status: open title: Test file 'test_keyword.py' submission for use with keyword.py type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file18537/test_keyword.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 14:23:45 2010 From: report at bugs.python.org (Floris Bruynooghe) Date: Sun, 15 Aug 2010 12:23:45 +0000 Subject: [New-bugs-announce] [issue9608] Re-phrase best way of using exceptions in doanddont.rst In-Reply-To: <1281875025.64.0.398474348151.issue9608@psf.upfronthosting.co.za> Message-ID: <1281875025.64.0.398474348151.issue9608@psf.upfronthosting.co.za> New submission from Floris Bruynooghe : The description of how to best use exceptions is slightly confusing and led me to believe there was an issue when using open() as a context manager. The main issue is that the wording seems to suggest the example above it is the best and not the very last. Attached is a patch which uses a slightly different wording which IMHO makes it clearer that the with-statement is the preferred method and does not introduce subtle bugs. ---------- assignee: docs at python components: Documentation files: doandont.diff keywords: patch messages: 113949 nosy: docs at python, flub priority: normal severity: normal status: open title: Re-phrase best way of using exceptions in doanddont.rst type: feature request versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file18538/doandont.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 17:09:36 2010 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Sun, 15 Aug 2010 15:09:36 +0000 Subject: [New-bugs-announce] [issue9609] make cProfile multi-stack aware In-Reply-To: <1281884976.7.0.103613520648.issue9609@psf.upfronthosting.co.za> Message-ID: <1281884976.7.0.103613520648.issue9609@psf.upfronthosting.co.za> New submission from Kristj?n Valur J?nsson : One of the problems with the profiling modules provided with Python is that they are not useful in the presence of multiple threads. This is because time spent in a different thread may be falsely attributed to some random place in a thread being profiled. This patch helps fix that, by making the _lsprof.c module (the engine behind cProfile) multi-stack aware. At every entry into the profiler, a check is made to see which stack is in operation (by looking at the thread state). The previous stack is then paused and profiling commences on the new stack. Time spent on other stacks is then subtracted from the measured time on each stack. A complication arises because it is no longer possible to determine the recursion level of each function (or subcall instance) on each stack by looking at the function's entry alone. For this reason, it becomes necessary to walk the stack in cases where there are multiple stacks and multiple total recursions seen for the entries. This patch has been successfully used, with a modifiaction for stackless python, in production at CCP (the modification uses the Tasklet ID rather than the TLS pointer as a key to the stack map). To be useful, it is important that all threads in the process are set to use the same cProfile.Profiler() instance. Currently there is no easy way to do that and this patch doesn't attempt to fix that. But is is possible that an application designed for profiling would attach the profiler at each thread start point. (In the version of Stackless Python that this is used on, it is possible to enable tracing/profiling of all tasklets simultaneously) ---------- components: Extension Modules files: _lsprof.patch keywords: patch, patch messages: 113964 nosy: krisvale priority: normal severity: normal status: open title: make cProfile multi-stack aware type: feature request versions: Python 3.2 Added file: http://bugs.python.org/file18539/_lsprof.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 18:03:00 2010 From: report at bugs.python.org (Florent Xicluna) Date: Sun, 15 Aug 2010 16:03:00 +0000 Subject: [New-bugs-announce] [issue9610] buildbot: uncaptured python exception (smtpd), but no failure in regrtest In-Reply-To: <1281888180.27.0.972389981931.issue9610@psf.upfronthosting.co.za> Message-ID: <1281888180.27.0.972389981931.issue9610@psf.upfronthosting.co.za> New submission from Florent Xicluna : It occurs on PPC Leopard 3.x buildbot. (...) [184/346] test_ssl error: uncaptured python exception, closing channel (:pop from empty list [/Users/buildbot/buildarea/3.x.parc-leopard-1/build/Lib/asyncore.py|read|79] [/Users/buildbot/buildarea/3.x.parc-leopard-1/build/Lib/asyncore.py|handle_read_event|435] [/Users/buildbot/buildarea/3.x.parc-leopard-1/build/Lib/asynchat.py|handle_read|128] [/Users/buildbot/buildarea/3.x.parc-leopard-1/build/Lib/asyncore.py|recv|375] [/Users/buildbot/buildarea/3.x.parc-leopard-1/build/Lib/test/mock_socket.py|recv|47]) (...) http://www.python.org/dev/buildbot/all/builders/PPC%20Leopard%203.x/builds/295 ---------- assignee: ronaldoussoren components: Macintosh, Tests keywords: buildbot messages: 113971 nosy: flox, ronaldoussoren priority: normal severity: normal status: open title: buildbot: uncaptured python exception (smtpd), but no failure in regrtest type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 19:25:42 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 15 Aug 2010 17:25:42 +0000 Subject: [New-bugs-announce] [issue9611] FileIO not 64-bit safe under Windows In-Reply-To: <1281893142.91.0.972520708976.issue9611@psf.upfronthosting.co.za> Message-ID: <1281893142.91.0.972520708976.issue9611@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Modules/_io/fileio.c assumes that read() and write() allow a Py_ssize_t length, but under Windows the length is an int, limiting chunk size to 2GB. It should be easy enough to read or write in multiple chunks, although testing might be difficult. ---------- components: Extension Modules, Windows messages: 113974 nosy: pitrou priority: normal severity: normal status: open title: FileIO not 64-bit safe under Windows type: behavior versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 19:33:37 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 15 Aug 2010 17:33:37 +0000 Subject: [New-bugs-announce] [issue9612] setobject.c warnings under 64-bit Windows In-Reply-To: <1281893617.3.0.762329491862.issue9612@psf.upfronthosting.co.za> Message-ID: <1281893617.3.0.762329491862.issue9612@psf.upfronthosting.co.za> New submission from Antoine Pitrou : None of these warnings look critical (one affects the "search finger" optimization of pop(), one affects the result from __length_hint__ on set iterators, and the other the hash value of frozensets without any obviously bad consequences), but you might want to take a look at them anyway. (for the record, a C "long" is 32-bit under 64-bit Windows, so a Py_ssize_t won't fit in it) 1>..\Objects\setobject.c(743) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'long', possible loss of data 1>..\Objects\setobject.c(772) : warning C4244: '*=' : conversion from 'Py_ssize_t' to 'long', possible loss of data 1>..\Objects\setobject.c(819) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data ---------- assignee: rhettinger components: Interpreter Core messages: 113976 nosy: pitrou, rhettinger priority: low severity: normal status: open title: setobject.c warnings under 64-bit Windows type: behavior versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 20:02:27 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 15 Aug 2010 18:02:27 +0000 Subject: [New-bugs-announce] [issue9613] Python considers pid longs under 64-bit Windows In-Reply-To: <1281895347.49.0.271541660208.issue9613@psf.upfronthosting.co.za> Message-ID: <1281895347.49.0.271541660208.issue9613@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Under 64-bit Windows, Python aliases PyLong_FromPid() to PyLong_FromLong() (and PyLong_AsPid() to PyLong_AsLong()), but a C "long" is 32-bit, while apparently the MSVCRT defines a pid to be intptr_t, that is 64-bit. A potential loss of data ensues. ---------- components: Extension Modules, Interpreter Core, Windows messages: 113982 nosy: brian.curtin, pitrou, tim.golden priority: normal severity: normal status: open title: Python considers pid longs under 64-bit Windows type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 20:13:02 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 15 Aug 2010 18:13:02 +0000 Subject: [New-bugs-announce] [issue9614] _pickle is not entirely 64-bit safe In-Reply-To: <1281895982.89.0.760453311109.issue9614@psf.upfronthosting.co.za> Message-ID: <1281895982.89.0.760453311109.issue9614@psf.upfronthosting.co.za> New submission from Antoine Pitrou : A number of legitimate warnings get emitted under a 64-bit Windows build (in many places, _pickle uses ints or longs instead of "Py_ssize_t" variable to store various lengths and sizes): 1>..\Modules\_pickle.c(284) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 1>..\Modules\_pickle.c(301) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 1>..\Modules\_pickle.c(461) : warning C4244: '+=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 1>..\Modules\_pickle.c(628) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'long', possible loss of data 1>..\Modules\_pickle.c(647) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data 1>..\Modules\_pickle.c(1320) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 1>..\Modules\_pickle.c(1558) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 1>..\Modules\_pickle.c(1806) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data ---------- components: Extension Modules messages: 113986 nosy: alexandre.vassalotti, pitrou priority: normal severity: normal status: open title: _pickle is not entirely 64-bit safe type: behavior versions: Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 21:11:22 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 15 Aug 2010 19:11:22 +0000 Subject: [New-bugs-announce] [issue9615] Building SSL fails under 64-bit Windows In-Reply-To: <1281899482.21.0.598309644137.issue9615@psf.upfronthosting.co.za> Message-ID: <1281899482.21.0.598309644137.issue9615@psf.upfronthosting.co.za> New submission from Antoine Pitrou : This is what I get when MSVC 2008 tries to build the _ssl module: 8>------ Build started: Project: _ssl, Configuration: Debug x64 ------ 8>Performing Pre-Build Event... 8>'""' is not recognized as an internal or external command, 8>operable program or batch file. 8>Project : error PRJ0019: A tool returned an error code from "Performing Pre-Build Event..." 8>Build log was saved at "file://Z:\py3k\__svn__\PCbuild\x64-temp-Debug\_ssl\BuildLog.htm" 8>_ssl - 1 error(s), 0 warning(s) The build log has the following contents: Creating temporary file "C:\Users\Antoine\AppData\Local\Temp\BAT00012021242476.bat" with contents [ @echo off cd "Z:\py3k\__svn__\PCbuild\" "" build_ssl.py Release x64 -a if errorlevel 1 goto VCReportError goto VCEnd :VCReportError echo Project : error PRJ0019: A tool returned an error code from "Performing Pre-Build Event..." exit 1 :VCEnd ] Creating command line "C:\Users\Antoine\AppData\Local\Temp\BAT00012021242476.bat" I have installed Perl and Python 2.7. ---------- components: Build, Extension Modules, Windows messages: 113998 nosy: loewis, pitrou priority: normal severity: normal status: open title: Building SSL fails under 64-bit Windows versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 22:12:26 2010 From: report at bugs.python.org (Neil Harkins) Date: Sun, 15 Aug 2010 20:12:26 +0000 Subject: [New-bugs-announce] [issue9616] copy.deepcopy() copying pointers from a dict/dict/list, should copy values In-Reply-To: <1281903146.28.0.294470710617.issue9616@psf.upfronthosting.co.za> Message-ID: <1281903146.28.0.294470710617.issue9616@psf.upfronthosting.co.za> New submission from Neil Harkins : hi. after using deepcopy() on a nested dict/list structure, i noticed that modifications to the deepcopied structure were affecting the original. this looks to me like a serious bug: >>> import copy >>> foo = { 'a':[1,2,3], 'b':{'c':[4,5]} } >>> bar = copy.deepcopy(foo) >>> id(foo) 4297360512 >>> id(bar) 4297373104 >>> id(foo['a']) 4299410752 >>> id(bar['a']) 4299760200 >>> id(foo['b']) 4297371984 >>> id(bar['b']) 4297373920 >>> id(foo['b']['c']) 4299721040 >>> id(bar['b']['c']) 4299761496 >>> id(foo['b']['c'][0]) 4297074656 >>> id(bar['b']['c'][0]) 4297074656 ---------- components: Extension Modules messages: 114007 nosy: nharkins priority: normal severity: normal status: open title: copy.deepcopy() copying pointers from a dict/dict/list, should copy values type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 23:28:29 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 15 Aug 2010 21:28:29 +0000 Subject: [New-bugs-announce] [issue9617] Buffered IO shouldn't ignore incoming signals during a partial write In-Reply-To: <1281907709.19.0.902405894969.issue9617@psf.upfronthosting.co.za> Message-ID: <1281907709.19.0.902405894969.issue9617@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Prompted by Martin in #9611, here is a patch fixing the new buffered IO layer so that an incoming signal during a successful partial write() doesn't get ignored. Tests included. ---------- components: IO files: sigbufio.patch keywords: patch messages: 114012 nosy: exarkun, loewis, pitrou, rnk priority: normal severity: normal stage: patch review status: open title: Buffered IO shouldn't ignore incoming signals during a partial write type: behavior versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18540/sigbufio.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 00:52:10 2010 From: report at bugs.python.org (Cherniavsky Beni) Date: Sun, 15 Aug 2010 22:52:10 +0000 Subject: [New-bugs-announce] [issue9618] IDLE shell ignores all but first statement In-Reply-To: <1281912730.25.0.579832640698.issue9618@psf.upfronthosting.co.za> Message-ID: <1281912730.25.0.579832640698.issue9618@psf.upfronthosting.co.za> New submission from Cherniavsky Beni : [Spinoff of http://bugs.python.org/issue3559] If you manage to type several simple statements into the prompt (by copy-pasting them, using Ctrl+J, or creative deletion), IDLE runs the first one and silently ignores the rest: >>> x = 1 x = 2 >>> x 1 Moreover, it doesn't even parse the additional lines: >>> x = 3 $@syntax error?! >>> x 3 If the first statement is a compound statement, IDLE refuses with a SyntaxError at the begging of the second statement: >>> def f(): return 42 f() SyntaxError: invalid syntax I believe in both cases the right least-surprise behavior is to run all statements. If not, a clear error explaining that IDLE doesn't support multiple statements must be printed. But I can't see a reason to choose this over making it Just Work. [Implementation: might or might not be related to http://bugs.python.org/issue7741] ---------- components: IDLE messages: 114019 nosy: cben priority: normal severity: normal status: open title: IDLE shell ignores all but first statement versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 01:20:52 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 15 Aug 2010 23:20:52 +0000 Subject: [New-bugs-announce] [issue9619] test_ssl freezes In-Reply-To: <1281914452.35.0.951436005695.issue9619@psf.upfronthosting.co.za> Message-ID: <1281914452.35.0.951436005695.issue9619@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Recently there have been test_ssl freezes on the buildbots. They seem to happen in the asyncore test case: http://www.python.org/dev/buildbot/builders/i386%20Ubuntu%203.x/builds/1903/steps/test/logs/stdio http://www.python.org/dev/buildbot/builders/x86%20Ubuntu%203.x/builds/1742/steps/test/logs/stdio test_asyncore_server (test.test_ssl.ThreadedTests) Check the example asyncore integration. ... server: new connection from 127.0.0.1:36622 client: sending b'FOO\n'... server: read b'FOO\n' from client client: read b'foo\n' client: closing connection. server: read b'over\n' from client server: closed connection server: read b'' from client The only significant change recently in ssl has been r83869, and asyncore doesn't seem to have recent any important changes lately. ---------- components: Library (Lib), Tests messages: 114024 nosy: giampaolo.rodola, pitrou priority: normal severity: normal status: open title: test_ssl freezes versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 09:20:16 2010 From: report at bugs.python.org (beng umali) Date: Mon, 16 Aug 2010 07:20:16 +0000 Subject: [New-bugs-announce] [issue9620] IDLE Message-ID: <1281943216.85.0.864932852857.issue9620@psf.upfronthosting.co.za> Changes by beng umali : ---------- nosy: bpumali priority: normal severity: normal status: open title: IDLE _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 17:39:59 2010 From: report at bugs.python.org (Matt Bond) Date: Mon, 16 Aug 2010 15:39:59 +0000 Subject: [New-bugs-announce] [issue9621] Graphviz output for 2to3 fixer patterns In-Reply-To: <1281973199.06.0.194769344976.issue9621@psf.upfronthosting.co.za> Message-ID: <1281973199.06.0.194769344976.issue9621@psf.upfronthosting.co.za> New submission from Matt Bond : As part of my GSoC project working on 2to3, I've created a script which will allow compiled fixer patterns to be visualized using graphviz. This would be useful for debugging and understanding exactly how patterns are matched. I've written using the 2to3 sandbox as my base. The script is named pat2dot and is found in the scripts directory. The script currently relies on an external graphviz library (I provided bindings for the GvGen library with this patch), they are separated enough from the rest of the code that it would be trivial to create a class that would work using a different graphviz library. Additionally, since the code is never called within 2to3 proper, this dependency will only appear if you wish to use pat2dot, and will not affect any other usages of lib2to3. Usage of the script is `python pat2dot.py fixername` where fixername is any fixer provided in 2to3, as named by 2to3's -l option. ---------- components: 2to3 (2.x to 3.0 conversion tool) files: 2to3-graph.diff keywords: patch messages: 114049 nosy: facundobatista, gmattbond, loewis priority: normal severity: normal status: open title: Graphviz output for 2to3 fixer patterns versions: Python 2.6 Added file: http://bugs.python.org/file18544/2to3-graph.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 19:17:15 2010 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Mon, 16 Aug 2010 17:17:15 +0000 Subject: [New-bugs-announce] [issue9622] Allow to set profile/trace function globally In-Reply-To: <1281979035.75.0.299243674716.issue9622@psf.upfronthosting.co.za> Message-ID: <1281979035.75.0.299243674716.issue9622@psf.upfronthosting.co.za> New submission from Kristj?n Valur J?nsson : issue 9609 updates _lsprof.c to be multi-stack aware. This allows cProfile.Profile() objects to be shared by many threads and provide meaningfull results. This update makes it more convenient to profile running, multi-threaded, applications. By adding a set of global (cross thread) profiling hooks that override the per-thread hooks, it is possible to enable and disable profiling/tracing for the entire program. A multithreaded python could then do something like this: def ProfileMe(t): p = cProfile.Profile() p.enable(global=True) time.sleep(t) p.disable() p.print_stats() A patch is provided, also, an updated _lsprof adding the new 'global' flag to the "enable" function. (This paradigm is used successfully in EVE, albeit with "global" there meaning all tasklets, to do snapshot profiling of a running server. The results are displayed on a web page served by the server backend.) ---------- components: Interpreter Core files: globaltrace.patch keywords: patch, patch messages: 114054 nosy: krisvale priority: normal severity: normal status: open title: Allow to set profile/trace function globally type: feature request versions: Python 3.2 Added file: http://bugs.python.org/file18545/globaltrace.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 21:44:27 2010 From: report at bugs.python.org (Dave Malcolm) Date: Mon, 16 Aug 2010 19:44:27 +0000 Subject: [New-bugs-announce] [issue9623] test_site.py has a couple of stray self.assertTrue calls that test for equality In-Reply-To: <1281987867.95.0.832612777786.issue9623@psf.upfronthosting.co.za> Message-ID: <1281987867.95.0.832612777786.issue9623@psf.upfronthosting.co.za> New submission from Dave Malcolm : test_site.py has a couple of assertions of the form self.assertTrue(len(foo), some number) which appear to be incorrect, and should read: self.assertEqual(len(foo), some number) or assertEquals (that file uses both methods). r76047 fixed some of these, but a couple remain (introduced in r74526) in both 2.7 branch and py3k. Patch attached (for 2.7 branch) ---------- components: Tests keywords: easy, needs review, patch messages: 114069 nosy: dmalcolm priority: normal severity: normal stage: patch review status: open title: test_site.py has a couple of stray self.assertTrue calls that test for equality type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 01:36:35 2010 From: report at bugs.python.org (Jay Ballard) Date: Mon, 16 Aug 2010 23:36:35 +0000 Subject: [New-bugs-announce] [issue9624] 2755 In-Reply-To: <1282001795.13.0.196803574469.issue9624@psf.upfronthosting.co.za> Message-ID: <1282001795.13.0.196803574469.issue9624@psf.upfronthosting.co.za> New submission from Jay Ballard : failure to find drive ---------- components: None messages: 114085 nosy: Kartton priority: normal severity: normal status: open title: 2755 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 11:19:04 2010 From: report at bugs.python.org (Martin Pengelly-Phillips) Date: Tue, 17 Aug 2010 09:19:04 +0000 Subject: [New-bugs-announce] [issue9625] argparse: Problem with defaults for variable nargs In-Reply-To: <1282036744.37.0.964764969496.issue9625@psf.upfronthosting.co.za> Message-ID: <1282036744.37.0.964764969496.issue9625@psf.upfronthosting.co.za> New submission from Martin Pengelly-Phillips : Variable argument count plays badly with choices. Example: ======== >>> import argparse >>> parser = argparse.ArgumentParser() >>> parser.add_argument('choices', nargs='*', default='a', choices=['a', 'b', 'c']) >>> args = parser.parse_args() >>> print type(args.choices) >>> args = parser.parse_args(['a']) >>> print type(args.choices) If the user specifies the value on the command line then a list is used, but if the value comes from the default a string is used. Unfortunately, changing default to a list value gives an error: error: argument choices: invalid choice: ['a'] (choose from 'a', 'b', 'c') Additionally, this means it is also not possible to use default=['a', 'c']. The current workaround is to create a custom type: def my_type(string): if string not in ['a', 'b', 'c']: raise TypeError return string ---------- components: Library (Lib) messages: 114108 nosy: thesociable priority: normal severity: normal status: open title: argparse: Problem with defaults for variable nargs type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 15:14:35 2010 From: report at bugs.python.org (Alexey Luchko) Date: Tue, 17 Aug 2010 13:14:35 +0000 Subject: [New-bugs-announce] [issue9626] OderedDict.viewitems() does not preserve item order In-Reply-To: <1282050875.1.0.267221585344.issue9626@psf.upfronthosting.co.za> Message-ID: <1282050875.1.0.267221585344.issue9626@psf.upfronthosting.co.za> New submission from Alexey Luchko : OrderedDict.viewitems() is expected to preserve item order like items() do >>> from collections import OrderedDict >>> d = OrderedDict([(1, 2), ("a", "b")]) >>> d.items() [(1, 2), ('a', 'b')] But it does not: >>> list(d.viewitems()) [('a', 'b'), (1, 2)] ---------- components: Library (Lib) messages: 114117 nosy: luch priority: normal severity: normal status: open title: OderedDict.viewitems() does not preserve item order type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 15:24:58 2010 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 17 Aug 2010 13:24:58 +0000 Subject: [New-bugs-announce] [issue9627] Regrtest failed to clean up temporary directory In-Reply-To: <1282051498.42.0.53321689124.issue9627@psf.upfronthosting.co.za> Message-ID: <1282051498.42.0.53321689124.issue9627@psf.upfronthosting.co.za> New submission from Nick Coghlan : Watching the Windows buildbot to check if test_dis was working yet, I found this output: http://www.python.org/dev/buildbot/stable/builders/x86%20XP-4%203.x/builds/2774/steps/test/logs/stdio It appears something still had files open in the directory when regrtest was attempting to clean it out. ---------- messages: 114120 nosy: ncoghlan priority: normal severity: normal status: open title: Regrtest failed to clean up temporary directory type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 18:29:37 2010 From: report at bugs.python.org (Dave Malcolm) Date: Tue, 17 Aug 2010 16:29:37 +0000 Subject: [New-bugs-announce] [issue9628] runtests.sh -x doesn't work with more than two args (sed error) In-Reply-To: <1282062577.36.0.157889963246.issue9628@psf.upfronthosting.co.za> Message-ID: <1282062577.36.0.157889963246.issue9628@psf.upfronthosting.co.za> New submission from Dave Malcolm : runtests.sh -x fails to work with more than two tests; for example, running: $ ./runtests.sh -x test_httplib test_http_cookies test_dl erroneously runs test_dl By default, "sed -e s" only substitutes the first match - the invocations within runtests.sh need to add the trailing "g" flag to substitute all matches. >From "info sed": The `s' command can be followed by zero or more of the following FLAGS: `g' Apply the replacement to _all_ matches to the REGEXP, not just the first. Am attaching a patch. (Seen with sed-4.2.1 on Fedora 13) ---------- components: Tests files: fix-sed-invocations-in-runtests.sh.patch keywords: easy, needs review, patch, patch messages: 114134 nosy: dmalcolm priority: normal severity: normal stage: patch review status: open title: runtests.sh -x doesn't work with more than two args (sed error) versions: Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file18554/fix-sed-invocations-in-runtests.sh.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 20:50:13 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 17 Aug 2010 18:50:13 +0000 Subject: [New-bugs-announce] [issue9629] SIZEOF_SOCKET_T used in longobject.h but undefined In-Reply-To: <1282071013.13.0.416867033883.issue9629@psf.upfronthosting.co.za> Message-ID: <1282071013.13.0.416867033883.issue9629@psf.upfronthosting.co.za> New submission from Antoine Pitrou : longobject.h uses SIZEOF_SOCKET_T: #if SIZEOF_SOCKET_T <= SIZEOF_LONG #define PyLong_FromSocket_t(fd) PyLong_FromLong((SOCKET_T)(fd)) #define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLong(fd) #else #define PyLong_FromSocket_t(fd) PyLong_FromLongLong(((SOCKET_T)(fd)); #define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLongLong(fd) #endif but SIZEOF_SOCKET_T doesn't exist at that point since it is defined in Modules/socketmodule.h which isn't part of Include/Python.h. As a result, PyLong_FromSocket_t is always aliased to PyLong_FromLong, which is wrong under 64-bit Windows (a SOCKET is 64-bit there, while a long is 32-bit). ---------- components: Extension Modules messages: 114144 nosy: brian.curtin, christian.heimes, pitrou, tim.golden priority: normal severity: normal stage: needs patch status: open title: SIZEOF_SOCKET_T used in longobject.h but undefined type: behavior versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 01:47:06 2010 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Aug 2010 23:47:06 +0000 Subject: [New-bugs-announce] [issue9630] Reencode filenames of all module and code objects when setting the filesystem encoding In-Reply-To: <1282088826.81.0.444273804054.issue9630@psf.upfronthosting.co.za> Message-ID: <1282088826.81.0.444273804054.issue9630@psf.upfronthosting.co.za> New submission from STINNER Victor : Python 3 has a very important variable: the filesystem encoding, sys.getfilesystemencoding(). It is used to encode and decode filenames to access to the filesystem, to encode program arguments in subprocess, etc. The encoding is hardcoded to "mbcs" on Windows and "utf-8" on Mac OS X. On other OSes, Python gets the encoding from the locale. The problem is that the code getting the locale encoding loads Python modules (eg. locale) and Python uses a default encoding before the locale encoding is known. As a result, modules and code objects created before Python sets the locale encoding are encoded with the old encoding. The default encoding is "utf-8". If the locale encoding is also "utf-8", there is no problem because the filename are correctly encoded. If the locale encoding is different, we keep filenames encoded in the wrong encoding. It becomes worse when the locale encoding is unable to encode the filenames, eg. ASCII encoding. -- A solution would be to avoid loading any Python module, but I don't think that it is possible. The locale encoding can be something different than ascii, latin-1, utf-8 or mbcs. The locale encoding can be an alias like 'utf8' (instead of 'utf-8'), 'iso-8859-1' (Python uses 'latin_1') or 'ANSI_x3.4_1968' (for 'ascii') and encoding aliases are implemented as Lib/encodings/aliases.py which is... a Python module. -- I wrote a patch to reencode filenames of all module and code objects in initfsencoding() when the locale encoding is known. I tested my patch on my import_unicode branch (branch to fix #8611, see also #9425: issue to merge the branch to py3k). I would like one or more reviews of the patch because it is long and complex. Please check for refleaks :-) -- About the patch. I don't know how to list *all* code objects and so I created a list to store weak references to all code objects, list filled by the code object constructor. The list is destroyed at initfsencoding() exit (early in Python initialization). There is a FIXME: I don't know if sys.path_importer_cache keys should also be reencoded. I tried to apply all remarks made on the first patch (posted on Rietveld for #9425). The patch now stores weak references instead of strong references to code objects in the code object list. (r84168 creates PyModule_GetFilenameObject, function needed by this patch) ---------- components: Interpreter Core, Unicode files: reencode_modules_path.patch keywords: patch messages: 114191 nosy: haypo priority: normal severity: normal status: open title: Reencode filenames of all module and code objects when setting the filesystem encoding versions: Python 3.2 Added file: http://bugs.python.org/file18560/reencode_modules_path.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 07:22:33 2010 From: report at bugs.python.org (Prakash Palanivel) Date: Wed, 18 Aug 2010 05:22:33 +0000 Subject: [New-bugs-announce] [issue9631] Python 2.7 installation issue for Linux Red Hat 4.1 In-Reply-To: <1282108953.92.0.943632360126.issue9631@psf.upfronthosting.co.za> Message-ID: <1282108953.92.0.943632360126.issue9631@psf.upfronthosting.co.za> New submission from Prakash Palanivel : Server on Linux:gcc version 4.1.0 20060304 (Red Hat 4.1.0-3) Which "sunaudiodev" library i need to install on linux. Kindly help me how to install or configure or avoid this issue. Error: Python build finished, but the necessary bits to build these modules were not found: _tkinter bsddb185 sunaudiodev To find the necessary bits, look in setup.py in detect_modules() for the module's name. ---------- components: Installation messages: 114196 nosy: spprakash priority: normal severity: normal status: open title: Python 2.7 installation issue for Linux Red Hat 4.1 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 13:56:04 2010 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Aug 2010 11:56:04 +0000 Subject: [New-bugs-announce] [issue9632] Remove sys.setfilesystemencoding() In-Reply-To: <1282132564.59.0.094866961442.issue9632@psf.upfronthosting.co.za> Message-ID: <1282132564.59.0.094866961442.issue9632@psf.upfronthosting.co.za> New submission from STINNER Victor : sys.setfilesystemencoding() function is dangerous because it introduces a lot of inconsistencies: this function is unable to reencode all filenames in all objects (eg. Python is unable to find filenames in user objects or 3rd party libraries). Eg. if you change the filesystem from utf8 to ascii, it will not be possible to use existing non-ascii (unicode) filenames: they will raise UnicodeEncodeError. As sys.setdefaultencoding() in Python2, I think that sys.setfilesystemencoding() is the root of evil :-) PYTHONFSENCODING (issue #8622) is the right solution to set the filesysteme encoding. Attached patch removes sys.setfilesystemencoding(). ---------- components: Library (Lib), Unicode messages: 114211 nosy: haypo priority: normal severity: normal status: open title: Remove sys.setfilesystemencoding() versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 14:17:17 2010 From: report at bugs.python.org (=?utf-8?q?Markus_Pr=C3=B6ller?=) Date: Wed, 18 Aug 2010 12:17:17 +0000 Subject: [New-bugs-announce] [issue9633] pdb go stack up/down In-Reply-To: <1282133837.82.0.171010459939.issue9633@psf.upfronthosting.co.za> Message-ID: <1282133837.82.0.171010459939.issue9633@psf.upfronthosting.co.za> New submission from Markus Pr?ller : Hello, with python 2.7 I encounter the following problem: I have created the following sample script: import pdb def function_1(number): stack_1 = number function_2(stack_1) def function_2(number): stack_2 = number + 1 function_3(stack_2) def function_3(number): stack_3 = number + 1 pdb.set_trace() print stack_3 function_1(1) This is what I have done in the pdb session: > c:\tst_pdb.py(14)function_3() -> print stack_3 (Pdb) l 9 function_3(stack_2) 10 11 def function_3(number): 12 stack_3 = number + 1 13 pdb.set_trace() 14 -> print stack_3 15 16 function_1(1) [EOF] (Pdb) stack_3 3 (Pdb) !stack_3 = 177 (Pdb) !print stack_3 177 (Pdb) u > c:\tst_pdb.py(9)function_2() -> function_3(stack_2) (Pdb) l 4 stack_1 = number 5 function_2(stack_1) 6 7 def function_2(number): 8 stack_2 = number + 1 9 -> function_3(stack_2) 10 11 def function_3(number): 12 stack_3 = number + 1 13 pdb.set_trace() 14 print stack_3 (Pdb) !print stack_2 2 (Pdb) !stack_2 = 144 (Pdb) !print stack_2 144 (Pdb) d > c:\tst_pdb.py(14)function_3() -> print stack_3 (Pdb) l 9 function_3(stack_2) 10 11 def function_3(number): 12 stack_3 = number + 1 13 pdb.set_trace() 14 -> print stack_3 15 16 function_1(1) [EOF] (Pdb) stack_3 3 (Pdb) u > c:\tst_pdb.py(9)function_2() -> function_3(stack_2) (Pdb) !print stack_2 2 (Pdb) I walked through the stack and changed the values of the variables stack_x but the values weren't saved when I moved one frame up/down ---------- components: Library (Lib) messages: 114213 nosy: Markus.Pr?ller priority: normal severity: normal status: open title: pdb go stack up/down type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 19:46:21 2010 From: report at bugs.python.org (Kelly Lucas) Date: Wed, 18 Aug 2010 17:46:21 +0000 Subject: [New-bugs-announce] [issue9634] Add timeout parameter to Queue.join() In-Reply-To: <1282153581.83.0.092560551276.issue9634@psf.upfronthosting.co.za> Message-ID: <1282153581.83.0.092560551276.issue9634@psf.upfronthosting.co.za> New submission from Kelly Lucas : I've seen quite a few people requesting to add a timeout value to the Queue.join() method, as it seems like a nice feature to have when waiting for queue's to finish. Please add a feature so that Queue.join() will issue a self.all_tasks_done.release() when the timeout value is reached. ---------- components: Library (Lib) messages: 114257 nosy: kdlucas priority: normal severity: normal status: open title: Add timeout parameter to Queue.join() versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 01:43:25 2010 From: report at bugs.python.org (Dave Malcolm) Date: Wed, 18 Aug 2010 23:43:25 +0000 Subject: [New-bugs-announce] [issue9635] RFE(patch): add Py_BREAKPOINT and sys.breakpoint hooks In-Reply-To: <1282175005.37.0.905894818052.issue9635@psf.upfronthosting.co.za> Message-ID: <1282175005.37.0.905894818052.issue9635@psf.upfronthosting.co.za> New submission from Dave Malcolm : It's sometimes useful to be able to programatically inject a breakpoint when debugging CPython. For example, sometimes you want a conditional breakpoint, but the logic involved is too complex to be expressed in the debugger (e.g. runtime complexity of evaluating the conditional in the debugger process, or deficiency of the debugger itself). I'm attaching a patch which: - adds a Py_BREAKPOINT macro to pyport.h This is available as a quick and dirty way of hardcoding a breakpoint in code (e.g. in extension modules); so that when you need to you can put of these in (perhaps guarded by C-level conditionals): if (complex_conditional()) { Py_BREAKPOINT(); } - when Py_BREAKPOINT is defined, adds a sys.breakpoint() method. This means that you can add C-level breakpoints to Python scripts, perhaps guarded by python-level conditionals: if foo and bar and not baz: sys.breakpoint() Naturally this is highly system-dependent. Only tested on Linux (Fedora 13 x86_64 with gcc-4.4.4). The Windows implementation was copied from http://bugs.python.org/issue8863 but I don't have a Windows box to test it on. I note that the GLib library within GNOME has a similar idea with a G_BREAKPOINT macro, which has accumulated a collection of platform-specific logic: http://git.gnome.org/browse/glib/tree/glib/gbacktrace.h (unfortunately that's LGPLv2+ licensed) Doesn't yet have a unit test. Note that when running on Linux when _not_ under a debugger, the default for SIGTRAP is to get a coredump: Trace/breakpoint trap (core dumped) so people should be strongly discouraged from adding these calls to their code. ---------- components: Interpreter Core, Library (Lib) files: add-sys.breakpoint.patch keywords: patch, patch messages: 114301 nosy: dmalcolm, haypo priority: normal severity: normal stage: patch review status: open title: RFE(patch): add Py_BREAKPOINT and sys.breakpoint hooks type: feature request versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file18572/add-sys.breakpoint.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 02:47:27 2010 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Aug 2010 00:47:27 +0000 Subject: [New-bugs-announce] [issue9636] {'key': 'value'}[b'key'] raises a BytesWarning In-Reply-To: <1282178847.04.0.326162016951.issue9636@psf.upfronthosting.co.za> Message-ID: <1282178847.04.0.326162016951.issue9636@psf.upfronthosting.co.za> New submission from STINNER Victor : With python3 -bb: {'key': 'value'}[b'key'] raises a BytesWarning, but {'key': 'value'}[b'missing_key'] doesn't. The warning is unexpected here because it's an implicit comparaison (I mean, different than an explicit: 'key' == b'key'), we cannot check that the dict keys are all bytes / unicode (at least, I don't want to). And so I think that it should be fixed. First lookdict_unicode() is used because all dict keys are unicode, but lookdict_unicode() falls back to lookdict() because the asked key type is not unicode. lookdict() checks the hash: they matches, hash('key') == hash(b'key'). Then it compares the two key objects with PyObject_RichCompareBool(startkey, key, Py_EQ). PyUnicode_RichCompare() returns NotImplemented, and so bytes_richcompare() is called. Finally, bytes_richcompare() raises the BytesWarning. ---------- components: Interpreter Core, Unicode messages: 114314 nosy: haypo priority: normal severity: normal status: open title: {'key': 'value'}[b'key'] raises a BytesWarning versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 07:44:29 2010 From: report at bugs.python.org (Kirikaza) Date: Thu, 19 Aug 2010 05:44:29 +0000 Subject: [New-bugs-announce] [issue9637] docs do not say that urllib uses HTTP_PROXY In-Reply-To: <1282196669.74.0.629180904202.issue9637@psf.upfronthosting.co.za> Message-ID: <1282196669.74.0.629180904202.issue9637@psf.upfronthosting.co.za> New submission from Kirikaza : In practice urllib reads HTTP_PROXY firstly and then if HTTP_PROXY is empty urllib reads http_proxy. Documentation (http://docs.python.org/library/urllib.html) says nothing about HTTP_PROXY. Maybe it affects all the versions of Python. ---------- assignee: docs at python components: Documentation messages: 114319 nosy: docs at python, kirikaza priority: normal severity: normal status: open title: docs do not say that urllib uses HTTP_PROXY versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 08:57:39 2010 From: report at bugs.python.org (Mark Lawrence) Date: Thu, 19 Aug 2010 06:57:39 +0000 Subject: [New-bugs-announce] [issue9638] remove dead code from py3k imaplib In-Reply-To: <1282201059.85.0.738229053301.issue9638@psf.upfronthosting.co.za> Message-ID: <1282201059.85.0.738229053301.issue9638@psf.upfronthosting.co.za> New submission from Mark Lawrence : The title says it all. ---------- files: imaplibpy3k.diff keywords: patch messages: 114331 nosy: BreamoreBoy priority: normal severity: normal stage: patch review status: open title: remove dead code from py3k imaplib versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18573/imaplibpy3k.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 11:11:50 2010 From: report at bugs.python.org (Marcus Huewe) Date: Thu, 19 Aug 2010 09:11:50 +0000 Subject: [New-bugs-announce] [issue9639] urllib2's AbstractBasicAuthHandler is limited to 6 requests In-Reply-To: <1282209110.27.0.244600135673.issue9639@psf.upfronthosting.co.za> Message-ID: <1282209110.27.0.244600135673.issue9639@psf.upfronthosting.co.za> New submission from Marcus Huewe : It seems that commit r81636 broke urllib2's AbstractBasicAuthHandler because the "retried" attribute isn't reset on success. Therefore it's limited to 6 requests. The attached patch should fix this problem. ---------- components: Library (Lib) files: urllib2-AbstractBasicAuthHandler_reset_attr.diff keywords: patch messages: 114336 nosy: mhuewe priority: normal severity: normal status: open title: urllib2's AbstractBasicAuthHandler is limited to 6 requests type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file18574/urllib2-AbstractBasicAuthHandler_reset_attr.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 13:04:11 2010 From: report at bugs.python.org (W. Trevor King) Date: Thu, 19 Aug 2010 11:04:11 +0000 Subject: [New-bugs-announce] [issue9640] Improved doctest REPORT_*DIFFs with ELLIPSIS and/or NORMALIZE_WHITESPACE In-Reply-To: <1282215851.54.0.826836496752.issue9640@psf.upfronthosting.co.za> Message-ID: <1282215851.54.0.826836496752.issue9640@psf.upfronthosting.co.za> New submission from W. Trevor King : I had been struggling to find the failure-causing mismatch in a doctest with lots of output. REPORT_UDIFF gave lots of false mismatches because I was also using NORMALIZE_WHITESPACE. Looking through the doctest.py source, I saw a comment suggesting a nicer diff in the similar REPORT_*DIFF and ELLIPSIS situation. So I went ahead and implemented one. I'm not super happy with the cleanliness of the implementation, but it ended up being a bit trickier than I'd initially expected. ---------- components: Library (Lib) messages: 114340 nosy: labrat priority: normal severity: normal status: open title: Improved doctest REPORT_*DIFFs with ELLIPSIS and/or NORMALIZE_WHITESPACE type: feature request versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 13:29:29 2010 From: report at bugs.python.org (Anders Sandvig) Date: Thu, 19 Aug 2010 11:29:29 +0000 Subject: [New-bugs-announce] [issue9641] httplib/ftplib: timeout parameter not applied correctly In-Reply-To: <1282217369.56.0.577376889076.issue9641@psf.upfronthosting.co.za> Message-ID: <1282217369.56.0.577376889076.issue9641@psf.upfronthosting.co.za> New submission from Anders Sandvig : >From : Consider the following code for retreieving a web page using httplib: def get_url(hostname, port, url, timeout=5): con = httplib.HTTPConnection(hostname, port, timeout) con.request("GET", url) res = con.getresponse() data = res.read() return res, data As expected, this will raise a socket.error if the client is unable to connect before the timeout has expired. However, once the connection has been made, the timeout parameter no longer has any effect and con.getresponse() will block forever if the server does not send any data. I think the reason for this is that the socket object created in HTTPConnection.connect() has a default timeout of 0 (i.e. it is never set explicitly): def connect(self): """Connect to the host and port specified in __init__.""" self.sock = socket.create_connection((self.host,self.port), self.timeout) For now I have been able to work around this by manually setting the timeout of the (private) socket object after calling con.request(), like this: ... con.request("GET", url) con.sock.settimeout(timeout) res = con.getresponse() ... However, I don't think this is a very good solution as it relies on knowledge about the inner workings of httplib (and I had to read the library source code to come up with it). >From the top of my head, I can come up with three (four) ways of properly solving the issue: 1) Documenting the timeout behavior and describing the above hack in the httplib documentation. 2) Modify HTTPConnection.connect() to set the timeout on the socket object after it has been created (using the same timeout as given on the HTTPConnection constructor). 3) Adding (optional) timeout parameters to HTTPConnection.getresponse() and HTTPResponse.read() (and possibly other functions with the same problem). 4) A combination of 2) and 3). [...] ---------- components: Library (Lib) messages: 114343 nosy: anders.sandvig priority: normal severity: normal status: open title: httplib/ftplib: timeout parameter not applied correctly type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 14:02:28 2010 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Aug 2010 12:02:28 +0000 Subject: [New-bugs-announce] [issue9642] #ifdef and mbcs: don't check for defined(HAVE_USABLE_WCHAR_T) In-Reply-To: <1282219348.43.0.267719038373.issue9642@psf.upfronthosting.co.za> Message-ID: <1282219348.43.0.267719038373.issue9642@psf.upfronthosting.co.za> New submission from STINNER Victor : mbcs codec functions are surrounded by: #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) (especially in unicodeobject.c and _codecsmodule.c) or #ifdef MS_WIN32 (in unicodeobject.h) or #if defined(MS_WINDOWS) && !defined(__BORLANDC__) (in timemodule.c) I think that all of these tests are wrong. We should just check that we are compiling under Windows: mbcs functions don't use the wchar_t type. And it's better to use the same test in all tests (MS_WIN32 vs MS_WINDOWS). Attached patch replaces all #ifdef (except the one in timemodule.c because I don't know what to do with the BORLAND check, does anyone use this compiler?). I suppose that my patch doesn't change anything in pratice because mbcs is used in many places and noboby complained that mbcs encoding was missing on Windows. ---------- components: Unicode, Windows files: ifdef_mbcs.patch keywords: patch messages: 114350 nosy: brian.curtin, haypo, tim.golden priority: normal severity: normal status: open title: #ifdef and mbcs: don't check for defined(HAVE_USABLE_WCHAR_T) versions: Python 3.2 Added file: http://bugs.python.org/file18577/ifdef_mbcs.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 19:59:11 2010 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 19 Aug 2010 17:59:11 +0000 Subject: [New-bugs-announce] [issue9643] urllib2 - Basic, Digest Auth Handlers Retry will give 401 code instead of 407 In-Reply-To: <1282240751.95.0.79564995249.issue9643@psf.upfronthosting.co.za> Message-ID: <1282240751.95.0.79564995249.issue9643@psf.upfronthosting.co.za> New submission from Senthil Kumaran : The retry logic and code used by ProxyBasicAuthHandler and ProxyDigestAuthHandler are same as normal authentication handlers. While this reuse is good, there is a problem that, on authentication failure, the HTTPError code is hardcoded to 401, whereas for Proxy cases it should have been 407. The problematic line is this: def http_error_auth_reqed(self, auth_header, host, req, headers): ... raise HTTPError(req.full_url, 401, "digest auth failed", headers, None) can be changed by: - Passing the errcode as arg. - Or getting it from headers. ---------- assignee: orsenthil messages: 114386 nosy: orsenthil priority: normal severity: normal status: open title: urllib2 - Basic,Digest Auth Handlers Retry will give 401 code instead of 407 versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 20:40:37 2010 From: report at bugs.python.org (David Watson) Date: Thu, 19 Aug 2010 18:40:37 +0000 Subject: [New-bugs-announce] [issue9644] PEP 383: os.statvfs() does not accept surrogateescape arguments In-Reply-To: <1282243237.49.0.435221885834.issue9644@psf.upfronthosting.co.za> Message-ID: <1282243237.49.0.435221885834.issue9644@psf.upfronthosting.co.za> New submission from David Watson : The statvfs() function still converts its argument with the "s" format; the attached patch (for 3.2) fixes it to use PyUnicode_FSConverter(). ---------- components: Extension Modules files: statvfs-pep383-3.2.diff keywords: patch messages: 114392 nosy: baikie priority: normal severity: normal status: open title: PEP 383: os.statvfs() does not accept surrogateescape arguments type: behavior versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18578/statvfs-pep383-3.2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 20:41:33 2010 From: report at bugs.python.org (David Watson) Date: Thu, 19 Aug 2010 18:41:33 +0000 Subject: [New-bugs-announce] [issue9645] PEP 383: os.pathconf() does not accept surrogateescape arguments In-Reply-To: <1282243293.83.0.904461489597.issue9645@psf.upfronthosting.co.za> Message-ID: <1282243293.83.0.904461489597.issue9645@psf.upfronthosting.co.za> New submission from David Watson : The pathconf() function still converts its argument with the "s" format; the attached pathconf-pep383-3.2.diff fixes it to use PyUnicode_FSConverter() (in 3.2). Also attaching pathconf-cleanup.diff to clean up the indentation, which otherwise makes the code rather confusing to look at. ---------- components: Extension Modules files: pathconf-pep383-3.2.diff keywords: patch messages: 114393 nosy: baikie priority: normal severity: normal status: open title: PEP 383: os.pathconf() does not accept surrogateescape arguments type: behavior versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18579/pathconf-pep383-3.2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 20:42:10 2010 From: report at bugs.python.org (=?utf-8?q?S=C3=A9rgio_Surkamp?=) Date: Thu, 19 Aug 2010 18:42:10 +0000 Subject: [New-bugs-announce] [issue9646] Mutable default function parameter warning In-Reply-To: <1282243330.02.0.3448153911.issue9646@psf.upfronthosting.co.za> Message-ID: <1282243330.02.0.3448153911.issue9646@psf.upfronthosting.co.za> New submission from S?rgio Surkamp : The documentation states that the default value of function parameter, if mutable, can change it's default value at runtime due to be evaluated only once on function object creation. I would like to suggest the inclusion of an default language warning when this kind of construction is used, as it's Python specific behavior and can lead to "strange behavior" or misuse by programmers that are migrating from other languages to Python. Documentation reference: http://docs.python.org/reference/compound_stmts.html#function ---------- components: None messages: 114394 nosy: surkamp priority: normal severity: normal status: open title: Mutable default function parameter warning type: behavior versions: Python 2.5, Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 20:44:53 2010 From: report at bugs.python.org (David Watson) Date: Thu, 19 Aug 2010 18:44:53 +0000 Subject: [New-bugs-announce] [issue9647] os.confstr() does not handle value changing length between calls In-Reply-To: <1282243493.08.0.1214343728.issue9647@psf.upfronthosting.co.za> Message-ID: <1282243493.08.0.1214343728.issue9647@psf.upfronthosting.co.za> New submission from David Watson : This came up in relation to issue #9579; there is some discussion of it there. Basically, if os.confstr() has to call confstr() twice because the buffer wasn't big enough the first time, the existing code assumes the string is the same length that the OS reported in the first call instead of using the length from the second call and resizing the buffer if necessary. This means the returned value will be truncated or contain trailing garbage if the string changed its length betweeen calls. I don't know of an actual environment where configuration strings can change at runtime, but it's not forbidden by POSIX as far as I can see (the strings are described as "variables", after all, and sysconf() values such as CHILD_MAX can change at runtime). Implementations can also provide additional confstr() variables not specified by POSIX. The patch confstr-long-result.diff at issue #9579 would fix this (for 3.x), but Victor Stinner has expressed concern that a buggy confstr() could create a near-infinite loop with that patch applied. ---------- components: Extension Modules messages: 114396 nosy: baikie priority: normal severity: normal status: open title: os.confstr() does not handle value changing length between calls type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 03:59:37 2010 From: report at bugs.python.org (Brian Curtin) Date: Fri, 20 Aug 2010 01:59:37 +0000 Subject: [New-bugs-announce] [issue9648] 2to3 doesn't convert "file" usage to an "open" equivalent In-Reply-To: <1282269577.88.0.849452359327.issue9648@psf.upfronthosting.co.za> Message-ID: <1282269577.88.0.849452359327.issue9648@psf.upfronthosting.co.za> New submission from Brian Curtin : """ with file("sample.py", "r") as f: pass """ The above code comes out of 2to3 with no modifications suggested. "file" is gone in 3.x and could be substituted with "open" usage in most cases. We would also have to handle or otherwise notify the user about code like "isinstance(x, file)". ---------- messages: 114417 nosy: brian.curtin priority: normal severity: normal stage: needs patch status: open title: 2to3 doesn't convert "file" usage to an "open" equivalent type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 17:43:16 2010 From: report at bugs.python.org (Mike Dirolf) Date: Fri, 20 Aug 2010 15:43:16 +0000 Subject: [New-bugs-announce] [issue9649] wrong default for sort_keys in json module documentation In-Reply-To: <1282318996.73.0.279349248821.issue9649@psf.upfronthosting.co.za> Message-ID: <1282318996.73.0.279349248821.issue9649@psf.upfronthosting.co.za> New submission from Mike Dirolf : The json module docs state that sort_keys defaults to True. From the source it looks like it actually defaults to False. Patch attached. ---------- assignee: docs at python components: Documentation files: sort_keys_json.patch keywords: patch messages: 114426 nosy: docs at python, mdirolf priority: normal severity: normal status: open title: wrong default for sort_keys in json module documentation versions: Python 2.7 Added file: http://bugs.python.org/file18584/sort_keys_json.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 17:49:40 2010 From: report at bugs.python.org (Catherine Devlin) Date: Fri, 20 Aug 2010 15:49:40 +0000 Subject: [New-bugs-announce] [issue9650] format codes in time.strptime docstrings In-Reply-To: <1282319380.5.0.724924373031.issue9650@psf.upfronthosting.co.za> Message-ID: <1282319380.5.0.724924373031.issue9650@psf.upfronthosting.co.za> New submission from Catherine Devlin : Is there any reason not to include the strftime formatting codes in the docstrings of time.strftime and time.strptime? >>> print time.strftime.__doc__ strftime(format[, tuple]) -> string Convert a time tuple to a string according to a format specification. See the library reference manual for formatting codes. When the time tuple is not present, current time as returned by localtime() is used. Sending users to look up such a basic, frequently-used, hard-to-remember set of codes in the docs every single time seems unfriendly. Even a tightly abbreviated list would be very convenient. ---------- components: Library (Lib) messages: 114427 nosy: catherine priority: normal severity: normal status: open title: format codes in time.strptime docstrings type: feature request versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 19:10:01 2010 From: report at bugs.python.org (=?utf-8?b?QW5kcsOpIEJqw6RyYnk=?=) Date: Fri, 20 Aug 2010 17:10:01 +0000 Subject: [New-bugs-announce] [issue9651] ctypes crash when writing zerolength string buffer to file In-Reply-To: <1282324201.94.0.528743574069.issue9651@psf.upfronthosting.co.za> Message-ID: <1282324201.94.0.528743574069.issue9651@psf.upfronthosting.co.za> New submission from Andr? Bj?rby : The attached (5 line) file will crash ctypes (Python 2.6.6rc2) with a "Floating point exception" (division by zero at _ctypes.c:2533). There's no crash with python 2.5.5 ---------- assignee: theller components: ctypes files: test.py messages: 114430 nosy: andbj, theller priority: normal severity: normal status: open title: ctypes crash when writing zerolength string buffer to file type: crash versions: Python 2.6 Added file: http://bugs.python.org/file18586/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 22:56:59 2010 From: report at bugs.python.org (Tom Browder) Date: Fri, 20 Aug 2010 20:56:59 +0000 Subject: [New-bugs-announce] [issue9652] Tidy argparse default output In-Reply-To: <1282337819.1.0.781769535861.issue9652@psf.upfronthosting.co.za> Message-ID: <1282337819.1.0.781769535861.issue9652@psf.upfronthosting.co.za> New submission from Tom Browder : I would like to be able to change argparse default strings so the first word is capitalized. In lieu of that, I propose the attached patch to 2.7 which changes them in the source code. ---------- components: Library (Lib) files: python-v2.7-argparser-patch.txt messages: 114455 nosy: Tom.Browder priority: normal severity: normal status: open title: Tidy argparse default output type: feature request versions: Python 2.7 Added file: http://bugs.python.org/file18590/python-v2.7-argparser-patch.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 23:04:48 2010 From: report at bugs.python.org (Tom Browder) Date: Fri, 20 Aug 2010 21:04:48 +0000 Subject: [New-bugs-announce] [issue9653] New default argparse output to be added In-Reply-To: <1282338288.42.0.879106308654.issue9653@psf.upfronthosting.co.za> Message-ID: <1282338288.42.0.879106308654.issue9653@psf.upfronthosting.co.za> New submission from Tom Browder : When I use the argparse module, and I enter my program name with NO arguments or options, I would like the argparser to output something like: Usage: [options] Use option '-h' for help. I haven't yet found how to do that in the argparse module source code, but I do that now in my programs by adding this code near the beginning of the program: # give rudimentary help if nothing but prog name is entered import os # get program name as it is called pnam = os.path.basename(sys.argv[0]) Use = "Usage: {0} [options]".format(pnam) if len(sys.argv) == 1: print(Use) print("Use option '-h' for help.") sys.exit() ---------- components: Library (Lib) messages: 114457 nosy: Tom.Browder priority: normal severity: normal status: open title: New default argparse output to be added type: feature request versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 23:41:09 2010 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 20 Aug 2010 21:41:09 +0000 Subject: [New-bugs-announce] [issue9654] merge PC/getpathp.c into Modules/getpath.c In-Reply-To: <1282340469.22.0.133345899544.issue9654@psf.upfronthosting.co.za> Message-ID: <1282340469.22.0.133345899544.issue9654@psf.upfronthosting.co.za> New submission from Amaury Forgeot d'Arc : The file Modules/getpath.c computes sys.prefix and the initial sys.path. The Windows version uses its own copy of this file, with a lot of similarities, but also non-obvious differences. I propose to merge both files, this would ease maintenance and understanding of how these paths are determined. ---------- components: Build messages: 114460 nosy: amaury.forgeotdarc, brian.curtin priority: normal severity: normal status: open title: merge PC/getpathp.c into Modules/getpath.c type: feature request versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 12:27:34 2010 From: report at bugs.python.org (Albert Weichselbraun) Date: Sat, 21 Aug 2010 10:27:34 +0000 Subject: [New-bugs-announce] [issue9655] urllib2 fails to retrieve a url which is handled correctly by urllib In-Reply-To: <1282386454.2.0.0653465391263.issue9655@psf.upfronthosting.co.za> Message-ID: <1282386454.2.0.0653465391263.issue9655@psf.upfronthosting.co.za> New submission from Albert Weichselbraun : urllib2 fails to retrieve the content of http://www.mfsa.com.mt/insguide/english/glossarysearch.jsp?letter=all >>> urllib2.urlopen("http://www.mfsa.com.mt/insguide/english/glossarysearch.jsp?letter=all").read() '' urllib handles the same link correctly: >>> len( urllib.urlopen("http://www.mfsa.com.mt/insguide/english/glossarysearch.jsp?letter=all").read() ) 56105 ---------- components: Library (Lib) messages: 114482 nosy: Albert.Weichselbraun priority: normal severity: normal status: open title: urllib2 fails to retrieve a url which is handled correctly by urllib type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 18:32:27 2010 From: report at bugs.python.org (Kay Hayen) Date: Sat, 21 Aug 2010 16:32:27 +0000 Subject: [New-bugs-announce] [issue9656] compiler module provides wrong AST for extended slice of length 1 In-Reply-To: <1282408347.11.0.146975597015.issue9656@psf.upfronthosting.co.za> Message-ID: <1282408347.11.0.146975597015.issue9656@psf.upfronthosting.co.za> New submission from Kay Hayen : Please check the following: [GCC 4.4.5 20100728 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import compiler >>> compiler.parse( "d[1,] = None" ) Module(None, Stmt([Assign([Subscript(Name('d'), 'OP_ASSIGN', [Const(1)])], Name('None'))])) >>> compiler.parse( "d[1] = None" ) Module(None, Stmt([Assign([Subscript(Name('d'), 'OP_ASSIGN', [Const(1)])], Name('None'))])) >>> d = {} >>> d[1,] = None >>> d[1] = None >>> d {1: None, (1,): None} As you can see d[1] = None and d[1,] = None do different things, but do they lead to the same abstract syntax tree. It's the same on Python 2.7: Python 2.7.0+ (r27:82500, Aug 7 2010, 19:41:51) [GCC 4.4.5 20100728 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import compiler >>> compiler.parse( "d[1,] = None" ) Module(None, Stmt([Assign([Subscript(Name('d'), 'OP_ASSIGN', [Const(1)])], Name('None'))])) >>> compiler.parse( "d[1] = None" ) Module(None, Stmt([Assign([Subscript(Name('d'), 'OP_ASSIGN', [Const(1)])], Name('None'))])) ---------- components: Library (Lib) messages: 114507 nosy: kayhayen priority: normal severity: normal status: open title: compiler module provides wrong AST for extended slice of length 1 type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 20:43:59 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 21 Aug 2010 18:43:59 +0000 Subject: [New-bugs-announce] [issue9657] Add circular imports test In-Reply-To: <1282416239.8.0.283191331068.issue9657@psf.upfronthosting.co.za> Message-ID: <1282416239.8.0.283191331068.issue9657@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Here is a test for multi-threaded circular imports (in order to exercise the import lock), following a comment by Graham Dumpleton on #9260. ---------- components: Tests files: circulartest.patch keywords: patch messages: 114541 nosy: brett.cannon, ncoghlan, pitrou priority: normal severity: normal stage: patch review status: open title: Add circular imports test type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file18600/circulartest.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 21:44:22 2010 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 21 Aug 2010 19:44:22 +0000 Subject: [New-bugs-announce] [issue9658] weakref.proxy unequal to its referent in 2.x In-Reply-To: <1282419862.51.0.264413322839.issue9658@psf.upfronthosting.co.za> Message-ID: <1282419862.51.0.264413322839.issue9658@psf.upfronthosting.co.za> New submission from Mark Dickinson : Nicholas Cole noted on python-list that the behaviour of weakref.proxy with respect to equality changed between 2.x and 3.x: Python 2.7 (r27:82500, Aug 15 2010, 14:21:15) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import weakref >>> s = set() >>> s == weakref.proxy(s) False Python 3.1.2 (r312:79147, Aug 20 2010, 20:06:00) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import weakref >>> s = set() >>> s == weakref.proxy(s) True This seems to be an inadvertent change resulting from the switch from 3-way comparisons to rich comparisons: the 2.x source implements tp_compare for proxy objects. The tp_compare slot *does* unwrap the proxy objects before comparing, but since the tp_compare slot in general is only ever called (for objects implemented in C) when the types of the objects being compared are the same, a proxy object won't compare equal to its referent. I believe that Nicholas ran into this when using weakrefs as elements of containers. Nicholas: is that right? Care to elaborate? The 3.x source changes this to use tp_richcompare (see r51533), so now a proxy object *does* compare equal to its referent. The 3.x behaviour seems better to my limited eyes, and the 2.x behaviour has been around a long time without causing problems, so we probably don't want to change the behaviour in either case. But it might be good to document the difference somewhere. ---------- messages: 114557 nosy: mark.dickinson priority: normal severity: normal status: open title: weakref.proxy unequal to its referent in 2.x type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 16:42:21 2010 From: report at bugs.python.org (Carsten Klein) Date: Sun, 22 Aug 2010 14:42:21 +0000 Subject: [New-bugs-announce] [issue9659] frozenset, when subclassed will yield warning upon call to super(...).__init__(iterable) In-Reply-To: <1282488141.53.0.297735015406.issue9659@psf.upfronthosting.co.za> Message-ID: <1282488141.53.0.297735015406.issue9659@psf.upfronthosting.co.za> New submission from Carsten Klein : Example class a(frozenset): def __init__(self, iterable): super(a, self).__init__(iterable) i = a([1,2,3]) > __main__:3: DeprecationWarning: object.__init__() takes no parameters > a([1, 2, 3]) This might be due to the fact that the frozenset type structure does not initialize the tp_init field in setobject.c, thus inheriting the original __init__ from object. Subclassing set will not issue that warning as it actually defines the tp_init field to (initroc)set_init. This holds true also for the Python 2.7 release and maybe also later releases. Expected behaviour: do not output that warning message and provide an initproc for the tp_field. ---------- components: None messages: 114676 nosy: carsten.klein at axn-software.de priority: normal severity: normal status: open title: frozenset, when subclassed will yield warning upon call to super(...).__init__(iterable) type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 20:26:02 2010 From: report at bugs.python.org (David Watson) Date: Sun, 22 Aug 2010 18:26:02 +0000 Subject: [New-bugs-announce] [issue9660] PEP 383: socket module doesn't handle undecodable protocol or service names In-Reply-To: <1282501562.64.0.000983913636939.issue9660@psf.upfronthosting.co.za> Message-ID: <1282501562.64.0.000983913636939.issue9660@psf.upfronthosting.co.za> New submission from David Watson : The protocol and service/port number databases are typically implemented as text files on Unix and can contain non-ASCII names in any encoding (presumably for local services), but the socket module tries to decode them as strict UTF-8. In particular, getservbyport() and getnameinfo() will raise UnicodeError when this fails. Attached is a patch for 3.2 to use the file system encoding and surrogateescape handler instead, in line with PEP 383. This is what Python already does for the passwd and group databases, and it will allow protocol and service names to be given correctly as command line arguments. ---------- components: Extension Modules files: proto-service-pep383-3.2.diff keywords: patch messages: 114687 nosy: baikie priority: normal severity: normal status: open title: PEP 383: socket module doesn't handle undecodable protocol or service names type: behavior versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18608/proto-service-pep383-3.2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 20:51:18 2010 From: report at bugs.python.org (Brodie Rao) Date: Sun, 22 Aug 2010 18:51:18 +0000 Subject: [New-bugs-announce] [issue9661] 2to3 except fixer does the wrong thing for certain raise statements In-Reply-To: <1282503078.33.0.815316651161.issue9661@psf.upfronthosting.co.za> Message-ID: <1282503078.33.0.815316651161.issue9661@psf.upfronthosting.co.za> New submission from Brodie Rao : Given the following statements: raise Foo('bar'), None, baz raise Foo('bar'), None 2to3 produces: raise Foo('bar')(None).with_traceback(baz) raise Foo('bar')(None) Instead of: raise Foo('bar').with_traceback(baz) raise Foo('bar') ---------- components: 2to3 (2.x to 3.0 conversion tool) messages: 114694 nosy: brodie priority: normal severity: normal status: open title: 2to3 except fixer does the wrong thing for certain raise statements type: behavior versions: Python 2.6, Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 22:45:24 2010 From: report at bugs.python.org (Brett Cannon) Date: Sun, 22 Aug 2010 20:45:24 +0000 Subject: [New-bugs-announce] [issue9662] ctypes not building under OS X because of ffi_closure_free not being defined early enough In-Reply-To: <1282509924.5.0.810083084534.issue9662@psf.upfronthosting.co.za> Message-ID: <1282509924.5.0.810083084534.issue9662@psf.upfronthosting.co.za> New submission from Brett Cannon : When I build under OS X 10.6 with LLVM I get four warnings of the type: /Users/brett/Dev/python/3.x/scratch/Modules/_ctypes/callbacks.c:20:9: warning: implicit declaration of function 'ffi_closure_free' is invalid in C99 [-Wimplicit-function-declaration] ffi_closure_free(self->pcl_write); ^ They are for ffi_closure_free, ffi_closure_alloc, and ffi_prep_closure_loc. ---------- assignee: theller components: ctypes messages: 114704 nosy: brett.cannon, theller priority: release blocker severity: normal stage: needs patch status: open title: ctypes not building under OS X because of ffi_closure_free not being defined early enough type: compile error versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 00:24:13 2010 From: report at bugs.python.org (Brett Cannon) Date: Sun, 22 Aug 2010 22:24:13 +0000 Subject: [New-bugs-announce] [issue9663] importlib should exclusively open bytecode files In-Reply-To: <1282515853.22.0.456551292376.issue9663@psf.upfronthosting.co.za> Message-ID: <1282515853.22.0.456551292376.issue9663@psf.upfronthosting.co.za> New submission from Brett Cannon : Importlib does not use any OS-level protections to gain exclusivity when opening a file like import.c does through open_exclusive. It probably should, though, when writing bytecode else one might end up with corrupt code. That's bad as bad marshal data is a flat-out import failure and not simply glossed over. Plus if I don't do this now I will just end up getting a bug report that test_multiprocessing is randomly failing on the buildbots because of this issue since that "precious" little test seems to love to ferret out concurrency issues in importlib. ---------- assignee: brett.cannon components: Library (Lib) messages: 114714 nosy: brett.cannon priority: normal severity: normal stage: unit test needed status: open title: importlib should exclusively open bytecode files type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 10:06:50 2010 From: report at bugs.python.org (Matthias Klose) Date: Mon, 23 Aug 2010 08:06:50 +0000 Subject: [New-bugs-announce] [issue9664] Make gzip module not require that underlying file object support seek In-Reply-To: <1282550810.11.0.164823540463.issue9664@psf.upfronthosting.co.za> Message-ID: <1282550810.11.0.164823540463.issue9664@psf.upfronthosting.co.za> New submission from Matthias Klose : [ forwarded from http://bugs.debian.org/571317 ] "I'm writing a program that uses the popularity contest results. Since downloading the compressed results takes about a quarter of the time it takes to download the uncompressed results, I'd like to use the following construct to iterate over the results: for line in gzip.GzipFile(fileobj=urllib.request.urlopen('http://popcon.debian.org/by_vote.gz')): Unfortunately, this fails with the following exception: Traceback (most recent call last): File "/home/kraai/bin/rc-bugs", line 76, in main() File "/home/kraai/bin/rc-bugs", line 56, in main for line in gzip.GzipFile(fileobj=urllib.request.urlopen('http://popcon.debian.org/by_vote.gz')): File "/usr/lib/python3.1/gzip.py", line 469, in __next__ line = self.readline() File "/usr/lib/python3.1/gzip.py", line 424, in readline c = self.read(readsize) File "/usr/lib/python3.1/gzip.py", line 249, in read self._read(readsize) File "/usr/lib/python3.1/gzip.py", line 277, in _read pos = self.fileobj.tell() # Save current position io.UnsupportedOperation: seek I wish that the gzip module didn't require the underlying file object to support seek so that this construct would work." ---------- messages: 114728 nosy: doko priority: normal severity: normal status: open title: Make gzip module not require that underlying file object support seek versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 23:32:01 2010 From: report at bugs.python.org (Brian Curtin) Date: Mon, 23 Aug 2010 21:32:01 +0000 Subject: [New-bugs-announce] [issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io In-Reply-To: <1282599121.2.0.918330648156.issue9665@psf.upfronthosting.co.za> Message-ID: <1282599121.2.0.918330648156.issue9665@psf.upfronthosting.co.za> New submission from Brian Curtin : Using Cygwin 1.7, there are build failures for both _curses, _curses_panel, and _io. The curses failures are because symlinking /usr/include/{n}curses.h from /usr/include/{n}curses.h was removed in recent versions [0], so I added "-I/usr/include/ncurses" to the BASECFLAGS for cygwin. Not knowing the ins and outs of gcc/configure/make, I doubt the patch (ncurses_fix.diff) is correct or complete. It works on my machine so at least it's a starting point (maybe?). _io gets the following warning and then later failure on gcc 4.3.4: /cygdrive/c/Users/bcurtin/cygwin-python/release27-maint/Modules/_io/_iomodule.c:172: warning: ?PyExc_BlockingIOError? redeclared without dllimport attribute: previous dllimport ignored ... build/temp.cygwin-1.7.5-i686-2.7/cygdrive/c/Users/bcurtin/cygwin-python/release27-maint/Modules/_io/bufferedio.o: In function `_buffered_check_blocking_error': /cygdrive/c/Users/bcurtin/cygwin-python/release27-maint/Modules/_io/bufferedio.c:558: undefined reference to `__imp__PyExc_BlockingIOError' /cygdrive/c/Users/bcurtin/cygwin-python/release27-maint/Modules/_io/bufferedio.c:558: undefined reference to `__imp__PyExc_BlockingIOError' My Linux compile (gcc 4.5.0) gets the same warning, but no error. Windows is totally fine with _iomodule.c:172. This was found by Ben Walker. [0] http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html ---------- assignee: brian.curtin components: Build, Extension Modules, Windows files: ncurses_fix.diff keywords: patch, patch messages: 114738 nosy: brian.curtin, stutzbach, tim.golden priority: normal severity: normal stage: needs patch status: open title: Buid issues on Cygwin - _curses, _curses_panel, and _io type: compile error versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18614/ncurses_fix.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 04:56:11 2010 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 24 Aug 2010 02:56:11 +0000 Subject: [New-bugs-announce] [issue9666] 'hasattr' fix to suppress only AttributeError In-Reply-To: <1282618571.72.0.746588634044.issue9666@psf.upfronthosting.co.za> Message-ID: <1282618571.72.0.746588634044.issue9666@psf.upfronthosting.co.za> New submission from Yury Selivanov : As discussed on python-dev mailing list (http://mail.python.org/pipermail/python-dev/2010-August/103178.html), 'hasattr' default behaviour should be changed to suppress only AttributeError exceptions. Other should pass through. The fix, however, shouldn't change behaviour of existing C API, functions PyObject_HasAttr and PyObject_HasAttrString in particular. I'm targeting this issue on Python 3.2 version, but probably it may be introduced in the next Python 3.1 maintenance release. ---------- assignee: docs at python components: Documentation, Library (Lib) files: hasattr.patch keywords: patch messages: 114767 nosy: Yury.Selivanov, docs at python priority: normal severity: normal status: open title: 'hasattr' fix to suppress only AttributeError type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file18622/hasattr.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 12:15:14 2010 From: report at bugs.python.org (Bill Green) Date: Tue, 24 Aug 2010 10:15:14 +0000 Subject: [New-bugs-announce] [issue9667] NetBSD curses KEY_* constants In-Reply-To: <1282644914.67.0.328045909398.issue9667@psf.upfronthosting.co.za> Message-ID: <1282644914.67.0.328045909398.issue9667@psf.upfronthosting.co.za> New submission from Bill Green : _cursesmodule.c provides a list of constants, prefixed with KEY_, corresponding to special keys (KEY_DOWN, KEY_LEFT, KEY_BACKSPACE, etc.). A portion of the function init_curses, which implements these, is #defined out on NetBSD (at line 2860 in Python 2.7). PyCurses_KeyName, which seems related (line 2111) is also not compiled on NetBSD. This is presumably because NetBSD's libcurses doesn't provide this functionality. These functions work when _cursesmodule.c is linked to ncurses rather than BSD curses. Could the preprocessor directives be changed to omit these functions only if the platform is NetBSD AND ncurses is not being used? ---------- components: Library (Lib) messages: 114774 nosy: bgreen priority: normal severity: normal status: open title: NetBSD curses KEY_* constants type: behavior versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 14:25:34 2010 From: report at bugs.python.org (refresh) Date: Tue, 24 Aug 2010 12:25:34 +0000 Subject: [New-bugs-announce] [issue9668] strings in json.dump in '' instead of "" In-Reply-To: <1282652734.85.0.734132617851.issue9668@psf.upfronthosting.co.za> Message-ID: <1282652734.85.0.734132617851.issue9668@psf.upfronthosting.co.za> New submission from refresh : when you use json.dump() on object, the strings in the file it was written to are inside '' instead of "" ---------- components: None messages: 114781 nosy: refresh priority: normal severity: normal status: open title: strings in json.dump in '' instead of "" type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 15:12:04 2010 From: report at bugs.python.org (Armin Rigo) Date: Tue, 24 Aug 2010 13:12:04 +0000 Subject: [New-bugs-announce] [issue9669] regexp: zero-width matches in MIN_UNTIL In-Reply-To: <1282655524.54.0.725053060384.issue9669@psf.upfronthosting.co.za> Message-ID: <1282655524.54.0.725053060384.issue9669@psf.upfronthosting.co.za> New submission from Armin Rigo : The attached example shows a case where the '_sre' module goes into an instantaneous infinite memory leak. The bug (and probably the fix too) is related to empty matches in the MIN_UNTIL operator ("+?", "*?"). It looks very similar to the bug and fix already checked in about the MAX_UNTIL operator ("+", "*"). ---------- components: Extension Modules files: empty_minuntil.py messages: 114785 nosy: arigo priority: normal severity: normal status: open title: regexp: zero-width matches in MIN_UNTIL type: crash versions: Python 2.7 Added file: http://bugs.python.org/file18628/empty_minuntil.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 15:23:21 2010 From: report at bugs.python.org (Jared Lang) Date: Tue, 24 Aug 2010 13:23:21 +0000 Subject: [New-bugs-announce] [issue9670] Exceed Recursion Limit in Thread In-Reply-To: <1282656201.3.0.572219885558.issue9670@psf.upfronthosting.co.za> Message-ID: <1282656201.3.0.572219885558.issue9670@psf.upfronthosting.co.za> New submission from Jared Lang : Recursion within a thread on OSX can result in a crash by exceeding the systems recursion limit. Recursion behaves as expected if not in thread, meaning it throws a RunTimeError with the message "maximum recursion depth exceeded." The crash is able to be avoided if the recursion limit is set to a lower number, ie. 800, via sys.setrecursionlimit. Example program which crashes on OSX: >>> def f(): ... return f() ... >>> import threading >>> thread = threading.Thread(target=f) >>> thread.start() Bus error Alternatively, the following works as expected: >>> import sys >>> def f(): ... return f() ... >>> import threading >>> thread = threading.Thread(target=f) >>> sys.setrecursionlimit(800) >>> thread.start() >>> Exception in thread Thread-1: Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 532, in __bootstrap_inner self.run() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 484, in run self.__target(*self.__args, **self.__kwargs) File "", line 2, in f File "", line 2, in f File "", line 2, in f File "", line 2, in f File "", line 2, in f File "", line 2, in f ... RuntimeError: maximum recursion depth exceeded ---------- assignee: ronaldoussoren components: Macintosh messages: 114787 nosy: jaredlang, ronaldoussoren priority: normal severity: normal status: open title: Exceed Recursion Limit in Thread type: crash versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 18:40:33 2010 From: report at bugs.python.org (Sridhar Ratnakumar) Date: Tue, 24 Aug 2010 16:40:33 +0000 Subject: [New-bugs-announce] [issue9671] test_executable_without_cwd fails: AssertionError: 1 != 47 In-Reply-To: <1282668033.06.0.983312258691.issue9671@psf.upfronthosting.co.za> Message-ID: <1282668033.06.0.983312258691.issue9671@psf.upfronthosting.co.za> New submission from Sridhar Ratnakumar : I see the following failure on Fedora Core 4 (32-bit and 64-bit) with Python 2.7.0. ====================================================================== FAIL: test_executable_without_cwd (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/apy/rrun/tmp/autotest/apy/lib/python2.7/test/test_subprocess.py", line 157, in test_executable_without_cwd self.assertEqual(p.returncode, 47) AssertionError: 1 != 47 ====================================================================== FAIL: test_executable_without_cwd (test.test_subprocess.ProcessTestCaseNoPoll) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/apy/rrun/tmp/autotest/apy/lib/python2.7/test/test_subprocess.py", line 157, in test_executable_without_cwd self.assertEqual(p.returncode, 47) AssertionError: 1 != 47 ---------------------------------------------------------------------- ---------- components: Library (Lib), Tests messages: 114797 nosy: srid priority: normal severity: normal status: open title: test_executable_without_cwd fails: AssertionError: 1 != 47 type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 18:41:49 2010 From: report at bugs.python.org (Sridhar Ratnakumar) Date: Tue, 24 Aug 2010 16:41:49 +0000 Subject: [New-bugs-announce] [issue9672] test_xpickle fails on Windows: invokes pythonx.y instead of pythonxy In-Reply-To: <1282668109.22.0.482627052843.issue9672@psf.upfronthosting.co.za> Message-ID: <1282668109.22.0.482627052843.issue9672@psf.upfronthosting.co.za> New submission from Sridhar Ratnakumar : test_xpickle 'python2.4' is not recognized as an internal or external command, operable program or batch file. 'python2.5' is not recognized as an internal or external command, operable program or batch file. 'python2.6' is not recognized as an internal or external command, operable program or batch file. On Windows, that should be python24.exe (not python2.4.exe). ---------- components: Tests, Windows messages: 114798 nosy: srid priority: normal severity: normal status: open title: test_xpickle fails on Windows: invokes pythonx.y instead of pythonxy type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 19:49:42 2010 From: report at bugs.python.org (Firat Ozgul) Date: Tue, 24 Aug 2010 17:49:42 +0000 Subject: [New-bugs-announce] [issue9673] Entry Widget Not Editable under Windows XP In-Reply-To: <1282672182.44.0.886074830019.issue9673@psf.upfronthosting.co.za> Message-ID: <1282672182.44.0.886074830019.issue9673@psf.upfronthosting.co.za> New submission from Firat Ozgul : In a Tkinter application that has an Entry() widget on the main window and an askopenfilename() dialog, one should be able to click and type into the Entry() widget as soon as the askopenfilename() dialog is closed. However, the askopenfilename() dialog renders the Entry() widget on the main window unusable/non-editable. This issue was explored in http://mail.python.org/pipermail/tkinter-discuss/2010-August/002332.html at Tkinter-Discuss mailing list. All details relating to the issue can be followed from there. It seems that only Windows OS is affected by this issue. In Ubuntu Karmic Koala (GNOME) and Debian (IceWM), at least, this issue cannot be reproduced, and everything works like expected. ---------- components: Tkinter, Windows messages: 114800 nosy: firatozgul priority: normal severity: normal status: open title: Entry Widget Not Editable under Windows XP type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 21:19:48 2010 From: report at bugs.python.org (aj) Date: Tue, 24 Aug 2010 19:19:48 +0000 Subject: [New-bugs-announce] [issue9674] make install DESTDIR=/ fails In-Reply-To: <1282677588.85.0.771807305266.issue9674@psf.upfronthosting.co.za> Message-ID: <1282677588.85.0.771807305266.issue9674@psf.upfronthosting.co.za> New submission from aj : I tried to install python with make install DESTDIR=/home/blah ./python -E ./setup.py install \ --prefix=/ \ --install-scripts=//bin \ --install-platlib=//lib/python2.6/lib-dynload \ --root=//home/blah running install running build running build_ext INFO: Can't locate Tcl/Tk libs and/or headers Failed to find the necessary bits to build these modules: _tkinter bsddb185 dl imageop sunaudiodev To find the necessary bits, look in setup.py in detect_modules() for the module's name. running build_scripts running install_lib creating /lib/python2.6 error: could not create '/lib/python2.6': Permission denied make: *** [sharedinstall] Error 1 I asked for help on the mailing list http://groups.google.com/group/comp.lang.python/browse_thread/thread/a0b0e49f7b8153d1#, and according to Martin v. Loewis "If you have / as the prefix, you get two leading slashes, e.g. for //lib/python2.x. Any other prefix would have given you only a single slash: e.g. if it had been /usr, then you end up with /usr/lib/python2.x. Now, the code strips the first character to make it a relative path name (so that join can be used), which fails to work correctly if there are two leading slashes. " I have attached the patch provided by him. ---------- components: Installation files: python-destdir.patch keywords: patch messages: 114804 nosy: mailtome priority: normal severity: normal status: open title: make install DESTDIR=/ fails type: compile error versions: Python 2.6 Added file: http://bugs.python.org/file18632/python-destdir.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 22:51:48 2010 From: report at bugs.python.org (Florent Xicluna) Date: Tue, 24 Aug 2010 20:51:48 +0000 Subject: [New-bugs-announce] [issue9675] segfault: PyDict_SetItem: Assertion `value' failed. In-Reply-To: <1282683108.48.0.667769171779.issue9675@psf.upfronthosting.co.za> Message-ID: <1282683108.48.0.667769171779.issue9675@psf.upfronthosting.co.za> New submission from Florent Xicluna : Crash on Python 2.7 branch. $ ./python -We -c 'import anydbm' python: Objects/dictobject.c:759: PyDict_SetItem: Assertion `value' failed. Abandon It occurs with all optional modules compiled. ---------- messages: 114823 nosy: flox priority: normal severity: normal stage: unit test needed status: open title: segfault: PyDict_SetItem: Assertion `value' failed. type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 23:02:14 2010 From: report at bugs.python.org (Amadiro) Date: Tue, 24 Aug 2010 21:02:14 +0000 Subject: [New-bugs-announce] [issue9676] Keyword to disambiguate python version In-Reply-To: <1282683734.42.0.996381037193.issue9676@psf.upfronthosting.co.za> Message-ID: <1282683734.42.0.996381037193.issue9676@psf.upfronthosting.co.za> New submission from Amadiro : I would propose that an idiomatic way is created, for instance a pragma or statement, which allows one to disambiguate the used python version in a manner that is both obvious for the human reader, and as well allows python to reject the script, should the wrong version of the interpreter be present. I think this is a quite common problem[1][2], which could be solved in a fairly easy and pragmatic way. Being a python beginner, I'm not well-adversed in the ways of idiomatic python, so feel free to reject or improve on my syntactic examples, these are merely meant to demonstrate my point. Building on [3], I would suggest some syntax like this: #!/usr/local/bin/python # version: python-3 import os, sys ... Alternatively, some syntax could be used that allows one to use basic comparison operators, a range or even simple chained logical statements. #!/usr/local/bin/python # version: [2.4 .. 3.0] and not 2.6.1 # or multiple clauses # version: >= 2.4.2 # version: < 3.0 # version: not 2.6.1 # jpython-version: ... # or multiple keys # min-version: 2.4.2 # min-jpython-version: 2.4.4 # max-version: 2.6.1 import os, sys ... This way it should be fairly obvious to the casual reader which python version the program is intended to run under, and the python interpreter can simply reject to parse/execute the program, should it encounter an incompatible requirement. References [1] http://stackoverflow.com/questions/446052/python-best-way-to-check-for-python-version-in-program-that-uses-new-language-fe [2] http://stackoverflow.com/questions/1093322/how-do-i-check-what-version-of-python-is-running-my-script [3] http://www.python.org/dev/peps/pep-0263/ ---------- components: Interpreter Core messages: 114826 nosy: Amadiro priority: normal severity: normal status: open title: Keyword to disambiguate python version type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 23:26:03 2010 From: report at bugs.python.org (Brett Cannon) Date: Tue, 24 Aug 2010 21:26:03 +0000 Subject: [New-bugs-announce] [issue9677] "Global Module Index" link dead In-Reply-To: <1282685163.07.0.524302094141.issue9677@psf.upfronthosting.co.za> Message-ID: <1282685163.07.0.524302094141.issue9677@psf.upfronthosting.co.za> New submission from Brett Cannon : When you build the HTML docs the "Global Module Index" link does not work while the "modules" link in the upper-right corner does. ---------- assignee: docs at python components: Documentation messages: 114832 nosy: brett.cannon, docs at python priority: high severity: normal stage: needs patch status: open title: "Global Module Index" link dead versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 05:09:58 2010 From: report at bugs.python.org (Takayuki SHIMIZUKAWA) Date: Wed, 25 Aug 2010 03:09:58 +0000 Subject: [New-bugs-announce] [issue9678] uuid._ifconfig_getnode can't work on NetBSD In-Reply-To: <1282705798.9.0.0619423981288.issue9678@psf.upfronthosting.co.za> Message-ID: <1282705798.9.0.0619423981288.issue9678@psf.upfronthosting.co.za> New submission from Takayuki SHIMIZUKAWA : uuid.getnode() not work correctly on NetBSD5, then uuid.getnode() return random value per Python interpreter instance. This problem is caused by the uuid._ifconfig_getnode() not supporting a 'ifconfig' / 'arp' output format of NetBSD. I create a patch for this problem and attached. ---------- components: Library (Lib) files: uuid-ifconfig_getnode-netbsd.patch keywords: patch messages: 114878 nosy: shimizukawa priority: normal severity: normal status: open title: uuid._ifconfig_getnode can't work on NetBSD type: behavior versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1 Added file: http://bugs.python.org/file18641/uuid-ifconfig_getnode-netbsd.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 09:39:28 2010 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Wed, 25 Aug 2010 07:39:28 +0000 Subject: [New-bugs-announce] [issue9679] unicode DNS names in urllib, urlopen In-Reply-To: <1282721968.42.0.723881796109.issue9679@psf.upfronthosting.co.za> Message-ID: <1282721968.42.0.723881796109.issue9679@psf.upfronthosting.co.za> New submission from Martin v. L?wis : Copy of issue 1027206; support in the socket module was provided, but this request remains: Also other modules should support unicode hostnames. (httplib already does) but urllib and urllib2 don't. ---------- components: Library (Lib), Unicode keywords: buildbot, patch messages: 114884 nosy: baikie, flox, gdamjan, haypo, loewis, orsenthil priority: normal severity: normal stage: patch review status: open title: unicode DNS names in urllib, urlopen type: feature request versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 11:21:41 2010 From: report at bugs.python.org (Carsten Klein) Date: Wed, 25 Aug 2010 09:21:41 +0000 Subject: [New-bugs-announce] [issue9680] Add in declaration order support for the dictionary passed in to the meta class __init__ and __new__ methods In-Reply-To: <1282728101.98.0.555622360483.issue9680@psf.upfronthosting.co.za> Message-ID: <1282728101.98.0.555622360483.issue9680@psf.upfronthosting.co.za> New submission from Carsten Klein : Example class Meta(type): def __new__(cls, name, bases, locals): print repr(locals.keys()) class Test(object): __metaclass__ = Meta A = 1 B = 2 C = 3 D = 4 E = 5 The above will yield the keys in a somewhat random order, everytime you start up the Python interpreter: ['__module__', 'E', 'C', 'D', 'B', '__metaclass__', 'A'] While the above example is far from complete, it shows the basic dilemma when having some concept that relies on the order in which the elements have been declared and in the order by which they have been processed during the parse phase and ast traversal phase. In the aforementioned first two phases one can rely on the declaration order, but as soon as we enter the __new__ method, the order becomes irrelevant and is completely lost. For a framework of mine, I would like the locals dict that is being passed as an argument to the __new__ method to give out references to the keys in the order in which they have been declared in the dict. Thus, the above example would yield ['__metaclass__', '__module__', 'A', 'B', 'C', 'D', 'E'] The basic reason is that I find it more intuitive to class A(object): __metaclass__ = Meta A = 5 Z = 9 than class A(object): __metaclass__ = Meta __fields__ = ((A,5), (Z,9)) As you might easily guesses, the main application for the above is a new enum type I am currently developing, where the order is important as every new instance of that class must always yield the same ordinals for the individual constants declared. This should not break with the overall contract of the dict, which defines that keys returned are in no specific order. Thus, adding a specific order to keys in the above locals dict for class instantiation purposes only, would not break with existing code and should be both backwards and forwards compatible. ---------- components: Interpreter Core messages: 114890 nosy: carsten.klein at axn-software.de priority: normal severity: normal status: open title: Add in declaration order support for the dictionary passed in to the meta class __init__ and __new__ methods type: feature request versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 15:31:45 2010 From: report at bugs.python.org (Winston C. Yang) Date: Wed, 25 Aug 2010 13:31:45 +0000 Subject: [New-bugs-announce] [issue9681] small typo in online documentation In-Reply-To: <1282743105.63.0.0178074444742.issue9681@psf.upfronthosting.co.za> Message-ID: <1282743105.63.0.0178074444742.issue9681@psf.upfronthosting.co.za> New submission from Winston C. Yang : See http://docs.python.org/library/subprocess.html 17.1.1.2. Exceptions containing traceback information from the child[']s point of view ---------- messages: 114901 nosy: wcyang priority: normal severity: normal status: open title: small typo in online documentation versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 20:08:13 2010 From: report at bugs.python.org (R. David Murray) Date: Wed, 25 Aug 2010 18:08:13 +0000 Subject: [New-bugs-announce] [issue9682] socket.create_connection error message for domain subpart with invalid length is very confusing In-Reply-To: <1282759693.65.0.0842882042261.issue9682@psf.upfronthosting.co.za> Message-ID: <1282759693.65.0.0842882042261.issue9682@psf.upfronthosting.co.za> New submission from R. David Murray : >>> socket.create_connection(('a..com', 25)) Traceback (most recent call last): File "", line 1, in File "/home/rdmurray/python/py3k/Lib/socket.py", line 300, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): File "/home/rdmurray/python/py3k/Lib/encodings/idna.py", line 167, in encode result.extend(ToASCII(label)) File "/home/rdmurray/python/py3k/Lib/encodings/idna.py", line 73, in ToASCII raise UnicodeError("label empty or too long") UnicodeError: label empty or too long I have two problems with this: why is it a UnicodeError? (That confused me into going down a blind alley before finding my typo in the original context where I encountered this). The other problem is the term 'label'. I realize this is technically correct and precise, but I doubt most users will recognize it (I didn't remember what it meant until I looked it up). Could we perhaps change it to 'domain name subpart'? Note that in 2.x this gives 'name or service not known' unless the input string is unicode, in which case it gives the error above. So in 2.x the UnicodeError was at least not totally dissociated from the cause of the error, but still strikes me as sub-optimal. I would expect a ValueError. ---------- components: Library (Lib) keywords: easy messages: 114923 nosy: loewis, r.david.murray priority: low severity: normal status: open title: socket.create_connection error message for domain subpart with invalid length is very confusing type: feature request versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 21:13:43 2010 From: report at bugs.python.org (=?utf-8?q?Andreas_St=C3=BChrk?=) Date: Wed, 25 Aug 2010 19:13:43 +0000 Subject: [New-bugs-announce] [issue9683] Dead code in pyk inspect module In-Reply-To: <1282763623.07.0.68649497821.issue9683@psf.upfronthosting.co.za> Message-ID: <1282763623.07.0.68649497821.issue9683@psf.upfronthosting.co.za> New submission from Andreas St?hrk : There is some code in the inspect module that is now with the removal of tuple unpacking in arguments in Python 3 no longer needed. The mentioned code does not even work with Python 3 (because ``len(map(...))`` will raise a TypeError). The attached patch removes the dead code. ---------- components: Library (Lib) files: dead_code_removed.patch keywords: patch messages: 114925 nosy: Trundle priority: normal severity: normal status: open title: Dead code in pyk inspect module versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18643/dead_code_removed.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 21:16:58 2010 From: report at bugs.python.org (Daniel Stutzbach) Date: Wed, 25 Aug 2010 19:16:58 +0000 Subject: [New-bugs-announce] [issue9684] PC/pyconfig.h should define SIZEOF_WCHAR_T In-Reply-To: <1282763818.18.0.885121985374.issue9684@psf.upfronthosting.co.za> Message-ID: <1282763818.18.0.885121985374.issue9684@psf.upfronthosting.co.za> New submission from Daniel Stutzbach : Presently, the pyconfig.h generated by configure defines SIZEOF_WCHAR_T, but PC/pyconfig.h does not, periodically causing problems: http://bugs.python.org/issue8781 http://bugs.python.org/issue4474 http://trac.wxwidgets.org/ticket/12013 Problem and the one-line solution already discussed in Issue8781 (and to a less extent in Issue4474). ---------- assignee: stutzbach components: Windows messages: 114926 nosy: stutzbach priority: normal severity: normal status: open title: PC/pyconfig.h should define SIZEOF_WCHAR_T type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 21:33:17 2010 From: report at bugs.python.org (David Albert Torpey) Date: Wed, 25 Aug 2010 19:33:17 +0000 Subject: [New-bugs-announce] [issue9685] tuples should remember their hash value In-Reply-To: <1282764797.19.0.867524122951.issue9685@psf.upfronthosting.co.za> Message-ID: <1282764797.19.0.867524122951.issue9685@psf.upfronthosting.co.za> New submission from David Albert Torpey : Dictionary keys are commonly numbers, strings, or tuples. Python has optimized numbers and strings to remember their hash values on successive calls. Tuples should do this too since their recursive hash function can take a long time to compute. Tuples are Python's official record type and the one obvious way of making non-scalar dictionary keys. The code to do this in stringobject.c is short and sweet, so this major speed boost should be an easy thing to. static long string_hash(PyStringObject *a) { register Py_ssize_t len; register unsigned char *p; register long x; if (a->ob_shash != -1) <== return a->ob_shash; <== len = Py_SIZE(a); p = (unsigned char *) a->ob_sval; x = *p << 7; while (--len >= 0) x = (1000003*x) ^ *p++; x ^= Py_SIZE(a); if (x == -1) <== x = -2; <== a->ob_shash = x; return x; } The code in tupleobject.c would just need to add the four lines marked above. Here's what is looks like now. static long tuplehash(PyTupleObject *v) { register long x, y; register Py_ssize_t len = Py_SIZE(v); register PyObject **p; long mult = 1000003L; x = 0x345678L; p = v->ob_item; while (--len >= 0) { y = PyObject_Hash(*p++); if (y == -1) return -1; x = (x ^ y) * mult; /* the cast might truncate len; that doesn't change hash stability */ mult += (long)(82520L + len + len); } x += 97531L; if (x == -1) x = -2; return x; } Thank you guys for all of your work. *David ---------- messages: 114929 nosy: dtorp priority: normal severity: normal status: open title: tuples should remember their hash value type: resource usage versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 21:41:33 2010 From: report at bugs.python.org (mmw) Date: Wed, 25 Aug 2010 19:41:33 +0000 Subject: [New-bugs-announce] [issue9686] asyncore infinite loop on raise In-Reply-To: <1282765293.84.0.0540536111672.issue9686@psf.upfronthosting.co.za> Message-ID: <1282765293.84.0.0540536111672.issue9686@psf.upfronthosting.co.za> New submission from mmw <0xcafefeed at gmail.com>: def send(self, data): try: result = self.socket.send(data) return result except socket.error, why: if why.args[0] == EWOULDBLOCK: return 0 elif why.args[0] in (ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED): self.handle_close() return 0 else: raise for whatever reason the connection could break client side, if you raise an anonymous exception there it's uncatchable, raise on a socket.error or dismiss async chat is a looper. that's the main reason why everybody gets this crazy infinite loop on for instance broken pipe error and the thing never exit, you just raise on your-self other and other again, BTW, you could have the same issue whatever the language, this is a developer bug. ---------- components: Library (Lib) messages: 114931 nosy: mmw priority: normal severity: normal status: open title: asyncore infinite loop on raise versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 22:04:59 2010 From: report at bugs.python.org (Dave Malcolm) Date: Wed, 25 Aug 2010 20:04:59 +0000 Subject: [New-bugs-announce] [issue9687] dbmmodule.c:dbm_contains fails on 64bit big-endian (test_dbm.py fails) when built against gdbm (int vs Py_ssize_t) In-Reply-To: <1282766699.94.0.103473116752.issue9687@psf.upfronthosting.co.za> Message-ID: <1282766699.94.0.103473116752.issue9687@psf.upfronthosting.co.za> New submission from Dave Malcolm : With a clean build of release27-maint (r84317), test_dbm.py fails on ppc64 with this error: File "test_dbm.py", line 24, in test_keys self.assert_(k in self.d) AssertionError I'm building gainst gdbm-1.8.0 (specifically, on a prerelease of RHEL6, with gdbm-devel-1.8.0-36.el6.ppc64) All of the headers define datum as: typedef struct { char *dptr; int dsize; } datum; Note the use of "int" for dsize. This fragment of code in python's Modules/dbmmodule.c:dbm_contains: if (PyString_AsStringAndSize(v, (char **)&key.dptr, (Py_ssize_t *)&key.dsize)) { return -1; } appears to assume that sizeof(datum.dsize) == sizeof(Py_ssize_t) which is not correct on these architectures: (gdb) p sizeof(key.dsize) $25 = 4 (gdb) p sizeof(Py_ssize_t) $26 = 8 On ppc64, when PyString_AsStringAndSize writes the 0x00000000000000001 value for the ob_size of "a" to &key.dsize, I believe the 0x00000000 part is written to &key.size, and the 0x00000001 part is written to the 4 bytes following it, due to the incorrect cast from (int*) to (Py_ssize_t*) Thankfully (gdb) p sizeof(key) $28 = 16 so it writes this value to padding within the "datum key", rather than corrupting the stack. The dbm_fetch() invocation is thus passed a 0 dsize, and doesn't find the key, hence the test fails. The various other uses with that source file appear correct: (i) there are various PyArg_Parse* calls using s#, with int, which is correct, given the absence of the PY_SSIZE_T_CLEAN macro. (ii) there are various calls of PyString_FromStringAndSize(, datum.dsize), which I believe is correct: I believe the compiler will coerce this int to the wider Py_ssize_t type. I'm attaching a patch which (I hope) correctly coerces the size of the key from Py_ssize_t to "int" within gdb_contains. ---------- components: Extension Modules files: fix-dbm_contains-on-64bit-bigendian.patch keywords: patch, patch messages: 114934 nosy: dmalcolm priority: normal severity: normal stage: patch review status: open title: dbmmodule.c:dbm_contains fails on 64bit big-endian (test_dbm.py fails) when built against gdbm (int vs Py_ssize_t) type: behavior versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18644/fix-dbm_contains-on-64bit-bigendian.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 00:44:35 2010 From: report at bugs.python.org (Dave Malcolm) Date: Wed, 25 Aug 2010 22:44:35 +0000 Subject: [New-bugs-announce] [issue9688] object.__basicsize__ is erroneously0 Message-ID: <1282776275.13.0.853395186036.issue9688@psf.upfronthosting.co.za> Changes by Dave Malcolm : ---------- nosy: dmalcolm priority: normal severity: normal status: open title: object.__basicsize__ is erroneously0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 00:45:54 2010 From: report at bugs.python.org (Pedro Mendes) Date: Wed, 25 Aug 2010 22:45:54 +0000 Subject: [New-bugs-announce] [issue9689] threading.Timer poorly documented In-Reply-To: <1282776354.83.0.958131650001.issue9689@psf.upfronthosting.co.za> Message-ID: <1282776354.83.0.958131650001.issue9689@psf.upfronthosting.co.za> New submission from Pedro Mendes : The documentation existent ( http://docs.python.org/library/threading.html#threading.Timer ) is not very helpful. The user is left wondering about the exact syntax of this function, what types of parameter it accepts etc. Could this possibly be fixed? ---------- messages: 114941 nosy: pedro3005 priority: normal severity: normal status: open title: threading.Timer poorly documented type: feature request versions: Python 2.5, Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 02:47:54 2010 From: report at bugs.python.org (Kay Hayen) Date: Thu, 26 Aug 2010 00:47:54 +0000 Subject: [New-bugs-announce] [issue9690] Cannot distinguish b"str" from "str" in ast module. In-Reply-To: <1282783674.62.0.292331118053.issue9690@psf.upfronthosting.co.za> Message-ID: <1282783674.62.0.292331118053.issue9690@psf.upfronthosting.co.za> New submission from Kay Hayen : There is no way to decide if a string literal should be non-unicode when the default has been set to unicode_literals. Please see: >>> import ast >>> ast.dump( ast.parse( """c = "d" """ ) ) "Module(body=[Assign(targets=[Name(id='c', ctx=Store())], value=Str(s='d'))])" >>> from __future__ import unicode_literals >>> ast.dump( ast.parse( """c = "d" """ ) ) "Module(body=[Assign(targets=[Name(id='c', ctx=Store())], value=Str(s='d'))])" >>> ast.dump( ast.parse( """c = b"d" """ ) ) "Module(body=[Assign(targets=[Name(id='c', ctx=Store())], value=Str(s='d'))])" >>> ast.dump( ast.parse( """c = u"d" """ ) ) "Module(body=[Assign(targets=[Name(id='c', ctx=Store())], value=Str(s=u'd'))])" I have checked fields, but didn't find anything either. Without an indication of the Str literal type, its type cannot be detected. In either case it is "str" and may or not have to be converted to a unicode value. ---------- components: Library (Lib) messages: 114950 nosy: kayhayen priority: normal severity: normal status: open title: Cannot distinguish b"str" from "str" in ast module. type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 13:30:49 2010 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 26 Aug 2010 11:30:49 +0000 Subject: [New-bugs-announce] [issue9691] sdist includes files that are not in MANIFEST.in In-Reply-To: <1282822249.86.0.974734126224.issue9691@psf.upfronthosting.co.za> Message-ID: <1282822249.86.0.974734126224.issue9691@psf.upfronthosting.co.za> New submission from Ronald Oussoren : The attached file 'manifest-test.zip' is a small distutils project that demonstrates a problem I have with the sdist command. The archive contains a directory 'sandbox' that is not mentioned in MANIFEST.in or anywhere in setup.py. When I create an sdist using "python setup.py sdist" the sandbox directory is included in the archive. This happens with 2.7 on Windows, while 2.7 on OSX does not have this behavior. ---------- assignee: tarek components: Distutils files: manifest-test.zip messages: 114966 nosy: eric.araujo, ronaldoussoren, tarek priority: normal severity: normal stage: unit test needed status: open title: sdist includes files that are not in MANIFEST.in type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file18650/manifest-test.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 16:42:56 2010 From: report at bugs.python.org (Ulrich Seidl) Date: Thu, 26 Aug 2010 14:42:56 +0000 Subject: [New-bugs-announce] [issue9692] UnicodeDecodeError in ElementTree.tostring() In-Reply-To: <1282833776.05.0.825088232802.issue9692@psf.upfronthosting.co.za> Message-ID: <1282833776.05.0.825088232802.issue9692@psf.upfronthosting.co.za> New submission from Ulrich Seidl : The following code leads to an UnicodeError in python 2.7 while it works fine in 2.6 & 2.5: # -*- coding: latin-1 -*- import xml.etree.cElementTree as ElementTree oDoc = ElementTree.fromstring( '' ) oDoc.set( "ATTR", "???" ) print ElementTree.tostring( oDoc , encoding="iso-8859-1" ) ---------- components: XML messages: 114980 nosy: uis priority: normal severity: normal status: open title: UnicodeDecodeError in ElementTree.tostring() versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 18:19:52 2010 From: report at bugs.python.org (Giampaolo Rodola') Date: Thu, 26 Aug 2010 16:19:52 +0000 Subject: [New-bugs-announce] [issue9693] asynchat push_callable() patch In-Reply-To: <1282839592.68.0.629507252463.issue9693@psf.upfronthosting.co.za> Message-ID: <1282839592.68.0.629507252463.issue9693@psf.upfronthosting.co.za> New submission from Giampaolo Rodola' : This can be useful in those circumstances where the user wants to execute some action right after some data has been sent (push()) or a producer has been consumed (push_with_producer()). Example: def log(msg): logging.debug(msg) class Sender(asynchat.async_chat): def __init__(self, conn): asynchat.async_chat.__init__(self, conn) self.set_terminator("\r\n") self.push("220 hello\r\n") self.push_callable(log, "hello has been sent") ---------- components: Library (Lib) files: asynchat-push-callable.patch keywords: patch, patch messages: 115001 nosy: giampaolo.rodola, josiah.carlson, josiahcarlson, nirs, r.david.murray priority: normal severity: normal stage: patch review status: open title: asynchat push_callable() patch type: feature request versions: Python 3.2 Added file: http://bugs.python.org/file18651/asynchat-push-callable.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 20:19:19 2010 From: report at bugs.python.org (Ben Schmaus) Date: Thu, 26 Aug 2010 18:19:19 +0000 Subject: [New-bugs-announce] [issue9694] argparse: Default Help Message Lists Required Args As Optional In-Reply-To: <1282846759.11.0.900867962743.issue9694@psf.upfronthosting.co.za> Message-ID: <1282846759.11.0.900867962743.issue9694@psf.upfronthosting.co.za> New submission from Ben Schmaus : The argparse module lists required args as optional in the default help message. If you run the following program (also attached) you'll get the output listed below. #!/usr/bin/env python import argparse parser = argparse.ArgumentParser( description = 'Do something' ) parser.add_argument('--reqarg', '-r', help = 'This is required', required = True) parser.add_argument('--optarg','-o', help = "This is optional", required = False) args = parser.parse_args() $ python argparse-help-says-required-args-are-optional.py -h usage: argparse-help-says-required-args-are-optional.py [-h] --reqarg REQARG [--optarg OPTARG] Do something optional arguments: -h, --help show this help message and exit --reqarg REQARG, -r REQARG This is required --optarg OPTARG, -o OPTARG This is optional $ ---------- components: Library (Lib) files: argparse-help-says-required-args-are-optional.py messages: 115017 nosy: benschmaus priority: normal severity: normal status: open title: argparse: Default Help Message Lists Required Args As Optional type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file18654/argparse-help-says-required-args-are-optional.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 23:58:54 2010 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 26 Aug 2010 21:58:54 +0000 Subject: [New-bugs-announce] [issue9695] Return from generators in Python 3.2 In-Reply-To: <1282859934.45.0.531494544052.issue9695@psf.upfronthosting.co.za> Message-ID: <1282859934.45.0.531494544052.issue9695@psf.upfronthosting.co.za> New submission from Yury Selivanov : The patch is intended to fix behaviour of 'return' statement in python's generators. Please read this message before looking at the patch. http://mail.python.org/pipermail/python-dev/2010-August/103297.html ---------- components: Interpreter Core files: generators_return.patch keywords: patch messages: 115033 nosy: Yury.Selivanov priority: normal severity: normal status: open title: Return from generators in Python 3.2 type: feature request versions: Python 3.2 Added file: http://bugs.python.org/file18655/generators_return.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 00:05:03 2010 From: report at bugs.python.org (David Powell) Date: Thu, 26 Aug 2010 22:05:03 +0000 Subject: [New-bugs-announce] [issue9696] xdrlib's pack_int generates DeprecationWarnings for negative in-range values In-Reply-To: <1282860303.06.0.424236317482.issue9696@psf.upfronthosting.co.za> Message-ID: <1282860303.06.0.424236317482.issue9696@psf.upfronthosting.co.za> New submission from David Powell : The problem is easy to reproduce: >>> import xdrlib >>> p = xdrlib.Packer() >>> p.pack_int(-1) __main__:1: DeprecationWarning: struct integer overflow masking is deprecated The cause is xdrlib.Packer uses the same pack operation for both signed and unsigned integers... def pack_uint(self, x): self.__buf.write(struct.pack('>L', x)) pack_int = pack_uint ...and the unsigned struct.pack('>L', x) gags on the negative value. ---------- components: Extension Modules messages: 115034 nosy: dep priority: normal severity: normal status: open title: xdrlib's pack_int generates DeprecationWarnings for negative in-range values type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 00:07:25 2010 From: report at bugs.python.org (Jayesh) Date: Thu, 26 Aug 2010 22:07:25 +0000 Subject: [New-bugs-announce] [issue9697] python 2.3.4 installation error on 64 bit env In-Reply-To: <1282860445.87.0.394142601563.issue9697@psf.upfronthosting.co.za> Message-ID: <1282860445.87.0.394142601563.issue9697@psf.upfronthosting.co.za> New submission from Jayesh : [root at server Python-2.3.4]# ./configure checking MACHDEP... linux2 checking EXTRAPLATDIR... checking for --without-gcc... no checking for --with-cxx=... no checking for c++... no checking for g++... no checking for gcc... gcc checking for C++ compiler default output... configure: error: C++ compiler cannot create executables See `config.log' for more details. [root at SBX40104 Python-2.3.4]# cat config.log This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by python configure 2.3, which was generated by GNU Autoconf 2.57. Invocation command line was $ ./configure ## --------- ## ## Platform. ## ## --------- ## hostname = I.HAVE.CHANGED.THIS.com uname -m = x86_64 uname -r = 2.6.18-028stab069.6 uname -s = Linux uname -v = #1 SMP Wed May 26 18:10:06 MSD 2010 /usr/bin/uname -p = unknown /bin/uname -X = unknown /bin/arch = x86_64 /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /usr/local/sbin PATH: /usr/local/bin PATH: /sbin PATH: /bin PATH: /usr/sbin PATH: /usr/bin PATH: /usr/X11R6/bin PATH: /root/bin ## ----------- ## ## Core tests. ## ## ----------- ## configure:1402: checking MACHDEP configure:1511: result: linux2 configure:1517: checking EXTRAPLATDIR configure:1532: result: configure:1545: checking for --without-gcc configure:1594: result: no configure:1600: checking for --with-cxx= configure:1621: result: no configure:1640: checking for c++ configure:1669: result: no configure:1640: checking for g++ configure:1669: result: no configure:1640: checking for gcc configure:1656: found /usr/bin/gcc configure:1666: result: gcc configure:1707: checking for C++ compiler default output configure:1710: gcc conftest.cc >&5 gcc: installation problem, cannot exec `cc1plus': No such file or directory configure:1713: $? = 1 configure: failed program was: | #line 1686 "configure" | /* confdefs.h. */ | | #define _GNU_SOURCE 1 | #define _NETBSD_SOURCE 1 | #define __BSD_VISIBLE 1 | #define _XOPEN_SOURCE 600 | #define _XOPEN_SOURCE_EXTENDED 1 | #define _POSIX_C_SOURCE 200112L | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:1752: error: C++ compiler cannot create executables See `config.log' for more details. ## ---------------- ## ## Cache variables. ## ## ---------------- ## ac_cv_env_CC_set=set ac_cv_env_CC_value=gcc ac_cv_env_CFLAGS_set= ac_cv_env_CFLAGS_value= ac_cv_env_CPPFLAGS_set= ac_cv_env_CPPFLAGS_value= ac_cv_env_CPP_set= ac_cv_env_CPP_value= ac_cv_env_LDFLAGS_set= ac_cv_env_LDFLAGS_value= ac_cv_env_build_alias_set= ac_cv_env_build_alias_value= ac_cv_env_host_alias_set= ac_cv_env_host_alias_value= ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= ac_cv_prog_CXX=gcc ## ----------------- ## ## Output variables. ## ## ----------------- ## AR='' BASECFLAGS='' BLDLIBRARY='' BLDSHARED='' BUILDEXEEXT='' CC='gcc' CCSHARED='' CFLAGS='' CFLAGSFORSHARED='' CONFIG_ARGS=' 'CC=gcc'' CPP='' CPPFLAGS='' CXX='gcc' DEFS='' DLINCLDIR='' DLLLIBRARY='' DYNLOADFILE='' ECHO_C='' ECHO_N='-n' ECHO_T='' EGREP='' EXEEXT='' EXTRAMACHDEPPATH='' EXTRAPLATDIR='' HAVE_GETHOSTBYNAME='' HAVE_GETHOSTBYNAME_R='' HAVE_GETHOSTBYNAME_R_3_ARG='' HAVE_GETHOSTBYNAME_R_5_ARG='' HAVE_GETHOSTBYNAME_R_6_ARG='' INSTALL_DATA='' INSTALL_PROGRAM='' INSTALL_SCRIPT='' INSTSONAME='' LDFLAGS='' LDLAST='' LDLIBRARY='' LDLIBRARYDIR='' LDSHARED='' LIBC='' LIBM='' LIBOBJS='' LIBRARY='' LIBS='' LIBTOOL_CRUFT='' LINKCC='' LINKFORSHARED='' LN='' LTLIBOBJS='' MACHDEP='linux2' MACHDEP_OBJS='' MAINOBJ='python.o' OBJEXT='' OPT='' PACKAGE_BUGREPORT='' PACKAGE_NAME='python' PACKAGE_STRING='python 2.3' PACKAGE_TARNAME='python' PACKAGE_VERSION='2.3' PATH_SEPARATOR=':' PYTHONFRAMEWORK='' PYTHONFRAMEWORKDIR='no-framework' PYTHONFRAMEWORKINSTALLDIR='' PYTHONFRAMEWORKPREFIX='' RANLIB='' RUNSHARED='' SGI_ABI='' SHELL='/bin/sh' SHLIBS='' SIGNAL_OBJS='' SO='' SOVERSION='1.0' SRCDIRS='' THREADHEADERS='' THREADOBJ='' TRUE='' UNICODE_OBJS='' USE_SIGNAL_MODULE='' USE_THREAD_MODULE='' VERSION='2.3' ac_ct_CC='' ac_ct_RANLIB='' bindir='${exec_prefix}/bin' build_alias='' datadir='${prefix}/share' exec_prefix='NONE' host_alias='' includedir='${prefix}/include' infodir='${prefix}/info' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' localstatedir='${prefix}/var' mandir='${prefix}/man' oldincludedir='/usr/include' prefix='NONE' program_transform_name='s,x,x,' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sysconfdir='${prefix}/etc' target_alias='' ## ----------- ## ## confdefs.h. ## ## ----------- ## #define _GNU_SOURCE 1 #define _NETBSD_SOURCE 1 #define _POSIX_C_SOURCE 200112L #define _XOPEN_SOURCE 600 #define _XOPEN_SOURCE_EXTENDED 1 #define __BSD_VISIBLE 1 configure: exit 77 [root at server Python-2.3.4]# [root at server Python-2.3.4]# rpm -qa |grep -i gcc libgcc-3.4.6-11.el4_8.1 libgcc-3.4.6-11.el4_8.1 gcc-3.4.6-11.el4_8.1 [root at SBX40104 Python-2.3.4]# which cc /usr/bin/cc [root at server Python-2.3.4]# which gcc /usr/bin/gcc [root at server Python-2.3.4]# echo $PATH /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin [root at SBX40104 Python-2.3.4]# env |grep PATH PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin [root at server Python-2.3.4]# whreis cc -bash: whreis: command not found [root at SBX40104 Python-2.3.4]# whereis cc gcc cc: /usr/bin/cc gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz [root at server Python-2.3.4]# ---------- messages: 115035 nosy: JayeshMahajan priority: normal severity: normal status: open title: python 2.3.4 installation error on 64 bit env type: compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 08:59:28 2010 From: report at bugs.python.org (Luci Stanescu) Date: Fri, 27 Aug 2010 06:59:28 +0000 Subject: [New-bugs-announce] [issue9698] When reusing an handler, urllib(2)'s digest authentication fails after multiple regative replies In-Reply-To: <1282892368.57.0.758322534297.issue9698@psf.upfronthosting.co.za> Message-ID: <1282892368.57.0.758322534297.issue9698@psf.upfronthosting.co.za> New submission from Luci Stanescu : Hi, The HTTPDigestAuthHandler's code looks like this: def http_error_401(self, req, fp, code, msg, headers): host = urlparse(req.full_url)[1] retry = self.http_error_auth_reqed('www-authenticate', host, req, headers) self.reset_retry_count() return retry After successful authentication, the HTTP server might still return an error code, such as 404 or 304. In that case, self.http_error_auth_reqed raises the appropriate HTTPError and self.reset_retry_count is not called. I think that the code should be something along the lines of: try: retry = self.http_error_auth_reqed('www-authenticate', host, req, headers) except HTTPError, e: if e.code != 401: self.reset_retry_counter() raise else: self.reset_retry_counter() return retry Ways to reproduce the problem: try to access a resource for which an HTTP server requires authentication but for which after successful authentication returns a negative reply. I've attached an example script to demonstrate it (for python 2.X; bug also resent in 3.X, just replace import urllib2 with from urllib import request as urllib2 ;-) ). The same problem applies to ProxyDigestAuthHandler. ---------- components: Library (Lib) files: test_urllib2.py messages: 115054 nosy: Luci.Stanescu priority: normal severity: normal status: open title: When reusing an handler, urllib(2)'s digest authentication fails after multiple regative replies type: behavior versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file18656/test_urllib2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 13:42:20 2010 From: report at bugs.python.org (sorin) Date: Fri, 27 Aug 2010 11:42:20 +0000 Subject: [New-bugs-announce] [issue9699] invalid call of Windows API _popen() generating The input line is too long error message In-Reply-To: <1282909340.45.0.225876683414.issue9699@psf.upfronthosting.co.za> Message-ID: <1282909340.45.0.225876683414.issue9699@psf.upfronthosting.co.za> New submission from sorin : Behavior: you get "The input line is too long." error message when you try to run an external process by using os.system(), subprocess.Popen() or other similar methods. The real command line limit is 8192 under Windows and in most cases (if not all) the cause for getting this message is not the length. The real cause is that if you even have a quote inside your command line you need to include the entire command in quote. Here are some details: http://stackoverflow.com/questions/682799/what-to-do-with-the-input-line-is-too-long-error-message/3583282#3583282 http://msdn.microsoft.com/en-us/library/96ayss4b.aspx (see comment) Even if this is caused by a bug on Windows that is present for more than ten years I think Python needs to workaround it by adding the quotes when they are needed. This will prevent other developers from writing OS specific code in their Python programs in order to workaround this bug. ---------- components: Windows messages: 115062 nosy: sorin priority: normal severity: normal status: open title: invalid call of Windows API _popen() generating The input line is too long error message type: behavior versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 14:39:53 2010 From: report at bugs.python.org (=?utf-8?b?U8OpYmFzdGllbiBTYWJsw6k=?=) Date: Fri, 27 Aug 2010 12:39:53 +0000 Subject: [New-bugs-announce] [issue9700] semaphore errors on AIX 6.1 In-Reply-To: <1282912793.51.0.185151157786.issue9700@psf.upfronthosting.co.za> Message-ID: <1282912793.51.0.185151157786.issue9700@psf.upfronthosting.co.za> New submission from S?bastien Sabl? : Hi, The same problem that was reported in issue 1106262 is appearing again on AIX 6.1 (the following error messages appear sometime when runnning python: sem_trywait: Permission denied sem_post: Permission denied sem_destroy: Permission denied) It can be easily corrected by defining HAVE_BROKEN_POSIX_SEMAPHORES for AIX 6, like it is done for AIX 5. I attach a patch that does that (I made the patch on Python 2.6.6 but it should apply to Python 2.7 and 3.X as well). regards ---------- components: None files: patch-semaphore.diff keywords: patch messages: 115068 nosy: sable priority: normal severity: normal status: open title: semaphore errors on AIX 6.1 versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file18658/patch-semaphore.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 15:10:01 2010 From: report at bugs.python.org (Sylvain Mora) Date: Fri, 27 Aug 2010 13:10:01 +0000 Subject: [New-bugs-announce] [issue9701] Update ZSH profile on Mac OS installation Message-ID: <1282914601.34.0.890986507824.issue9701@psf.upfronthosting.co.za> Changes by Sylvain Mora : ---------- components: Build files: postflight.patch-profile.diff keywords: patch nosy: ronaldoussoren, solevis priority: normal severity: normal status: open title: Update ZSH profile on Mac OS installation versions: Python 2.7 Added file: http://bugs.python.org/file18659/postflight.patch-profile.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 15:53:27 2010 From: report at bugs.python.org (david) Date: Fri, 27 Aug 2010 13:53:27 +0000 Subject: [New-bugs-announce] [issue9702] Python violates most users expectations via the modification differences of immutable and mutable objects in methods In-Reply-To: <1282917207.25.0.718078039013.issue9702@psf.upfronthosting.co.za> Message-ID: <1282917207.25.0.718078039013.issue9702@psf.upfronthosting.co.za> New submission from david : Python violates most users expectations via the modification differences of immutable and mutable objects in methods. def foo(bar): bar = bar + bar def listy(bar): bar = [1] def dicty(bar): bar['1'] = '1' if __name__ == "__main__": bar = 1 foo(bar) print bar baz = [] print baz listy(baz) print baz dict_d = {} print dict_d dicty(dict_d) print dict_d this will output 1 [] [] {} {'1': '1'} So sure this is 'expected'(pass by reference vs new object - for immutable objects) but it sure isn't obvious. I feel this is a bug in python core. I think that the behaviour should be the same for *all* objects. If it is pass by reference, *and* the item has to be able to be updated(I feel this breaks most people's expectations...) then the result of a modification to an object that is immutable should be that the pointer to the original now points to the resulting string. Personally I do not want to be able to modify the dictionary as I did above like I did. ---------- messages: 115074 nosy: db priority: normal severity: normal status: open title: Python violates most users expectations via the modification differences of immutable and mutable objects in methods _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 00:31:08 2010 From: report at bugs.python.org (vladimir) Date: Fri, 27 Aug 2010 22:31:08 +0000 Subject: [New-bugs-announce] [issue9703] default param values In-Reply-To: <1282948268.07.0.00114901729063.issue9703@psf.upfronthosting.co.za> Message-ID: <1282948268.07.0.00114901729063.issue9703@psf.upfronthosting.co.za> New submission from vladimir : This program: class t( object): def __init__(self,ime,param1=[],param2=[]): print "+++init+++" print "ime = ",ime print "param1 = ", param1 print "param2 = ", param2 print self.ime = ime self.sirina = param1 self.visina = param2 def load(self): print "load self.ime = ",self.ime self.sirina.append('a') self.visina.append('b') t1 = t("jedan",[1,2],[3,4]) t2 = t("dva",[5,6],[7,8]) t3 = t("tri") t3.load() t4 = t("cetiri") produces this output: +++init+++ ime = jedan param1 = [1, 2] param2 = [3, 4] +++init+++ ime = dva param1 = [5, 6] param2 = [7, 8] +++init+++ ime = tri param1 = [] param2 = [] load self.ime = tri +++init+++ ime = cetiri param1 = ['a'] param2 = ['b'] Question: How's possible that call t4 = t("cetiri") gives param1 value ['a'] and param2 value ['b'] Is it possible that is bug or my computer gone crazy or maybe i am executed on: Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on linux2 ---------- messages: 115137 nosy: vladimir priority: normal severity: normal status: open title: default param values type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 02:32:13 2010 From: report at bugs.python.org (Sridhar Ratnakumar) Date: Sat, 28 Aug 2010 00:32:13 +0000 Subject: [New-bugs-announce] [issue9704] 3.2 - zlib.pc.in is missing in source tree In-Reply-To: <1282955533.72.0.347267981951.issue9704@psf.upfronthosting.co.za> Message-ID: <1282955533.72.0.347267981951.issue9704@psf.upfronthosting.co.za> New submission from Sridhar Ratnakumar : We, ActiveState, are trying to build Python 3.2 (py3k branch) and get this error: make: [build_zlib] running 'cd build/pyhg_branches_py3k-linux-x86_64-hgtip32/python/Modules/zlib && CFLAGS="-fPIC" ./configure --prefix=/home/sridharr/as/apy/branches/32a1ssl1/build/pyhg_branches_py3k-linux-x86_64-hgtip32/ExTAcTiVePyThOnPrEfIxExTAcTiVePyThOnPrEfIxExTAcTiVePyThOnPrEfIxExTAcTiVePyThOnPrEfIxExTAcTiVePyThOnPrEfIxExTAcTiVePyThOnPrEfIxExTAcTiVePyThOnPrEfIxExTAcTiVePyThOnPrEfIxExTAcTiVePyThOnPrEfIxExTAcTiVePyThOnPrEfIx && make && make install' Checking for gcc... Checking for shared library support... Tested gcc -w -c -fPIC -fPIC ztest8832.c Tested gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map -fPIC -fPIC -o ztest8832.so ztest8832.o /usr/bin/ld: cannot open linker script file zlib.map: No such file or directory collect2: ld returned 1 exit status No shared library support; try without defining CC and CFLAGS Building static library libz.a version 1.2.5 with gcc. Checking for off64_t... Yes. Checking for fseeko... Yes. cp: cannot stat `zconf.h.in': No such file or directory Checking for unistd.h... Yes. Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf(). Checking for vsnprintf() in stdio.h... Yes. Checking for return value of vsnprintf()... Yes. Checking for attribute(visibility) support... Yes. ./configure: 596: cannot open zlib.pc.in: No such file gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o example.o example.c gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o adler32.o adler32.c gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o compress.o compress.c gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o crc32.o crc32.c gcc -fPIC -D_LARGEFILE64_SOURCE=1 -c -o deflate.o deflate.c make: *** No rule to make target `gzguts.h', needed by `gzclose.o'. Stop. Running a ./configure Modules/zlib leads to: sridharr at whymac:~/code/o/py/py3k/Modules/zlib > ./configure Checking for gcc... Checking for shared library support... Building shared library libz.1.2.5.dylib with gcc. Checking for off64_t... No. Checking for fseeko... Yes. cp: zconf.h.in: No such file or directory Checking for unistd.h... Yes. Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf(). Checking for vsnprintf() in stdio.h... Yes. Checking for return value of vsnprintf()... Yes. Checking for attribute(visibility) support... Yes. ./configure: line 575: zlib.pc.in: No such file or directory *** Is zlib.pc.in missing by accident? *** I can run ./configure in Modules/zlib for Python trunk (2.7) though. Sifting through the changelog, I discovered that this commit must have introduced this bug http://svn.python.org/view/python/branches/py3k/Modules/zlib/configure?r1=56849&r2=83296 Marin, perhaps you forgot to checkin zlib.pc.in? Have you tried running ./configure (under Modules/zlib) on a OSX or Linux machine? ---------- components: Build, Extension Modules messages: 115143 nosy: loewis, srid priority: normal severity: normal status: open title: 3.2 - zlib.pc.in is missing in source tree type: compile error versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 19:00:57 2010 From: report at bugs.python.org (Ultrasick) Date: Sat, 28 Aug 2010 17:00:57 +0000 Subject: [New-bugs-announce] [issue9705] limit dict.update() to a given list of keys In-Reply-To: <1283014857.1.0.520835595652.issue9705@psf.upfronthosting.co.za> Message-ID: <1283014857.1.0.520835595652.issue9705@psf.upfronthosting.co.za> New submission from Ultrasick : my_dict_1 = {'a' : 1, 'b' : 1} my_dict_2 = {'a' : 2, 'b' : 2, 'c' : 2} my_dict_1.update(my_dict_2, ['a', 'c']) should result for my_dict_1: {'a' : 2, 'b' : 1, 'c' : 2} ---------- components: Interpreter Core messages: 115157 nosy: Ultrasick priority: normal severity: normal status: open title: limit dict.update() to a given list of keys type: feature request versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 21:19:03 2010 From: report at bugs.python.org (Giampaolo Rodola') Date: Sat, 28 Aug 2010 19:19:03 +0000 Subject: [New-bugs-announce] [issue9706] ssl errors checking In-Reply-To: <1283023143.92.0.0739229876484.issue9706@psf.upfronthosting.co.za> Message-ID: <1283023143.92.0.0739229876484.issue9706@psf.upfronthosting.co.za> New submission from Giampaolo Rodola' : There are various errors I think ssl module should check. In the examples below I'll always refer to ssl.wrap_socket() function but I expect that ssl.SSLContext suffers the exact same issues. === server side mode === When server_side option is set to True it is always required that at least a certfile argument is specified. This condition is not verified if the socket is still not connected: >>> ssl.wrap_socket(socket.socket(), server_side=1) ...later on, when the socket will be connected, we'll get this message: SSLError: _ssl.c:296: Both the key & certificate files must be specified for server-side operation I would change this behavior in SSLSocket constructor and raise ValueError if server_side is True and certfile is None. Also, the message coming from the C code should be adjusted to state than keyfile argument is not mandatory. === server side on connect === >>> s = ssl.wrap_socket(socket.socket(), server_side=1) >>> s.connect(('blogger.com', 443)) >>> For consistency I would expect something like ValueError("can't connect in server-side mode") on connect(). === no such certfile === >>> os.path.exists('xxx') False >>> ssl.wrap_socket(socket.socket(), certfile='xxx') Traceback (most recent call last): File "", line 1, in File "/home/giampaolo/svn/python-3.2/Lib/ssl.py", line 404, in wrap_socket ciphers=ciphers) File "/home/giampaolo/svn/python-3.2/Lib/ssl.py", line 132, in __init__ self.context.load_cert_chain(certfile, keyfile) ssl.SSLError: [Errno 336445442] _ssl.c:1604: error:140DC002:SSL routines:SSL_CTX_use_certificate_chain_file:system lib >>> A simple "IOError No such file or directory 'xxx'" exception would be a lot more clear. === invalid certfile === >>> open('foo', 'w').write('blabla') 6 >>> ssl.wrap_socket(socket.socket(), certfile="foo") Traceback (most recent call last): File "", line 1, in File "/home/giampaolo/svn/python-3.2/Lib/ssl.py", line 404, in wrap_socket ciphers=ciphers) File "/home/giampaolo/svn/python-3.2/Lib/ssl.py", line 132, in __init__ self.context.load_cert_chain(certfile, keyfile) ssl.SSLError: [Errno 336445449] _ssl.c:1604: error:140DC009:SSL routines:SSL_CTX_use_certificate_chain_file:PEM lib >>> If possible, the error should be more clear about what happened. Something like "malformed certfile was provided" or something. ---------- messages: 115166 nosy: giampaolo.rodola, janssen, pitrou priority: normal severity: normal status: open title: ssl errors checking versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 22:26:36 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 28 Aug 2010 20:26:36 +0000 Subject: [New-bugs-announce] [issue9707] Reworked threading.local reference implementation In-Reply-To: <1283027196.81.0.843812441705.issue9707@psf.upfronthosting.co.za> Message-ID: <1283027196.81.0.843812441705.issue9707@psf.upfronthosting.co.za> New submission from Antoine Pitrou : This is a reworked reference implementation of _threading_local without the __del__ quirks. The _patch() ugliness is unfortunately still needed because of a doctest checking that derived __slots__ attributes aren't actually thread-local. Note that users are unlikely to ever use this code in the real world, except perhaps with non-CPython implementations. ---------- components: Library (Lib) files: threadlocal.patch keywords: patch messages: 115170 nosy: gregory.p.smith, pitrou priority: normal severity: normal stage: patch review status: open title: Reworked threading.local reference implementation type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file18669/threadlocal.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 23:51:36 2010 From: report at bugs.python.org (Adrian Nye) Date: Sat, 28 Aug 2010 21:51:36 +0000 Subject: [New-bugs-announce] [issue9708] cElementTree iterparse does not support "parser" argument In-Reply-To: <1283032296.54.0.54816594665.issue9708@psf.upfronthosting.co.za> Message-ID: <1283032296.54.0.54816594665.issue9708@psf.upfronthosting.co.za> New submission from Adrian Nye : The (python) ElementTree library began in 2.7 to support the "parser" argument, but cElementTree does not support it. Either cElementTree should support it, or the documentation should mention that it does not. ---------- components: XML messages: 115173 nosy: adrian_nye priority: normal severity: normal status: open title: cElementTree iterparse does not support "parser" argument versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 19:10:38 2010 From: report at bugs.python.org (Stefan Krah) Date: Sun, 29 Aug 2010 17:10:38 +0000 Subject: [New-bugs-announce] [issue9709] test_distutils warning: initfunc exported twice on Windows In-Reply-To: <1283101838.76.0.73949668593.issue9709@psf.upfronthosting.co.za> Message-ID: <1283101838.76.0.73949668593.issue9709@psf.upfronthosting.co.za> New submission from Stefan Krah : On Windows, the initfunc of a C extension is exported twice, as seen here: test_distutils xxmodule.c xxmodule.obj : warning LNK4197: export 'initxx' specified multiple times; using first specification First export: pyport.h: #define PyMODINIT_FUNC __declspec(dllexport) void Second export: Specified on the command line with /EXPORT The code responsible for adding the initfunc name to ext.export_symbols is in build_ext.py:get_export_symbols. I'm not sure if it could be removed, since older extensions might not use PyMODINIT_FUNC. If it can't be removed, perhaps PyMODINIT_FUNC could be specified simply as void. ---------- assignee: eric.araujo components: Distutils, Distutils2 messages: 115181 nosy: brian.curtin, eric.araujo, skrah priority: normal severity: normal stage: needs patch status: open title: test_distutils warning: initfunc exported twice on Windows type: behavior versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 21:48:10 2010 From: report at bugs.python.org (Florent Xicluna) Date: Sun, 29 Aug 2010 19:48:10 +0000 Subject: [New-bugs-announce] [issue9710] 2to3 could remove "-*- coding: utf-8 -*-" In-Reply-To: <1283111290.18.0.408621476951.issue9710@psf.upfronthosting.co.za> Message-ID: <1283111290.18.0.408621476951.issue9710@psf.upfronthosting.co.za> New submission from Florent Xicluna : According to PEP8, "Files using ASCII (or UTF-8, for Python 3.0) should not have a coding cookie." ---------- components: 2to3 (2.x to 3.0 conversion tool) messages: 115191 nosy: flox priority: normal severity: normal status: open title: 2to3 could remove "-*- coding: utf-8 -*-" type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 22:50:04 2010 From: report at bugs.python.org (Giampaolo Rodola') Date: Sun, 29 Aug 2010 20:50:04 +0000 Subject: [New-bugs-announce] [issue9711] ssl.SSLSocket's keyfile argument seems to be ignored if specified without certfile In-Reply-To: <1283115004.18.0.127719277897.issue9711@psf.upfronthosting.co.za> Message-ID: <1283115004.18.0.127719277897.issue9711@psf.upfronthosting.co.za> New submission from Giampaolo Rodola' : By taking a look at ssl.py it seems that keyfile argument is ignored if certfile argument is not specified as well. Here's an extract of ssl.py code: class SSLSocket: def __init__(self, sock=None, keyfile=None, certfile=None, server_side=False, cert_reqs=CERT_NONE, ssl_version=PROTOCOL_SSLv23, ca_certs=None, do_handshake_on_connect=True, family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None, suppress_ragged_eofs=True, ciphers=None, _context=None): [...] if certfile and not keyfile: keyfile = certfile [...] if certfile: self.context.load_cert_chain(certfile, keyfile) So at the current stage this: >>> ssl.wrap_socket(socket.socket(), keyfile="XXX") ...would be equal to: >>> ssl.wrap_socket(socket.socket()) To me this leads to one question: are there circumstances in which it makes sense to specify "keyfile" and *not* "certfile"? As far as I know, on server-side it is always required to specify *at least* certfile argument, in which case this would represent a bug. Not sure about client-side sockets. ---------- messages: 115195 nosy: exarkun, giampaolo.rodola, janssen, pitrou priority: normal severity: normal status: open title: ssl.SSLSocket's keyfile argument seems to be ignored if specified without certfile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:42:57 2010 From: report at bugs.python.org (Florent Xicluna) Date: Mon, 30 Aug 2010 07:42:57 +0000 Subject: [New-bugs-announce] [issue9712] tokenize yield an ERRORTOKEN if the identifier starts with a non-ascii char In-Reply-To: <1283154177.7.0.16014867671.issue9712@psf.upfronthosting.co.za> Message-ID: <1283154177.7.0.16014867671.issue9712@psf.upfronthosting.co.za> New submission from Florent Xicluna : from io import BytesIO from tokenize import tokenize, tok_name sample = '?l?phants = "un ?l?phant, deux ?l?phants, ..."\nprint(?l?phants)\n' sampleb = sample.encode('utf-8') exec(sample) # output: un ?l?phant, deux ?l?phants, ... exec(sampleb) # output: un ?l?phant, deux ?l?phants, ... module = BytesIO() module.write(sampleb) module.seek(0) for line in tokenize(module.readline): print(tok_name[line.type], line) # output: ENCODING TokenInfo(type=57, string='utf-8', start=(0, 0), end=(0, 0), line='') ERRORTOKEN TokenInfo(type=54, string='?', start=(1, 0), end=(1, 1), line='?l?phants = "un ?l?phant, deux ?l?phants, ..."\n') NAME TokenInfo(type=1, string='l?phants', start=(1, 1), end=(1, 9), line='?l?phants = "un ?l?phant, deux ?l?phants, ..."\n') OP TokenInfo(type=53, string='=', start=(1, 10), end=(1, 11), line='?l?phants = "un ?l?phant, deux ?l?phants, ..."\n') STRING TokenInfo(type=3, string='"un ?l?phant, deux ?l?phants, ..."', start=(1, 12), end=(1, 46), line='?l?phants = "un ?l?phant, deux ?l?phants, ..."\n') NEWLINE TokenInfo(type=4, string='\n', start=(1, 46), end=(1, 47), line='?l?phants = "un ?l?phant, deux ?l?phants, ..."\n') NAME TokenInfo(type=1, string='print', start=(2, 0), end=(2, 5), line='print(?l?phants)\n') OP TokenInfo(type=53, string='(', start=(2, 5), end=(2, 6), line='print(?l?phants)\n') ERRORTOKEN TokenInfo(type=54, string='?', start=(2, 6), end=(2, 7), line='print(?l?phants)\n') NAME TokenInfo(type=1, string='l?phants', start=(2, 7), end=(2, 15), line='print(?l?phants)\n') OP TokenInfo(type=53, string=')', start=(2, 15), end=(2, 16), line='print(?l?phants)\n') NEWLINE TokenInfo(type=4, string='\n', start=(2, 16), end=(2, 17), line='print(?l?phants)\n') ENDMARKER TokenInfo(type=0, string='', start=(3, 0), end=(3, 0), line='') ---------- messages: 115201 nosy: flox priority: normal severity: normal stage: unit test needed status: open title: tokenize yield an ERRORTOKEN if the identifier starts with a non-ascii char type: behavior versions: Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:46:53 2010 From: report at bugs.python.org (Campbell Barton) Date: Mon, 30 Aug 2010 07:46:53 +0000 Subject: [New-bugs-announce] [issue9713] Py_CompileString fails on non decode-able paths. In-Reply-To: <1283154413.35.0.877915229941.issue9713@psf.upfronthosting.co.za> Message-ID: <1283154413.35.0.877915229941.issue9713@psf.upfronthosting.co.za> New submission from Campbell Barton : On linux I have a path which python reads as... /data/test/num\udce9ro_bad/untitled.blend os.listdir("/data/test/") returns this ['num\udce9ro_bad'] But the same path cant be given to the C api's Py_CompileString Where fn is '/data/test/num\udce9ro_bad/untitled.blend/test.py' Py_CompileString(buf, fn, Py_file_input); ...gives this error. UnicodeDecodeError: 'utf8' codec can't decode bytes in position 14-16: invalid data >From this pep, non decode-able paths should use surrogateescape's http://www.python.org/dev/peps/pep-0383/ ---------- components: None messages: 115202 nosy: ideasman42 priority: normal severity: normal status: open title: Py_CompileString fails on non decode-able paths. type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 13:54:16 2010 From: report at bugs.python.org (Kuno Woudt) Date: Mon, 30 Aug 2010 11:54:16 +0000 Subject: [New-bugs-announce] [issue9714] urllib2 digest authentication doesn't work when connecting to a Catalyst server. In-Reply-To: <1283169256.94.0.0442479793498.issue9714@psf.upfronthosting.co.za> Message-ID: <1283169256.94.0.0442479793498.issue9714@psf.upfronthosting.co.za> New submission from Kuno Woudt : In the WWW-Authenticate header Catalyst::Authentication::Credential::HTTP sends the following value for qop: qop="auth,auth-int" This is identical to the example given in section 3.5 of the RFC (http://tools.ietf.org/html/rfc2617#section-3.5 ), so I assume this is correct. urllib2 does not expect multiple values for qop, and only works when qop="auth". I've managed to work around it with: class DigestAuthHandler (urllib2.HTTPDigestAuthHandler): def get_authorization (self, req, chal): qop = chal.get ('qop', None) if qop and ',' in qop and 'auth' in qop.split (','): chal['qop'] = 'auth' return urllib2.HTTPDigestAuthHandler.get_authorization (self, req, chal) ---------- components: Library (Lib) messages: 115207 nosy: warpr priority: normal severity: normal status: open title: urllib2 digest authentication doesn't work when connecting to a Catalyst server. type: behavior versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 13:54:42 2010 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 30 Aug 2010 11:54:42 +0000 Subject: [New-bugs-announce] [issue9715] io doc improvements In-Reply-To: <1283169282.13.0.519600528292.issue9715@psf.upfronthosting.co.za> Message-ID: <1283169282.13.0.519600528292.issue9715@psf.upfronthosting.co.za> New submission from Antoine Pitrou : This is an improvement patch for the :mod:`io` documentation. It adds an user-friendly overview, and makes a couple of other fixes/improvements. There's a problem where I want to make a link to a glossary term while using the plural form ("abstract base classes"), and it doesn't work. Can someone help me? ---------- assignee: docs at python components: Documentation, IO files: iodoc.patch keywords: patch messages: 115208 nosy: benjamin.peterson, docs at python, pitrou priority: normal severity: normal stage: patch review status: open title: io doc improvements type: behavior versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file18679/iodoc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 20:28:17 2010 From: report at bugs.python.org (Kay Hayen) Date: Mon, 30 Aug 2010 18:28:17 +0000 Subject: [New-bugs-announce] [issue9716] The inittab modules cannot be packages In-Reply-To: <1283192897.9.0.714463074092.issue9716@psf.upfronthosting.co.za> Message-ID: <1283192897.9.0.714463074092.issue9716@psf.upfronthosting.co.za> New submission from Kay Hayen : Hello, I try to include modules with PyImport_AppendInittab or PyImport_ExtendInittab and that works fine. But if these modules are part of a package, i.e. I provide "package_name.module_name" as the name, they never get considered. Is there any way to add a package with modules below it from C/API? So that an import package_name.module_name from other modules will find it? Yours, Kay Hayen ---------- messages: 115235 nosy: kayhayen priority: normal severity: normal status: open title: The inittab modules cannot be packages type: feature request versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 20:49:34 2010 From: report at bugs.python.org (Arnaud Delobelle) Date: Mon, 30 Aug 2010 18:49:34 +0000 Subject: [New-bugs-announce] [issue9717] operator module - "in place" operators documentation In-Reply-To: <1283194174.19.0.42398116416.issue9717@psf.upfronthosting.co.za> Message-ID: <1283194174.19.0.42398116416.issue9717@psf.upfronthosting.co.za> New submission from Arnaud Delobelle : More detailed explanation of how in place operators work, and how they are related to the operator module iadd, isub, ... functions. Submitted following this message on python-list: http://mail.python.org/pipermail/python-list/2010-August/1254243.html ---------- assignee: docs at python components: Documentation files: operator_inplace.diff keywords: patch messages: 115237 nosy: arno, docs at python priority: normal severity: normal status: open title: operator module - "in place" operators documentation versions: Python 3.3 Added file: http://bugs.python.org/file18682/operator_inplace.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 21:08:57 2010 From: report at bugs.python.org (quindraco) Date: Mon, 30 Aug 2010 19:08:57 +0000 Subject: [New-bugs-announce] [issue9718] Python Interpreter Crash In-Reply-To: <1283195337.42.0.488897462003.issue9718@psf.upfronthosting.co.za> Message-ID: <1283195337.42.0.488897462003.issue9718@psf.upfronthosting.co.za> New submission from quindraco : I am attaching my stacktrace from using Python 2.6, but I get identical behaviour in 2.7. I suspect that at least one of the underlying modules I'm using is broken, but the interpreter shouldn't crash just because an external module is broken, so I'm reporting the issue. That's what's happening - I'm crashing the python interpreter. Here's what I type to cause the issue; I'm not sure what more information is needed. from django.test.client import Client c = Client() response = c.post(logindir, loginvars) response = c.get(getdir) ---------- components: None files: stacktrace.txt messages: 115240 nosy: quindraco priority: normal severity: normal status: open title: Python Interpreter Crash type: crash versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file18684/stacktrace.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 23:05:05 2010 From: report at bugs.python.org (Sridhar Ratnakumar) Date: Mon, 30 Aug 2010 21:05:05 +0000 Subject: [New-bugs-announce] [issue9719] build_ssl.py: cannot find 'asm64/*.*' In-Reply-To: <1283202305.21.0.603628878344.issue9719@psf.upfronthosting.co.za> Message-ID: <1283202305.21.0.603628878344.issue9719@psf.upfronthosting.co.za> New submission from Sridhar Ratnakumar : With openssl-1.0.0a, I get the following error when building the py3k branch on Windows 64-bit: Traceback (most recent call last): File "build_ssl.py", line 262, in main() File "build_ssl.py", line 234, in main for f in os.listdir("asm"+dirsuffix): WindowsError: [Error 3] The system cannot find the path specified: 'asm64/*.*' Likely due to this commit http://svn.python.org/view/python/branches/py3k/PCbuild/build_ssl.py?r1=83288&r2=83335 ---------- components: Build, Windows messages: 115243 nosy: loewis, srid priority: normal severity: normal status: open title: build_ssl.py: cannot find 'asm64/*.*' versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 03:02:20 2010 From: report at bugs.python.org (Craig de Stigter) Date: Tue, 31 Aug 2010 01:02:20 +0000 Subject: [New-bugs-announce] [issue9720] zipfile writes incorrect local file header for large files in zip64 In-Reply-To: <1283216540.17.0.624049939978.issue9720@psf.upfronthosting.co.za> Message-ID: <1283216540.17.0.624049939978.issue9720@psf.upfronthosting.co.za> New submission from Craig de Stigter : Steps to reproduce: # create a large (>4gb) file f = open('foo.txt', 'wb') text = 'a' * 1024**2 for i in xrange(5 * 1024): f.write(text) f.close() # now zip the file import zipfile z = zipfile.ZipFile('foo.zip', mode='w', allowZip64=True) z.write('foo.txt') z.close() Now inspect the file headers using a hex editor. The written headers are incorrect. The filesize and compressed size should be written as 0xffffffff and the 'extra field' should contain the actual sizes. Tested on Python 2.5 but looking at the latest code in 3.2 it still looks broken. The problem is that the ZipInfo.FileHeader() is written before the filesize is populated, so Zip64 extensions are not written. Later, the sizes in the header are written, but Zip64 extensions are not taken into account and the filesize is just wrapped (7gb becomes 3gb, for instance). My patch fixes the problem on Python 2.5, it might need minor porting to fix trunk. It works by assigning the uncompressed filesize to the ZipInfo header initially, then writing the header. Then later on, I re-write the header (this is okay since the header size will not have increased.) ---------- components: Library (Lib) files: zipfile_zip64_header.patch keywords: patch messages: 115250 nosy: craigds priority: normal severity: normal status: open title: zipfile writes incorrect local file header for large files in zip64 type: behavior versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file18685/zipfile_zip64_header.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 07:20:58 2010 From: report at bugs.python.org (Bastian Kleineidam) Date: Tue, 31 Aug 2010 05:20:58 +0000 Subject: [New-bugs-announce] [issue9721] urlparse.urljoin() cuts off last base character with semicolon at url start In-Reply-To: <1283232058.13.0.308353601536.issue9721@psf.upfronthosting.co.za> Message-ID: <1283232058.13.0.308353601536.issue9721@psf.upfronthosting.co.za> New submission from Bastian Kleineidam : The urljoin() implementation cuts off the last base URL character if the URL to join starts with a semicolon. Expected output is no cut off characters. $ python2.6 Python 2.6.6 (r266:84292, Aug 29 2010, 12:36:23) [GCC 4.4.5 20100824 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import urlparse >>> print urlparse.urljoin('http://localhost:8080/feedback', ';jsessionid=XXX') http://localhost:8080/feedbac;jsessionid=XXX >>> ... same in Python 3.1.2: $ python3.1 Python 3.1.2 (release31-maint, Aug 29 2010, 18:45:17) [GCC 4.4.5 20100824 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import urllib.parse >>> urllib.parse.urljoin('http://localhost:8080/feedback', ';jsessionid=XXX') 'http://localhost:8080/feedbac;jsessionid=XXX' >>> ... in Python 2.5 the last path segment is cut off. $ python2.5 Python 2.5.5 (r255:77872, Aug 23 2010, 02:55:15) [GCC 4.4.5 20100816 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. m>>> import urlparse >>> print urlparse.urljoin('http://localhost:8080/feedback', ';jsessionid=XXX') http://localhost:8080/;jsessionid=XXX >>> ---------- components: Library (Lib) messages: 115252 nosy: calvin priority: normal severity: normal status: open title: urlparse.urljoin() cuts off last base character with semicolon at url start type: behavior versions: Python 2.5, Python 2.6, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 11:43:08 2010 From: report at bugs.python.org (Krauzi) Date: Tue, 31 Aug 2010 09:43:08 +0000 Subject: [New-bugs-announce] [issue9722] PyObject_Print with Visual Studio 2010 In-Reply-To: <1283247788.01.0.709012210199.issue9722@psf.upfronthosting.co.za> Message-ID: <1283247788.01.0.709012210199.issue9722@psf.upfronthosting.co.za> New submission from Krauzi : Hi guys, i recently found out that PyObject_Print is not working with Visual Studio 2010: #include #include int main( int argc, char** argv ) { Py_Initialize(); PyObject_Print( PyUnicode_FromString("test"), stdout, Py_PRINT_RAW ); Py_Finalize(); std::cin.get(); return EXIT_SUCCESS; } ---------- components: Interpreter Core, Windows messages: 115256 nosy: Krauzi priority: normal severity: normal status: open title: PyObject_Print with Visual Studio 2010 type: crash versions: Python 2.6, Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 15:40:14 2010 From: report at bugs.python.org (Brandon Craig Rhodes) Date: Tue, 31 Aug 2010 13:40:14 +0000 Subject: [New-bugs-announce] [issue9723] pipes.quote() needs to be documented In-Reply-To: <1283262014.72.0.527039259842.issue9723@psf.upfronthosting.co.za> Message-ID: <1283262014.72.0.527039259842.issue9723@psf.upfronthosting.co.za> New submission from Brandon Craig Rhodes : The only way to safely build shell command lines from inside of Python ? which is necessary when sending commands across SSH, since that behaves like os.system() rather than like subprocess.call() ? is to use the wonderful pipes.call() method to turn possibly-dangerous arguments, like filenames that might have spaces, special characters, and embedded "rm -r" calls, into perfectly quoted strings for an "sh"-like shell (say, bash or zsh). This call is already recommended on mailing lists, blog posts, and Stack Overflow ? and since it doesn't start with a "_", I think its public use is fair game. But the "pipes" documentation itself doesn't officially mention or support it. I think it should be added to the Standard Library documentation for "pipes". So. Yeah. ---------- assignee: docs at python components: Documentation messages: 115263 nosy: brandon-rhodes, docs at python priority: normal severity: normal status: open title: pipes.quote() needs to be documented type: feature request versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 16:21:46 2010 From: report at bugs.python.org (Cherniavsky Beni) Date: Tue, 31 Aug 2010 14:21:46 +0000 Subject: [New-bugs-announce] [issue9724] help('nonlocal') missing In-Reply-To: <1283264506.65.0.891353538251.issue9724@psf.upfronthosting.co.za> Message-ID: <1283264506.65.0.891353538251.issue9724@psf.upfronthosting.co.za> New submission from Cherniavsky Beni : >>> help('nonlocal') no Python documentation found for 'nonlocal' As a language keyword, it clearly should have documentation. ---------- assignee: docs at python components: Documentation messages: 115266 nosy: cben, docs at python priority: normal severity: normal status: open title: help('nonlocal') missing versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 19:05:37 2010 From: report at bugs.python.org (Petr Machek) Date: Tue, 31 Aug 2010 17:05:37 +0000 Subject: [New-bugs-announce] [issue9725] urllib.request.FancyURLopener won't connect to pages requiring username and password In-Reply-To: <1283274337.79.0.0864543833676.issue9725@psf.upfronthosting.co.za> Message-ID: <1283274337.79.0.0864543833676.issue9725@psf.upfronthosting.co.za> New submission from Petr Machek : Code: import urllib.request class MyOpener(urllib.request.FancyURLopener): prompt_user_passwd = lambda x, y, z: ("username", "password") opener = MyOpener() page = opener.open("http://riddle.p4x.ch/music") print(page.readlines()) opener.open() call ends with error for every page requiring login via prompt_user_password(). urllib/request.py tries to encode password with base64 without conversion to bytes which is required for base64.b64encode() in Python 3.1. Even after applying conversion to bytes, another new error is generated ---------- components: Library (Lib) messages: 115269 nosy: petr6.6 priority: normal severity: normal status: open title: urllib.request.FancyURLopener won't connect to pages requiring username and password type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 21:11:27 2010 From: report at bugs.python.org (Desmond Cox) Date: Tue, 31 Aug 2010 19:11:27 +0000 Subject: [New-bugs-announce] [issue9726] logging.handlers.RotatingFileHandler: implement "preserve log file name extension" feature In-Reply-To: <1283281887.54.0.818676292303.issue9726@psf.upfronthosting.co.za> Message-ID: <1283281887.54.0.818676292303.issue9726@psf.upfronthosting.co.za> New submission from Desmond Cox : See https://issues.apache.org/jira/browse/LOG4NET-64 - "[PATCH] to RollingFileAppender.cs to add the ability to preserve the log file name extension when rolling the log file." Currently, rollover appends a numeric extension to the base file name. E.g.: app.log app.log.1 app.log.2 Consider adding an option to preserve the log file name extension. E.g.: app.log app.1.log app.2.log This maintains file associations in Windows, most notably. ---------- components: Library (Lib) messages: 115272 nosy: desmondgc priority: normal severity: normal status: open title: logging.handlers.RotatingFileHandler: implement "preserve log file name extension" feature type: feature request versions: Python 2.7 _______________________________________ Python tracker _______________________________________