From report at bugs.python.org Sun Jan 2 01:07:50 2011 From: report at bugs.python.org (kai zhu) Date: Sun, 02 Jan 2011 00:07:50 +0000 Subject: [New-bugs-announce] [issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows In-Reply-To: <1293926870.23.0.886180589728.issue10802@psf.upfronthosting.co.za> Message-ID: <1293926870.23.0.886180589728.issue10802@psf.upfronthosting.co.za> New submission from kai zhu : i have 2 debian i386 unstable distros. 1) python3.2 (latest hg) running under vps @ linode.com seems ok 2) python3.2 (latest hg) running under colinux (in windows xp) breaks *NOTE 3) python3.2 (release b2) works fine under colinux public at colinux: python3.2 Python 3.2b2+ (py3k, Jan 1 2011, 17:42:23) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess >>> subprocess.Popen('ls') Traceback (most recent call last): File "", line 1, in File "/home/public/i486-pc-linux-gnu/lib/python3.2/subprocess.py", line 708, in __init__ restore_signals, start_new_session) File "/home/public/i486-pc-linux-gnu/lib/python3.2/subprocess.py", line 1136, in _execute_child errpipe_read, errpipe_write = _create_pipe() OSError: [Errno 38] Function not implemented >>> ---------- components: IO, Interpreter Core messages: 125020 nosy: kaizhu priority: normal severity: normal status: open title: python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 07:59:06 2011 From: report at bugs.python.org (Markus F.X.J. Oberhumer) Date: Sun, 02 Jan 2011 06:59:06 +0000 Subject: [New-bugs-announce] [issue10803] ctypes: better support of bytearray objects In-Reply-To: <1293951546.17.0.00856255345379.issue10803@psf.upfronthosting.co.za> Message-ID: <1293951546.17.0.00856255345379.issue10803@psf.upfronthosting.co.za> New submission from Markus F.X.J. Oberhumer : Python 3.2b2 does not properly support accessing bytearrays from ctypes, which makes dealing with large buffers somewhat unpleasant. A very first fix - a simple patch for the z_set() function - is given here. build/Python-3.2b2 $ quilt diff Index: b/Modules/_ctypes/cfield.c =================================================================== --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -1363,6 +1363,10 @@ *(char **)ptr = PyBytes_AsString(value); Py_INCREF(value); return value; + } else if (PyByteArray_Check(value)) { + *(char **)ptr = PyByteArray_AsString(value); + Py_INCREF(value); + return value; } else if (PyLong_Check(value)) { #if SIZEOF_VOID_P == SIZEOF_LONG_LONG *(char **)ptr = (char *)PyLong_AsUnsignedLongLongMask(value); ---------- assignee: theller components: ctypes messages: 125032 nosy: mfxmfx, theller priority: normal severity: normal status: open title: ctypes: better support of bytearray objects type: feature request versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 13:28:20 2011 From: report at bugs.python.org (Torsten Landschoff) Date: Sun, 02 Jan 2011 12:28:20 +0000 Subject: [New-bugs-announce] [issue10804] Copy and paste error in _json.c In-Reply-To: <1293971300.52.0.745698040415.issue10804@psf.upfronthosting.co.za> Message-ID: <1293971300.52.0.745698040415.issue10804@psf.upfronthosting.co.za> New submission from Torsten Landschoff : There is a copy and paste error in _json.c: The pairs_hook field is assigned but object_hook is verified to be non-null. The same field is verified a few lines back to this is superfluous at least. ---------- components: Library (Lib) files: patch messages: 125044 nosy: torsten priority: normal severity: normal status: open title: Copy and paste error in _json.c versions: Python 2.7 Added file: http://bugs.python.org/file20219/patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 15:23:51 2011 From: report at bugs.python.org (Austin Bingham) Date: Sun, 02 Jan 2011 14:23:51 +0000 Subject: [New-bugs-announce] [issue10805] traceback.print_exception throws AttributeError when exception is None In-Reply-To: <1293978231.38.0.946265028499.issue10805@psf.upfronthosting.co.za> Message-ID: <1293978231.38.0.946265028499.issue10805@psf.upfronthosting.co.za> New submission from Austin Bingham : traceback.print_exception() will throw an AttributeException if `value` is None and `chain` is True. This is because `_iter_chain` assumes that the exception object has a `__cause__` attribute. You can trigger this by trying for format a non-existent exception: >>> import logging, sys >>> logging.Formatter().formatException(sys.exc_info()) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.1/logging/__init__.py", line 418, in formatException traceback.print_exception(ei[0], ei[1], ei[2], None, sio) File "/usr/lib/python3.1/traceback.py", line 155, in print_exception for value, tb in values: File "/usr/lib/python3.1/traceback.py", line 122, in _iter_chain cause = exc.__cause__ This is assuming that sys.exc_info() returns (None, None, None). ---------- components: Library (Lib) messages: 125054 nosy: abingham priority: normal severity: normal status: open title: traceback.print_exception throws AttributeError when exception is None type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 19:08:37 2011 From: report at bugs.python.org (Ross Lagerwall) Date: Sun, 02 Jan 2011 18:08:37 +0000 Subject: [New-bugs-announce] [issue10806] Subprocess error if fds 0, 1, 2 are closed In-Reply-To: <1293991717.46.0.660046429073.issue10806@psf.upfronthosting.co.za> Message-ID: <1293991717.46.0.660046429073.issue10806@psf.upfronthosting.co.za> New submission from Ross Lagerwall : There is an issue where if a python program closes all the std. file descriptors (e.g. a daemon) and then uses the subprocess module, the file descriptors may not be set up properly in the subprocess. This may actually be a fairly common use case in a daemon program that needs to run a subprocess and set up pipes to it. Here is an example: import os, subprocess, sys x=os.open('/dev/null', os.O_RDWR) os.close(0) os.close(1) os.close(2) res = subprocess.Popen([sys.executable, "-c", 'import sys;' 'sys.stdout.write("apple");' 'sys.stdout.flush();' 'sys.stderr.write("orange")'], stdin=x, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() with open('/tmp/out', 'w') as f: f.write(repr(res) + '\n') f.write(repr((b'apple', b'orange')) + '\n') The expected output in /tmp/out is: ('apple', 'orange') ('apple', 'orange') but we get: (b'', b"Fatal Python error: Py_Initialize: can't initialize sys standard streams\nOSError: [Errno 9] Bad file descriptor\n") (b'apple', b'orange') The problem comes about where the calls are made (this applies to the python & c versions): os.dup2(p2cread, 0) os.dup2(c2pwrite, 1) os.dup2(errwrite, 2) if c2pwrite or p2cread or errwrite is the same as what it's being dupped() to (eg if c2pwrite == 1) then the dup2 call does nothing. But, if we're using pipes, the close-on-exec flags are set initially and the dup2() call would normally remove the flag but it doesn't. Attached is a patch which basically uses fcntl if necessary to remove the close-on-exec flag, and tests. ---------- components: Library (Lib) files: subprocess.patch keywords: patch messages: 125067 nosy: georg.brandl, giampaolo.rodola, gregory.p.smith, pitrou, rosslagerwall priority: normal severity: normal status: open title: Subprocess error if fds 0,1,2 are closed type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file20223/subprocess.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 19:22:49 2011 From: report at bugs.python.org (yihuang) Date: Sun, 02 Jan 2011 18:22:49 +0000 Subject: [New-bugs-announce] [issue10807] `b'dGVzdA==\n'.decode('base64')` raise exception In-Reply-To: <1293992569.84.0.544003446653.issue10807@psf.upfronthosting.co.za> Message-ID: <1293992569.84.0.544003446653.issue10807@psf.upfronthosting.co.za> New submission from yihuang : >>> b'dGVzdA==\n'.decode('base64') Traceback (most recent call last): File "", line 1, in File "../Lib/encodings/base64_codec.py", line 20, in base64_decode return (base64.decodebytes(input), len(input)) File "../Lib/base64.py", line 359, in decodebytes raise TypeError("expected bytes, not %s" % s.__class__.__name__) TypeError: expected bytes, not memoryview ---------- components: Unicode messages: 125068 nosy: yi.codeplayer priority: normal severity: normal status: open title: `b'dGVzdA==\n'.decode('base64')` raise exception type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 20:52:17 2011 From: report at bugs.python.org (Florian Apolloner) Date: Sun, 02 Jan 2011 19:52:17 +0000 Subject: [New-bugs-announce] [issue10808] ssl unwrap fails with Error 0 In-Reply-To: <1293997937.94.0.348375754935.issue10808@psf.upfronthosting.co.za> Message-ID: <1293997937.94.0.348375754935.issue10808@psf.upfronthosting.co.za> New submission from Florian Apolloner : If I use the server code in the attachment I get this error in unwrap: Traceback (most recent call last): File "server.py", line 23, in deal_with_client(connstream) File "server.py", line 13, in deal_with_client s = connstream.unwrap() File "/usr/lib/python3.1/ssl.py", line 302, in unwrap s = self._sslobj.shutdown() socket.error: [Errno 0] Error This error message is imo far from optiomal as it gives no clue whatsoever. My Openssl version is: 'OpenSSL 0.9.8o 01 Jun 2010'. Aside from that connstream.close() doesn't close the underlying socket (as seen in http://bugs.python.org/issue10127 Reproduceable with py2.6 and 2.7). The only way to properly close the connection now is: connstream.close(); newsocket.close() or del newsocket; connstream.close() Maybe the docs should point that out more prominent. If you need more info just tell me. ---------- components: None files: server.py messages: 125081 nosy: apollo13 priority: normal severity: normal status: open title: ssl unwrap fails with Error 0 type: behavior versions: Python 2.6, Python 2.7, Python 3.1 Added file: http://bugs.python.org/file20227/server.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 22:21:32 2011 From: report at bugs.python.org (Andrew Dalke) Date: Sun, 02 Jan 2011 21:21:32 +0000 Subject: [New-bugs-announce] [issue10809] complex() comments wrongly say it supports NaN and inf In-Reply-To: <1294003292.33.0.779224851357.issue10809@psf.upfronthosting.co.za> Message-ID: <1294003292.33.0.779224851357.issue10809@psf.upfronthosting.co.za> New submission from Andrew Dalke : complex("nan") raises "ValueError: complex() arg is a malformed string" while complex(float("nan")) returns (nan+0j). This was reported in http://bugs.python.org/issue2121 with the conclusion "wont fix". complex("inf") has the same behaviors. The implementation in complexobject.c says /* a valid complex string usually takes one of the three forms: - real part only j - imaginary part only j - real and imaginary parts where represents any numeric string that's accepted by the float constructor (including 'nan', 'inf', 'infinity', etc.), and is any string of the form whose first character is '+' or '-'. This comment is wrong and it distracted me for a while as I tried to figure out why complex("nan") wasn't working. It should be fixed, with the word "including" replaced by "excluding". I don't have a real need for complex("nan") support - this was of intellectual interest only. Also of intellectual interest, PyPy 1.4 does accept complex("nan") but converts complex("nan+nanj") to (nannanj), so it suffers from the strange corner cases which Raymond points out when advocating for "wont fix." Because ---------- assignee: docs at python components: Documentation messages: 125104 nosy: dalke, docs at python priority: normal severity: normal status: open title: complex() comments wrongly say it supports NaN and inf versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 2 23:50:31 2011 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sun, 02 Jan 2011 22:50:31 +0000 Subject: [New-bugs-announce] [issue10810] logging.handlers.TimedRotatingFileHandler.__init__(): ST_MTIME NameError In-Reply-To: <1294008631.29.0.376698831209.issue10810@psf.upfronthosting.co.za> Message-ID: <1294008631.29.0.376698831209.issue10810@psf.upfronthosting.co.za> New submission from Arfrever Frehtes Taifersar Arahesis : r82912 introduced NameError for ST_MTIME in Lib/logging/handlers.py on 3.1 branch. It's a regression in 3.1.3. The code in 3.2 is correct. -from stat import ST_DEV, ST_INO +from stat import ST_DEV, ST_INO, ST_MTIME This bug was originally reported in Gentoo Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=350400 ---------- components: Library (Lib) messages: 125116 nosy: Arfrever, vinay.sajip priority: normal severity: normal status: open title: logging.handlers.TimedRotatingFileHandler.__init__(): ST_MTIME NameError versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 02:33:47 2011 From: report at bugs.python.org (Erick Tryzelaar) Date: Mon, 03 Jan 2011 01:33:47 +0000 Subject: [New-bugs-announce] [issue10811] sqlite segfault with generators In-Reply-To: <1294018427.94.0.141740646278.issue10811@psf.upfronthosting.co.za> Message-ID: <1294018427.94.0.141740646278.issue10811@psf.upfronthosting.co.za> New submission from Erick Tryzelaar : I found that the sqlite3 function executemany module crashes when passed in a generator that it iself is executing a query. It looks like this confuses the statement cache, and causes it to get cleared inappropriately in this case. I've attached a file that exhibits the problem, which results in this stack trace: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000028 pysqlite_statement_mark_dirty (self=0x0) at /Users/Shared/erickt/Projects/py3k/Modules/_sqlite/statement.c:367 367 self->in_use = 1; (gdb) bt #0 pysqlite_statement_mark_dirty (self=0x0) at /Users/Shared/erickt/Projects/py3k/Modules/_sqlite/statement.c:367 #1 0x000000010067e125 in _pysqlite_query_execute (self=0x100568880, multiple=1, args=) at /Users/Shared/erickt/Projects/py3k/Modules/_sqlite/cursor.c:625 #2 0x00000001000af6a2 in PyEval_EvalFrameEx (f=0x1003579f0, throwflag=) at Python/ceval.c:3874 #3 0x00000001000b000a in PyEval_EvalCodeEx (_co=0x1004977a0, globals=, locals=, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3310 #4 0x00000001000b031f in PyEval_EvalCode (co=, globals=, locals=) at Python/ceval.c:760 #5 0x00000001000d71eb in run_mod [inlined] () at /Users/Shared/erickt/Projects/py3k/Python/pythonrun.c:1759 #6 0x00000001000d71eb in PyRun_FileExFlags (fp=0x7fff703f6f40, filename=0x1005c9190 "/Users/erickt/sqlite-crash.py", start=, globals=0x100325220, locals=0x100325220, closeit=1, flags=0x7fff5fbfef90) at Python/pythonrun.c:1716 #7 0x00000001000d74b9 in PyRun_SimpleFileExFlags (fp=0x7fff703f6f40, filename=0x1005c9190 "/Users/erickt/sqlite-crash.py", closeit=1, flags=0x7fff5fbfef90) at Python/pythonrun.c:1241 #8 0x00000001000ebe13 in Py_Main (argc=4832928, argv=) at Modules/main.c:297 #9 0x0000000100000abf in main (argc=2, argv=0x7fff5fbff090) at ./Modules/python.c:59 ---------- components: Library (Lib) files: sqlite-crash.py messages: 125148 nosy: Erick.Tryzelaar priority: normal severity: normal status: open title: sqlite segfault with generators type: crash versions: Python 3.2 Added file: http://bugs.python.org/file20238/sqlite-crash.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 13:45:52 2011 From: report at bugs.python.org (Ross Lagerwall) Date: Mon, 03 Jan 2011 12:45:52 +0000 Subject: [New-bugs-announce] [issue10812] Add some posix functions In-Reply-To: <1294058752.01.0.285856626146.issue10812@psf.upfronthosting.co.za> Message-ID: <1294058752.01.0.285856626146.issue10812@psf.upfronthosting.co.za> New submission from Ross Lagerwall : Here's a patch that adds a bunch of posix functions that are missing from the posix module. Includes tests & documentation. Tested on Linux & FreeBSD. Specifically: futimes lutimes futimens fexecve gethostid sethostname waitid lockf readv pread writev pwrite truncate posix_fallocate posix_fadvise sync ---------- components: Extension Modules files: mpos.patch keywords: patch messages: 125162 nosy: georg.brandl, giampaolo.rodola, gregory.p.smith, loewis, pitrou, rosslagerwall priority: normal severity: normal status: open title: Add some posix functions type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file20239/mpos.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 13:58:07 2011 From: report at bugs.python.org (Carsten Grohmann) Date: Mon, 03 Jan 2011 12:58:07 +0000 Subject: [New-bugs-announce] [issue10813] Suppress adding decimal point for places=0 in moneyfmt() In-Reply-To: <1294059487.44.0.656415691247.issue10813@psf.upfronthosting.co.za> Message-ID: <1294059487.44.0.656415691247.issue10813@psf.upfronthosting.co.za> New submission from Carsten Grohmann : Hi, the documentation of the decimal module contains a small recipe called moneyfmt() for format decimal values. It's very usefull. I'd like to suggest a small improvement because the output is incorrect with given dp="." (default) and places=0. Example: >>> moneyfmt(decimal.Decimal('-0.02'), neg='<', trailneg='>', places=1) '<0.0>' >>> moneyfmt(decimal.Decimal('-0.02'), neg='<', trailneg='>', places=0) '<0.>' Change: --- moneyfmt.py 2011-01-03 13:56:32.774169788 +0100 +++ moneyfmt.py.new 2011-01-03 13:56:58.130165330 +0100 @@ -33,7 +33,8 @@ build(trailneg) for i in range(places): build(next() if digits else '0') - build(dp) + if places: + build(dp) if not digits: build('0') i = 0 What do you think about the change? Regrads, Carsten ---------- assignee: docs at python components: Documentation messages: 125164 nosy: cgrohmann, docs at python priority: normal severity: normal status: open title: Suppress adding decimal point for places=0 in moneyfmt() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 15:03:47 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 03 Jan 2011 14:03:47 +0000 Subject: [New-bugs-announce] [issue10814] assertion failed on Windows buildbots In-Reply-To: <1294063427.37.0.763229574949.issue10814@psf.upfronthosting.co.za> Message-ID: <1294063427.37.0.763229574949.issue10814@psf.upfronthosting.co.za> New submission from Antoine Pitrou : See e.g. http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.1 test_time f:\dd\vctools\crt_bld\self_x86\crt\src\asctime.c(130) : Assertion failed: ( ( tb->tm_mday >= 1 ) && ( ( ( _days[ tb->tm_mon + 1 ] - _days[ tb->tm_mon ] ) >= tb->tm_mday ) || ( ( IS_LEAP_YEAR( tb->tm_year + 1900 ) ) && ( tb->tm_mon == 1 ) && ( tb->tm_mday <= 29 ) ) ) ) program finished with exit code -1073740777 (don't know about 2.6 but it's likely to crash there too) ---------- components: Library (Lib), Tests messages: 125170 nosy: amaury.forgeotdarc, belopolsky, benjamin.peterson, db3l, georg.brandl, pitrou priority: critical severity: normal stage: needs patch status: open title: assertion failed on Windows buildbots type: crash versions: Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 15:26:44 2011 From: report at bugs.python.org (Michal Vyskocil) Date: Mon, 03 Jan 2011 14:26:44 +0000 Subject: [New-bugs-announce] [issue10815] Write to /dev/full does not raise IOError In-Reply-To: <1294064804.78.0.484906299225.issue10815@psf.upfronthosting.co.za> Message-ID: <1294064804.78.0.484906299225.issue10815@psf.upfronthosting.co.za> New submission from Michal Vyskocil : Write to /dev/full in python3 don't raise IOError. Python2 works as expected, the close call causes an IOError exception with no space left on device message. $ python Python 2.7 (r27:82500, Aug 07 2010, 16:54:59) [GCC] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> f = open('/dev/full', 'w') >>> f.write('s') >>> f.close() Traceback (most recent call last): File "", line 1, in IOError: [Errno 28] No space left on device However using python3 I don't get an IOError after close $ python3 Python 3.1.2 (r312:79147, Nov 20 2010, 11:33:28) [GCC 4.5.1 20101001 [gcc-4_5-branch revision 164883]] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> f = open('/dev/full', 'w') >>> f.write('s') 1 >>> f.close() The only one way how to raise IOError in python3 is call f.flush() ... >>> f.write('s') 1 >>> f.flush() Traceback (most recent call last): File "", line 1, in IOError: [Errno 28] No space left on device Documentation of io.IOBase.close() [1] said Flush and close this stream, so one should expect calls f.flush();f.close() will be the same as plain f.close(). [1] http://docs.python.org/py3k/library/io.html ---------- components: IO messages: 125175 nosy: mvyskocil priority: normal severity: normal status: open title: Write to /dev/full does not raise IOError versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 16:27:49 2011 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Jan 2011 15:27:49 +0000 Subject: [New-bugs-announce] [issue10816] test_multiprocessing: unclosed sockets In-Reply-To: <1294068469.4.0.316876658618.issue10816@psf.upfronthosting.co.za> Message-ID: <1294068469.4.0.316876658618.issue10816@psf.upfronthosting.co.za> New submission from STINNER Victor : test_remote (__main__.WithManagerTestRemoteManager) ... /home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:812: ResourceWarning: unclosed util.debug('... decref failed %s', e) ok test_pool_initializer (__main__.TestInitializers) ... /home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: unclosed util.info('incref failed: %s' % e) ok test_pool_in_process (__main__.TestStdinBadfiledescriptor) ... /home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: unclosed util.info('incref failed: %s' % e) /home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: unclosed util.info('incref failed: %s' % e) /home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: unclosed util.info('incref failed: %s' % e) /home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: unclosed util.info('incref failed: %s' % e) /home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: unclosed util.info('incref failed: %s' % e) /home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: unclosed util.info('incref failed: %s' % e) /home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: unclosed util.info('incref failed: %s' % e) /home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: unclosed util.info('incref failed: %s' % e) ok test_queue_in_process (__main__.TestStdinBadfiledescriptor) ... /home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: unclosed util.info('incref failed: %s' % e) /home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: unclosed util.info('incref failed: %s' % e) /home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: unclosed util.info('incref failed: %s' % e) /home/haypo/prog/GIT/py3k/Lib/multiprocessing/managers.py:831: ResourceWarning: unclosed util.info('incref failed: %s' % e) ok ---------- components: Library (Lib) messages: 125180 nosy: haypo priority: normal severity: normal status: open title: test_multiprocessing: unclosed sockets versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 16:50:04 2011 From: report at bugs.python.org (Robert Cheng) Date: Mon, 03 Jan 2011 15:50:04 +0000 Subject: [New-bugs-announce] [issue10817] urllib.request.urlretrieve never raises ContentTooShortError if no reporthook In-Reply-To: <1294069804.34.0.860239284714.issue10817@psf.upfronthosting.co.za> Message-ID: <1294069804.34.0.860239284714.issue10817@psf.upfronthosting.co.za> New submission from Robert Cheng : When reporthook is None, size variable is not computed and defaulted to -1. Thus, without reporthook, ContentTooShortError is not raised even when Content-Length header is supplied and download size is less than expected amount, contrary to the documentation. ---------- components: Library (Lib) messages: 125186 nosy: RC priority: normal severity: normal status: open title: urllib.request.urlretrieve never raises ContentTooShortError if no reporthook type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 3 17:17:21 2011 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Jan 2011 16:17:21 +0000 Subject: [New-bugs-announce] [issue10818] pydoc: refactorize duplicate DocHandler and DocServer classes In-Reply-To: <1294071441.53.0.907267492881.issue10818@psf.upfronthosting.co.za> Message-ID: <1294071441.53.0.907267492881.issue10818@psf.upfronthosting.co.za> New submission from STINNER Victor : The pydoc module has two DocHandler classes and two DocServer classes. I think that they can be easily factorized. DocServer may also use serve_forever()+shutdown() instead of serve_until_quit()+quit flag, to be able to wait the server (with shutdown()). ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 125190 nosy: docs at python, haypo priority: normal severity: normal status: open title: pydoc: refactorize duplicate DocHandler and DocServer classes versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 00:51:33 2011 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Jan 2011 23:51:33 +0000 Subject: [New-bugs-announce] [issue10819] ValueError on repr(closed_socket_file) In-Reply-To: <1294098693.54.0.480300363848.issue10819@psf.upfronthosting.co.za> Message-ID: <1294098693.54.0.480300363848.issue10819@psf.upfronthosting.co.za> New submission from STINNER Victor : The following code raise a ValueError('I/O operation on closed file.'): --- import socket socket.socket(socket.SOCK_STREAM, socket.AF_INET) s=socket.socket(socket.SOCK_STREAM, socket.AF_INET) f=s.makefile("rb") f.close() print(repr(f)) --- io.BufferedReader.__repr__() reads self.name (self.buffer.name), but self.buffer is closed. io.BufferedReader.__repr__() catchs AttributeError when reading self.name. It should also maybe catch ValueError: attached patch does that. socket.repr(x) returns a string with "[closed]". BufferedReader.repr() should maybe do the same. Note: TextIOWrapper has the same issue. ---------- components: IO messages: 125253 nosy: haypo, pitrou priority: normal severity: normal status: open title: ValueError on repr(closed_socket_file) versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 08:18:57 2011 From: report at bugs.python.org (Ned Deily) Date: Tue, 04 Jan 2011 07:18:57 +0000 Subject: [New-bugs-announce] [issue10820] 3.2 Makefile changes for versioned scripts break OS X framework installs In-Reply-To: <1294125537.03.0.564909640075.issue10820@psf.upfronthosting.co.za> Message-ID: <1294125537.03.0.564909640075.issue10820@psf.upfronthosting.co.za> New submission from Ned Deily : The changes for Issue10679 (r87525) to installed versioned scripts break OS X framework installs. The install_versionedtools target in Mac/Makefile already did most of this work and is now superfluous. The attached patch fixes the problem. ---------- assignee: ronaldoussoren components: Build, Macintosh messages: 125295 nosy: georg.brandl, ned.deily, ronaldoussoren priority: release blocker severity: normal stage: patch review status: open title: 3.2 Makefile changes for versioned scripts break OS X framework installs versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 11:18:18 2011 From: report at bugs.python.org (=?utf-8?b?UGV0ciBTa2xlbsOhxZk=?=) Date: Tue, 04 Jan 2011 10:18:18 +0000 Subject: [New-bugs-announce] [issue10821] gethostbyname(gethostname()) is wrong when IP is changed In-Reply-To: <1294136298.58.0.0957564280259.issue10821@psf.upfronthosting.co.za> Message-ID: <1294136298.58.0.0957564280259.issue10821@psf.upfronthosting.co.za> New submission from Petr Sklen?? : version: tried python 2.6 on rhel55 tried python-2.7-8 on fedora14 Steps to Reproduce: 1. install machine, have a fixed hostname up to mac address 1.1.1.1 = machine.something.com 2. wait a week or longer when your local dhcp server changes your IP but not hostname 1.1.1.159 = machine.something.com [root at machine.something.com ~]# host machine.something.com machine.something.com has address 1.1.1.159 ifconfig shows the same 3. gethostbyname(gethostname()) shows wrong IP, the original one Actual results: [root at machine.something.com ~]# python Python 2.4.3 (#1, Jun 11 2009, 14:09:37) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from socket import gethostname >>> from socket import gethostbyname >>> gethostname() 'machine.something.com' >>> gethostbyname(gethostname()) '1.1.1.1' >>> Expected results: gethostbyname(gethostname()) will return your actual IP, 1.1.1.159 Other: 1.1.1.1 = machine.something.com is added in /etc/hosts in the time of OS installation , then its not changed ---------- components: IO messages: 125298 nosy: psklenar priority: normal severity: normal status: open title: gethostbyname(gethostname()) is wrong when IP is changed versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 12:08:39 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 04 Jan 2011 11:08:39 +0000 Subject: [New-bugs-announce] [issue10822] test_getgroups failure under Solaris In-Reply-To: <1294139319.03.0.190267830849.issue10822@psf.upfronthosting.co.za> Message-ID: <1294139319.03.0.190267830849.issue10822@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Under OpenSolaris, I get the following failure: $ pfexec ./python -m test test_posix [1/1] test_posix test test_posix failed -- Traceback (most recent call last): File "/home/antoine/py3k/cc/Lib/test/test_posix.py", line 402, in test_getgroups set(posix.getgroups())) AssertionError: Items in the first set but not the second: 0 ---------- components: Tests messages: 125303 nosy: jcea, laca, pitrou, ronaldoussoren priority: normal severity: normal stage: needs patch status: open title: test_getgroups failure under Solaris type: behavior versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 13:04:33 2011 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Jan 2011 12:04:33 +0000 Subject: [New-bugs-announce] [issue10823] "conversion from 'Py_ssize_t' to 'int', possible loss of data" in various files In-Reply-To: <1294142673.84.0.738838324131.issue10823@psf.upfronthosting.co.za> Message-ID: <1294142673.84.0.738838324131.issue10823@psf.upfronthosting.co.za> New submission from STINNER Victor : On "AMD64 Windows Server 2008 3.x", there are many "conversion from 'Py_ssize_t' to 'int', possible loss of data" errors: Python\Python-ast.c(3403) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3409) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3439) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3445) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3498) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3504) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3606) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3612) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3631) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3637) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3697) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3703) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3722) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3728) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3769) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3775) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3794) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3800) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3853) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3859) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3890) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(3896) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4014) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4020) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4039) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4045) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4090) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4096) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4115) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4121) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4165) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4171) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4190) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4196) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4251) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4257) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4324) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4330) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4349) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4355) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4374) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4380) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4412) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4418) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4437) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4443) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4508) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4514) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4557) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4563) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4605) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4611) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4641) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4647) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4787) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4793) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(4994) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5000) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5019) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5025) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5055) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5061) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5104) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5110) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5153) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5159) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5215) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5221) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5265) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5271) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5337) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5343) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5362) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5368) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5415) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5421) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5440) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5446) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5749) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5755) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5798) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5804) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5968) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(5974) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(6323) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(6329) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(6423) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(6429) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(6473) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(6479) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(6520) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(6526) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(6567) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(6573) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(6592) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\Python-ast.c(6598) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\pystrtod.c(902) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\pystrtod.c(1023) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\peephole.c(82) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data Python\peephole.c(185) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data Python\peephole.c(239) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data Python\peephole.c(311) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data Python\peephole.c(354) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\peephole.c(405) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data Python\peephole.c(420) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data Python\peephole.c(461) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\peephole.c(546) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\peephole.c(557) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data Python\peephole.c(589) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\peephole.c(603) : warning C4244: '-=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\peephole.c(634) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\peephole.c(663) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data Python\peephole.c(673) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data Python\getargs.c(374) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\getargs.c(486) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\getargs.c(860) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\getargs.c(915) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\getargs.c(923) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\getargs.c(967) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\getargs.c(1117) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\getargs.c(1444) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\getargs.c(1445) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\compile.c(340) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data Python\compile.c(385) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data Python\compile.c(480) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\compile.c(535) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\compile.c(949) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data Python\compile.c(964) : warning C4244: 'return' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\compile.c(1256) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\compile.c(1401) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\compile.c(3687) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\compile.c(3713) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\compile.c(3739) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\compile.c(3907) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\compile.c(3911) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\compile.c(3951) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\compile.c(3958) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\ceval.c(3970) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Python\ceval.c(4158) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects/stringlib/formatter.h(979) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects/stringlib/formatter.h(1151) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects/stringlib/formatter.h(1155) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects\typeobject.c(6226) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects\listobject.c(1955) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects\funcobject.c(632) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects\funcobject.c(633) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects\funcobject.c(633) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects\frameobject.c(480) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects\frameobject.c(513) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects\frameobject.c(871) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects\frameobject.c(872) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects\frameobject.c(918) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects\frameobject.c(919) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects\fileobject.c(393) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned int', possible loss of data Objects\codeobject.c(495) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Objects\codeobject.c(517) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_io\fileio.c(522) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned int', possible loss of data Modules\_io\fileio.c(661) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned int', possible loss of data Modules\_io\fileio.c(701) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned int', possible loss of data Modules\zlibmodule.c(127) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\zlibmodule.c(211) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\zlibmodule.c(217) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data Modules\zlibmodule.c(271) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data Modules\zlibmodule.c(422) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\zlibmodule.c(434) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data Modules\zlibmodule.c(451) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data Modules\zlibmodule.c(505) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\zlibmodule.c(526) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data Modules\zlibmodule.c(556) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data Modules\zlibmodule.c(935) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data Modules\zlibmodule.c(938) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data Modules\zlibmodule.c(963) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data Modules\zlibmodule.c(966) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'uInt', possible loss of data Modules\sha512module.c(558) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\sha512module.c(710) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\sha512module.c(751) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\sha256module.c(492) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\sha256module.c(644) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\sha256module.c(685) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\sha1module.c(399) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned long', possible loss of data Modules\sha1module.c(520) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned long', possible loss of data Modules\md5module.c(423) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned long', possible loss of data Modules\md5module.c(544) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'unsigned long', possible loss of data Modules\audioop.c(332) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(354) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(376) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(398) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(423) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(632) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(687) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(737) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(763) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(810) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(868) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(928) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(984) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(1018) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(1053) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(1284) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(1316) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(1353) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(1385) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(1424) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\audioop.c(1530) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_sre.c(1895) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_sre.c(1898) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_sre.c(1932) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_sre.c(1935) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_sre.c(2079) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_sre.c(2082) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_sre.c(2209) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_sre.c(2212) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_sre.c(2361) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_sre.c(2364) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_sre.c(3750) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_sre.c(3753) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_sre.c(3783) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_sre.c(3786) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_pickle.c(156) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_pickle.c(195) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_pickle.c(754) : warning C4244: 'return' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_pickle.c(1283) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'long', possible loss of data Modules\_pickle.c(1957) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_pickle.c(2238) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_pickle.c(2496) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_pickle.c(4331) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_pickle.c(4596) : warning C4244: 'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_pickle.c(4636) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_pickle.c(4877) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_pickle.c(4924) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_pickle.c(4941) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_pickle.c(4972) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_pickle.c(5128) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_ctypes\_ctypes.c(3984) : warning C4244: 'return' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_elementtree.c(1239) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_elementtree.c(1372) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_elementtree.c(1414) : warning C4244: '+=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_elementtree.c(2666) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\socketmodule.c(2274) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\socketmodule.c(2489) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\socketmodule.c(2644) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\socketmodule.c(2696) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\socketmodule.c(2778) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_sqlite\statement.c(140) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_sqlite\statement.c(186) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_sqlite\statement.c(188) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_sqlite\statement.c(190) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_sqlite\row.c(89) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_sqlite\row.c(147) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_sqlite\connection.c(506) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_testcapimodule.c(2191) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data Modules\_tkinter.c(398) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_tkinter.c(501) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_tkinter.c(953) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_tkinter.c(973) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_tkinter.c(1007) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_tkinter.c(1159) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_tkinter.c(2808) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_tkinter.c(2830) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_tkinter.c(2864) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\bz2module.c(735) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\bz2module.c(830) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\bz2module.c(878) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\bz2module.c(1443) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\bz2module.c(1739) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\bz2module.c(1958) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\bz2module.c(2050) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\selectmodule.c(98) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\pyexpat.c(830) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_multiprocessing\socket_connection.c(126) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_multiprocessing\socket_connection.c(137) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_multiprocessing\socket_connection.c(145) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_multiprocessing\connection.h(139) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_multiprocessing\connection.h(183) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_multiprocessing\connection.h(237) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_multiprocessing\connection.h(285) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_multiprocessing\connection.h(323) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_multiprocessing\connection.h(139) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_multiprocessing\connection.h(183) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_multiprocessing\connection.h(237) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_multiprocessing\connection.h(285) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data modules\_multiprocessing\connection.h(323) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data Modules\_ssl.c(1095) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data -- See also #8650 and #8651. ---------- components: Build, Windows messages: 125310 nosy: haypo, pitrou priority: normal severity: normal status: open title: "conversion from 'Py_ssize_t' to 'int', possible loss of data" in various files versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 14:42:44 2011 From: report at bugs.python.org (=?utf-8?b?TWljaGFsIMSMaWhhxZk=?=) Date: Tue, 04 Jan 2011 13:42:44 +0000 Subject: [New-bugs-announce] [issue10824] urandom should not block In-Reply-To: <1294148564.76.0.493970702032.issue10824@psf.upfronthosting.co.za> Message-ID: <1294148564.76.0.493970702032.issue10824@psf.upfronthosting.co.za> New submission from Michal ?iha? : Currently if /dev/urandom does not provide any data, unradom() call is just stuck infinitely waiting for data. I actually faced this issue when /dev/urandom was empty regular file (due to bug in pbuilder, but I don't think it matters how it did happen) and urandom() call just hang. I think it would be much saner in such case to throw an error and let user know that something it wrong than waiting infinitely. ---------- components: Library (Lib) messages: 125316 nosy: nijel priority: normal severity: normal status: open title: urandom should not block type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 14:49:04 2011 From: report at bugs.python.org (Sandro Tosi) Date: Tue, 04 Jan 2011 13:49:04 +0000 Subject: [New-bugs-announce] [issue10825] use assertIsNone(...) instead of assertEquals(None, ...) In-Reply-To: <1294148944.07.0.481041700804.issue10825@psf.upfronthosting.co.za> Message-ID: <1294148944.07.0.481041700804.issue10825@psf.upfronthosting.co.za> New submission from Sandro Tosi : Hello, after I saw that in issue9554, I created a small patch to replace all assertEquals(None, ...) with assertIsNone(...) It's not rocket science, but I think it makes test suite "better" and leverage new unittest features. Cheers, Sandro ---------- assignee: sandro.tosi components: Tests files: use_assertIsNone-py3k.patch keywords: patch messages: 125317 nosy: sandro.tosi priority: normal severity: normal stage: patch review status: open title: use assertIsNone(...) instead of assertEquals(None, ...) versions: Python 3.3 Added file: http://bugs.python.org/file20256/use_assertIsNone-py3k.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 15:44:50 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 04 Jan 2011 14:44:50 +0000 Subject: [New-bugs-announce] [issue10826] pass_fds sometimes fails In-Reply-To: <1294152290.71.0.646502628705.issue10826@psf.upfronthosting.co.za> Message-ID: <1294152290.71.0.646502628705.issue10826@psf.upfronthosting.co.za> New submission from Antoine Pitrou : This happens selectively (and intermittently) on the Solaris buildbot: test_pass_fds (test.test_subprocess.POSIXProcessTestCase) ... -- maxfd = 256 [36787 refs] -- fds that should have been closed: {5, 6, 7, 8, 9, 10, 11, 12, 13} -- fds that remained open: {0, 1, 2, 3, 5} FAIL test_pass_fds (test.test_subprocess.ProcessTestCasePOSIXPurePython) ... -- maxfd = 256 [36787 refs] -- fds that should have been closed: {5, 6, 7, 8, 9, 10, 11, 12, 13} -- fds that remained open: {0, 1, 2, 3, 5} FAIL As you see (thanks to debug output), all fds have been closed except number 5. (http://www.python.org/dev/buildbot/all/builders/sparc%20solaris10%20gcc%203.x/builds/2466/steps/test/logs/stdio) ---------- components: Library (Lib), Tests messages: 125326 nosy: gregory.p.smith, pitrou priority: normal severity: normal status: open title: pass_fds sometimes fails type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 17:48:32 2011 From: report at bugs.python.org (Alexander Belopolsky) Date: Tue, 04 Jan 2011 16:48:32 +0000 Subject: [New-bugs-announce] [issue10827] Functions in time module should support year < 1900 when accept2dyear = 0 In-Reply-To: <1294159712.85.0.42147185487.issue10827@psf.upfronthosting.co.za> Message-ID: <1294159712.85.0.42147185487.issue10827@psf.upfronthosting.co.za> New submission from Alexander Belopolsky : """ > http://docs.python.org/library/time.html#time-y2kissues > "Values 100?1899 are always illegal." Why are these values illegal? The GNU libc accepts year in [1900-2^31; 2^31-1] (tm_year in [-2147483648; 2147481747]). If time.accept2dyear=False, we should at least accept years in [1; 9999]. The system libc would raise an error (return NULL) if it doesn't know how to format years older than 1900. """ -- Victor Stinner at msg12516 ---------- assignee: belopolsky components: Extension Modules messages: 125339 nosy: SilentGhost, belopolsky, haypo priority: normal severity: normal status: open title: Functions in time module should support year < 1900 when accept2dyear = 0 type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 4 20:44:17 2011 From: report at bugs.python.org (ingemar) Date: Tue, 04 Jan 2011 19:44:17 +0000 Subject: [New-bugs-announce] [issue10828] Cannot use nonascii utf8 in names of files imported from In-Reply-To: <1294170257.81.0.980912064683.issue10828@psf.upfronthosting.co.za> Message-ID: <1294170257.81.0.980912064683.issue10828@psf.upfronthosting.co.za> New submission from ingemar : I have a set of programs written for Python3.1 and running well on Kubuntu. The source files are located on a Samba server on a Kubuntu box. Several of the programs contain Python/PyQt code to start other programs in the set ( QtCore.QProcess().startDetached(kommando) ) I have had no problems using non-ascii filenames in the Linux environment. When I tried to check the programs in a MS Windows environment (Win2K with Python 3.1.2 in a VirtualBox in a Kubuntu box) then Python complained: ImportError: module xxx not found.. The ugly solution has been to refrain from the use of non-ascii characters in the names of files imported from. This involved the filename of the imported file and also one line of code changed in the importing file. Example: 1) rename "gui_j?mf?ra.py" ---> "gui_jamfora.py" 2) in the importing file "j?mf?ra.py" change one line: "from gui_j?mf?ra import * " ---> "from gui_jamfora import gui_J?mf?ra" Is there a beautiful solution that will permit me to use non-ascii utf-8 also in the file names of files imported from? ---------- messages: 125360 nosy: ingemar priority: normal severity: normal status: open title: Cannot use nonascii utf8 in names of files imported from versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 01:46:43 2011 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2011 00:46:43 +0000 Subject: [New-bugs-announce] [issue10829] PyUnicode_FromFormatV() bugs with "%" and "%%" format strings In-Reply-To: <1294188403.72.0.24360709681.issue10829@psf.upfronthosting.co.za> Message-ID: <1294188403.72.0.24360709681.issue10829@psf.upfronthosting.co.za> New submission from STINNER Victor : Steps 1 and 3 of PyUnicode_FromFormatV() doesn't handle the format string "%%" correctly. The loop responsible to skip the precision moves outside the format string, and the function will then read uninitialized memory. The loop: while (*++f && *f != '%' && !Py_ISALPHA((unsigned)*f)) ; This is another issue: for (f = format; *f; f++) { if (*f == '%') { if (*(f+1)=='%') continue; ... continue only skips the first %: with "%%", the second % will be interpreted (and not escaped). Attached patch fixes the issue, but I don't feal confortable with this ugly function, and I would appreciate a review :-) The patch adds unit tests. I found the bug when trying to add new tests before trying to implement "%zi" format. I was first surprised that "%zi" (and %li and %lli) is not supported, but now I am surprised because I found bugs :-) ---------- components: Interpreter Core, Unicode files: pyunicode_fromformatv.patch keywords: patch messages: 125387 nosy: amaury.forgeotdarc, haypo priority: normal severity: normal status: open title: PyUnicode_FromFormatV() bugs with "%" and "%%" format strings versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20262/pyunicode_fromformatv.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 02:43:12 2011 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2011 01:43:12 +0000 Subject: [New-bugs-announce] [issue10830] PyUnicode_FromFormatV("%c") doesn't support non-BMP characters on narrow build In-Reply-To: <1294191792.83.0.0600420394952.issue10830@psf.upfronthosting.co.za> Message-ID: <1294191792.83.0.0600420394952.issue10830@psf.upfronthosting.co.za> New submission from STINNER Victor : PyUnicode_FromFormatV("%c") supposes that an unicode character is always stored as a single Py_UNICODE word: but that's wrong on narrow build with characters in [U+10000; U+10FFFF]. Attached patch fixes this bug. See also #10829. ---------- components: Interpreter Core, Unicode files: pyunicode_fromformatv_c.patch keywords: patch messages: 125393 nosy: amaury.forgeotdarc, haypo priority: normal severity: normal status: open title: PyUnicode_FromFormatV("%c") doesn't support non-BMP characters on narrow build versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file20265/pyunicode_fromformatv_c.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 02:55:17 2011 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2011 01:55:17 +0000 Subject: [New-bugs-announce] [issue10831] PyUnicode_FromFormatV() doesn't support %li, %lli, %zi In-Reply-To: <1294192517.91.0.585635268064.issue10831@psf.upfronthosting.co.za> Message-ID: <1294192517.91.0.585635268064.issue10831@psf.upfronthosting.co.za> New submission from STINNER Victor : PyUnicode_FromFormatV() supports %d, %ld, %lld, %zd, %u, %lu, %llu, %zu, %i. But it doesn't support %li, %lli, %zi. Attached patch implements the 3 missing formats, and add unit tests for all these formats. ---------- components: Interpreter Core, Unicode files: pyunicode_fromformatv_zi.patch keywords: patch messages: 125396 nosy: haypo priority: normal severity: normal status: open title: PyUnicode_FromFormatV() doesn't support %li, %lli, %zi versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file20266/pyunicode_fromformatv_zi.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 03:55:10 2011 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2011 02:55:10 +0000 Subject: [New-bugs-announce] [issue10832] Add support of bytes objects in PyBytes_FromFormatV() In-Reply-To: <1294196110.74.0.942895284505.issue10832@psf.upfronthosting.co.za> Message-ID: <1294196110.74.0.942895284505.issue10832@psf.upfronthosting.co.za> New submission from STINNER Victor : It would be very practical use have a format, eg. '%y', to accept bytes object in PyBytes_FromFormatV(). Example (extracted from posixmodule.c): k = PyBytes_AsString(key2); v = PyBytes_AsString(val2); len = PyBytes_GET_SIZE(key2) + PyBytes_GET_SIZE(val2) + 2; p = PyMem_NEW(char, len); if (p == NULL) { PyErr_NoMemory(); ... } PyOS_snprintf(p, len, "%s=%s", k, v); With %y, it can be written: p = PyBytes_FromFormat("%y=%y", key2, val2); if (p == NULL) { PyErr_NoMemory(); ... } The '%y' may also accept bytearray and any object with the buffer interface (as the 'y' format of PyArg_Parse*() functions). ---------- components: Interpreter Core messages: 125398 nosy: haypo priority: normal severity: normal status: open title: Add support of bytes objects in PyBytes_FromFormatV() versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 04:02:34 2011 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jan 2011 03:02:34 +0000 Subject: [New-bugs-announce] [issue10833] Replace %.100s by %s in PyErr_Format(): the arbitrary limit of 500 bytes is outdated In-Reply-To: <1294196554.94.0.785505480291.issue10833@psf.upfronthosting.co.za> Message-ID: <1294196554.94.0.785505480291.issue10833@psf.upfronthosting.co.za> New submission from STINNER Victor : Guido created the "convenience function" PyErr_Format() 13 years ago (r7580) with a naive implementation using char buffer[500] and vsprintf(). He added a comment: /* Caller is responsible for limiting the format */ Ok, that was true 13 years ago. But today Python uses dynamically allocated buffers, and so we can simply replace %.100s ("%\.[0-9]+s" regex) by %s. Anyway, PyUnicode_FromFormatV() doesn't support precision for %s and %U formats :-) ---------- components: Interpreter Core messages: 125399 nosy: amaury.forgeotdarc, haypo priority: normal severity: normal status: open title: Replace %.100s by %s in PyErr_Format(): the arbitrary limit of 500 bytes is outdated versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 11:41:03 2011 From: report at bugs.python.org (Peter Heiberg) Date: Wed, 05 Jan 2011 10:41:03 +0000 Subject: [New-bugs-announce] [issue10834] Python 2.7 x86 fails to run in Windows 7 In-Reply-To: <1294224063.9.0.656095341139.issue10834@psf.upfronthosting.co.za> Message-ID: <1294224063.9.0.656095341139.issue10834@psf.upfronthosting.co.za> New submission from Peter Heiberg : I recently installed Win7 on my laptop, and installed the x86 Python 2.7 package. IDLE fails to even start, and shows nothing but a process in task manager. I've tried compatibility modes both to Vista and XPSP2, with no luck. I ran 2.7 x86 on the same laptop in XPSP2, and I am also able to run 2.7 x86 on another computer using the exact same version of Win7. Command line works fine, by the way. ---------- components: None messages: 125415 nosy: excubated priority: normal severity: normal status: open title: Python 2.7 x86 fails to run in Windows 7 type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 13:51:34 2011 From: report at bugs.python.org (Allan McRae) Date: Wed, 05 Jan 2011 12:51:34 +0000 Subject: [New-bugs-announce] [issue10835] sys.executable default and altinstall In-Reply-To: <1294231894.7.0.0581440878919.issue10835@psf.upfronthosting.co.za> Message-ID: <1294231894.7.0.0581440878919.issue10835@psf.upfronthosting.co.za> New submission from Allan McRae : when sys.executable is run with a modified argv[0] such as: > sh -c "exec -a '' /usr/bin/python2.7 -c 'import sys; print(sys.executable)'" it returns some a hardcoded value. In this case, it returns /usr/bin/python. This value is likely wrong when python is installed with "make altinstall". A possible solution is to modify the "progname" variable in Python/pythonrun.c to include the version in it so that the hardcoded return value is the most version specific binary. I.e. static char *progname = "python2.7"; ---------- components: Interpreter Core messages: 125420 nosy: allan priority: normal severity: normal status: open title: sys.executable default and altinstall 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 Wed Jan 5 19:27:16 2011 From: report at bugs.python.org (=?utf-8?q?Alexandru_Mo=C8=99oi?=) Date: Wed, 05 Jan 2011 18:27:16 +0000 Subject: [New-bugs-announce] [issue10836] TypeError during exception handling in urllib.request.urlretrieve In-Reply-To: <1294252036.56.0.144119584231.issue10836@psf.upfronthosting.co.za> Message-ID: <1294252036.56.0.144119584231.issue10836@psf.upfronthosting.co.za> New submission from Alexandru Mo?oi : If I try to download a inexistent file I get a TypeError which is thrown during exception handling. >>> import urllib.request >>> urllib.request.urlretrieve('missing') Traceback (most recent call last): File "/usr/lib/python3.1/urllib/request.py", line 1705, in open_local_file stats = os.stat(localname) OSError: [Errno 2] No such file or directory: 'missing' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.1/urllib/request.py", line 133, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/usr/lib/python3.1/urllib/request.py", line 1507, in retrieve fp = self.open_local_file(url1) File "/usr/lib/python3.1/urllib/request.py", line 1707, in open_local_file raise URLError(e.errno, e.strerror, e.filename) TypeError: __init__() takes at most 3 positional arguments (4 given) ---------- components: Library (Lib) messages: 125449 nosy: Alexandru.Mo?oi priority: normal severity: normal status: open title: TypeError during exception handling in urllib.request.urlretrieve type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 21:02:05 2011 From: report at bugs.python.org (Josh Hanson) Date: Wed, 05 Jan 2011 20:02:05 +0000 Subject: [New-bugs-announce] [issue10837] Issue catching KeyboardInterrupt while reading stdin In-Reply-To: <1294257725.97.0.863829105509.issue10837@psf.upfronthosting.co.za> Message-ID: <1294257725.97.0.863829105509.issue10837@psf.upfronthosting.co.za> New submission from Josh Hanson : Example code: try: sys.stdin.read() except KeyboardInterrupt: print "Interrupted!" except: print "Some other exception?" finally: print "cleaning up..." print "done." Test: run the code and hit ctrl-c while the read is blocking. Expected behavior: program should print: Interrupted! cleaning up... done. Actual behavior: On linux, behaves as expected. On windows, prints: cleaning up... Traceback (most recent call last): File "filename.py", line 119, in print 'cleaning up...' KeyboardInterrupt As you can see, neither of the "except" blocks was executed, and the "finally" block was erroneously interrupted. If I add one line inside the try block, as follows: try: sys.stdin.read() print "Done reading." ... [etc.] Then this is the output: Done reading. Interrupted! cleaning up... done. Here, the exception handler and finally block were executed as expected. This is still mildly unusual because the "done reading" print statement was reached when it probably shouldn't have been, but much more surprising because a newline was not printed after "Done reading.", and for some reason a space was. This has been tested and found in 32-bit python versions 2.6.5, 2.6.6, 2.7.1, and 3.1.3 on 64-bit Win7. ---------- components: IO, Windows messages: 125463 nosy: Josh.Hanson priority: normal severity: normal status: open title: Issue catching KeyboardInterrupt while reading stdin type: behavior versions: Python 2.6, Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 21:52:49 2011 From: report at bugs.python.org (Toshio Kuratomi) Date: Wed, 05 Jan 2011 20:52:49 +0000 Subject: [New-bugs-announce] [issue10838] subprocess __all__ is incomplete In-Reply-To: <1294260769.5.0.0970426129524.issue10838@psf.upfronthosting.co.za> Message-ID: <1294260769.5.0.0970426129524.issue10838@psf.upfronthosting.co.za> New submission from Toshio Kuratomi : I have a compatibility module for subprocess in python-2.7 for people who are stuck on python-2.4 (without check_call) and they got a traceback from trying to use compat.subprocess.list2cmdline(). In order to use the stdlib's subprocess if it's of a recent enough version, I check the version and import the symbols from there using from subprocess import * in the compat module. Unfortunately, one of the people is using list2cmdline() in their code and list2cmdline() is not in __all__. Comparing the output, there's a few things not in __all__ in both python-2.7 and in python-3.1: (From python-2.7, but python-3.1 boils down to the same list): >>> sorted([d for d in dir (subprocess) if not d.startswith('_')]) ['CalledProcessError', 'MAXFD', 'PIPE', 'Popen', 'STDOUT', 'call', 'check_call', 'check_output', 'errno', 'fcntl', 'gc', 'list2cmdline', 'mswindows', 'os', 'pickle', 'select', 'signal', 'sys', 'traceback', 'types'] >>> sorted(subprocess.__all__) ['CalledProcessError', 'PIPE', 'Popen', 'STDOUT', 'call', 'check_call', 'check_output'] So, MAXFD, list2cmdline, and mswindows seem to be left out. These could either be made private (prepend with "_"), or added to __all__ to resolve this bug. (I note that searching for "subprocess.any of those three" leads to some hits so whether or not they're intended to be public, they are being used :-( ---------- components: Library (Lib) messages: 125468 nosy: a.badger priority: normal severity: normal status: open title: subprocess __all__ is incomplete versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 5 22:40:03 2011 From: report at bugs.python.org (Adrien Saladin) Date: Wed, 05 Jan 2011 21:40:03 +0000 Subject: [New-bugs-announce] [issue10839] email module should not allow some header field repetitions In-Reply-To: <1294263603.86.0.308955870327.issue10839@psf.upfronthosting.co.za> Message-ID: <1294263603.86.0.308955870327.issue10839@psf.upfronthosting.co.za> New submission from Adrien Saladin : Hi, The following script shows two problems with email.mime.text.MIMEText: - first the use of msg['To'] seems confusing because its dictionnary-like syntax made me think it acts as a "set or replace", but in fact is working as a stream operation - second this behavior allows for the same field to be repeated several times in a header which is discouraged in rfc-822 and forbidden for many fields in rfc-2822. #########################################" from email.mime.text import MIMEText msg = MIMEText("""Hello World""") dest = ["one at example.com", "two at example.com", "three at example.com", "four at example.com"] for d in dest: msg["From"] = "myself at example.com" msg["To"] = d msg["subject"] = "just a test" print (msg) # + send the buggy mail... ################################### the last sent mail will looks like this: --------------------- Hello World Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: myself at example.com To: one at example.com subject: just a test From: myself at example.com To: two at example.com subject: just a test From: myself at example.com To: three at example.com subject: just a test From: myself at example.com To: four at example.com subject: just a test Hello World ---------------------- I see some possible modifications: * make the [] operator work as a dictionnary-like syntax. So calling msg['To'] multiple times would simply replace the previous 'To:' field. The additional constraint is that some fields like 'comments' or 'keywords' can be repeated * (or) throw an error when some fields are repeated in this list: from, sender, reply-to, to, cc, bcc, message-id, in-reply-to, references, subject ---------- components: Library (Lib) messages: 125473 nosy: adrien-saladin priority: normal severity: normal status: open title: email module should not allow some header field repetitions versions: Python 2.6, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 01:32:18 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 06 Jan 2011 00:32:18 +0000 Subject: [New-bugs-announce] [issue10840] pyarg_parsetuple docs and py_buffer In-Reply-To: <1294273938.78.0.510835761549.issue10840@psf.upfronthosting.co.za> Message-ID: <1294273938.78.0.510835761549.issue10840@psf.upfronthosting.co.za> New submission from Antoine Pitrou : The docs for "s*" and friends should mention that contiguity of the buffer is automatically enforced. ---------- assignee: docs at python components: Documentation messages: 125488 nosy: docs at python, exarkun, mark.dickinson, pitrou priority: normal severity: normal stage: needs patch status: open title: pyarg_parsetuple docs and py_buffer versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 03:11:57 2011 From: report at bugs.python.org (Glenn Linderman) Date: Thu, 06 Jan 2011 02:11:57 +0000 Subject: [New-bugs-announce] [issue10841] binary stdio In-Reply-To: <1294279917.2.0.685442041198.issue10841@psf.upfronthosting.co.za> Message-ID: <1294279917.2.0.685442041198.issue10841@psf.upfronthosting.co.za> New submission from Glenn Linderman : Per Antoine's request, I wrote this test code, it isn't elegant, I whipped it together quickly; but it shows the issue. The issue may be one of my ignorance, but it does show the behavior I described in issue 4953. Here's the output from the various test parameters that might be useful in running the test. >c:\python32\python.exe test.py test 1 ['c:\\python32\\python.exe', 'test.py', '1'] All OK >c:\python32\python.exe test.py test 2 ['c:\\python32\\python.exe', 'test.py', '2'] Not OK: b'abc\r\r\ndef\r\r\n' >c:\python32\python.exe test.py test 3 ['c:\\python32\\python.exe', 'test.py', '3'] All OK >c:\python32\python.exe test.py test 4 ['c:\\python32\\python.exe', 'test.py', '4'] Not OK: b'abc\r\r\ndef\r\r\n' >c:\python32\python.exe test.py test 1-u ['c:\\python32\\python.exe', '-u', 'test.py', '1-u'] All OK >c:\python32\python.exe test.py test 2-u ['c:\\python32\\python.exe', '-u', 'test.py', '2-u'] All OK >c:\python32\python.exe test.py test 3-u ['c:\\python32\\python.exe', '-u', 'test.py', '3-u'] All OK >c:\python32\python.exe test.py test 4-u ['c:\\python32\\python.exe', '-u', 'test.py', '4-u'] All OK > Note that test 2 and 4, which do not use the mscvrt stuff, have double \r: one sent by the code, and another added, apparently by MSC newline processing. test 2-u and 4-u, which are invoking the subprocess with Python's -u parameter, also do not exhibit the problem, even though the mscvrt stuff is not used. This seems to indicate that Python's -u parameter does approximately the same thing as my windows_binary function. Seems like if Python already has code for this, that it would be nice to either make it more easily available to the user as an API (like my windows_binary function, invoked with a single line) in the io or sys modules (since it is used to affect sys.std* files). And it would be nice if the function "worked cross-platform", even if it is a noop on most platforms. ---------- files: test.py messages: 125500 nosy: v+python priority: normal severity: normal status: open title: binary stdio Added file: http://bugs.python.org/file20285/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:20:37 2011 From: report at bugs.python.org (Ned Deily) Date: Thu, 06 Jan 2011 09:20:37 +0000 Subject: [New-bugs-announce] [issue10842] Update third-party libraries for OS X installer builds In-Reply-To: <1294305637.23.0.341106753223.issue10842@psf.upfronthosting.co.za> Message-ID: <1294305637.23.0.341106753223.issue10842@psf.upfronthosting.co.za> New submission from Ned Deily : The third-party libraries used by the 32-bit OS X installer are in need of updating. (Patch follows.) ---------- assignee: ronaldoussoren components: Build, Macintosh messages: 125532 nosy: georg.brandl, ned.deily, ronaldoussoren priority: normal severity: normal stage: patch review status: open title: Update third-party libraries for OS X installer builds versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:45:03 2011 From: report at bugs.python.org (Ned Deily) Date: Thu, 06 Jan 2011 09:45:03 +0000 Subject: [New-bugs-announce] [issue10843] OS X installer: install the Tools source directory In-Reply-To: <1294307103.62.0.440849003452.issue10843@psf.upfronthosting.co.za> Message-ID: <1294307103.62.0.440849003452.issue10843@psf.upfronthosting.co.za> New submission from Ned Deily : As suggested in Issue10502 and now that the former Demos directory has been pruned and moved under the Tools directory, the OS X installer should install the Tools source directory in the /Applications/Python 3.x/Extras directory where Demos was formerly installed. The existing README file there still applies, i.e. not all of these files are applicable to OS X users. (patch follows) ---------- assignee: ronaldoussoren components: Build, Macintosh messages: 125540 nosy: georg.brandl, michael.foord, ned.deily, ronaldoussoren priority: high severity: normal status: open title: OS X installer: install the Tools source directory versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 10:55:25 2011 From: report at bugs.python.org (Ned Deily) Date: Thu, 06 Jan 2011 09:55:25 +0000 Subject: [New-bugs-announce] [issue10844] OS X installer: update copyright dates in app bundles In-Reply-To: <1294307725.56.0.795948655729.issue10844@psf.upfronthosting.co.za> Message-ID: <1294307725.56.0.795948655729.issue10844@psf.upfronthosting.co.za> New submission from Ned Deily : The copyright dates in the plists for the various app bundles installed by the OS X installer need updating. They are visible with the Finder's Get Info command. (patch for py3k follows, backport for 2.7 and 3.1 needed) ---------- assignee: ronaldoussoren components: Build, Macintosh messages: 125542 nosy: georg.brandl, ned.deily, ronaldoussoren priority: high severity: normal status: open title: OS X installer: update copyright dates in app bundles versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 11:26:21 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 06 Jan 2011 10:26:21 +0000 Subject: [New-bugs-announce] [issue10845] test_multiprocessing failure under Windows In-Reply-To: <1294309581.41.0.731804987161.issue10845@psf.upfronthosting.co.za> Message-ID: <1294309581.41.0.731804987161.issue10845@psf.upfronthosting.co.za> New submission from Antoine Pitrou : This is under a Windows 7 VM. I don't understand what the assertion means: Z:\>__svn__\PCbuild\amd64\python_d.exe -m test -v test_multiprocessing == CPython 3.2b2+ (py3k, Jan 6 2011, 10:56:48) [MSC v.1500 64 bit (AMD64)] == Windows-7-6.1.7600 little-endian == Z:\__svn__\build\test_python_1360 Testing with flags: sys.flags(debug=0, division_warning=0, inspect=0, interactiv e=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_enviro nment=0, verbose=0, bytes_warning=0, quiet=0) [1/1] test_multiprocessing Traceback (most recent call last): File "", line 1, in File "Z:\__svn__\lib\multiprocessing\forking.py", line 369, in main prepare(preparation_data) File "Z:\__svn__\lib\multiprocessing\forking.py", line 477, in prepare assert main_name not in sys.modules, main_name AssertionError: __main__ [49434 refs] Traceback (most recent call last): File "", line 1, in File "Z:\__svn__\lib\multiprocessing\forking.py", line 369, in main prepare(preparation_data) File "Z:\__svn__\lib\multiprocessing\forking.py", line 477, in prepare assert main_name not in sys.modules, main_name AssertionError: __main__ [49434 refs] test test_multiprocessing crashed -- : Traceback (most recent call last): File "Z:\__svn__\lib\test\regrtest.py", line 969, in runtest_inner Traceback (most recent call last): File "", line 1, in File "Z:\__svn__\lib\multiprocessing\forking.py", line 369, in main indirect_test() File "Z:\__svn__\lib\test\test_multiprocessing.py", line 2102, in test_main prepare(preparation_data) File "Z:\__svn__\lib\multiprocessing\forking.py", line 477, in prepare assert main_name not in sys.modules, main_name AssertionError: __main__ ManagerMixin.manager.start() File "/home/antoine/py3k/__svn__/Lib/multiprocessing/managers.py", line 531, i n start [49434 refs] Traceback (most recent call last): File "", line 1, in File "Z:\__svn__\lib\multiprocessing\forking.py", line 369, in main self._address = reader.recv() EOFError Traceback (most recent call last): File "", line 1, in prepare(preparation_data) File "Z:\__svn__\lib\multiprocessing\forking.py", line 477, in prepare File "Z:\__svn__\lib\multiprocessing\forking.py", line 369, in main 1 test failed: assert main_name not in sys.modules, main_name AssertionError: __main__ prepare(preparation_data) File "Z:\__svn__\lib\multiprocessing\forking.py", line 477, in prepare [49434 refs] assert main_name not in sys.modules, main_name AssertionError: __main__ [49434 refs] test_multiprocessing Traceback (most recent call last): File "Z:\__svn__\lib\test\support.py", line 468, in temp_cwd yield os.getcwd() File "Z:\__svn__\lib\test\__main__.py", line 13, in regrtest.main() File "Z:\__svn__\lib\test\regrtest.py", line 708, in main sys.exit(len(bad) > 0 or interrupted) SystemExit: True ---------- components: Library (Lib), Tests messages: 125547 nosy: asksol, jnoller, pitrou priority: normal severity: normal status: open title: test_multiprocessing failure under Windows type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 20:15:47 2011 From: report at bugs.python.org (Vladimir Rutsky) Date: Thu, 06 Jan 2011 19:15:47 +0000 Subject: [New-bugs-announce] [issue10846] typo in threading doc's: "size of the resource size" In-Reply-To: <1294341347.62.0.125412301486.issue10846@psf.upfronthosting.co.za> Message-ID: <1294341347.62.0.125412301486.issue10846@psf.upfronthosting.co.za> New submission from Vladimir Rutsky : I think there is a typo in threading documentation: > In any situation where the size of the resource size is fixed, > you should use a bounded semaphore. - "size of the resource size", see attached patch for proposed fix. (Based on official http://svn.python.org/projects/python/branches/py3k/ repository.) ---------- assignee: docs at python components: Documentation files: threading_typo_size_of_size.patch keywords: patch messages: 125580 nosy: docs at python, rutsky priority: normal severity: normal status: open title: typo in threading doc's: "size of the resource size" versions: Python 3.3 Added file: http://bugs.python.org/file20293/threading_typo_size_of_size.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 22:21:57 2011 From: report at bugs.python.org (Stefan Krah) Date: Thu, 06 Jan 2011 21:21:57 +0000 Subject: [New-bugs-announce] [issue10847] Distutils drops -fno-strict-aliasing when CFLAGS are set In-Reply-To: <1294348917.86.0.0652237323155.issue10847@psf.upfronthosting.co.za> Message-ID: <1294348917.86.0.0652237323155.issue10847@psf.upfronthosting.co.za> New submission from Stefan Krah : When CFLAGS are set, distutils drops -fno-strict-aliasing (among other flags): $ python2.7 setup.py build ... gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./src -I/usr/local/include -I/usr/local/include/python2.7 -c src/gmpy.c -o build/temp.linux-x86_64-2.7/src/gmpy.o ... $ CFLAGS="-fomit-frame-pointer" python2.7 setup.py build ... gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fomit-frame-pointer -fPIC -I./src -I/usr/local/include -I/usr/local/include/python2.7 -c src/gmpy.c -o build/temp.linux-x86_64-2.7/src/gmpy.o src/gmpy.c: In function ?_cmp_to_object?: src/gmpy.c:4692: warning: dereferencing type-punned pointer will break strict-aliasing rules ... I'm not sure if this is intentional. The documentation says: "Compiler flags can also be supplied through setting the CFLAGS environment variable. If set, the contents of CFLAGS will be added to the compiler flags specified in the Setup file." To me, this sounds as if they should be appended to the regular flags. ---------- assignee: tarek components: Distutils messages: 125591 nosy: eric.araujo, skrah, tarek priority: high severity: normal status: open title: Distutils drops -fno-strict-aliasing when CFLAGS are set type: behavior versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 23:34:19 2011 From: report at bugs.python.org (Brett Cannon) Date: Thu, 06 Jan 2011 22:34:19 +0000 Subject: [New-bugs-announce] [issue10848] Move test.regrtest from getopt to argparse In-Reply-To: <1294353259.48.0.852026284896.issue10848@psf.upfronthosting.co.za> Message-ID: <1294353259.48.0.852026284896.issue10848@psf.upfronthosting.co.za> New submission from Brett Cannon : r87812 shows that using getopt is not a good thing; having the short and long versions of an argument separated from each other can lead to bugs. It would be good to move test.regrtest over to argparse to help prevent that from happening again. ---------- components: Tests keywords: easy messages: 125597 nosy: brett.cannon priority: low severity: normal status: open title: Move test.regrtest from getopt to argparse type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 6 23:52:30 2011 From: report at bugs.python.org (Alexander Belopolsky) Date: Thu, 06 Jan 2011 22:52:30 +0000 Subject: [New-bugs-announce] [issue10849] Backport test/__main__ In-Reply-To: <1294354350.96.0.765120918707.issue10849@psf.upfronthosting.co.za> Message-ID: <1294354350.96.0.765120918707.issue10849@psf.upfronthosting.co.za> New submission from Alexander Belopolsky : It is much easier to remember and to type -m test instead of -m test.regrtest, but the usefulness of this feature is limited by the fact that it only works with the latest version. Since this does not require any user-visible changes, I think it should be ported to all actively maintained branches. Note that we used to have a similar issue with -m test.regrtest and it was quite annoying to remember a separate incantation for 2.5. ---------- messages: 125600 nosy: belopolsky priority: normal severity: normal status: open title: Backport test/__main__ versions: Python 2.6, Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 01:32:54 2011 From: report at bugs.python.org (chrysn) Date: Fri, 07 Jan 2011 00:32:54 +0000 Subject: [New-bugs-announce] [issue10850] inconsistent behavior concerning multiprocessing.manager.BaseManager._Server In-Reply-To: <1294360374.53.0.588595674921.issue10850@psf.upfronthosting.co.za> Message-ID: <1294360374.53.0.588595674921.issue10850@psf.upfronthosting.co.za> New submission from chrysn : The multiprocessing.manager.BaseManager class has a class property called _Server, defaulting to multiprocessing.manager.Server, that is used in the ._run_server method (typically invoked via .run()) to determine the class of the server that is to be created. On the other hand, the .get_server() method creates an instance of Server independent of what is configured in ._Server. Thus, managers started via .run() behave slightly different than those started with .get_server().serve_forever(), and in a way that is hard to track. I am aware that the ._Server property is undocumented, but it's quite useful when extending BaseManager in a way that it needs to be configured by the server. I suggest to have .get_server() use ._Server instead of Server; I can't think of situations in which this does the wrong thing (rather, I assume that up to now, users of ._Server didn't try running with .get_server().serve_forever(); it seems ._Server is not used in the standard library). ---------- components: None messages: 125606 nosy: chrysn priority: normal severity: normal status: open title: inconsistent behavior concerning multiprocessing.manager.BaseManager._Server type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 02:20:52 2011 From: report at bugs.python.org (Daniel Black) Date: Fri, 07 Jan 2011 01:20:52 +0000 Subject: [New-bugs-announce] [issue10851] further extend ssl SNI and ciphers API In-Reply-To: <1294363252.79.0.602058607156.issue10851@psf.upfronthosting.co.za> Message-ID: <1294363252.79.0.602058607156.issue10851@psf.upfronthosting.co.za> New submission from Daniel Black : as a further extension to issue #5639 (sni) and issue #8322 this patch provides the ability to set ciphers in the SSLContext.wrap_socket and server_hostname in ssl.wrap_socket. This just makes all the ssl apis look the same. Restructured the documentation associated with these functions to all be around the wrap_socket method. ---------- components: Library (Lib) files: p3k-sni-ciphers.patch keywords: patch messages: 125612 nosy: grooverdan, pitrou priority: normal severity: normal status: open title: further extend ssl SNI and ciphers API versions: Python 3.3 Added file: http://bugs.python.org/file20296/p3k-sni-ciphers.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 05:43:00 2011 From: report at bugs.python.org (Daniel Black) Date: Fri, 07 Jan 2011 04:43:00 +0000 Subject: [New-bugs-announce] [issue10852] SSL/TLS sni use in smtp, pop, imap, nntp, ftp client libs by default In-Reply-To: <1294375380.08.0.187691378511.issue10852@psf.upfronthosting.co.za> Message-ID: <1294375380.08.0.187691378511.issue10852@psf.upfronthosting.co.za> New submission from Daniel Black : Like r85793, sni is enabled by default for url and https classes. This continues the consistency throughout the python libraries by adding it to other places where wrap_socket is used to instigate a SSL/TLS connection. ---------- components: Library (Lib) files: sni-pop-smtp-imap-nntp.patch keywords: patch messages: 125621 nosy: grooverdan, pitrou priority: normal severity: normal status: open title: SSL/TLS sni use in smtp,pop,imap,nntp,ftp client libs by default type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file20299/sni-pop-smtp-imap-nntp.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 05:44:06 2011 From: report at bugs.python.org (Daniel Black) Date: Fri, 07 Jan 2011 04:44:06 +0000 Subject: [New-bugs-announce] [issue10853] SSL/TLS sni use in smtp, pop, imap, nntp, ftp client libs by default In-Reply-To: <1294375446.18.0.329599270499.issue10853@psf.upfronthosting.co.za> Message-ID: <1294375446.18.0.329599270499.issue10853@psf.upfronthosting.co.za> New submission from Daniel Black : Like r85793, sni is enabled by default for url and https classes. This continues the consistency throughout the python libraries by adding it to other places where wrap_socket is used to instigate a SSL/TLS connection. ---------- components: Library (Lib) files: sni-pop-smtp-imap-nntp.patch keywords: patch messages: 125622 nosy: grooverdan, pitrou priority: normal severity: normal status: open title: SSL/TLS sni use in smtp,pop,imap,nntp,ftp client libs by default type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file20300/sni-pop-smtp-imap-nntp.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 16:48:45 2011 From: report at bugs.python.org (anatoly techtonik) Date: Fri, 07 Jan 2011 15:48:45 +0000 Subject: [New-bugs-announce] [issue10854] Output DLL name in error message of ImportError when DLL is missing In-Reply-To: <1294415325.09.0.315523226252.issue10854@psf.upfronthosting.co.za> Message-ID: <1294415325.09.0.315523226252.issue10854@psf.upfronthosting.co.za> New submission from anatoly techtonik : When an extension could not be loaded, because it requires some DLL that is missing, Python shows the following error message: ImportError: DLL load failed: The specified module could not be found. It will help tremendously in debugging extension problems if the missing DLL name is specified in error message. ---------- components: Extension Modules messages: 125649 nosy: techtonik priority: normal severity: normal status: open title: Output DLL name in error message of ImportError when DLL is missing type: resource usage versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:23:44 2011 From: report at bugs.python.org (Peter Creath) Date: Fri, 07 Jan 2011 16:23:44 +0000 Subject: [New-bugs-announce] [issue10855] wave.Wave_read.close() doesn't release file In-Reply-To: <1294417424.98.0.47429499245.issue10855@psf.upfronthosting.co.za> Message-ID: <1294417424.98.0.47429499245.issue10855@psf.upfronthosting.co.za> New submission from Peter Creath : Calling wave.close() fails to release all references to the file passed in via wave.open(filename_or_obj, "rb"). As a result, processing many wave files produces an IOError of too many files open. This bug is often masked because this dangling reference is collected if the wave object is collected. However, if the wave object is retained, calling wave_obj.close() won't release the reference, and so the file will never be closed. There are two solutions: 1) The workaround: the client program can explicitly close the file object it passed to the wave object ("file_obj.close()"). 2) The bug fix: the wave module can properly release the extra reference to the file, by setting "self._data_chunk = None" in the close() method. Explanation: Trunk code (and 2.7.1, and older): def close(self): if self._i_opened_the_file: self._i_opened_the_file.close() self._i_opened_the_file = None self._file = None but note initfp(self, file): ... self._file = Chunk(file, bigendian = 0) ... chunk = Chunk(self._file, bigendian = 0) ... self._data_chunk = chunk ... therefore close needs to add: self._data_chunk = None ---------- components: Library (Lib) messages: 125654 nosy: pjcreath priority: normal severity: normal status: open title: wave.Wave_read.close() doesn't release file type: resource usage versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:23:48 2011 From: report at bugs.python.org (anatoly techtonik) Date: Fri, 07 Jan 2011 16:23:48 +0000 Subject: [New-bugs-announce] [issue10856] documentation for ImportError parameters and attributes In-Reply-To: <1294417428.74.0.78747071216.issue10856@psf.upfronthosting.co.za> Message-ID: <1294417428.74.0.78747071216.issue10856@psf.upfronthosting.co.za> New submission from anatoly techtonik : Need documentation for ImportError parameters and exception instance attributes. ---------- assignee: docs at python components: Documentation messages: 125655 nosy: docs at python, techtonik priority: normal severity: normal status: open title: documentation for ImportError parameters and attributes type: feature request versions: Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 17:26:24 2011 From: report at bugs.python.org (anatoly techtonik) Date: Fri, 07 Jan 2011 16:26:24 +0000 Subject: [New-bugs-announce] [issue10857] ImportError module attribute In-Reply-To: <1294417584.32.0.11817196448.issue10857@psf.upfronthosting.co.za> Message-ID: <1294417584.32.0.11817196448.issue10857@psf.upfronthosting.co.za> New submission from anatoly techtonik : Need ImportError.module attribute to get the name of failed import. Right now it requires parsing ImportError.args that is presented in form "('No module named zqwer',)" that is not pythonic. ---------- messages: 125656 nosy: techtonik priority: normal severity: normal status: open title: ImportError module attribute type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 19:09:30 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 07 Jan 2011 18:09:30 +0000 Subject: [New-bugs-announce] [issue10858] Make source code links less proeminent In-Reply-To: <1294423770.11.0.311474750627.issue10858@psf.upfronthosting.co.za> Message-ID: <1294423770.11.0.311474750627.issue10858@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Reading library source code will only be enlightening to expert users, since most modules are not academic but real-world implementations, with all the complications it entails. Therefore, putting a link at the top of module sections is only confusing for most people. I would like to shift these links to the bottom of doc pages, where we already have "see also" links to RFCs and the like. ---------- assignee: docs at python components: Documentation messages: 125669 nosy: docs at python, pitrou, rhettinger priority: normal severity: normal status: open title: Make source code links less proeminent versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 20:05:12 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 07 Jan 2011 19:05:12 +0000 Subject: [New-bugs-announce] [issue10859] Is GeneratorContextManager public? In-Reply-To: <1294427112.3.0.241437231702.issue10859@psf.upfronthosting.co.za> Message-ID: <1294427112.3.0.241437231702.issue10859@psf.upfronthosting.co.za> New submission from Antoine Pitrou : contextlib.GeneratorContextManager doesn't have an underscore but it's not documented either. Something has to be done (I would say make it private). ---------- components: Library (Lib) messages: 125683 nosy: michael.foord, ncoghlan, pitrou priority: normal severity: normal status: open title: Is GeneratorContextManager public? type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 20:14:30 2011 From: report at bugs.python.org (Shawn Ligocki) Date: Fri, 07 Jan 2011 19:14:30 +0000 Subject: [New-bugs-announce] [issue10860] urllib2 crashes on valid URL In-Reply-To: <1294427670.55.0.855321383674.issue10860@psf.upfronthosting.co.za> Message-ID: <1294427670.55.0.855321383674.issue10860@psf.upfronthosting.co.za> New submission from Shawn Ligocki : urllib2 crashes with stack trace on legal URL http://118114.cn Transcript: Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import urllib2 >>> urllib2.urlopen("http://118114.cn") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen return _opener.open(url, data, timeout) File "/usr/lib/python2.6/urllib2.py", line 397, in open response = meth(req, response) File "/usr/lib/python2.6/urllib2.py", line 510, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python2.6/urllib2.py", line 429, in error result = self._call_chain(*args) File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 605, in http_error_302 return self.parent.open(new, timeout=req.timeout) File "/usr/lib/python2.6/urllib2.py", line 391, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 409, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1161, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1107, in do_open h = http_class(host, timeout=req.timeout) # will parse host:port File "/usr/lib/python2.6/httplib.py", line 657, in __init__ self._set_hostport(host, port) File "/usr/lib/python2.6/httplib.py", line 682, in _set_hostport raise InvalidURL("nonnumeric port: '%s'" % host[i+1:]) httplib.InvalidURL: nonnumeric port: '' >>> I think the problem is that "http://118114.cn" says it redirects to "http://www.118114.cn:", but it seems like urllib2 should be able to deal with that or at least report back a more useful error message. $ nc 118114.cn 80 GET / HTTP/1.1 Host: 118114.cn User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13 HTTP/1.1 301 Moved Permanently Server: nginx/0.7.64 Date: Fri, 07 Jan 2011 19:06:32 GMT Content-Type: text/html Content-Length: 185 Connection: keep-alive Keep-Alive: timeout=60 Location: http://www.118114.cn: 301 Moved Permanently

301 Moved Permanently


nginx/0.7.64
---------- components: Library (Lib) messages: 125687 nosy: sligocki priority: normal severity: normal status: open title: urllib2 crashes on valid URL type: crash versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 20:41:58 2011 From: report at bugs.python.org (Shawn Ligocki) Date: Fri, 07 Jan 2011 19:41:58 +0000 Subject: [New-bugs-announce] [issue10861] urllib2 sporadically falsely claims infinite redirect In-Reply-To: <1294429318.76.0.578486353319.issue10861@psf.upfronthosting.co.za> Message-ID: <1294429318.76.0.578486353319.issue10861@psf.upfronthosting.co.za> New submission from Shawn Ligocki : urllib2 sporadically falsely claims that http://www.bankofamerica.com/ has infinite redirect: $ python -c 'import urllib2; print urllib2.urlopen("http://www.bankofamerica.com/").geturl()' https://www.bankofamerica.com/ $ python -c 'import urllib2; print urllib2.urlopen("http://www.bankofamerica.com/").geturl()' Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen return _opener.open(url, data, timeout) File "/usr/lib/python2.6/urllib2.py", line 397, in open response = meth(req, response) File "/usr/lib/python2.6/urllib2.py", line 510, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python2.6/urllib2.py", line 429, in error result = self._call_chain(*args) File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 605, in http_error_302 return self.parent.open(new, timeout=req.timeout) File "/usr/lib/python2.6/urllib2.py", line 397, in open response = meth(req, response) File "/usr/lib/python2.6/urllib2.py", line 510, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python2.6/urllib2.py", line 429, in error result = self._call_chain(*args) File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 605, in http_error_302 return self.parent.open(new, timeout=req.timeout) File "/usr/lib/python2.6/urllib2.py", line 397, in open response = meth(req, response) File "/usr/lib/python2.6/urllib2.py", line 510, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python2.6/urllib2.py", line 429, in error result = self._call_chain(*args) File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 605, in http_error_302 return self.parent.open(new, timeout=req.timeout) File "/usr/lib/python2.6/urllib2.py", line 397, in open response = meth(req, response) File "/usr/lib/python2.6/urllib2.py", line 510, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python2.6/urllib2.py", line 429, in error result = self._call_chain(*args) File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 605, in http_error_302 return self.parent.open(new, timeout=req.timeout) File "/usr/lib/python2.6/urllib2.py", line 397, in open response = meth(req, response) File "/usr/lib/python2.6/urllib2.py", line 510, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python2.6/urllib2.py", line 429, in error result = self._call_chain(*args) File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 595, in http_error_302 self.inf_msg + msg, headers, fp) urllib2.HTTPError: HTTP Error 302: The HTTP server returned a redirect error that would lead to an infinite loop. The last 30x error message was: Found Since it is sporadic, it could just be a problem with bankofamerica.com's servers. Is there an easy way to see what response urllib2 got that made it unhappy? ---------- components: Library (Lib) messages: 125693 nosy: sligocki priority: normal severity: normal status: open title: urllib2 sporadically falsely claims infinite redirect versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 20:43:01 2011 From: report at bugs.python.org (xiscu) Date: Fri, 07 Jan 2011 19:43:01 +0000 Subject: [New-bugs-announce] [issue10862] Complete your registration to Python tracker -- key yq3FVw0zXbfo3RJCzK2PqphC2n0XTohy In-Reply-To: <20110107194123.412F61D41A@psf.upfronthosting.co.za> Message-ID: <4D276CCA.2050406@email.de> New submission from xiscu : On 01/07/2011 08:41 PM, Python tracker wrote: > To complete your registration of the user "xiscu" with > Python tracker, please do one of the following: > > - send a reply to report at bugs.python.org and maintain the subject line as is (the > reply's additional "Re:" is ok), > > - or visit the following URL: > > http://bugs.python.org/?@action=confrego&otk=yq3FVw0zXbfo3RJCzK2PqphC2n0XTohy > > > ---------- messages: 125694 nosy: xiscu priority: normal severity: normal status: open title: Complete your registration to Python tracker -- key yq3FVw0zXbfo3RJCzK2PqphC2n0XTohy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 7 21:02:51 2011 From: report at bugs.python.org (Jose-Luis Fernandez-Barros) Date: Fri, 07 Jan 2011 20:02:51 +0000 Subject: [New-bugs-announce] [issue10863] zlib.compress() fails with string In-Reply-To: <1294430571.2.0.193589316262.issue10863@psf.upfronthosting.co.za> Message-ID: <1294430571.2.0.193589316262.issue10863@psf.upfronthosting.co.za> New submission from Jose-Luis Fernandez-Barros : On "The Python Tutorial", section 10.9. Data Compression http://docs.python.org/py3k/tutorial/stdlib.html#data-compression >>> import zlib >>> s = 'witch which has which witches wrist watch' ... >>> t = zlib.compress(s) Traceback (most recent call last): File "", line 1, in TypeError: must be bytes or buffer, not str Possible solution (sorry, newbie) are: >>> s = b'witch which has which witches wrist watch' or >>> s = 'witch which has which witches wrist watch'.encode("utf-8") At "The Python Standard Library", secction 12. Data Compression and Archiving http://docs.python.org/py3k/library/zlib.html#module-zlib apparently example is correct: zlib.compress(string[, level]) ---------- assignee: docs at python components: Documentation messages: 125702 nosy: docs at python, joseluisfb priority: normal severity: normal status: open title: zlib.compress() fails with string type: compile error versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 03:43:17 2011 From: report at bugs.python.org (STINNER Victor) Date: Sat, 08 Jan 2011 02:43:17 +0000 Subject: [New-bugs-announce] [issue10864] time.strftime("%Y"): limitation of 4 digits on OpenIndiana (Solaris) In-Reply-To: <1294454597.35.0.957818587484.issue10864@psf.upfronthosting.co.za> Message-ID: <1294454597.35.0.957818587484.issue10864@psf.upfronthosting.co.za> New submission from STINNER Victor : The following example displays '2345' instead of '12345': import time t = (12345,) + (0,)*8 print(repr(time.strftime("%Y", t))) time.strftime() should raise a ValueError if the year is bigger than 9999, as it is done with Visual Studio for year outside [1; 9999]. ---------- components: Library (Lib) messages: 125744 nosy: haypo priority: normal severity: normal status: open title: time.strftime("%Y"): limitation of 4 digits on OpenIndiana (Solaris) versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 08:02:58 2011 From: report at bugs.python.org (ulidtko) Date: Sat, 08 Jan 2011 07:02:58 +0000 Subject: [New-bugs-announce] [issue10865] chroot-ing breaks encodings.idna In-Reply-To: <1294470178.85.0.531669703509.issue10865@psf.upfronthosting.co.za> Message-ID: <1294470178.85.0.531669703509.issue10865@psf.upfronthosting.co.za> New submission from ulidtko : Consider the following test script: import os import urllib.request os.chroot("/tmp") urllib.request.urlopen("http://localhost") When executed with enough privileges, the script terminates with the following traceback: Traceback (most recent call last): File "./test.py", line 8, in urllib.request.urlopen("http://localhost") File "/usr/lib/python3.1/urllib/request.py", line 121, in urlopen File "/usr/lib/python3.1/urllib/request.py", line 350, in open File "/usr/lib/python3.1/urllib/request.py", line 368, in _open File "/usr/lib/python3.1/urllib/request.py", line 328, in _call_chain File "/usr/lib/python3.1/urllib/request.py", line 1110, in http_open File "/usr/lib/python3.1/urllib/request.py", line 1092, in do_open File "/usr/lib/python3.1/http/client.py", line 940, in request File "/usr/lib/python3.1/http/client.py", line 978, in _send_request File "/usr/lib/python3.1/http/client.py", line 936, in endheaders File "/usr/lib/python3.1/http/client.py", line 790, in _send_output File "/usr/lib/python3.1/http/client.py", line 731, in send File "/usr/lib/python3.1/http/client.py", line 713, in connect File "/usr/lib/python3.1/socket.py", line 320, in create_connection LookupError: unknown encoding: idna Without the os.chroot line it runs ok. Furthermore, when importing encodings.idna explicitly and before chroot-ing, any hostname refuses to resolve at all. Script: import os import urllib.request import encodings.idna os.chroot("/tmp") urllib.request.urlopen("http://localhost") now terminates with the following traceback: Traceback (most recent call last): File "./test.py3", line 9, in urllib.request.urlopen("http://localhost") File "/usr/lib/python3.1/urllib/request.py", line 121, in urlopen File "/usr/lib/python3.1/urllib/request.py", line 350, in open File "/usr/lib/python3.1/urllib/request.py", line 368, in _open File "/usr/lib/python3.1/urllib/request.py", line 328, in _call_chain File "/usr/lib/python3.1/urllib/request.py", line 1110, in http_open File "/usr/lib/python3.1/urllib/request.py", line 1095, in do_open urllib.error.URLError: ---------- components: Library (Lib) messages: 125756 nosy: ulidtko priority: normal severity: normal status: open title: chroot-ing breaks encodings.idna versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From orsenthil at gmail.com Sat Jan 8 09:11:23 2011 From: orsenthil at gmail.com (Senthil Kumaran) Date: Sat, 8 Jan 2011 16:11:23 +0800 Subject: [New-bugs-announce] [issue10860] urllib2 crashes on valid URL In-Reply-To: <1294427670.55.0.855321383674.issue10860@psf.upfronthosting.co.za> References: <1294427670.55.0.855321383674.issue10860@psf.upfronthosting.co.za> <1294427670.55.0.855321383674.issue10860@psf.upfronthosting.co.za> Message-ID: <20110108081123.GA1162@rubuntu> On Fri, Jan 07, 2011 at 07:14:30PM +0000, Shawn Ligocki wrote: > > I think the problem is that "http://118114.cn" says it redirects to > "http://www.118114.cn:", but it seems like urllib2 should be able to > deal with that or at least report back a more useful error message. I think, this is improper at the Server End to redirect it to URL where ':' is provided and Port is missing. Any client, which does a transparent redirection, can be expected to fail. senthil at rubuntu:~$ curl -L http://118114.cn curl: (6) Couldn't resolve host 'www.118114.cn:' The Redirected URL is an Invalid Syntax and I don't think we should fix by providing a default port at urllib2 end. What can be done is fail with timeout or raise an Exception for an Invalid URL. From report at bugs.python.org Sat Jan 8 09:16:17 2011 From: report at bugs.python.org (Ross Lagerwall) Date: Sat, 08 Jan 2011 08:16:17 +0000 Subject: [New-bugs-announce] [issue10866] Add sethostname() In-Reply-To: <1294474577.93.0.97800635081.issue10866@psf.upfronthosting.co.za> Message-ID: <1294474577.93.0.97800635081.issue10866@psf.upfronthosting.co.za> New submission from Ross Lagerwall : This patch adds sethostname to the socket module (since socket has gethostname()). ---------- components: Library (Lib) files: sethostname.patch keywords: patch messages: 125761 nosy: giampaolo.rodola, loewis, rosslagerwall priority: normal severity: normal status: open title: Add sethostname() versions: Python 3.3 Added file: http://bugs.python.org/file20312/sethostname.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 8 13:20:30 2011 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Sat, 08 Jan 2011 12:20:30 +0000 Subject: [New-bugs-announce] [issue10867] python mmap objects issue msync() in destructor even if mapping was created with prot=mmap.PROT_READ only In-Reply-To: <1294489230.48.0.811640987738.issue10867@psf.upfronthosting.co.za> Message-ID: <1294489230.48.0.811640987738.issue10867@psf.upfronthosting.co.za> New submission from ???? ????????? : python mmap objects issue msync() in destructor even if mapping was created with prot=mmap.PROT_READ only ---------- messages: 125780 nosy: mmarkk priority: normal severity: normal status: open title: python mmap objects issue msync() in destructor even if mapping was created with prot=mmap.PROT_READ only _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 00:32:13 2011 From: report at bugs.python.org (Edoardo Spadolini) Date: Sat, 08 Jan 2011 23:32:13 +0000 Subject: [New-bugs-announce] [issue10868] ABCMeta.register() should work as a decorator In-Reply-To: <1294529533.15.0.442078735636.issue10868@psf.upfronthosting.co.za> Message-ID: <1294529533.15.0.442078735636.issue10868@psf.upfronthosting.co.za> New submission from Edoardo Spadolini : If we make ABCMeta.register() return the registered class, like atexit.register() does for the registered function, we can then use it as a decorator: Now: class Foo: ... ABarC.register(Foo) With this change: @ABarC.register class Foo: ... The only problem this would cause is in code that relies on ABCMeta.register() to return None; I can't think of a reason anyone would rely on this, but... ---------- components: Library (Lib) files: abcmeta_register_deco.diff keywords: patch messages: 125804 nosy: kerio priority: normal severity: normal status: open title: ABCMeta.register() should work as a decorator type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file20314/abcmeta_register_deco.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 01:13:40 2011 From: report at bugs.python.org (David White) Date: Sun, 09 Jan 2011 00:13:40 +0000 Subject: [New-bugs-announce] [issue10869] ast.increment_lineno() increments root node twice In-Reply-To: <1294532020.29.0.848816436513.issue10869@psf.upfronthosting.co.za> Message-ID: <1294532020.29.0.848816436513.issue10869@psf.upfronthosting.co.za> New submission from David White : When using ast.increment_lineno(), it visits the root node twice. Therefore if the root node contains the lineno attribute, it is incremented twice. (Often, the root node will not have a lineno attribute, so there is no effect. This is why the current test case passes.) I believe that part of the problem is that the docs for ast.walk(), which ast.increment_lineno() calls, state that it visits all child nodes of the given node. It does not state that it also visits the given node itself. I use 2.7, but I noticed the same issue is present in 3.1 and the py3k branch. I have written a patch that fixes both of these issues, ast.increment_lineno and the ast.walk docs, and adds a new test case to the test suite. I will be posting it after I submit the issue (so I have the issue number). ---------- components: Library (Lib) messages: 125813 nosy: dpwhite2 priority: normal severity: normal status: open title: ast.increment_lineno() increments root node twice type: behavior versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 09:59:46 2011 From: report at bugs.python.org (Baptiste Lepilleur) Date: Sun, 09 Jan 2011 08:59:46 +0000 Subject: [New-bugs-announce] [issue10870] Last line of argparse code samples can not be read on Windows In-Reply-To: <1294563586.16.0.961055405371.issue10870@psf.upfronthosting.co.za> Message-ID: <1294563586.16.0.961055405371.issue10870@psf.upfronthosting.co.za> New submission from Baptiste Lepilleur : When the code samples from the CHM documentation are displayed, if the lines are too long, a scroll bar is added at the bottom which prevents reading the last line of the code sample. Usually this can be worked-around by making the windows larger, but some examples in the documentation of the argparse are so wide that even in full screen, the window is not wide enough. I attached a screen capture to illustrate the issue (taken from section 14.4.3.3. nargs of Python 3.2b2). This is even worth with one-liner code sample when not browsing full screen (e.g. with the index on the side). Environment: Windows XP SP3, resolution: 1024x768, python 3.2b2. I don't know if it is possible, but adding a blank line at the end of code sample that are more than 80 characters wide would likely work-around the issue. ---------- assignee: docs at python components: Documentation files: argparse-codesample-unreadable.png messages: 125832 nosy: blep, docs at python priority: normal severity: normal status: open title: Last line of argparse code samples can not be read on Windows versions: Python 3.2 Added file: http://bugs.python.org/file20321/argparse-codesample-unreadable.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 10:07:40 2011 From: report at bugs.python.org (Baptiste Lepilleur) Date: Sun, 09 Jan 2011 09:07:40 +0000 Subject: [New-bugs-announce] [issue10871] argparse example use "file" instead of "open" In-Reply-To: <1294564060.95.0.807361745459.issue10871@psf.upfronthosting.co.za> Message-ID: <1294564060.95.0.807361745459.issue10871@psf.upfronthosting.co.za> New submission from Baptiste Lepilleur : In section "14.4.3.6. type" of the argparse module, the following code sample is given: >>> parser = argparse.ArgumentParser() >>> parser.add_argument('foo', type=int) >>> parser.add_argument('bar', type=file) >>> parser.parse_args('2 temp.txt'.split()) Namespace(bar=, foo=2) The built-in "file" used for argument 'bar' no longer exists in python 3.2. ---------- assignee: docs at python components: Documentation messages: 125834 nosy: blep, docs at python priority: normal severity: normal status: open title: argparse example use "file" instead of "open" versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 10:22:28 2011 From: report at bugs.python.org (Georg Brandl) Date: Sun, 09 Jan 2011 09:22:28 +0000 Subject: [New-bugs-announce] [issue10872] Add mode to TextIOWrapper repr In-Reply-To: <1294564948.19.0.858903256762.issue10872@psf.upfronthosting.co.za> Message-ID: <1294564948.19.0.858903256762.issue10872@psf.upfronthosting.co.za> New submission from Georg Brandl : The old file type had its mode in the repr(), which I think was useful; TextIOWrapper doesn't. Can we add it back? ---------- assignee: pitrou messages: 125836 nosy: georg.brandl, pitrou priority: normal severity: normal status: open title: Add mode to TextIOWrapper repr versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 13:20:44 2011 From: report at bugs.python.org (Ashwin Purohit) Date: Sun, 09 Jan 2011 12:20:44 +0000 Subject: [New-bugs-announce] [issue10873] String formatting example invalid In-Reply-To: <1294575644.02.0.857949444366.issue10873@psf.upfronthosting.co.za> Message-ID: <1294575644.02.0.857949444366.issue10873@psf.upfronthosting.co.za> New submission from Ashwin Purohit : Your example on page http://docs.python.org/tutorial/inputoutput.html is outdated and won't work in Python 2.7: Basic usage of the str.format() method looks like this: >>> print 'We are the {} who say "{}!"'.format('knights', 'Ni') We are the knights who say "Ni!" Now, all brackets have to have a numeric or keyword argument. ---------- assignee: docs at python components: Documentation messages: 125838 nosy: doagie, docs at python priority: normal severity: normal status: open title: String formatting example invalid type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 17:52:43 2011 From: report at bugs.python.org (=?utf-8?q?Andreas_St=C3=BChrk?=) Date: Sun, 09 Jan 2011 16:52:43 +0000 Subject: [New-bugs-announce] [issue10874] test_urllib2 shouldn't use is operator for comparing strings In-Reply-To: <1294591963.25.0.901803829485.issue10874@psf.upfronthosting.co.za> Message-ID: <1294591963.25.0.901803829485.issue10874@psf.upfronthosting.co.za> New submission from Andreas St?hrk : See the attached patch (applies to 2.7 and 3.2). ---------- components: Tests files: test_urllib2.patch keywords: patch messages: 125846 nosy: Trundle, lukasz.langa priority: normal severity: normal status: open title: test_urllib2 shouldn't use is operator for comparing strings versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file20324/test_urllib2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 21:20:09 2011 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 09 Jan 2011 20:20:09 +0000 Subject: [New-bugs-announce] [issue10875] Update Regular Expression HOWTO In-Reply-To: <1294604409.29.0.577762819836.issue10875@psf.upfronthosting.co.za> Message-ID: <1294604409.29.0.577762819836.issue10875@psf.upfronthosting.co.za> New submission from Terry J. Reedy : 0. Does 'Release 0.05' at the top have any useful current meaning? or could it be deleted? 1. Introduction: The history paragraph "The re module was added in Python 1.5, and provides Perl-style regular expression patterns. Earlier versions of Python came with the regex module, which provided Emacs-style patterns. The regex module was removed completely in Python 2.5." might be eliminated in 3.x, or at least the irrelevant-for-py3 reference to regex. This is a policy decision. 2. Performing matches: "If you have Tkinter available, you may also want to look at Tools/scripts/redemo.py," Change 'Tkinter' to 'tkinter' and make it a module reference. In link, change 'scripts' to 'demo' as redemo.py got moved. "Phil Schwartz?s Kodos is also an interactive tool for developing and testing RE patterns." Add the url '(http://kodos.sourceforge.net/)' to the text so that Windows help users can copy and paste it into a browser. (This should be a general policy.) "Python 2.2.2 (#1, Feb 10 2003, 12:57:01)" delete <_sre.SRE_Match object at 80c4f68> This is correctly updated (for late 2.x and 3.x) "" (7 like this) Globally replace 're.MatchObject instance' with '_sre.SRE_Match object' 3. Footnote "[1] Introduced in Python 2.2.2." remove for 3.x here and wherever footnote reference is in the text. 4. "Not Using re.VERBOSE" This section is about *using* re.VERBOSE and the benefit thereof, not about not using it. I recommend deleting 'Not' as it gives the impression that the section is a warning about not using, the opposite of the intent. 5. Code example output and doctest: I ran doctest.testfile("C:/programs/PyDev/py32/Doc/howto/regex.rst", module_relative = False) After the 're...' to '_sre...' substitution above, all 11 failures would be due to 'at 0x#######' address mismatches. I believe changing all 11 addresses to '0x...' (I took this from the doctest doc) would both fix the failures and remove irrelevant detail for human readers. The other 87 examples all passed ;-!. Is there any current doctest-related markup that should be added? ---------- assignee: docs at python components: Documentation messages: 125855 nosy: akuchling, docs at python, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Update Regular Expression HOWTO versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 9 23:17:47 2011 From: report at bugs.python.org (Kira Erethon) Date: Sun, 09 Jan 2011 22:17:47 +0000 Subject: [New-bugs-announce] [issue10876] Zipfile crashes when zip password is 610 In-Reply-To: <1294611467.71.0.814994722037.issue10876@psf.upfronthosting.co.za> Message-ID: <1294611467.71.0.814994722037.issue10876@psf.upfronthosting.co.za> New submission from Kira Erethon : Was playing around with Zipfile and passwords in zip files and I noticed that when the password on zipfile.setpassword(pwd) was set 610, the program crashed with the following errors File "/usr/lib/python2.6/zipfile.py", line 938, in extractall self.extract(zipinfo, path, pwd) File "/usr/lib/python2.6/zipfile.py", line 926, in extract return self._extract_member(member, path, pwd) File "/usr/lib/python2.6/zipfile.py", line 971, in _extract_member shutil.copyfileobj(source, target) File "/usr/lib/python2.6/shutil.py", line 28, in copyfileobj buf = fsrc.read(length) File "/usr/lib/python2.6/zipfile.py", line 612, in read newdata = self.dc.decompress(newdata) zlib.error: Error -3 while decompressing: invalid distance too far back ---------- components: Extension Modules messages: 125867 nosy: Kira.Kapoios priority: normal severity: normal status: open title: Zipfile crashes when zip password is 610 type: crash versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 00:52:54 2011 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 09 Jan 2011 23:52:54 +0000 Subject: [New-bugs-announce] [issue10877] Make Tools (and subdirs) a package (and subpackages) In-Reply-To: <1294617174.73.0.902104851361.issue10877@psf.upfronthosting.co.za> Message-ID: <1294617174.73.0.902104851361.issue10877@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Given that sys.path includes ".../python32" adding the requisite empty __init__.py to Tools/ and, for instance, demo/ would allow >>> from Tools.demo.redemo import main; main() to work (I tried it with Scripts instead of demo in b2). Now I have to open an editor window and hit F5 to run. (On Windows, the Command Prompt window is so wretched that it is much easier to work and explore within a Python shell.) Can files like __init__.py be added to the repository just by adding them to a checked-out working copy? Would there be a reason to exclude any subdirectories (that have .py files)? Can this be done for 3.2? I see that things have already been moved around within Tools since b2. If there is a policy against this, perhaps Tools/README could mention it. In any case, "This directory contains a number of Python programs that are useful" should be edited to "This directory contains a number of subdirectories with Python programs that are useful" as *every* program has been put in a subdirectory, even if by itself. ---------- components: Demos and Tools messages: 125875 nosy: terry.reedy priority: normal severity: normal status: open title: Make Tools (and subdirs) a package (and subpackages) type: feature request versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 07:40:38 2011 From: report at bugs.python.org (Teodor Georgiev) Date: Mon, 10 Jan 2011 06:40:38 +0000 Subject: [New-bugs-announce] [issue10878] asyncore does not react properly on close() In-Reply-To: <1294641638.26.0.753920382409.issue10878@psf.upfronthosting.co.za> Message-ID: <1294641638.26.0.753920382409.issue10878@psf.upfronthosting.co.za> New submission from Teodor Georgiev : I am trying to add a simple timer to each created socket and destroy it once the timer expires: class client(asyncore.dispatcher): def __init__(self,host): ... self.timeout = time.time() + 5 def readable(self): if time.time() >= self.timeout: self.close() return True When running that code, it raises an exception: asyncore.loop(timeout=0.8) File "/usr/lib/python2.6/asyncore.py", line 211, in loop poll_fun(timeout) File "/usr/lib/python2.6/asyncore.py", line 144, in poll raise File "/usr/lib/python2.6/asyncore.py", line 141, in poll r, w, e = select.select(r, w, e, timeout) select.error: (9, 'Bad file descriptor') Although del_channel is executed properly and the socket is removed from the map, the poll function is not updated with that info and continues to keep the socket into the r,w,e. ---------- components: Library (Lib) messages: 125882 nosy: tgeorgiev priority: normal severity: normal status: open title: asyncore does not react properly on close() versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 09:34:50 2011 From: report at bugs.python.org (Glenn Linderman) Date: Mon, 10 Jan 2011 08:34:50 +0000 Subject: [New-bugs-announce] [issue10879] cgi memory usage In-Reply-To: <1294648490.09.0.987257947586.issue10879@psf.upfronthosting.co.za> Message-ID: <1294648490.09.0.987257947586.issue10879@psf.upfronthosting.co.za> New submission from Glenn Linderman : In attempting to review issue 4953, I discovered a conundrum in handling of multipart/formdata. cgi.py has claimed for some time (at least since 2.4) that it "handles" file storage for uploading large files. I looked at the code in 2.6 that handles such, and it uses the rfc822.Message method, which parses headers from any object supporting readline(). In particular, it doesn't attempt to read message bodies, and there is code in cgi.py to perform that. There is still code in 3.2 cgi.py to read message bodies, but... rfc822 has gone away, and been replaced with the email package. Theoretically this is good, but the cgi FieldStorage read_multi method now parses the whole CGI input and then iteration parcels out items to FieldStorage instances. There is a significant difference here: email reads everything into memory (if I understand it correctly). That will never work to upload large or many files when combined with a Web server that launches CGI programs with memory limits. I see several possible actions that could be taken: 1) Documentation. While it is doubtful that any is using 3.x CGI, and this makes it more doubtful, the present code does not match the documentation, because while the documenteation claims to handle file uploads as files, rather than in-memory blobs, the current code does not do that. 2) If there is a method in the email package that corresponds to rfc822.Message, parsing only headers, I couldn't find it. Perhaps it is possible to feed just headers to BytesFeedParser, and stop, and get the same sort of effect. However, this is not the way the cgi.py presently is coded. And if there is a better API, for parsing only headers, that is or could be exposed by email, that might be handy. 3) The 2.6 cgi.py does not claim to support nested multipart/ stuff, only one level. I'm not sure if any present or planned web browsers use nested multipart/ stuff... I guess it would require a nested
tag? which is illegal HTML last I checked. So perhaps the general logic flow of 2.6 cgi.py could be reinstated, with a technique to feed only headers to BytesFeedParser, together with reinstating the MIME body parsing in cgi.py,b and this could make a solution that works. I discovered this, beacuase I couldn't figure out where a bunch of the methods in cgi.py were called from, particularly read_lines_to_outerboundary, and make_file. They seemed to be called much too late in the process. It wasn't until I looked back at 2.6 code that I could see that there was a transition from using rfc822 only for headers to using email for parsing the whole data stream, and that that was the cause of the documentation not seeming to match the code logic. I have no idea if this problem is in 2.7, as I don't have it installed here for easy reference, and I'm personally much more interested in 3.2. ---------- components: Library (Lib) messages: 125884 nosy: r.david.murray, v+python priority: normal severity: normal status: open title: cgi memory usage versions: Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 17:55:22 2011 From: report at bugs.python.org (Yuriy) Date: Mon, 10 Jan 2011 16:55:22 +0000 Subject: [New-bugs-announce] [issue10880] do_mkvalue and 'boolean' In-Reply-To: <1294678522.28.0.674271875959.issue10880@psf.upfronthosting.co.za> Message-ID: <1294678522.28.0.674271875959.issue10880@psf.upfronthosting.co.za> New submission from Yuriy : If a value created by Py_VaBuildValue and parameter "b" is transfered - a PyLong_Type value is returned despite of the fact that it would be reasonable if PyBool_Type were returned. Are there any reasons for this? modsupport.c Ln 214 ---------- messages: 125903 nosy: IROV priority: normal severity: normal status: open title: do_mkvalue and 'boolean' type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 20:54:07 2011 From: report at bugs.python.org (Stephen Hansen) Date: Mon, 10 Jan 2011 19:54:07 +0000 Subject: [New-bugs-announce] [issue10881] test_site and macframework builds fails In-Reply-To: <1294689247.64.0.100970558273.issue10881@psf.upfronthosting.co.za> Message-ID: <1294689247.64.0.100970558273.issue10881@psf.upfronthosting.co.za> New submission from Stephen Hansen : With the latest from branches/py3k, in a framework build, I get: Wimp:build pythonbuildbot$ ./python.exe -m test.regrtest test_site [1/1] test_site test test_site failed -- Traceback (most recent call last): File "/Users/pythonbuildbot/32test/build/Lib/test/test_site.py", line 225, in test_getsitepackages self.assertEqual(len(dirs), 2) AssertionError: 3 != 2 1 test failed: test_site Wimp:build pythonbuildbot$ ./python.exe Python 3.2b2+ (py3k:87899M, Jan 10 2011, 11:08:48) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import site >>> site.getsitepackages() ['/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages', '/Library/Frameworks/Python.framework/Versions/3.2/lib/site-python', '/Library/Python/3.2/site-packages'] Those three dirs look correct for me, but the test is written to find exactly two from site.getsitepackages() -- the code, however, adds an extra in the event of framework builds. ---------- assignee: ronaldoussoren components: Macintosh, Tests messages: 125919 nosy: ixokai, ronaldoussoren priority: normal severity: normal status: open title: test_site and macframework builds fails versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 21:27:48 2011 From: report at bugs.python.org (Ross Lagerwall) Date: Mon, 10 Jan 2011 20:27:48 +0000 Subject: [New-bugs-announce] [issue10882] Add os.sendfile() In-Reply-To: <1294691268.76.0.727179568007.issue10882@psf.upfronthosting.co.za> Message-ID: <1294691268.76.0.727179568007.issue10882@psf.upfronthosting.co.za> New submission from Ross Lagerwall : Attached is a patch which implements os.sendfile for unix systems (linux, freebsd, apple, solaris, dragonfly). It takes the iov initialization code and off_t parsing from i10812. It encapsulates all the functionality from the various sendfiles which means a fair amount of #ifdefs but the basic case works for all of them. Tested on Linux & FreeBSD - it should work on solaris but since it needs to link with the sendfile library and I have no idea how to link the posix module with the sendfile library only on Solaris, i couldn't test it. If someone could please contribute this... I think it might be possible to get a Windows equivalent of this - i'll leave it for someone else to do ;-) ---------- components: Extension Modules files: sendfile.patch keywords: patch messages: 125924 nosy: giampaolo.rodola, loewis, pitrou, rosslagerwall priority: normal severity: normal status: open title: Add os.sendfile() type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file20338/sendfile.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 10 23:32:44 2011 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Jan 2011 22:32:44 +0000 Subject: [New-bugs-announce] [issue10883] urllib: socket is not closed explicitly In-Reply-To: <1294698764.05.0.403920474459.issue10883@psf.upfronthosting.co.za> Message-ID: <1294698764.05.0.403920474459.issue10883@psf.upfronthosting.co.za> New submission from STINNER Victor : test_urllibnet.py and test_urllibnet2.py emit ResourceWarning: ============== $ ./python Lib/test/test_urllibnet.py testURLread (__main__.URLTimeoutTest) ... ok test_bad_address (__main__.urlopenNetworkTests) ... ok test_basic (__main__.urlopenNetworkTests) ... ok test_fileno (__main__.urlopenNetworkTests) ... ok test_getcode (__main__.urlopenNetworkTests) ... /home/haypo/prog/GIT/py3k/Lib/socket.py:333: ResourceWarning: unclosed self._sock = None ok test_geturl (__main__.urlopenNetworkTests) ... ok test_info (__main__.urlopenNetworkTests) ... ok test_readlines (__main__.urlopenNetworkTests) ... ok test_basic (__main__.urlretrieveNetworkTests) ... /home/haypo/prog/GIT/py3k/Lib/socket.py:333: ResourceWarning: unclosed self._sock = None ok test_data_header (__main__.urlretrieveNetworkTests) ... /home/haypo/prog/GIT/py3k/Lib/socket.py:333: ResourceWarning: unclosed self._sock = None ok test_header (__main__.urlretrieveNetworkTests) ... /home/haypo/prog/GIT/py3k/Lib/socket.py:333: ResourceWarning: unclosed self._sock = None ok test_specified_path (__main__.urlretrieveNetworkTests) ... /home/haypo/prog/GIT/py3k/Lib/socket.py:333: ResourceWarning: unclosed self._sock = None ok ---------------------------------------------------------------------- Ran 12 tests in 17.473s ============== It looks like these warning are real bugs: the socket is not closed explicitly by urllib. Nadeem Vawda suggests a first fix: diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -2151,7 +2151,9 @@ conn = self.ftp.ntransfercmd(cmd) self.busy = 1 # Pass back both a suitably decorated object and a retrieval length - return (addclosehook(conn[0].makefile('rb'), self.endtransfer), conn[1]) + fp = addclosehook(conn[0].makefile('rb'), self.endtransfer) + conn[0].close() + return (fp, conn[1]) def endtransfer(self): if not self.busy: return ---------- components: Library (Lib) messages: 125944 nosy: haypo, nvawda, orsenthil priority: normal severity: normal status: open title: urllib: socket is not closed explicitly versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 05:56:27 2011 From: report at bugs.python.org (Michael Mulich) Date: Tue, 11 Jan 2011 04:56:27 +0000 Subject: [New-bugs-announce] [issue10884] pkgutil EggInfoDistribution requirements for .egg-info metadata In-Reply-To: <1294721787.13.0.963133670506.issue10884@psf.upfronthosting.co.za> Message-ID: <1294721787.13.0.963133670506.issue10884@psf.upfronthosting.co.za> New submission from Michael Mulich : Found an issue where the metadata initialization of .egg-info dirs (an EggInfoDistribution object) overrides the 'path' variable, which makes it impossible to find a distributions requirements. I've fixed the issue at https://bitbucket.org/pumazi/distutils2-fixes/changeset/f3b5eb2aac2c (changeset also attached). ---------- assignee: tarek components: Distutils2 files: distutils2-fixes-f3b5eb2aac2c.diff keywords: patch messages: 125982 nosy: eric.araujo, pumazi, tarek priority: normal severity: normal status: open title: pkgutil EggInfoDistribution requirements for .egg-info metadata 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/file20351/distutils2-fixes-f3b5eb2aac2c.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 11:47:25 2011 From: report at bugs.python.org (Ross Lagerwall) Date: Tue, 11 Jan 2011 10:47:25 +0000 Subject: [New-bugs-announce] [issue10885] multiprocessing docs In-Reply-To: <1294742845.68.0.53995604469.issue10885@psf.upfronthosting.co.za> Message-ID: <1294742845.68.0.53995604469.issue10885@psf.upfronthosting.co.za> New submission from Ross Lagerwall : I think there is a small docs bug: it says that multiprocessing.Semaphore is "a bounded semaphore". Shouldn't it says that it is just "a semaphore". Attached is a patch to fix this. ---------- components: Library (Lib) files: docupdate.patch keywords: patch messages: 125995 nosy: georg.brandl, rosslagerwall priority: normal severity: normal status: open title: multiprocessing docs versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20354/docupdate.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 12:16:59 2011 From: report at bugs.python.org (Torsten Landschoff) Date: Tue, 11 Jan 2011 11:16:59 +0000 Subject: [New-bugs-announce] [issue10886] Unhelpful backtrace for multiprocessing.Queue In-Reply-To: <1294744619.25.0.366060169853.issue10886@psf.upfronthosting.co.za> Message-ID: <1294744619.25.0.366060169853.issue10886@psf.upfronthosting.co.za> New submission from Torsten Landschoff : When trying to send an object via a Queue that can't be pickled, one gets a quite unhelpful traceback: Traceback (most recent call last): File "/usr/lib/python2.6/multiprocessing/queues.py", line 242, in _feed send(obj) PicklingError: Can't pickle : attribute lookup __builtin__.module failed I have no idea where I am sending this. It would be helpful to get the call trace to the call to Queue.put. My workaround was to create a Queue via this function MyQueue: def MyQueue(): import cPickle def myput(obj, *args, **kwargs): cPickle.dumps(obj) return orig_put(obj, *args, **kwargs) q = Queue() orig_put, q.put = q.put, myput return q That way I get the pickle exception in the caller to put and was able to find out the offending code. ---------- components: Library (Lib) messages: 125996 nosy: torsten priority: normal severity: normal status: open title: Unhelpful backtrace for multiprocessing.Queue type: feature request versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 12:34:41 2011 From: report at bugs.python.org (anatoly techtonik) Date: Tue, 11 Jan 2011 11:34:41 +0000 Subject: [New-bugs-announce] [issue10887] Add link to development ML In-Reply-To: <1294745681.16.0.799239354624.issue10887@psf.upfronthosting.co.za> Message-ID: <1294745681.16.0.799239354624.issue10887@psf.upfronthosting.co.za> New submission from anatoly techtonik : Tarek, can you add link to http://groups.google.com/group/the-fellowship-of-the-packaging to distutils dev pages at https://bitbucket.org/tarek/distutils2/wiki/Home ? ---------- assignee: tarek components: Distutils2 messages: 125998 nosy: eric.araujo, tarek, techtonik priority: normal severity: normal status: open title: Add link to development ML _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 14:13:01 2011 From: report at bugs.python.org (dobbelaj) Date: Tue, 11 Jan 2011 13:13:01 +0000 Subject: [New-bugs-announce] [issue10888] os.stat(filepath).st_mode gives wrong 'executable permission' result In-Reply-To: <1294751581.52.0.421644635374.issue10888@psf.upfronthosting.co.za> Message-ID: <1294751581.52.0.421644635374.issue10888@psf.upfronthosting.co.za> New submission from dobbelaj : The 'os.stat' method on windows seems to be hardcoded to check the file name extension when computing the 'executable permission flag' (st_mode). (See Modules/posixmodule.c: win32_stat and win32_wstat) Currently, it checks for : '.bat', '.cmd', '.exe', '.com' As dynamic libraries also must be executable on window, t should also check for : '.dll' It would be even better if the actual 'read and execute' permission is returned. ---------- components: Windows messages: 126004 nosy: jeroen.dobbelaere priority: normal severity: normal status: open title: os.stat(filepath).st_mode gives wrong 'executable permission' result type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 11 16:59:29 2011 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 11 Jan 2011 15:59:29 +0000 Subject: [New-bugs-announce] [issue10889] Fix range slicing and indexing to handle lengths > sys.maxsize In-Reply-To: <1294761569.28.0.225841776524.issue10889@psf.upfronthosting.co.za> Message-ID: <1294761569.28.0.225841776524.issue10889@psf.upfronthosting.co.za> New submission from Nick Coghlan : Enhancement to range to correctly handle indexing and slicing when len(x) raises OverflowError. Note that this enables correct calculation of the length of such ranges via: def _range_len(x): try: length = len(x) except OverflowError: step = x[1] - x[0] length = 1 + ((x[-1] - x[0]) // step) return length ---------- assignee: ncoghlan messages: 126017 nosy: ncoghlan priority: normal severity: normal status: open title: Fix range slicing and indexing to handle lengths > sys.maxsize _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 04:44:04 2011 From: report at bugs.python.org (James) Date: Wed, 12 Jan 2011 03:44:04 +0000 Subject: [New-bugs-announce] [issue10890] IDLE Freezing In-Reply-To: <1294803844.35.0.517588470253.issue10890@psf.upfronthosting.co.za> Message-ID: <1294803844.35.0.517588470253.issue10890@psf.upfronthosting.co.za> New submission from James : Recently installed Python 2.7.1 on my MacBook running OS X 10.6.6 and have not been able to use IDLE without it freezing. When I force quit it doesn't show that it's not responding. I can run scripts fine, but if I were to try to copy-paste, or save via command-S, it will lock up completely. ---------- assignee: ronaldoussoren components: Macintosh messages: 126070 nosy: jamgood96, ronaldoussoren priority: normal severity: normal status: open title: IDLE Freezing type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 11:29:48 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 12 Jan 2011 10:29:48 +0000 Subject: [New-bugs-announce] [issue10891] Tweak sorting howto to eliminate redundancy In-Reply-To: <1294828188.31.0.578827978132.issue10891@psf.upfronthosting.co.za> Message-ID: <1294828188.31.0.578827978132.issue10891@psf.upfronthosting.co.za> New submission from ?ric Araujo : When reading over the sorting howto, I noticed redundancy of the form ?the list.sort() method of a list?. Raymond, if you approve the attached patch, please assign back to me. There were no warnings during doc build and no link was broken. Note that :meth:`list.sort` (or :meth:`~list.sort`) does not trigger a link to the doc of the method, since sort is not marked up with a method directive but listed in a table alongside other list and bytearray methods (http://docs.python.org/dev/library/stdtypes#typesseq-mutable). This table is preceded by index-generating markup, but it does not create a target for :meth:`list.sort`; that?s a separate issue. Until it?s solved, the sorting howto could turn the first occurrence of ?list? into a link to the right section, using :ref:`typesseq-mutable `, or continue to live without a link to list or list.sort. ---------- assignee: rhettinger components: Documentation files: minor-sorting-changes.diff keywords: patch messages: 126083 nosy: docs at python, eric.araujo, rhettinger priority: normal severity: normal stage: commit review status: open title: Tweak sorting howto to eliminate redundancy versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20364/minor-sorting-changes.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 13:09:16 2011 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Wed, 12 Jan 2011 12:09:16 +0000 Subject: [New-bugs-announce] [issue10892] segfault with "del X.__abstractmethods__" In-Reply-To: <1294834156.26.0.13558320611.issue10892@psf.upfronthosting.co.za> Message-ID: <1294834156.26.0.13558320611.issue10892@psf.upfronthosting.co.za> New submission from Amaury Forgeot d'Arc : A short crasher:: class X(object): pass del X.__abstractmethods__ All versions since 2.6 are affected. The fix is probably simple: the setter function type_set_abstractmethods() in typeobject.c should check for a NULL value. ---------- keywords: easy messages: 126086 nosy: amaury.forgeotdarc priority: critical severity: normal status: open title: segfault with "del X.__abstractmethods__" type: crash versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 13:59:56 2011 From: report at bugs.python.org (Ram Rachum) Date: Wed, 12 Jan 2011 12:59:56 +0000 Subject: [New-bugs-announce] [issue10893] The docs mark staticmethod as a function In-Reply-To: <1294837196.34.0.0437845342766.issue10893@psf.upfronthosting.co.za> Message-ID: <1294837196.34.0.0437845342766.issue10893@psf.upfronthosting.co.za> New submission from Ram Rachum : The Python documentation uses :func:`staticmethod` to describe staticmethod, while staticmethod is a type. I want to link to the Python documentation from my project's documentation using Intersphinx, and I wouldn't want to mislead my users by marking static method as a function. ---------- assignee: docs at python components: Documentation messages: 126090 nosy: cool-RR, docs at python priority: normal severity: normal status: open title: The docs mark staticmethod as a function 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 Wed Jan 12 14:17:16 2011 From: report at bugs.python.org (SilentGhost) Date: Wed, 12 Jan 2011 13:17:16 +0000 Subject: [New-bugs-announce] [issue10894] Making stdlib APIs private In-Reply-To: <1294838236.87.0.84648349826.issue10894@psf.upfronthosting.co.za> Message-ID: <1294838236.87.0.84648349826.issue10894@psf.upfronthosting.co.za> New submission from SilentGhost : Following suggestion in the Developers Guide (http://docs.python.org/devguide/#index-5) and the rules proposed by Michael Foord (http://mail.python.org/pipermail/python-dev/2010-November/105476.html): ------------ > If a module or package defines __all__ that authoritatively defines the public interface. Modules with __all__ SHOULD still respect the naming conventions (leading underscore for private members) to avoid confusing users. Modules SHOULD NOT export private members in __all__. > Names imported into a module a never considered part of its public API unless documented to be so or included in __all__. > Methods / functions / classes and module attributes whose names begin with a leading underscore are private. > If a class name begins with a leading underscore none of its members are public, whether or not they begin with a leading underscore. > If a module name in a package begins with a leading underscore none of its members are public, whether or not they begin with a leading underscore. > If a module or package doesn't define __all__ then all names that don't start with a leading underscore are public. > All public members MUST be documented. Public functions, methods and classes SHOULD have docstrings. Private members may have docstrings. > Where in the standard library this means that a module exports stuff that isn't helpful or shouldn't be part of the public API we need to migrate to private names and follow our deprecation process for the public names. ------------ The following deprecation method is adopted: from warnings import warn as _warn def no_underscore(): _warn("The module.no_underscore() function is deprecated", DeprecationWarning, 2) return _no_underscore() Note: this is a meta-issue. It should only depend on all individual issues fixing APIs. It's currently dependant only on resolved issue10371. As I don't think it's reasonable to create an issue per stdlib module, I'm going to group a few modules in issue. However, when submitting patches, please create a patch per module to minimize disturbance. The files to check: Lib/module.py, Lib/test/test_module.py, Doc/library/module.rst ---------- components: Library (Lib) messages: 126094 nosy: SilentGhost, brett.cannon priority: normal severity: normal status: open title: Making stdlib APIs private versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 14:21:03 2011 From: report at bugs.python.org (SilentGhost) Date: Wed, 12 Jan 2011 13:21:03 +0000 Subject: [New-bugs-announce] [issue10895] Private stdlib API: getopt, getpass, glob, gzip, genericpath, gettext In-Reply-To: <1294838463.37.0.519255760117.issue10895@psf.upfronthosting.co.za> Message-ID: <1294838463.37.0.519255760117.issue10895@psf.upfronthosting.co.za> New submission from SilentGhost : Module generic path is in order (added here only for completeness). Attached patch is for getopt. ---------- components: Library (Lib) files: getopt_api.diff keywords: patch messages: 126095 nosy: SilentGhost priority: normal severity: normal status: open title: Private stdlib API: getopt, getpass, glob, gzip, genericpath, gettext versions: Python 3.3 Added file: http://bugs.python.org/file20365/getopt_api.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 15:44:49 2011 From: report at bugs.python.org (Vladimir Rutsky) Date: Wed, 12 Jan 2011 14:44:49 +0000 Subject: [New-bugs-announce] [issue10896] trace module compares directories as strings (--ignore-dir) In-Reply-To: <1294843489.43.0.983792093108.issue10896@psf.upfronthosting.co.za> Message-ID: <1294843489.43.0.983792093108.issue10896@psf.upfronthosting.co.za> New submission from Vladimir Rutsky : This is code from recent trace.py (http://svn.python.org/view/python/branches/release27-maint/Lib/trace.py?view=markup): trace.py:169: # Ignore a file when it contains one of the ignorable paths for d in self._dirs: # The '+ os.sep' is to ensure that d is a parent directory, # as compared to cases like: # d = "/usr/local" # filename = "/usr/local.py" # or # d = "/usr/local.py" # filename = "/usr/local.py" if filename.startswith(d + os.sep): self._ignore[modulename] = 1 return 1 Directories comparison like "filename.startswith(d + os.sep)" works incorrect on case-insensitive filesystems (such as NTFS on Windows). This leads to confusing results on Windows: python trace.py --ignore-dir='$prefix' -t test.py or python trace.py --ignore-dir C:\Python26\Lib -t test.py shows all calls from standard library, but this one doesn't: python trace.py --ignore-dir=c:\python26\lib -t test.py See attached test files and log for details. ---------- components: Library (Lib) files: test.py messages: 126101 nosy: vrutsky priority: normal severity: normal status: open title: trace module compares directories as strings (--ignore-dir) versions: Python 2.7 Added file: http://bugs.python.org/file20368/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 16:16:19 2011 From: report at bugs.python.org (Lorenz Huedepohl) Date: Wed, 12 Jan 2011 15:16:19 +0000 Subject: [New-bugs-announce] [issue10897] UNIX mmap unnecessarily dup() file descriptor In-Reply-To: <1294845379.76.0.427887707002.issue10897@psf.upfronthosting.co.za> Message-ID: <1294845379.76.0.427887707002.issue10897@psf.upfronthosting.co.za> New submission from Lorenz Huedepohl : The UNIX mmap version in Modules/mmapmodule.c makes a call to dup() to duplicate the file descriptor that is passed for creating the memory-mapped region. This way, I frequently hit the limit for the number of open file handles while creating mmap.mmap() instances, despite closing all my opened files after creating a mapping for them. My application is scientific data (read: "large data" :-) analysis for which mmap() is very well suited together with numpy/scipy - however, the large number of files causes me to hit the resource limit on open file handles) I propose to remove this dup(), which was apparently introduced in the process of fixing issue #728515, concerning incorrect behavior of the mmap.resize() method on UNIX, as it was feared the user could have closed the file handle already. I think it should be the responsibility of the user not to close the file in question or either - if it needs to be closed - not to call the resize method later. I should stress that a call to mmap(2) does not require an open file handle during the time of the mapping but that a duplicate of the file handle was only kept to allow .size() and .resize() to work. See the POSIX Programmer's Manual: The mmap() function shall add an extra reference to the file associated with the file descriptor fildes which is not removed by a subsequent close() on that file descriptor. This reference shall be removed when there are no more mappings to the file. It would be great if this little nicety would translate better to Python! Regards, Lorenz ---------- components: Library (Lib) files: no_dup.patch keywords: patch messages: 126104 nosy: lorenz priority: normal severity: normal status: open title: UNIX mmap unnecessarily dup() file descriptor type: resource usage 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/file20373/no_dup.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 19:32:28 2011 From: report at bugs.python.org (Alan Hourihane) Date: Wed, 12 Jan 2011 18:32:28 +0000 Subject: [New-bugs-announce] [issue10898] posixmodule.c redefines FSTAT In-Reply-To: <1294857148.96.0.548396285489.issue10898@psf.upfronthosting.co.za> Message-ID: <1294857148.96.0.548396285489.issue10898@psf.upfronthosting.co.za> New submission from Alan Hourihane : Python 2.7.1 redefines FSTAT, but the problem is my libc already defines FSTAT in sys/ioctl.h. I've worked around this by prefixing the FSTAT define with PYTHON. It should probably be done with STAT too. --- Modules/posixmodule.c.old 2011-01-12 01:46:45.000000000 +0000 +++ Modules/posixmodule.c 2011-01-12 01:47:05.000000000 +0000 @@ -344,11 +344,11 @@ #undef STAT #if defined(MS_WIN64) || defined(MS_WINDOWS) # define STAT win32_stat -# define FSTAT win32_fstat +# define PYTHON_FSTAT win32_fstat # define STRUCT_STAT struct win32_stat #else # define STAT stat -# define FSTAT fstat +# define PYTHON_FSTAT fstat # define STRUCT_STAT struct stat #endif @@ -6641,7 +6641,7 @@ if (!_PyVerify_fd(fd)) return posix_error(); Py_BEGIN_ALLOW_THREADS - res = FSTAT(fd, &st); + res = PYTHON_FSTAT(fd, &st); Py_END_ALLOW_THREADS if (res != 0) { #ifdef MS_WINDOWS ---------- messages: 126120 nosy: alanh priority: normal severity: normal status: open title: posixmodule.c redefines FSTAT type: compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 12 22:50:05 2011 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 12 Jan 2011 21:50:05 +0000 Subject: [New-bugs-announce] [issue10899] No function type annotations in the standard library In-Reply-To: <1294869005.61.0.164570460851.issue10899@psf.upfronthosting.co.za> Message-ID: <1294869005.61.0.164570460851.issue10899@psf.upfronthosting.co.za> New submission from Raymond Hettinger : The discussion for PEP 3107 said the use and interpretation of function type annotations was being left open for third-party developers to use as they see fit (some may use strings, other ABCs, others concrete types, or tuples of types or some other structure). Accordingly, we're not used them in the standard library because that would trump third-party uses. The exception is in the file Lib/_pyio.py which has a number of function annotations. I think those annotations should be replaced with comments. As it stands, they're untested, undocumented, and at odds with our idea to let the rest of the world decide how and when to use function type annotations. Guido, I think you pronounced on this a long time ago. Unfortunately, the PEP stops just short of saying "don't use this in the standard library" and the email threads are too voluminous to re-read. So, I wanted to ask, what do you think now? My vote is keep the stdlib out of the function type annotation business. ------------------ Excerpts from the PEP: """The only way that annotations take on meaning is when they are interpreted by third-party libraries. These annotation consumers can do anything they want with a function's annotations. For example, one library might use string-based annotations to provide improved help messages, like so ...""" """this PEP makes no attempt to introduce any kind of standard semantics, even for the built-in types. This work will be left to third-party libraries.""" """Though discussed early on ([5], [6]), including special objects in the stdlib for annotating generator functions and higher-order functions was ultimately rejected as being more appropriate for third-party libraries; including them in the standard library raised too many thorny issues.""" """Despite considerable discussion about a standard type parameterisation syntax, it was decided that this should also be left to third-party libraries. """ """ Despite yet more discussion, it was decided not to standardize a mechanism for annotation interoperability. Standardizing interoperability conventions at this point would be premature. We would rather let these conventions develop organically, based on real-world usage and necessity, than try to force all users into some contrived scheme. """ ---------- assignee: gvanrossum messages: 126143 nosy: collinwinter, gvanrossum, rhettinger priority: normal severity: normal status: open title: No function type annotations in the standard library versions: Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 18:14:25 2011 From: report at bugs.python.org (wrobell) Date: Thu, 13 Jan 2011 17:14:25 +0000 Subject: [New-bugs-announce] [issue10900] bz2 module fails to uncompress large files In-Reply-To: <1294938865.74.0.735458664613.issue10900@psf.upfronthosting.co.za> Message-ID: <1294938865.74.0.735458664613.issue10900@psf.upfronthosting.co.za> New submission from wrobell : There is problem to uncompress large files with bz2 module. For example, please download 13GB OpenStreetMap file using following torrent http://osm-torrent.torres.voyager.hr/files/planet-latest.osm.bz2.torrent Try to count lines in the compressed file with command... python3.2 bz2wc.py planet-110105.osm.bz2 3971 ... but there is much more lines in that file bzip2 -dc < planet-110105.osm.bz2 | wc -l The command bzip2 -t planet-110105.osm.bz2 validates the file successfully. ---------- components: Library (Lib) files: bz2wc.py messages: 126186 nosy: wrobell priority: normal severity: normal status: open title: bz2 module fails to uncompress large files versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file20390/bz2wc.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 13 18:22:25 2011 From: report at bugs.python.org (Brandon Craig Rhodes) Date: Thu, 13 Jan 2011 17:22:25 +0000 Subject: [New-bugs-announce] [issue10901] Python 3 MIME generator dies if not given boundary In-Reply-To: <1294939345.9.0.334725926474.issue10901@psf.upfronthosting.co.za> Message-ID: <1294939345.9.0.334725926474.issue10901@psf.upfronthosting.co.za> New submission from Brandon Craig Rhodes : If you try doing "msg.as_string()" to a MIMEMultipart message that has not been given a boundary, then it dies with this exception: Traceback (most recent call last): File "mime_gen_alt.py", line 40, in print(msg.as_string()) File "/home/brandon/python3.2b2/lib/python3.2/email/message.py", line 164, in as_string g.flatten(self, unixfrom=unixfrom) File "/home/brandon/python3.2b2/lib/python3.2/email/generator.py", line 88, in flatten self._write(msg) File "/home/brandon/python3.2b2/lib/python3.2/email/generator.py", line 134, in _write self._dispatch(msg) File "/home/brandon/python3.2b2/lib/python3.2/email/generator.py", line 160, in _dispatch meth(msg) File "/home/brandon/python3.2b2/lib/python3.2/email/generator.py", line 234, in _handle_multipart self.write('--' + boundary + self._NL) TypeError: Can't convert 'NoneType' object to str implicitly ---------- components: Library (Lib) messages: 126187 nosy: brandon-rhodes priority: normal severity: normal status: open title: Python 3 MIME generator dies if not given boundary type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 07:04:07 2011 From: report at bugs.python.org (Jean Jordaan) Date: Fri, 14 Jan 2011 06:04:07 +0000 Subject: [New-bugs-announce] [issue10902] Doc type: "run_*" instead of "run*" on http://docs.python.org/library/pdb.html In-Reply-To: <1294985047.82.0.945168102626.issue10902@psf.upfronthosting.co.za> Message-ID: <1294985047.82.0.945168102626.issue10902@psf.upfronthosting.co.za> New submission from Jean Jordaan : http://docs.python.org/library/pdb.html states "The run_* functions and set_trace() are aliases" but the functions in question are "run", "runeval" and "runcall": no underscores. ---------- assignee: docs at python components: Documentation messages: 126231 nosy: docs at python, neaj priority: normal severity: normal status: open title: Doc type: "run_*" instead of "run*" on http://docs.python.org/library/pdb.html type: performance versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 10:43:34 2011 From: report at bugs.python.org (arindam) Date: Fri, 14 Jan 2011 09:43:34 +0000 Subject: [New-bugs-announce] [issue10903] ZipExtFile:_update_crc fails for CRC >= 0x80000000 In-Reply-To: <1294998214.06.0.837210563153.issue10903@psf.upfronthosting.co.za> Message-ID: <1294998214.06.0.837210563153.issue10903@psf.upfronthosting.co.za> New submission from arindam : File: zipfile.py Function: _update_crc statement: if eof and self._running_crc != self._expected_crc: Due to comparison of long with int, "if eof and self._running_crc != self._expected_crc:" fails when _expected_crc is negative (0x80000000 or more). Type of _running_crc is long while _expected_crc is int. How to reproduce: Unzip a zip file containing a file having CRC >= 0x80000000. The issue is seen with 3.1 also. ---------- components: Library (Lib) messages: 126250 nosy: arindam priority: normal severity: normal status: open title: ZipExtFile:_update_crc fails for CRC >= 0x80000000 type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 11:27:20 2011 From: report at bugs.python.org (Peter Kleiweg) Date: Fri, 14 Jan 2011 10:27:20 +0000 Subject: [New-bugs-announce] [issue10904] PYTHONIOENCODING is not in manpage In-Reply-To: <1295000840.3.0.0583509737047.issue10904@psf.upfronthosting.co.za> Message-ID: <1295000840.3.0.0583509737047.issue10904@psf.upfronthosting.co.za> New submission from Peter Kleiweg : The environment variable PYTHONIOENCODING should be documented in de manpage ---------- assignee: docs at python components: Documentation, IO messages: 126252 nosy: docs at python, pebbe priority: normal severity: normal status: open title: PYTHONIOENCODING is not in manpage versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 13:03:48 2011 From: report at bugs.python.org (Zhigang Wang) Date: Fri, 14 Jan 2011 12:03:48 +0000 Subject: [New-bugs-announce] [issue10905] zipfile: fix arcname with leading '///' or '..' In-Reply-To: <1295006628.53.0.290414123413.issue10905@psf.upfronthosting.co.za> Message-ID: <1295006628.53.0.290414123413.issue10905@psf.upfronthosting.co.za> New submission from Zhigang Wang : We only support arcname with one leading '/', but not more. This patch fixes it. We don't support arcname with '..' well. The default behavior of unzip and 7z is to ignore all '..'. This patch does the same. Also updated the doc. If there are other security related issues exist, we should revise the doc. Please review. ---------- components: Library (Lib) files: python-zipfile-fix-arcname.patch keywords: patch messages: 126254 nosy: zhigang priority: normal severity: normal status: open title: zipfile: fix arcname with leading '///' or '..' type: security versions: Python 3.3 Added file: http://bugs.python.org/file20404/python-zipfile-fix-arcname.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 15:14:36 2011 From: report at bugs.python.org (anatoly techtonik) Date: Fri, 14 Jan 2011 14:14:36 +0000 Subject: [New-bugs-announce] [issue10906] wsgiref should mention that CGI scripts usually expect HTTPS variable to be set to 'on' In-Reply-To: <1295014476.87.0.519263477862.issue10906@psf.upfronthosting.co.za> Message-ID: <1295014476.87.0.519263477862.issue10906@psf.upfronthosting.co.za> New submission from anatoly techtonik : http://docs.python.org/library/wsgiref.html#wsgiref.util.guess_scheme The documentation says servers typically set HTTPS variable to a value of ?1? or ?yes?, when a request is received via SSL, but CGI tutorials, IIS and Apache set this to ?on?. Misleading documentation may be the reason of the bug with mod_wsgi that changes Apache's variable from ?on? to ?1? - https://issues.apache.org/bugzilla/show_bug.cgi?id=50581 The documentation should at least stress that ?on? is the mainstream value for this variable. It will help to mention at least one popular server that returns ?1?. ---------- assignee: docs at python components: Documentation messages: 126263 nosy: docs at python, techtonik priority: normal severity: normal status: open title: wsgiref should mention that CGI scripts usually expect HTTPS variable to be set to 'on' versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 16:52:41 2011 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 Jan 2011 15:52:41 +0000 Subject: [New-bugs-announce] [issue10907] OS X installer: warn users of buggy Tcl/Tk in OS X 10.6 In-Reply-To: <1295020361.6.0.15646249296.issue10907@psf.upfronthosting.co.za> Message-ID: <1295020361.6.0.15646249296.issue10907@psf.upfronthosting.co.za> New submission from Ned Deily : With 2.7 and now 3.2, we have been supplying two variants of OS X installers: the traditional 32-bit only version dynamically linked with Tk 8.4, the only version available across all supported OS X releases; and a new 64-bit/32-bit version dynamically linked with Tk 8.5 for 10.6 only. The Tcl/Tk 8.5 version supplied by Apple in OS X 10.6 has proven to work badly with IDLE and other Tkinter applications; issues reported include hangs when pasting text or opening new editor windows or after syntax errors. Until recently, it was the only standard version of non-X11 Tcl/Tk that was supported for both 64-bit and 32-bit executables. Recently, ActiveState has released a newer version of Tk 8.5 that is ABI-compatible with the Apple 10.6 one but which behaves much better with IDLE and Tkinter, with none of the previously reproducible hangs detected so far. Since the Python OS X installer depends on an external source for Tk, either the default Apple-suppled one or, now, an optional 3rd-party install like those from ActiveState, it is important that users are aware that there are options and that they can avoid bad experiences with IDLE crashing, etc. Because we are dependent on dynamic libraries, it is possible that the situation could change over the lifetime of the Python release, i.e. the Apple could update Tk in 10.6 or new problems could be found. So the solution here should allow for that. The attached patches take the following approach: 1. Define a canonical URL on the Python web site for a page that provides the latest status information on supported and recommended Tcl/Tk versions for all recent Python OS X installers. The URL chosen is: http://www.python.org/download/mac/tcltk/ 2. Add to the OS X Installer Welcome message and ReadMe files prominent references to the new web page. 3. Add an OS X only check in IDLE initialization to see if tkinter is running with the known buggy Apple version. If so, output a warning message via a print statement executed in the IDLE shell window: WARNING: The version of Tcl/Tk (8.5.7) in use may be unstable. Visit http://www.python.org/download/mac/tcltk/ for current information. Since it is possible the user will not be able to install ActiveTcl for some reason (licensing issues, perhaps), issuing the warning through the existing shell window will be much less obtrusive than opening an error window that would need to be dismissed every time IDLE is invoked. 4. Populate and maintain the new web page with the relevant information about OS X installer versions and Tcl/Tk versions. Make it easy for the user to find do the right thing. Attached is a first draft of the web page to show the basic approach. 5. Add and maintain references on the main Download page and the release-specific pages to the new web page. Those changes are also included in the web site patch. 6. Document and publish workarounds for 2.7.1 64-bit installer users. 7. Backport the 3.2 fixes for 2.7.2. ---------- assignee: ned.deily components: Build, IDLE, Macintosh files: issue_10_6_tk.patch keywords: patch messages: 126270 nosy: benjamin.peterson, georg.brandl, ned.deily priority: release blocker severity: normal status: open title: OS X installer: warn users of buggy Tcl/Tk in OS X 10.6 versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file20406/issue_10_6_tk.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 16:52:56 2011 From: report at bugs.python.org (SilentGhost) Date: Fri, 14 Jan 2011 15:52:56 +0000 Subject: [New-bugs-announce] [issue10908] Improvements to trace._Ignore In-Reply-To: <1295020376.03.0.967767300509.issue10908@psf.upfronthosting.co.za> Message-ID: <1295020376.03.0.967767300509.issue10908@psf.upfronthosting.co.za> New submission from SilentGhost : In the course of fixing #10896 I've noticed a few things: 1. --ignore-dir='$prefix' doesn't work on windows. I don't know if it has to, there is no information in docs regarding it at all. It does work on Unix. 2. The way module check is done is inefficient. 3. I'm not sure if filename could ever get the value of None in _Ignore.names (there is check for that though) 4. it's not clear why _Ignore initialised with default values of None, that path was never exercised and while I've added a test for it, I'm actually not sure if it's needed. 5. general clean up was needed for the code dealing with ignoring. Attached is the patch. The only change, that I consider beneficial, is that the ignored dir doesn't have actually be a directory. ---------- components: Library (Lib) files: trace_ignore.diff keywords: easy, patch messages: 126271 nosy: SilentGhost, belopolsky, vrutsky priority: normal severity: normal status: open title: Improvements to trace._Ignore versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20407/trace_ignore.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 18:37:27 2011 From: report at bugs.python.org (Scott M) Date: Fri, 14 Jan 2011 17:37:27 +0000 Subject: [New-bugs-announce] [issue10909] thread hang, possibly related to print In-Reply-To: <1295026647.31.0.671636636712.issue10909@psf.upfronthosting.co.za> Message-ID: <1295026647.31.0.671636636712.issue10909@psf.upfronthosting.co.za> New submission from Scott M : New to Python; be gentle if I've simply missed something. i'M running on Windows XP, using a recently downloaded 2.7.1. I'm running by hitting F5 in IDLE. The attached .py creates 2 threads, one which updates a Tkinter label 10 times a second forever, and one which sleeps for a second and then thrashes the CPU for ~4 seconds, forever. I wrote this to see how Python dealt with CPU-pig threads, and was pleased to see both threads got to run in a decently interleaved way, even in the face of a tight loop. But at a random point, one of the threads (which one varies) stops running. The other continues fine. The problem manifests in less then 5 minutes (often less than 1). At least once, but not ever time, the thread that stopped gave a traceback: Exception in thread Thread-1: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 530, in __bootstrap_inner self.run() File "F:\Python27\MyProjects\e.py", line 24, in run print "evil!" #<--- point 1 File "D:\Python27\lib\idlelib\rpc.py", line 595, in __call__ value = self.sockio.remotecall(self.oid, self.name, args, kwargs) File "D:\Python27\lib\idlelib\rpc.py", line 211, in remotecall return self.asyncreturn(seq) File "D:\Python27\lib\idlelib\rpc.py", line 240, in asyncreturn response = self.getresponse(seq, wait=0.05) File "D:\Python27\lib\idlelib\rpc.py", line 280, in getresponse response = self._getresponse(myseq, wait) File "D:\Python27\lib\idlelib\rpc.py", line 305, in _getresponse cvar = self.cvars[myseq] KeyError: 8680 BUT in some cases there wasn't a traceback (the last time there wasn't, it was BThread that had stopped running; the label was no longer updating.) If you comment out the print at point 2, or point 1, it seems to work fine, at least for as long as I cared to watch it. Also, I've noticed that if I close the app's window, that at least one thread keeps running and writing to the Python shell console. (One generally dies because the Tkinter label has gone away). They are both marked as daemonic; shouldn't they stop more or less instantly? ---------- components: Interpreter Core files: e.py messages: 126282 nosy: PythonInTheGrass priority: normal severity: normal status: open title: thread hang, possibly related to print type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file20409/e.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 22:21:40 2011 From: report at bugs.python.org (Bert JW Regeer) Date: Fri, 14 Jan 2011 21:21:40 +0000 Subject: [New-bugs-announce] [issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation In-Reply-To: <1295040100.28.0.0907494738582.issue10910@psf.upfronthosting.co.za> Message-ID: <1295040100.28.0.0907494738582.issue10910@psf.upfronthosting.co.za> New submission from Bert JW Regeer : I was recently attempting to get Botan (http://botan.randombit.net) working with Python 2.6.6 on FreeBSD when it failed to compile, I filled a bug with Botan (http://bugs.randombit.net/show_bug.cgi?id=135) and first thought it was a compiler issue, and then thought it might be a Boost.Python issue. However after further digging, see comment 3 (http://bugs.randombit.net/show_bug.cgi?id=135#c3) I figured out it had to do with the fix that went in to pyport.h for issues with isspace/toupper/et al. on FreeBSD's libc and also Mac OS X. As can be seen in http://svn.python.org/view/python/trunk/Include/pyport.h?r1=36519&r2=36793 a change was added to override the original definitions with a new one that used the wide character support. It was modified again in http://svn.python.org/view/python/trunk/Include/pyport.h?r1=77585&r2=80178 to also include Mac OS X for http://bugs.python.org/issue7072. The issue here is that if this file is included in any C++ code that then also includes or any of other functions that might pull in localefwd.h the defines will cause actual C++ code functions to be overwritten with invalid data, and the C++ compiler will throw errors such as: /usr/include/c++/4.2/bits/localefwd.h:58:34: error: macro "isspace" passed 2 arguments, but takes just 1 Putting an #if 0, #endif around that block of code allows Botan's python module to cleanly compile without issues. I do apologise that I don't have a simple C++ program that reproduces the problem. ---------- assignee: ronaldoussoren components: Build, Extension Modules, Library (Lib), Macintosh, Unicode, ctypes messages: 126299 nosy: X-Istence, ronaldoussoren priority: normal severity: normal status: open title: pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation type: compile error versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 14 22:34:37 2011 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Jan 2011 21:34:37 +0000 Subject: [New-bugs-announce] [issue10911] cgi: add more tests In-Reply-To: <1295040877.8.0.0807786274615.issue10911@psf.upfronthosting.co.za> Message-ID: <1295040877.8.0.0807786274615.issue10911@psf.upfronthosting.co.za> New submission from STINNER Victor : cgi was recently fixed just before Python 3.2 final, but the module has few tests. More tests should be written. You can find some examples attached to #4953. ---------- components: Library (Lib), Tests messages: 126300 nosy: haypo priority: normal severity: normal status: open title: cgi: add more tests versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 02:01:00 2011 From: report at bugs.python.org (Devin Jeanpierre) Date: Sat, 15 Jan 2011 01:01:00 +0000 Subject: [New-bugs-announce] [issue10912] PyObject_RichCompare differs in behaviour from PyObject_RichCompareBool ; difference not noted in documentation In-Reply-To: <1295053260.1.0.0634834443195.issue10912@psf.upfronthosting.co.za> Message-ID: <1295053260.1.0.0634834443195.issue10912@psf.upfronthosting.co.za> New submission from Devin Jeanpierre : PyObject_RichCoareBool is, according to the documentation in trunk (Doc\c-api\object.rst), exactly the same as PyObject_RichCompare, except it 1, 0, or -1 for error, false, and true respectively. However, it differs in behavior by both that, and also by assuming that identity implies equality. This noted in a two year-old ML post (sadly, no bug report was posted as best as I can find): http://mail.python.org/pipermail/python-list/2009-March/1195170.html Ideally PyObject_RichCompareBool should probably be named something else, since it can no longer be used, strictly, as "PyObject_RichCompare, but returning a C bool" (or, rather, a C int). Some suggestions were offered in the mailing list thread above. I'm filing this as a documentation bug because I find that outcome unlikely. At least the documentation should note the difference in behavior, so that people do not accidentally write C code that does not behave as intended. This issue is related to, but different from issue 4296, which objected to the new container behavior created by the change to PyObject_RichCompareBool. My only objection here is that the latter change does not appear to be documented. I would supply a patch for the tests, but PyObject_RichCompareBool is apparently not directly tested anywhere, just tested obliquely through testing the containment operator, and this was changed by the same commit that changed PyObject_RichCompareBool. I don't know how to word the (very small!) change to the docs. ---------- assignee: docs at python components: Documentation messages: 126306 nosy: Devin Jeanpierre, docs at python priority: normal severity: normal status: open title: PyObject_RichCompare differs in behaviour from PyObject_RichCompareBool ; difference not noted in documentation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 12:22:14 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 15 Jan 2011 11:22:14 +0000 Subject: [New-bugs-announce] [issue10913] Deprecate PyEval_AcquireLock() and PyEval_ReleaseLock() In-Reply-To: <1295090534.64.0.681277352782.issue10913@psf.upfronthosting.co.za> Message-ID: <1295090534.64.0.681277352782.issue10913@psf.upfronthosting.co.za> New submission from Antoine Pitrou : These two functions are very low-level and no good to use outside the interpreter core (actually, inside the core I don't think they are useful either). We should deprecate them and recommend the thread-state aware functions instead. See #1720250 for an example confusion. ---------- assignee: pitrou components: Documentation messages: 126324 nosy: grahamd, pitrou priority: high severity: normal status: open title: Deprecate PyEval_AcquireLock() and PyEval_ReleaseLock() type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 14:38:39 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 15 Jan 2011 13:38:39 +0000 Subject: [New-bugs-announce] [issue10914] Python sub-interpreter test In-Reply-To: <1295098719.73.0.016388283782.issue10914@psf.upfronthosting.co.za> Message-ID: <1295098719.73.0.016388283782.issue10914@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Here is a prototype test for embedding and sub-interpreters. ---------- components: Interpreter Core, Tests files: embedtest.patch keywords: patch messages: 126328 nosy: christian.heimes, grahamd, haypo, loewis, pitrou priority: normal severity: normal status: open title: Python sub-interpreter test versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file20414/embedtest.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 15:52:41 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 15 Jan 2011 14:52:41 +0000 Subject: [New-bugs-announce] [issue10915] Make the PyGILState API compatible with multiple interpreters In-Reply-To: <1295103161.75.0.771875465176.issue10915@psf.upfronthosting.co.za> Message-ID: <1295103161.75.0.771875465176.issue10915@psf.upfronthosting.co.za> New submission from Antoine Pitrou : It should be relatively easy to devise a new PyGILState API with support for multiple interpreters. We just need two new functions (similar to the two existing ones) taking a PyInterpreterState* parameter; a TLS key can be added to the PyInterpreterState structure (instead of the current global TLS key). It will be up to the caller to know which interpreter they want to hook into when calling these functions (which is application-dependent and is normally well-defined, e.g. when calling a Python callback, you should call it with the interpreter which was in use when registering the callback (i.e. ``PyThreadState_Get()->interp``)). ---------- components: Interpreter Core messages: 126333 nosy: amaury.forgeotdarc, grahamd, loewis, pitrou priority: normal severity: normal stage: needs patch status: open title: Make the PyGILState API compatible with multiple interpreters type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 15 16:19:02 2011 From: report at bugs.python.org (Ross Lagerwall) Date: Sat, 15 Jan 2011 15:19:02 +0000 Subject: [New-bugs-announce] [issue10916] mmap segfault In-Reply-To: <1295104742.35.0.155960214415.issue10916@psf.upfronthosting.co.za> Message-ID: <1295104742.35.0.155960214415.issue10916@psf.upfronthosting.co.za> New submission from Ross Lagerwall : If a mmap length 0 is used and an offset is used as well, the size to mmap() is calculated as the size of the file instead of the size of the file minus offset. This means that trying to access a certain part does not result in an index error but a segfault (bus error). Attached is a patch that fixes the issue + a unit test. ---------- components: Extension Modules files: mmap.patch keywords: patch messages: 126334 nosy: amaury.forgeotdarc, loewis, pitrou, r.david.murray, rosslagerwall priority: normal severity: normal status: open title: mmap segfault type: crash versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20415/mmap.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 08:50:08 2011 From: report at bugs.python.org (anatoly techtonik) Date: Sun, 16 Jan 2011 07:50:08 +0000 Subject: [New-bugs-announce] [issue10917] PEP 333 link to CGI specification is broken In-Reply-To: <1295164208.27.0.610516311421.issue10917@psf.upfronthosting.co.za> Message-ID: <1295164208.27.0.610516311421.issue10917@psf.upfronthosting.co.za> New submission from anatoly techtonik : http://www.python.org/dev/peps/pep-0333/#id7 Link to CGI spec is broken. ---------- assignee: docs at python components: Documentation messages: 126361 nosy: docs at python, techtonik priority: normal severity: normal status: open title: PEP 333 link to CGI specification is broken versions: 3rd party, 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 Sun Jan 16 16:49:52 2011 From: report at bugs.python.org (Adrian Dries) Date: Sun, 16 Jan 2011 15:49:52 +0000 Subject: [New-bugs-announce] [issue10918] **kwargs unnecessarily restricted in API In-Reply-To: <1295192992.12.0.880697566702.issue10918@psf.upfronthosting.co.za> Message-ID: <1295192992.12.0.880697566702.issue10918@psf.upfronthosting.co.za> New submission from Adrian Dries : An API such as in, e.g. futures: def submit(self, fn, *args, **kwargs): pass cannot be used thus: submit(foo, 1, 2, fn=bar) I can see two options: either mangle the named parameters: def submit(__self, __fn, *args, **kwargs): pass Or fiddle with *args: def submit(*args, **kwargs): self, fn = args[:2] args = args[2:] ---------- components: Library (Lib) messages: 126367 nosy: avdd priority: normal severity: normal status: open title: **kwargs unnecessarily restricted in API type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 19:23:30 2011 From: report at bugs.python.org (Richard Nienaber) Date: Sun, 16 Jan 2011 18:23:30 +0000 Subject: [New-bugs-announce] [issue10919] Environment variables are not expanded in _winreg when using REG_EXPAND_SZ. In-Reply-To: <1295202210.05.0.625952484383.issue10919@psf.upfronthosting.co.za> Message-ID: <1295202210.05.0.625952484383.issue10919@psf.upfronthosting.co.za> New submission from Richard Nienaber : According to Microsoft documentation (http://msdn.microsoft.com/en-us/library/ms724884(v=vs.85).aspx) when using the REG_EXPAND_SZ value type, environment variables (e.g. %programfiles%) should be expanded to their values (e.g. 'C:\Program Files'). I've added a test case that reproduces this error. ---------- components: Library (Lib) files: testcase-24042.py messages: 126368 nosy: rjnienaber priority: normal severity: normal status: open title: Environment variables are not expanded in _winreg when using REG_EXPAND_SZ. versions: Python 2.7 Added file: http://bugs.python.org/file20418/testcase-24042.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 16 20:47:42 2011 From: report at bugs.python.org (Jean-Michel Fauth) Date: Sun, 16 Jan 2011 19:47:42 +0000 Subject: [New-bugs-announce] [issue10920] cp65001, PowerShell, Python crash. In-Reply-To: <1295207262.38.0.033573856036.issue10920@psf.upfronthosting.co.za> Message-ID: <1295207262.38.0.033573856036.issue10920@psf.upfronthosting.co.za> New submission from Jean-Michel Fauth : Just relying a discussion open on comp.lang.python, http://groups.google.com/group/comp.lang.python/browse_thread/thread/771aa9081ad6584c# 1) Windows 7, open PowerShell 2) Change code page to cp65001 3) Launch Python3.1.2 or Python3.2.rc1 -> crash Key points: - The fact that Python does not recognize cp65001 is "ok". - The Python crash is unexpected. ---------- components: Windows messages: 126370 nosy: Jean-Michel.Fauth priority: normal severity: normal status: open title: cp65001, PowerShell, Python crash. type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 00:32:36 2011 From: report at bugs.python.org (Joe Peterson) Date: Sun, 16 Jan 2011 23:32:36 +0000 Subject: [New-bugs-announce] [issue10921] imaplib: Internaldate2tuple crashes, does not handle negative TZ offsets, does not handle DST correctly, and outputs localtime (not UTC) In-Reply-To: <1295220756.66.0.509737296044.issue10921@psf.upfronthosting.co.za> Message-ID: <1295220756.66.0.509737296044.issue10921@psf.upfronthosting.co.za> New submission from Joe Peterson : Internaldate2tuple() is broken in several ways. The last two issues have existed in the code for some time. New issues in Python 3: 1. It crashes with "KeyError". This is because the Mon2num dictionary's keys are strings, not bytes objects (note that other strings in imaplib have been updated, but not Mon2num). 2. The sign of the TZ offset (e.g. -0700) is compared to the string '-', not b'-', so the compare is never true, causing a large error when TZ offset is negative. Left over from Python 2.x: 3. DST is not handled correctly. Specifically, when the date is such that its local time form and its UTC form (if both interpreted as local time) are on different sides of a DST changeover, the result will be off by one hour. This is because the check for DST is done after treating the time as local time, even if it is not local time, causing it be tested while sometimes on the wrong side of a DST change. This can be corrected by using calls that keep time in UTC. 4. Related to #3, the result is returned in local time, whereas the documentation states that the result is in UT. The fix for #3 takes care of this one, as well. Here is an example: Run the following two dates, that represent exactly the same time, through Internaldate2tuple: '25 (INTERNALDATE "01-Apr-2000 19:02:23 -0700")' '101 (INTERNALDATE "02-Apr-2000 02:02:23 +0000")' Once the Mon2num issue is fixed, Python 3 will perform the conversions, but with a 15 hour difference. Python 2 will produce results with a one hour difference. Note that the last two issues (but describing only #4 above) were also addressed in a similar way in an old post I found by Colin Brown in 2004 (http://www.velocityreviews.com/forums/t336162-imaplib-function-bug.html). ---------- components: Library (Lib) files: imaplib_Internaldate2tuple.patch keywords: patch messages: 126386 nosy: lavajoe priority: normal severity: normal status: open title: imaplib: Internaldate2tuple crashes, does not handle negative TZ offsets, does not handle DST correctly, and outputs localtime (not UTC) versions: Python 3.2 Added file: http://bugs.python.org/file20419/imaplib_Internaldate2tuple.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 03:10:18 2011 From: report at bugs.python.org (=?utf-8?q?Daniel_Neuh=C3=A4user?=) Date: Mon, 17 Jan 2011 02:10:18 +0000 Subject: [New-bugs-announce] [issue10922] Unexpected exception when calling function_proxy.__class__.__call__(function_proxy) In-Reply-To: <1295230218.02.0.641570555776.issue10922@psf.upfronthosting.co.za> Message-ID: <1295230218.02.0.641570555776.issue10922@psf.upfronthosting.co.za> New submission from Daniel Neuh?user : Upon trying to create a proxy I stumbled upon this exception: Traceback (most recent call last): File "foo.py", line 11, in p.__class__.__call__(p) SystemError: PyEval_EvalCodeEx: NULL globals Investigating further led me to this code which reproduces the exception: class Proxy(object): def __init__(self, proxied): self.proxied = proxied @property def __class__(self): return self.proxied.__class__ def __call__(self): return self.proxied.__call__() p = Proxy(lambda: 1) p.__class__.__call__(p) I understand that `p.__class__.__call__()` expects an argument of a different type however this is not obvious from the exception itself. PyPy on the other hand raises this exception: Traceback (most recent call last): File "app_main.py", line 53, in run_toplevel File "foo.py", line 11, in p.__class__.__call__(p) TypeError: 'function' object expected, got 'Proxy' instead Which explains the issue and is expected (at least by me) and apparently Jython raises an exception at least similar to PyPy's. ---------- components: Interpreter Core messages: 126389 nosy: DasIch priority: normal severity: normal status: open title: Unexpected exception when calling function_proxy.__class__.__call__(function_proxy) type: behavior versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 03:17:33 2011 From: report at bugs.python.org (=?utf-8?q?Piotr_Ma=C5=9Blanka?=) Date: Mon, 17 Jan 2011 02:17:33 +0000 Subject: [New-bugs-announce] [issue10923] Python 2.7 hangs on Unicode+threading In-Reply-To: <1295230653.16.0.00822246437847.issue10923@psf.upfronthosting.co.za> Message-ID: <1295230653.16.0.00822246437847.issue10923@psf.upfronthosting.co.za> New submission from Piotr Ma?lanka : Python 2.7.1(x86 MSI), binary downloaded from python.org, hangs quite reliably. Code: with open(threadspecific, 'ab') as x: txt = unicode(str_or_unicode_parameter).encode('utf8') x.write(txt+'\r\n') However, it doesn't hang if I insert a print statement between with and txt, with anything. Previous testing determined that it hangs on encode(). Aforementioned code is executed in a threading environment, and it hangs in thread that is spawned by master thread. Interpreter is left with an open file. Same behaviour is repeatable on Python 2.5.1. ---------- components: None messages: 126390 nosy: henrietta priority: normal severity: normal status: open title: Python 2.7 hangs on Unicode+threading versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 08:06:37 2011 From: report at bugs.python.org (Sean Reifschneider) Date: Mon, 17 Jan 2011 07:06:37 +0000 Subject: [New-bugs-announce] [issue10924] Adding salt and Modular Crypt Format to crypt library. In-Reply-To: <1295247997.49.0.7150272714.issue10924@psf.upfronthosting.co.za> Message-ID: <1295247997.49.0.7150272714.issue10924@psf.upfronthosting.co.za> New submission from Sean Reifschneider : Over the years I've written the same code over and over to create a random salt string of 2 characters. Worse, the Modular Crypt Format is difficult to find documentation on, so creating stronger hashed passwords is difficult to get right. To that end, I'm proposing the addition of a "mksalt()" method which will generate a salt, and several METHOD_* values to select which hashing method to use. I also figure there will need to be a "methods()" call that figures out what methods are available in the library crypt() and return a list of the available ones. If we have a way to generate a salt, then I figure we could drop the salt argument of crypt.crypt(), and if not specified to generate one. So to hash a password you could do: "crypt.crypt('password')". I figure that the best way to accomplish this is to implement this all in Python and move the existing C crypt module to _crypt. A patch accomplishing this is attached. Please review. Attached is a patch to accomplish this. ---------- components: Library (Lib) files: python-underscore_crypt.patch keywords: easy, needs review, patch messages: 126393 nosy: jafo priority: normal severity: normal stage: patch review status: open title: Adding salt and Modular Crypt Format to crypt library. type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file20422/python-underscore_crypt.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 14:00:44 2011 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 17 Jan 2011 13:00:44 +0000 Subject: [New-bugs-announce] [issue10925] Document pure Python version of integer-to-float correctly-rounded conversion In-Reply-To: <1295269244.12.0.126728941356.issue10925@psf.upfronthosting.co.za> Message-ID: <1295269244.12.0.126728941356.issue10925@psf.upfronthosting.co.za> New submission from Mark Dickinson : It would be helpful (perhaps to developers of alternative implementations) to give a pure Python version of correctly-rounded long-to-float conversion. Attached is such a version, as a patch to test_long in the release27-maint branch. ---------- assignee: mark.dickinson files: pure_python_long_to_float.patch keywords: patch messages: 126398 nosy: mark.dickinson priority: normal severity: normal status: open title: Document pure Python version of integer-to-float correctly-rounded conversion versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file20423/pure_python_long_to_float.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 15:28:45 2011 From: report at bugs.python.org (Mark Summerfield) Date: Mon, 17 Jan 2011 14:28:45 +0000 Subject: [New-bugs-announce] [issue10926] Some Invalid Relative Imports succeed in Py 3.0 & 3.1 [& correctly fail in 3.2rc1] In-Reply-To: <1295274525.96.0.0836159838622.issue10926@psf.upfronthosting.co.za> Message-ID: <1295274525.96.0.0836159838622.issue10926@psf.upfronthosting.co.za> New submission from Mark Summerfield : I'm reporting this at Georg Brandl's suggestion. If you unpack the attached (tiny) tarball you get this directory structure: Graphics/ Graphics/Xpm.py Graphics/Vector/ Graphics/Vector/__init__.py Graphics/Vector/Svg.py Graphics/__init__.py The Svg.py file has this content: #!/usr/bin/env python3 from ..Graphics import Xpm SVG = 1 Here are 3 interactive actions, one each for 3.0, 3.1, and 3.2rc1: $ python30 Python 3.0.1 (r301:69556, Jul 15 2010, 10:31:51) [GCC 4.4.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from Graphics.Vector import * >>> Svg.SVG 1 $ python31 Python 3.1.2 (r312:79147, Jul 15 2010, 10:56:05) [GCC 4.4.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from Graphics.Vector import * >>> Svg.SVG 1 $ ~/opt/python32rc1/bin/python3 Python 3.2rc1 (r32rc1:88035, Jan 16 2011, 08:32:59) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from Graphics.Vector import * Traceback (most recent call last): File "", line 1, in File "Graphics/Vector/Svg.py", line 2, in from ..Graphics import Xpm ImportError: No module named Graphics So clearly 3.0 and 3.1 have the same behavior as each other; and this is different from 3.2rc1, and Georg says that 3.0 and 3.1 have a bug and that 3.2rc1 is correct. PS R. David Murray suggests that this might be related to http://bugs.python.org/issue7902 ---------- components: Interpreter Core files: py-import-bug.tar.gz messages: 126399 nosy: mark priority: normal severity: normal status: open title: Some Invalid Relative Imports succeed in Py 3.0 & 3.1 [& correctly fail in 3.2rc1] type: behavior versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20424/py-import-bug.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 16:44:06 2011 From: report at bugs.python.org (Geoffrey Bache) Date: Mon, 17 Jan 2011 15:44:06 +0000 Subject: [New-bugs-announce] [issue10927] Allow universal line endings in filecmp module In-Reply-To: <1295279046.42.0.435111163054.issue10927@psf.upfronthosting.co.za> Message-ID: <1295279046.42.0.435111163054.issue10927@psf.upfronthosting.co.za> New submission from Geoffrey Bache : It would be useful to compare the contents of two files while not caring what platform they were produced on, perhaps a universal_line_endings parameter to e.g. filecmp.cmp and possibly other methods. At the moment opening the files with "rb" is hardcoded in filecmp.py. If there is another way to achieve this, please enlighten me... ---------- components: Library (Lib) messages: 126405 nosy: gjb1002 priority: normal severity: normal status: open title: Allow universal line endings in filecmp module type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 17:57:23 2011 From: report at bugs.python.org (Kirill Bystrov) Date: Mon, 17 Jan 2011 16:57:23 +0000 Subject: [New-bugs-announce] [issue10928] Strange input processing In-Reply-To: <1295283443.74.0.675082012273.issue10928@psf.upfronthosting.co.za> Message-ID: <1295283443.74.0.675082012273.issue10928@psf.upfronthosting.co.za> New submission from Kirill Bystrov : I have written a simple script which evaluates some numeric expressions and faced a strange problem at some point. Some of these expressions cannot evaluate correctly. Here is an example: Python 2.7.1+ (r271:86832, Dec 24 2010, 10:03:35) [GCC 4.5.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 3158 + 04 3162 >>> 3158 + 05 3163 >>> 3158 + 06 3164 >>> 3158 + 07 3165 >>> 3158 + 08 File "", line 1 3158 + 08 ^ SyntaxError: invalid token >>> 3158 + 09 File "", line 1 3158 + 09 ^ SyntaxError: invalid token >>> Both 2.6 and 2.7 raise this exception. My distro is Ubuntu Natty if this matters. P.S.: sorry for my bad English :) ---------- components: Interpreter Core messages: 126411 nosy: byss priority: normal severity: normal status: open title: Strange input processing type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 17 22:26:19 2011 From: report at bugs.python.org (Joe Bennett) Date: Mon, 17 Jan 2011 21:26:19 +0000 Subject: [New-bugs-announce] [issue10929] telnetlib does not send FIN when self.close() issued In-Reply-To: <1295299579.64.0.0384853745776.issue10929@psf.upfronthosting.co.za> Message-ID: <1295299579.64.0.0384853745776.issue10929@psf.upfronthosting.co.za> New submission from Joe Bennett : Hi, am running Python 2.6.5 on Unbuntu 10.04 and am seeing no FIN when a self.close() is issued... I do see a reset issued, but it looks like some of the M$ servers do not appreciate on a reset and would like a graceful teardown... I understand that an RST can be issued in the event the buffer may have data to send, I do not believe that is the case. If there is a way to verify that, please let me know... ---------- components: IO messages: 126436 nosy: jammer10000 priority: normal severity: normal status: open title: telnetlib does not send FIN when self.close() issued type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 11:54:38 2011 From: report at bugs.python.org (Albert) Date: Tue, 18 Jan 2011 10:54:38 +0000 Subject: [New-bugs-announce] [issue10930] dict.setdefault: Bug: default argument is ALWAYS evaluated, i.e. no short-circuit eval In-Reply-To: <1295348078.83.0.563667045333.issue10930@psf.upfronthosting.co.za> Message-ID: <1295348078.83.0.563667045333.issue10930@psf.upfronthosting.co.za> New submission from Albert : Hello! Is it intentional, that the default argument is ALWAYS evaluated, even if it is not needed??? Is it not a bug, that this method has no short-circuit eval (http://en.wikipedia.org/wiki/Short-circuit_evaluation) ?? Example1: ========= infinite = 1e100 one_div_by = {0.0 : infinite} def func(n): return one_div_by.setdefault(float(n), 1/float(n)) for i in [1, 2, 3, 4]: print i, func(i) print one_div_by # works!! for i in [0, 1, 2, 3, 4]: # added 0 -> FAIL! print i, func(i) print one_div_by # fail!! Example2: ========= fib_d = {0 : 0, 1 : 1} def fibonacci(n): return fib_d.setdefault(n, fibonacci(n-1) + fibonacci(n-2)) for i in range(10): print i, fibonacci(i) print fib_d ---------- messages: 126456 nosy: albert.neu priority: normal severity: normal status: open title: dict.setdefault: Bug: default argument is ALWAYS evaluated, i.e. no short-circuit eval type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 12:13:08 2011 From: report at bugs.python.org (ricardw) Date: Tue, 18 Jan 2011 11:13:08 +0000 Subject: [New-bugs-announce] [issue10931] print() from pipe enclosed between 'b and 'pair on python3 In-Reply-To: <1295349188.44.0.579328833757.issue10931@psf.upfronthosting.co.za> Message-ID: <1295349188.44.0.579328833757.issue10931@psf.upfronthosting.co.za> New submission from ricardw : The following script produces different output on python2.6.6 vs. python3.1.2: ------------- import subprocess, sys ls = subprocess.Popen(['ls', '-l', '/etc/motd'], stdout=subprocess.PIPE,) end_of_pipe = ls.stdout print('Result:') for line in end_of_pipe: print(line.strip()) ------------- Result from invoking with python2 and python3 are respectively: Result: -rw-rw---- 1 root root 25 Jan 18 10:25 /etc/motd and: Result: b'-rw-rw---- 1 root root 25 Jan 18 10:25 /etc/motd' Is this difference a feature, or a bug ? ---------- components: Interpreter Core messages: 126457 nosy: ricardw priority: normal severity: normal status: open title: print() from pipe enclosed between 'b and 'pair on python3 type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 13:30:25 2011 From: report at bugs.python.org (Thorsten Simons) Date: Tue, 18 Jan 2011 12:30:25 +0000 Subject: [New-bugs-announce] [issue10932] distutils.core.setup - data_files missbehaviour ? In-Reply-To: <1295353825.23.0.755300594789.issue10932@psf.upfronthosting.co.za> Message-ID: <1295353825.23.0.755300594789.issue10932@psf.upfronthosting.co.za> New submission from Thorsten Simons : Hi ! when specifying additional files to be distributed by distutils.core.setup, documentation says that: "Each file name in files is interpreted relative to the setup.py script at the top of the package source distribution. No directory information from files is used to determine the final location of the installed file; only the name of the file is used" (http://docs.python.org/py3k/distutils/setupscript.html#distutils-additional-files) Well, this seems to be incorrect - I tried to specify a file from a higher level directory, which get's copies to a target based on the whole path I specified, not just the name... Pls. see attached file for details ---------- assignee: tarek components: Distutils files: issue.txt messages: 126459 nosy: Thorsten.Simons, eric.araujo, tarek priority: normal severity: normal status: open title: distutils.core.setup - data_files missbehaviour ? type: behavior versions: Python 3.1 Added file: http://bugs.python.org/file20435/issue.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 13:31:12 2011 From: report at bugs.python.org (Fabio Zadrozny) Date: Tue, 18 Jan 2011 12:31:12 +0000 Subject: [New-bugs-announce] [issue10933] Tracing disabled when a recursion error is triggered (even if properly handled) In-Reply-To: <1295353872.95.0.129870258846.issue10933@psf.upfronthosting.co.za> Message-ID: <1295353872.95.0.129870258846.issue10933@psf.upfronthosting.co.za> New submission from Fabio Zadrozny : It seems that tracing in the interpreter is lost after some recursion error is triggered (even if it's properly handled). This breaks any debugger working after any recursion error is triggered (which suppose shouldn't happen). The attached test case shows the problem in action. Tested the problem with Python 2.6.5 and 3.1.3 ---------- components: Interpreter Core files: recursion_error_disables_tracing.py messages: 126460 nosy: fabioz priority: normal severity: normal status: open title: Tracing disabled when a recursion error is triggered (even if properly handled) type: behavior versions: Python 2.6, Python 3.1 Added file: http://bugs.python.org/file20436/recursion_error_disables_tracing.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 14:46:08 2011 From: report at bugs.python.org (Joe Peterson) Date: Tue, 18 Jan 2011 13:46:08 +0000 Subject: [New-bugs-announce] [issue10934] imaplib: Internaldate2tuple() is documented to return UTC, but it returns local time In-Reply-To: <1295358368.86.0.12522725261.issue10934@psf.upfronthosting.co.za> Message-ID: <1295358368.86.0.12522725261.issue10934@psf.upfronthosting.co.za> New submission from Joe Peterson : Patched documentation for Internaldate2tuple() to correctly state it returns local time. Also, Time2Internaldate() (its inverse) did not state that it needs local time as input, so patched this as well. Patches for 3.2 and 2.7 are attached. ---------- assignee: docs at python components: Documentation files: imaplib_Internaldate2tuple_doc_python32.patch keywords: patch messages: 126463 nosy: docs at python, lavajoe priority: normal severity: normal status: open title: imaplib: Internaldate2tuple() is documented to return UTC, but it returns local time versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file20438/imaplib_Internaldate2tuple_doc_python32.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 18:29:24 2011 From: report at bugs.python.org (Tim Perevezentsev) Date: Tue, 18 Jan 2011 17:29:24 +0000 Subject: [New-bugs-announce] [issue10935] wsgiref.handlers.BaseHandler and subclasses of str In-Reply-To: <1295371764.49.0.785710350986.issue10935@psf.upfronthosting.co.za> Message-ID: <1295371764.49.0.785710350986.issue10935@psf.upfronthosting.co.za> New submission from Tim Perevezentsev : This code: assert type(val) is StringType,"Header values must be strings" (from here http://svn.python.org/view/python/tags/r271/Lib/wsgiref/handlers.py?revision=86833&view=markup) from "start_response" method, is not allowing to use str subclasses objects as header value. Usecase: I made class URL which subclasses str and has additional methods to manipulate query string. It is very handy. But when I need to set header "Location" with URL object as value I get assertion error. Can't we do this instead: assert isinstance(val, str),"Header values must be strings" ---------- components: Library (Lib) messages: 126471 nosy: riffm priority: normal severity: normal status: open title: wsgiref.handlers.BaseHandler and subclasses of str type: behavior versions: Python 2.5, Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 20:12:04 2011 From: report at bugs.python.org (Christopher Dunn) Date: Tue, 18 Jan 2011 19:12:04 +0000 Subject: [New-bugs-announce] [issue10936] Simple CSS fix for left margin at docs.python.org In-Reply-To: <1295377924.0.0.902429691003.issue10936@psf.upfronthosting.co.za> Message-ID: <1295377924.0.0.902429691003.issue10936@psf.upfronthosting.co.za> New submission from Christopher Dunn : This is an easy one. When I zoom my browser in (with Ctrl+ or Apple+) the left-side navigation margin gets bigger and bigger, pushing the useful text off the screen. That has bothered me (and anyone else with 40+ year old eyes) ever since the switch to the newest doc format with Sphinx. There is no fix that will satisfy everyone. People with perfect vision might like to zoom out (with Ctrl- or Apple-), since the margin currently gets smaller and smaller. But we need a compromise. The relevant CSS, in default.css, is this: div.bodywrapper { margin: 0 0 0 230px; } If instead it were something like this: div.bodywrapper { margin: 0 0 0 10%; } then at least the navigation margin would stay the same size always. If you really want it to grow and shrink, then you need some sort of javascript control of its position. ---------- assignee: docs at python components: Documentation messages: 126477 nosy: cdunn2001, docs at python priority: normal severity: normal status: open title: Simple CSS fix for left margin at docs.python.org type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 20:23:39 2011 From: report at bugs.python.org (Jeremy Langley) Date: Tue, 18 Jan 2011 19:23:39 +0000 Subject: [New-bugs-announce] [issue10937] WinPE 64 bit execution results with errors In-Reply-To: <1295378619.67.0.475043721406.issue10937@psf.upfronthosting.co.za> Message-ID: <1295378619.67.0.475043721406.issue10937@psf.upfronthosting.co.za> New submission from Jeremy Langley : old versions of python worked on old versions of winpe by copying the c:\python25\ directory over to the mounted (iso,usb) filesystem, then rebooting with the media and running the python.exe from the ramdrive. This formula no longer works with 64 bit versions of winpe (which is one way to push win7-64bit. When it's tried one gets platform based errors. ---------- components: Build messages: 126479 nosy: gettingback2basics priority: normal severity: normal status: open title: WinPE 64 bit execution results with errors type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 20:26:19 2011 From: report at bugs.python.org (Humberto Diogenes) Date: Tue, 18 Jan 2011 19:26:19 +0000 Subject: [New-bugs-announce] [issue10938] Undocumented option for datetime.strftime: %s In-Reply-To: <1295378779.48.0.643087757109.issue10938@psf.upfronthosting.co.za> Message-ID: <1295378779.48.0.643087757109.issue10938@psf.upfronthosting.co.za> New submission from Humberto Diogenes : On some systems, datetime.strftime() accepts a %s format string that returns epoch / UNIX timestamp, but this behavior is not documented at http://docs.python.org/library/datetime.html Python 2.7 (r27:82508, Jul 3 2010, 21:12:11) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> datetime.datetime.now().strftime('%s') '1295376929' ---------- assignee: docs at python components: Documentation messages: 126481 nosy: docs at python, hdiogenes priority: normal severity: normal status: open title: Undocumented option for datetime.strftime: %s versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 18 23:31:40 2011 From: report at bugs.python.org (Joe Peterson) Date: Tue, 18 Jan 2011 22:31:40 +0000 Subject: [New-bugs-announce] [issue10939] imaplib: Internaldate2tuple fails to parse month and does not work with negative TZ offset due to bytes/str issues In-Reply-To: <1295389900.99.0.76199090445.issue10939@psf.upfronthosting.co.za> Message-ID: <1295389900.99.0.76199090445.issue10939@psf.upfronthosting.co.za> New submission from Joe Peterson : There are two issues with conversion to Python 3: 1. It raise "KeyError". This is because the Mon2num dictionary keys are strings (str), not bytes objects (note that many other strings in imaplib have been updated, but not Mon2num). 2. The sign character of the TZ offset (e.g. -0700) is compared to the string (str) '-', not bytes array b'-', so the compare is never true, causing a large error when the TZ offset is negative. Patch attached that also adds a unit test. ---------- components: Library (Lib) files: imaplib_Internaldate2tuple_bytes_fixes_python32.patch keywords: patch messages: 126499 nosy: lavajoe priority: normal severity: normal status: open title: imaplib: Internaldate2tuple fails to parse month and does not work with negative TZ offset due to bytes/str issues type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file20444/imaplib_Internaldate2tuple_bytes_fixes_python32.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 00:02:03 2011 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 18 Jan 2011 23:02:03 +0000 Subject: [New-bugs-announce] [issue10940] IDLE hangs with Cmd-M hotkey on Mac O/S Message-ID: <1295391723.69.0.280577623459.issue10940@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: ned.deily components: IDLE nosy: brett.cannon, ned.deily, rhettinger priority: high severity: normal status: open title: IDLE hangs with Cmd-M hotkey on Mac O/S type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 00:41:47 2011 From: report at bugs.python.org (Joe Peterson) Date: Tue, 18 Jan 2011 23:41:47 +0000 Subject: [New-bugs-announce] [issue10941] imaplib: Internaldate2tuple produces wrong result if date is near a DST change In-Reply-To: <1295394107.36.0.490316527511.issue10941@psf.upfronthosting.co.za> Message-ID: <1295394107.36.0.490316527511.issue10941@psf.upfronthosting.co.za> New submission from Joe Peterson : DST is not handled correctly. Specifically, when the input date/time, ignoring the TZ offset (and treated as if it is local time) is on the other side of the DST changeover from the actual local time represented, the result will be off by one hour. This can happen, e.g., when the input date/time is actually UTC (offset +0000). This is because the check for DST is done after converting the time into a local time tuple, thereby treating as real local time. This can be corrected by keeping the time in real UTC (by using calendar.timegm() instead of checking the DST flag) until the final conversion to local time. Here is an example: Run the following two dates, that represent exactly the same time, through Internaldate2tuple: '25 (INTERNALDATE "01-Apr-2000 19:02:23 -0700")' '101 (INTERNALDATE "02-Apr-2000 02:02:23 +0000")' Note that a variant of this issue (but identifying it as a different problem) was addressed in a similar way in an old post I found by Colin Brown in 2004 (http://www.velocityreviews.com/forums/t336162-imaplib-function-bug.html). Patch also adds unit test to check the above example dates. Python 3 version of patch assumes patch from issue 10939 has been applied. Patch also corrects code python doc that currently states time is UT, not local (see issue 10934). ---------- components: Library (Lib) messages: 126503 nosy: lavajoe priority: normal severity: normal status: open title: imaplib: Internaldate2tuple produces wrong result if date is near a DST change type: behavior versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 01:12:29 2011 From: report at bugs.python.org (J_Tom_Moon_79) Date: Wed, 19 Jan 2011 00:12:29 +0000 Subject: [New-bugs-announce] [issue10942] xml.etree.ElementTree.tostring returns type bytes, expected type str In-Reply-To: <1295395949.96.0.0409847573272.issue10942@psf.upfronthosting.co.za> Message-ID: <1295395949.96.0.0409847573272.issue10942@psf.upfronthosting.co.za> New submission from J_Tom_Moon_79 : method xml.etree.ElementTree.tostring from module returns type bytes. The documentation reads """Returns an encoded string containing the XML data.""" (from http://docs.python.org/py3k/library/xml.etree.elementtree.html#xml.etree.ElementTree.tostring as of 2011-01-18) ======================================================= Here is a test program: ------------------------------------------------------- #!/usr/bin/python # created for python 3.1 import sys print(sys.version) # for help verifying version tested from xml.etree import ElementTree sampleinput = """""" xmlobj = ElementTree.fromstring(sampleinput) type(xmlobj) xmlstr = ElementTree.tostring(xmlobj,'utf-8') print("xmlstr value is '", xmlstr, "'", sep="") print("xmlstr type is '", type(xmlstr), "'", sep="") ------------------------------------------------------- test program output: ------------------------------------------------------- 3.1.3 (r313:86834, Nov 27 2010, 18:30:53) [MSC v.1500 32 bit (Intel)] xmlstr value is 'b''' xmlstr type is '' ======================================================= This cheap "fix" for this bug may be simply be a change in documentation. However, a method called "tostring" really should return something nearer to the built-in str. ---------- assignee: docs at python components: Documentation, XML messages: 126506 nosy: JTMoon79, docs at python priority: normal severity: normal status: open title: xml.etree.ElementTree.tostring returns type bytes, expected type str type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 09:38:50 2011 From: report at bugs.python.org (Leo) Date: Wed, 19 Jan 2011 08:38:50 +0000 Subject: [New-bugs-announce] [issue10943] abitype: Need better support to port C extension modules to the stable C API In-Reply-To: <1295426330.25.0.635363870245.issue10943@psf.upfronthosting.co.za> Message-ID: <1295426330.25.0.635363870245.issue10943@psf.upfronthosting.co.za> New submission from Leo : I tried to port the extension module at http://code.google.com/p/pyhyphen/source/browse/3.x/hnjmodule.c to the stable C API using abitype.py. I gave up after the following exceptions: - execption raised for missing PyVarObject_HEAD: this could be rixed by deleting a /* */ comment before. I think abitype.py should properly skip comments rather than forcing the user to delete them. - the xxxmodule.c on which hnjmodule.c is based, defines a PyObject Str_type wherr tp_basicsize is 0 rather than sizeof(XXX). This causes abitype.py to raise a key error as '0' seems to be ignored by abitype.py. Finally, I suggest to add to the source tree a boiler plate C module conforming to the stable API such as xxxmodule-stable-api.c. This would help creating extensions from scratch. ---------- components: Extension Modules messages: 126519 nosy: fhaxbox66 at googlemail.com priority: normal severity: normal status: open title: abitype: Need better support to port C extension modules to the stable C API type: feature request versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 10:15:53 2011 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Wed, 19 Jan 2011 09:15:53 +0000 Subject: [New-bugs-announce] [issue10944] ctypes documentation does not mention c_bool in table of standard types In-Reply-To: <1295428553.77.0.0934599344466.issue10944@psf.upfronthosting.co.za> Message-ID: <1295428553.77.0.0934599344466.issue10944@psf.upfronthosting.co.za> New submission from ???? ????????? : http://docs.python.org/library/ctypes.html: ----------- 15.16.1.4. Fundamental data types [table without c_bool] ------------ 15.16.2.7. Fundamental data types class ctypes.c_bool New in version 2.6. ------------ ---------- assignee: docs at python components: Documentation messages: 126520 nosy: docs at python, mmarkk priority: normal severity: normal status: open title: ctypes documentation does not mention c_bool in table of standard types type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 16:28:16 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 19 Jan 2011 15:28:16 +0000 Subject: [New-bugs-announce] [issue10945] bdist_wininst depends on MBCS codec, unavailable on non-Windows In-Reply-To: <1295450896.02.0.86964827296.issue10945@psf.upfronthosting.co.za> Message-ID: <1295450896.02.0.86964827296.issue10945@psf.upfronthosting.co.za> New submission from ?ric Araujo : If distutils.commands.bdist_wininst.bdist_wininst.get_inidata returns a unicode string (which is always the case in 3.x and can happen in 2.x if if you pass a unicode object as one setup argument), bdist_wininst will try to use the MBCS codec, which is not available on non-Windows OSes (see http://docs.python.org/dev/library/codecs#module-encodings.mbcs). If someone wants to make a patch, here are some guidelines: http://wiki.python.org/moin/Distutils/FixingBugs ---------- assignee: eric.araujo components: Distutils, Distutils2 messages: 126528 nosy: eric.araujo, tarek priority: normal severity: normal stage: needs patch status: open title: bdist_wininst depends on MBCS codec, unavailable on non-Windows type: behavior versions: 3rd party, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 16:32:49 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 19 Jan 2011 15:32:49 +0000 Subject: [New-bugs-announce] =?utf-8?q?=5Bissue10946=5D_bdist_doesn?= =?utf-8?q?=E2=80=99t_pass_--skip-build_on_to_subcommands?= In-Reply-To: <1295451169.68.0.9980803941.issue10946@psf.upfronthosting.co.za> Message-ID: <1295451169.68.0.9980803941.issue10946@psf.upfronthosting.co.za> New submission from ?ric Araujo : Yannick has found that bdist_* commands don?t get the --skip-build option from bdist. This should be solved easily thanks to set_undefined_options. Adding people from #414775 (r25075) to nosy. ---------- assignee: eric.araujo components: Distutils, Distutils2 keywords: easy messages: 126530 nosy: eric.araujo, kern, loewis, ygingras priority: normal severity: normal stage: needs patch status: open title: bdist doesn?t pass --skip-build on to subcommands type: behavior versions: 3rd party, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 16:35:32 2011 From: report at bugs.python.org (Joe Peterson) Date: Wed, 19 Jan 2011 15:35:32 +0000 Subject: [New-bugs-announce] [issue10947] imaplib: Internaldate2tuple and ParseFlags require (and latter returns) bytes arrays; should allow/return str In-Reply-To: <1295451332.43.0.977417439806.issue10947@psf.upfronthosting.co.za> Message-ID: <1295451332.43.0.977417439806.issue10947@psf.upfronthosting.co.za> New submission from Joe Peterson : In imaplib, there is currently a mix of bytes array and str use. Time2Internaldate(), e.g., returns (and accepts) str. Internaldate2tuple() and ParseFlags() only accept a bytes object, and the latter returns a tuple of bytes objects. Of course, these were all strings in Python 2. To regain compatibility with Python 2 behavior and make things more consistent, this patch changes the return type of ParseFlags() to a str tuple, and allow it and Internaldate2tuple() to accept either a bytes object or a str. The unit test has been expanded to test these. Note that applying this patch assumes that the the patches from issue 10939 and issue 10941 have been applied. Also, I am not sure it is proper to accept *both* bytes array and str. Perhaps only str should be allowed. Comments? ---------- components: Library (Lib) files: imaplib_string_compat.patch keywords: patch messages: 126532 nosy: lavajoe priority: normal severity: normal status: open title: imaplib: Internaldate2tuple and ParseFlags require (and latter returns) bytes arrays; should allow/return str type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file20453/imaplib_string_compat.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 18:07:18 2011 From: report at bugs.python.org (Diego Queiroz) Date: Wed, 19 Jan 2011 17:07:18 +0000 Subject: [New-bugs-announce] [issue10948] Trouble with dir_util created dir cache In-Reply-To: <1295456838.39.0.734609669589.issue10948@psf.upfronthosting.co.za> Message-ID: <1295456838.39.0.734609669589.issue10948@psf.upfronthosting.co.za> New submission from Diego Queiroz : There is a problem with dir_util cache (defined by "_path_created" global variable). It appears to be useful but it isn't, just repeat these steps to understand the problem I'm facing: 1) Use mkpath to create any path (eg. /home/user/a/b/c) 2) Open the terminal and manually delete the directory "/home/user/a" and its contents 3) Try to create "/home/user/a/b/c" again using mkpath Expected behavior: mkpath should create the folder tree again. What happens: Nothing, mkpath "thinks" the folder already exists because its creation was cached. Moreover, if you try to create one more folder level (eg. /home/user/a/b/c/d) it raises an exception because it thinks that part of the tree was already created and fails to create the last folder. I'm working with parallel applications that deal with files asynchronously, this problem gave me a headache. Anyway, the solution is easy: remove the cache. ---------- assignee: tarek components: Distutils messages: 126540 nosy: diegoqueiroz, eric.araujo, tarek priority: normal severity: normal status: open title: Trouble with dir_util created dir cache type: behavior versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 18:11:12 2011 From: report at bugs.python.org (Christophe Kalt) Date: Wed, 19 Jan 2011 17:11:12 +0000 Subject: [New-bugs-announce] [issue10949] logging.RotatingFileHandler not robust enough In-Reply-To: <1295457072.71.0.821420961283.issue10949@psf.upfronthosting.co.za> Message-ID: <1295457072.71.0.821420961283.issue10949@psf.upfronthosting.co.za> New submission from Christophe Kalt : logging.RotatingFileHandler.doRollover() can fail leaving the handler with a closed filehandle, causing all subsequent logging attempts to fail: >>> import logging >>> import logging.handlers >>> logging.getLogger().addHandler(logging.handlers.RotatingFileHandler('testlog', None, 10, 5)) >>> logging.getLogger().setLevel(logging.INFO) >>> logging.info('qwertyuiop') >>> os.system('ls -l testlog*') -rw-r--r-- 1 - - 11 Jan 19 10:02 testlog -rw-r--r-- 1 - - 0 Jan 19 10:02 testlog.1 0 >>> os.remove('testlog') >>> logging.info('qwertyuiop') Traceback (most recent call last): File "/home8/taraniso/opt/lib/python2.6/logging/handlers.py", line 72, in emit self.doRollover() File "/home8/taraniso/opt/lib/python2.6/logging/handlers.py", line 129, in doRollover os.rename(self.baseFilename, dfn) OSError: [Errno 2] No such file or directory >>> logging.info('qwertyuiop') Traceback (most recent call last): File "/home8/taraniso/opt/lib/python2.6/logging/handlers.py", line 71, in emit if self.shouldRollover(record): File "/home8/taraniso/opt/lib/python2.6/logging/handlers.py", line 145, in shouldRollover self.stream.seek(0, 2) #due to non-posix-compliant Windows feature ValueError: I/O operation on closed file >>> logging.info('qwertyuiop') Traceback (most recent call last): File "/home8/taraniso/opt/lib/python2.6/logging/handlers.py", line 71, in emit if self.shouldRollover(record): File "/home8/taraniso/opt/lib/python2.6/logging/handlers.py", line 145, in shouldRollover self.stream.seek(0, 2) #due to non-posix-compliant Windows feature ValueError: I/O operation on closed file Fix seems trivial enough, attaching. This is against 2.6.5, browsing subversion online seems to indicate it is needed on the trunk as well, although it won't apply cleanly. ---------- components: Library (Lib) files: logging.diff keywords: patch messages: 126541 nosy: kalt priority: normal severity: normal status: open title: logging.RotatingFileHandler not robust enough type: behavior versions: Python 2.6, Python 2.7, Python 3.1 Added file: http://bugs.python.org/file20454/logging.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 19:19:05 2011 From: report at bugs.python.org (Beau) Date: Wed, 19 Jan 2011 18:19:05 +0000 Subject: [New-bugs-announce] [issue10950] ServerProxy returns bad XML In-Reply-To: <1295461145.33.0.479841381445.issue10950@psf.upfronthosting.co.za> Message-ID: <1295461145.33.0.479841381445.issue10950@psf.upfronthosting.co.za> New submission from Beau : xmlrpc.client.ServerProxy calls that return XML (ie, the a non-marshallable type) give bad XML, with \" (backslash then double quote characters, '\\"'; not escaped double quote) in place of ", and \' in place of '. Ampersands aren't XML-escaped either. (I have only tested this with Last.fm's API but I have made calls that return marshallable types with no problem, so I'm assuming the issue lies with ServerProxy and not Last.fm's XML-RPC servers.) The following test code, identical to that in the attached file illustrates the bug; it throws an xml.parsers.expat.ExpatError as the XML is bad: # Get a Last.fm user's library. # http://www.last.fm/api/show?service=323 import xmlrpc.client import xml.etree server = xmlrpc.client.ServerProxy('http://ws.audioscrobbler.com/2.0/') parameters = {'api_key': 'b25b959554ed76058ac220b7b2e0a026', 'user': 'joanofarctan', 'page': 1} tracks = server.library.getTracks(parameters) tracks_xml = xml.etree.ElementTree.parse(tracks) # Should get "xml.parsers.expat.ExpatError: XML declaration not well-formed: line 1, column 14". # (Line 1, column 14 is a backslash: .) I'm running "Python 3.1.2 (r312:79149, Mar 20 2010, 22:55:39) [MSC v.1500 64 bit (AMD64)] on win32". ---------- components: Library (Lib) files: serverproxy_test.py messages: 126552 nosy: beaumartinez priority: normal severity: normal status: open title: ServerProxy returns bad XML type: compile error versions: Python 3.1 Added file: http://bugs.python.org/file20455/serverproxy_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 19 22:58:38 2011 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Jan 2011 21:58:38 +0000 Subject: [New-bugs-announce] [issue10951] gcc 4.6 warnings In-Reply-To: <1295474318.57.0.129834114348.issue10951@psf.upfronthosting.co.za> Message-ID: <1295474318.57.0.129834114348.issue10951@psf.upfronthosting.co.za> New submission from STINNER Victor : To analyze #9880, I installed gcc-4.6. It looks like this new gcc version emits new warnings. Here is a report of py3k warnings generated with "gcc-4.6 -O3 -Wall -Wextra -Wstrict-prototypes -Wno-missing-field-initializers -Wno-unused-parameter" on AMD64. I grouped manually the warnings. sign-compare: Parser/node.c: In function 'PyNode_AddChild': Parser/node.c:94:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Objects/bytesobject.c: In function 'PyBytes_FromStringAndSize': Objects/bytesobject.c:95:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Objects/floatobject.c: In function 'PyFloat_ClearFreeList': Objects/floatobject.c:1960:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Objects/floatobject.c:1970:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Objects/floatobject.c: In function 'PyFloat_Fini': Objects/floatobject.c:2014:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Objects/memoryobject.c: In function '_indirect_copy_nd': Objects/memoryobject.c:199:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Objects/tupleobject.c: In function 'PyTuple_New': Objects/tupleobject.c:85:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Objects/typeobject.c: In function 'PyType_FromSpec': Objects/typeobject.c:2339:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Objects/unicodeobject.c: In function '_PyUnicode_New': Objects/unicodeobject.c:326:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Objects/unicodeobject.c: In function 'PyUnicodeUCS2_AsWideCharString': Objects/unicodeobject.c:1288:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Objects/unicodeobject.c: In function 'PyUnicodeUCS2_DecodeFSDefaultAndSize': Objects/unicodeobject.c:1804:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Objects/unicodeobject.c: In function 'PyUnicodeUCS2_FSConverter': Objects/unicodeobject.c:1851:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Objects/unicodeobject.c: In function 'PyUnicodeUCS2_FSDecoder': Objects/unicodeobject.c:1892:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Objects/unicodeobject.c: In function 'PyUnicode_AsUnicodeCopy': Objects/unicodeobject.c:10336:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Python/asdl.c: In function 'asdl_seq_new': Python/asdl.c:12:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Python/asdl.c: In function 'asdl_int_seq_new': Python/asdl.c:43:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Parser/printgrammar.c: In function 'printdfas': Parser/printgrammar.c:96:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Parser/pgenmain.c: In function 'getgrammar': Parser/pgenmain.c:102:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Python/bltinmodule.c: In function 'source_as_string': Python/bltinmodule.c:528:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Python/getargs.c: In function 'convertsimple': Python/getargs.c:876:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Python/getargs.c:993:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Python/pythonrun.c: In function 'print_error_text': Python/pythonrun.c:1352:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ./Python/sysmodule.c: In function 'svnversion_init': ./Python/sysmodule.c:1367:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Python/traceback.c: In function '_Py_FindSourceFile': Python/traceback.c:191:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Python/dtoa.c: In function 'Balloc': Python/dtoa.c:349:56: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Python/thread_pthread.h: In function 'PyThread_create_key': Python/thread_pthread.h:592:22: warning: signed and unsigned type in conditional expression [-Wsign-compare] Python/compile.c: In function 'compiler_import_as': Python/compile.c:2076:49: warning: signed and unsigned type in conditional expression [-Wsign-compare] Python/compile.c: In function 'assemble_init': Python/compile.c:3619:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] unused-but-set-variable: Parser/parsetok.c: In function 'parsetok': Parser/parsetok.c:130:43: warning: variable 'handling_with' set but not used [-Wunused-but-set-variable] Objects/obmalloc.c: In function '_PyObject_DebugMallocStats': Objects/obmalloc.c:1778:14: warning: variable 'poolsinarena' set but not used [-Wunused-but-set-variable] Objects/unicodeobject.c: In function 'replace': Objects/unicodeobject.c:6932:29: warning: variable 'e' set but not used [-Wunused-but-set-variable] Python/bltinmodule.c: In function 'builtin___build_class__': Python/bltinmodule.c:40:23: warning: variable 'nbases' set but not used [-Wunused-but-set-variable] Python/bltinmodule.c: In function 'builtin_exec': Python/bltinmodule.c:769:9: warning: variable 'plain' set but not used [-Wunused-but-set-variable] ./Python/sysmodule.c: In function 'PySys_AddXOption': ./Python/sysmodule.c:1179:9: warning: variable 'r' set but not used [-Wunused-but-set-variable] Python/thread_pthread.h: In function 'PyThread_free_lock': Python/thread_pthread.h:294:17: warning: variable 'error' set but not used [-Wunused-but-set-variable] Python/thread_pthread.h: In function 'PyThread_acquire_lock_timed': Python/thread_pthread.h:325:17: warning: variable 'error' set but not used [-Wunused-but-set-variable] Python/thread_pthread.h: In function 'PyThread_release_lock': Python/thread_pthread.h:376:17: warning: variable 'error' set but not used [-Wunused-but-set-variable] ./Modules/_sre.c: In function '_validate_inner': ./Modules/_sre.c:2988:42: warning: variable 'prefix_skip' set but not used [-Wunused-but-set-variable] ./Modules/_sre.c:2966:38: warning: variable 'max' set but not used [-Wunused-but-set-variable] ./Modules/_sre.c:2966:33: warning: variable 'min' set but not used [-Wunused-but-set-variable] ./Modules/_io/bytesio.c: In function 'bytesiobuf_getbuffer': ./Modules/_io/bytesio.c:941:11: warning: variable 'ptr' set but not used [-Wunused-but-set-variable] empty-body: Parser/pgen.c: In function 'compile_rule': Parser/pgen.c:174:28: warning: suggest braces around empty body in an 'else' statement [-Wempty-body] Parser/pgen.c: In function 'compile_rhs': Parser/pgen.c:195:15: warning: suggest braces around empty body in an 'else' statement [-Wempty-body] Parser/pgen.c:210:19: warning: suggest braces around empty body in an 'else' statement [-Wempty-body] Parser/pgen.c: In function 'compile_alt': Parser/pgen.c:228:15: warning: suggest braces around empty body in an 'else' statement [-Wempty-body] Parser/pgen.c: In function 'compile_item': Parser/pgen.c:250:15: warning: suggest braces around empty body in an 'else' statement [-Wempty-body] Parser/pgen.c:253:19: warning: suggest braces around empty body in an 'else' statement [-Wempty-body] Parser/pgen.c:262:19: warning: suggest braces around empty body in an 'else' statement [-Wempty-body] Parser/pgen.c: In function 'compile_atom': Parser/pgen.c:286:15: warning: suggest braces around empty body in an 'else' statement [-Wempty-body] Parser/pgen.c:289:19: warning: suggest braces around empty body in an 'else' statement [-Wempty-body] ./Modules/_sre.c: In function '_validate': ./Modules/_sre.c:3194:31: warning: suggest braces around empty body in an 'else' statement [-Wempty-body] uninitialized: Objects/setobject.c: In function 'test_c_api': Objects/setobject.c:2445:11: warning: 'x' may be used uninitialized in this function [-Wuninitialized] Python/Python-ast.c: In function 'obj2ast_expr': Python/Python-ast.c:5824:24: warning: 'col_offset' may be used uninitialized in this function [-Wuninitialized] Python/Python-ast.c:5824:24: warning: 'lineno' may be used uninitialized in this function [-Wuninitialized] Python/Python-ast.c: In function 'obj2ast_stmt.part.15': Python/Python-ast.c:4678:24: warning: 'col_offset' may be used uninitialized in this function [-Wuninitialized] Python/Python-ast.c:4678:24: warning: 'lineno' may be used uninitialized in this function [-Wuninitialized] (other): ./Python/sysmodule.c: In function 'svnversion_init': ./Python/sysmodule.c:1368:9: warning: offset outside bounds of constant string [enabled by default] In file included from Python/thread.c:118:0: ---------- messages: 126571 nosy: haypo priority: normal severity: normal status: open title: gcc 4.6 warnings _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 02:54:59 2011 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Jan 2011 01:54:59 +0000 Subject: [New-bugs-announce] [issue10952] Don't normalize module names to NFKC? In-Reply-To: <1295488499.02.0.313090900295.issue10952@psf.upfronthosting.co.za> Message-ID: <1295488499.02.0.313090900295.issue10952@psf.upfronthosting.co.za> New submission from STINNER Victor : The Python 3 parser normalizes all identifiers using NFKC (as described in the PEP 3131). Examples: - U+00B5 (?: Micro sign) is normalized to U+03BC (?: Greek small letter mu) - U+FB03 (?: Latin small ligature ffi) is normalized to 'ffi' The problem is that it does also normalize module names, but not the filename. The module name in the Python source code is written with the keyboard (eg. U+00B5 in my case) and then normalized to NFKC (=> U+03BC). The filename is also written using the keyboard (U+00B5), but it is never normalized. Attached script tests the current behaviour using "?Torrent" name with U+00B5 and U+03BC: import with U+00B5 or U+03BC use the filename with U+03BC. The problem is that I'm able to write '?' (U+00B5) with my keyboard, but not U+03BC (?). ---------- components: Interpreter Core, Unicode files: module_name.py messages: 126577 nosy: haypo priority: normal severity: normal status: open title: Don't normalize module names to NFKC? versions: Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file20459/module_name.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 04:29:35 2011 From: report at bugs.python.org (kai zhu) Date: Thu, 20 Jan 2011 03:29:35 +0000 Subject: [New-bugs-announce] [issue10953] safely eval serialized dict/list data from arbitrary string over web with no side effects In-Reply-To: <1295494175.9.0.514806108432.issue10953@psf.upfronthosting.co.za> Message-ID: <1295494175.9.0.514806108432.issue10953@psf.upfronthosting.co.za> New submission from kai zhu : rather than serialize python dicts & list to json / xml / protocol buffer for web use, its more efficient to just serialize w/ repr() & then use eval(), if only there was a way to guarantee arbitrary code can't b executed. this is a very simple proposed method for the latter. b4 eval(), it compiles string to python code object & checks for: 1. co_names list can only contain 'False', 'None', 'True' -this ensures no function call can b made 2. co_consts list cannot contain code objects -embedded lambda's r forbidden. 3. grave accents are explicitly forbidden. here is the code for both python2.5 (intended for google appengine) & python 3k: ## safe_eval.py import sys, types if sys.version_info[0] == 2: ## py2x _co_safe = 'co_argcount co_nlocals co_varnames co_filename co_freevars co_cellvars'.split(' ') else: ## py3k _co_safe = 'co_argcount co_kwonlyargcount co_nlocals co_names co_varnames co_filename co_freevars co_cellvars'.split(' ') ## safely eval string with no side-effects def safe_eval(ss): if not ss: return None if '`' in ss: raise ValueError('grave accent "`" forbidden') cc = compile(ss, '', 'eval') for aa in _co_safe: if getattr(cc, aa): raise ValueError(aa + ' must be empty / none / zero') for aa in cc.co_names: if aa not in ['False', 'None', 'True']: raise ValueError('co_names can only contain False, None, True') for aa in cc.co_consts: if isinstance(aa, types.CodeType): raise TypeError('code objects not allowed in co_consts') return eval(cc, {}) python2.5 Python 2.5.5 (r255:77872, Nov 28 2010, 19:00:19) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from safe_eval import safe_eval >>> safe_eval('[False, None, True, {1:2}]') [False, None, True, {1: 2}] >>> safe_eval('[None, False, True, {1:2}, evil_code()]') Traceback (most recent call last): File "", line 1, in File "safe_eval.py", line 19, in safe_eval if aa not in ['False', 'None', 'True']: raise ValueError('co_names can only contain False, None, True') ValueError: co_names can only contain False, None, True >>> safe_eval('[None, False, True, {1:2}, `evil_code()`]') Traceback (most recent call last): File "", line 1, in File "safe_eval.py", line 14, in safe_eval if '`' in ss: raise ValueError('grave accent "`" forbidden') ValueError: grave accent "`" forbidden >>> safe_eval('[None, False, True, {1:2}, lambda: evil_code()]') Traceback (most recent call last): File "", line 1, in File "safe_eval.py", line 21, in safe_eval if isinstance(aa, types.CodeType): raise TypeError('code objects not allowed in co_consts') TypeError: code objects not allowed in co_consts ---------- components: Library (Lib) messages: 126586 nosy: kaizhu priority: normal severity: normal status: open title: safely eval serialized dict/list data from arbitrary string over web with no side effects type: feature request versions: Python 2.5, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 11:32:28 2011 From: report at bugs.python.org (Lennart Regebro) Date: Thu, 20 Jan 2011 10:32:28 +0000 Subject: [New-bugs-announce] [issue10954] No warning for csv.writer API change In-Reply-To: <1295519548.77.0.698015070506.issue10954@psf.upfronthosting.co.za> Message-ID: <1295519548.77.0.698015070506.issue10954@psf.upfronthosting.co.za> New submission from Lennart Regebro : In Python 2 the file used for csv.writer() should be opened in binary mode, while in Python 3 is should be opened in text mode but with newlines set to ''. This change is neither warned for by python -3, nor is there a fixer for it (and making a fixer would be tricky), thus it provides a surprising API change. I think that csv.writer() should warn or even fail if the file is opened in binary mode under Python 3. Failing is a god option, as a binary file is likely to be a port from Python 2, and you are likely to get the less useful message "must be bytes or buffer, not str". Even if you understand that message, you will then probably just change the file mode from binary to text, but you will not add the lineendings='' parameter, and thusly you might cause subtle error on windows. ---------- components: 2to3 (2.x to 3.0 conversion tool), Library (Lib) messages: 126596 nosy: lregebro priority: normal severity: normal status: open title: No warning for csv.writer API change type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 14:52:20 2011 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 20 Jan 2011 13:52:20 +0000 Subject: [New-bugs-announce] [issue10955] Possible regression with stdlib in zipfile In-Reply-To: <1295531540.01.0.823019908764.issue10955@psf.upfronthosting.co.za> Message-ID: <1295531540.01.0.823019908764.issue10955@psf.upfronthosting.co.za> New submission from Ronald Oussoren : I ran into this issue while debugging why py2app doesn't work with python 3.2rc2. The reason seems to be a regression w.r.t. having the stdlib inside a zipfile. Note that I haven't tested this without going through py2app yet. py2app basicly recreates a minimal sys.prefix that contains just the application python files and a minimal selection of files from the stdlib. The file structure in the app bundle contains (for python3.2): .../Resources/ lib/ python32.zip # Most compiled python files python3.2/ # Files that cannot be in the zip lib-dynload # Extensions This structure works fine with python2.7 (and earlier) and python3.1, with python 3.2rc2 I get a bootstrap error because the filesystem encoding codec cannot be located. This can be worked around by moving the encodings package and the codecs module from the zipfile to the python3.2 directory. That however is not good enough, I also have to change the default search-path using Py_SetPath. The default path has python32.zip before the python3.2 directory, only when I switch those around the application loads fine. All of this is on MacOSX 10.6.6 (where the filesystem encoding is UTF-8). This is a regression because it is no longer possible to have a packaged python application where all python code is inside a zipfile. Some files must be outside of the file to bootstrap the interpreter. ---------- messages: 126614 nosy: ronaldoussoren priority: normal severity: normal stage: unit test needed status: open title: Possible regression with stdlib in zipfile type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 15:12:31 2011 From: report at bugs.python.org (Mark Florisson) Date: Thu, 20 Jan 2011 14:12:31 +0000 Subject: [New-bugs-announce] [issue10956] file.write and file.read don't handle EINTR In-Reply-To: <1295532751.32.0.53142512873.issue10956@psf.upfronthosting.co.za> Message-ID: <1295532751.32.0.53142512873.issue10956@psf.upfronthosting.co.za> New submission from Mark Florisson : In both Python versions EINTR is not handled properly in the file.write and file.read methods. ------------------------- file.write ------------------------- In Python 2, file.write can write a short amount of bytes, and when it is interrupted there is no way to tell how many bytes it actually wrote. In Python 2 it raises an IOError with EINTR, whereas in Python 3 it simply stops writing and returns the amount of bytes written. Here is the output of fwrite with Python 2.7 (see attached files). Note also how inconsistent the IOError vs OSError difference is: python2.7 fwrite.py Writing 100000 bytes, interrupt me with SIGQUIT (^\) ^\^\(3, ) Traceback (most recent call last): File "fwrite.py", line 16, in print(write_file.write(b'a' * 100000)) IOError: [Errno 4] Interrupted system call read 65536 bytes ^\(3, ) Traceback (most recent call last): File "fwrite.py", line 21, in print('read %d bytes' % len(os.read(r, 100000))) OSError: [Errno 4] Interrupted system call Because os.read blocks on the second call to read, we know that only 65536 of the 100000 bytes were written. ------------------------- file.read ------------------------- When interrupting file.read in Python 3, it may have read bytes that are inaccessible. In Python 2 it returns the bytes, whereas in Python 3 it raises an IOError with EINTR. A demonstration: $ python3.2 fread.py Writing 7 bytes Reading 20 bytes... interrupt me with SIGQUIT (^\) ^\(3, ) Traceback (most recent call last): File "fread.py", line 18, in print('Read %d bytes using file.read' % len(read_file.read(20))) IOError: [Errno 4] Interrupted system call Reading any remaining bytes... ^\(3, ) Traceback (most recent call last): File "fread.py", line 23, in print('reading: %r' % os.read(r, 4096)) OSError: [Errno 4] Interrupted system call Note how in Python 2 it stops reading when interrupted and it returns our bytes, but in Python 3 it raises IOError while there is no way to access the bytes that it read. So basically, this behaviour is just plain wrong as EINTR is not an error, and this behaviour makes it impossible for the caller to handle the situation correctly. Here is how I think Python should behave. I think that it should be possible to interrupt both read and write calls, however, it should also be possible for the user to handle these cases. file.write, on EINTR, could decide to continue writing if no Python signal handler raised an exception. Analogously, file.read could decide to keep on reading on EINTR if no Python signal handler raised an exception. This way, it is possible for the programmer to write interruptable code while at the same time having proper file.write and file.read behaviour in case code should not be interrupted. KeyboardInterrupt would still interrupt read and write calls, because it raises an exception. If the programmer decided that writes should finish before allowing such an exception, the programmer could replace the default signal handler for SIGINT. So, in pseudo-code: bytes_written = 0 while bytes_written < len(buf): result = write(buf) if result < 0: if errno == EINTR if PyErr_CheckSignals() < 0: /* Propagate exception from signal handler */ return NULL continue else: PyErr_SetFromErrno(PyExc_IOError) return NULL buf += result bytes_written += result return bytes_written Similar code could be used for file.read with the obvious adjustments. However, in case of an error (either from the write call or from a Python signal handler), it would still be unclear how many bytes were actually written. Maybe (I think this part would be bonus points) we could put the number of bytes written on the exception object in this case, or make it retrievable in some other thread-safe way. For files with file descriptors in nonblocking mode (and maybe other cases) it will still return a short amount of bytes. ---------- components: IO files: fwrite.py messages: 126616 nosy: eggy priority: normal severity: normal status: open title: file.write and file.read don't handle EINTR 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/file20462/fwrite.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 17:34:15 2011 From: report at bugs.python.org (Jerry Seutter) Date: Thu, 20 Jan 2011 16:34:15 +0000 Subject: [New-bugs-announce] [issue10957] Python FAQ grammar error In-Reply-To: <1295541255.37.0.868919325173.issue10957@psf.upfronthosting.co.za> Message-ID: <1295541255.37.0.868919325173.issue10957@psf.upfronthosting.co.za> New submission from Jerry Seutter : Section 4.1 of the Python FAQ (http://www.python.org/dev/faq/) contains a grammar error: The sentence I am referring to says: "If you are developing on OS X for Python 2.x and will not be working with the OS X-specific modules from the standard library, then consider using the --without-toolbox-glue flag to faster compilation time." How about instead: "If you are developing on OS X for Python 2.x and will not be working with the OS X-specific modules from the standard library, then consider using the --without-toolbox-glue flag for a faster compile." (Note: Taken from the FAQ as of Jan 20, 2011) ---------- assignee: docs at python components: Documentation keywords: easy messages: 126626 nosy: docs at python, jerry.seutter priority: normal severity: normal status: open title: Python FAQ grammar error versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 18:00:04 2011 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Thu, 20 Jan 2011 17:00:04 +0000 Subject: [New-bugs-announce] [issue10958] stat.S_ISLNK() does not wok! In-Reply-To: <1295542804.63.0.323986582337.issue10958@psf.upfronthosting.co.za> Message-ID: <1295542804.63.0.323986582337.issue10958@psf.upfronthosting.co.za> New submission from ???? ????????? : ipython session: In [48]: qwe=os.stat('/usr/lib/libstdc++.so.6') In [49]: qwe.st_mode Out[49]: 33188 In [50]: stat.S_ISLNK(qwe.st_mode) Out[50]: False In [51]: stat.S_IFLNK & qwe.st_mode Out[51]: 32768 '/usr/lib/libstdc++.so.6' is really symlink !!! python in ubuntu 10.10 and RHEL 6.0. All the same. ---------- components: Library (Lib) messages: 126628 nosy: mmarkk priority: normal severity: normal status: open title: stat.S_ISLNK() does not wok! type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 18:00:35 2011 From: report at bugs.python.org (Ross Lagerwall) Date: Thu, 20 Jan 2011 17:00:35 +0000 Subject: [New-bugs-announce] [issue10959] mmap crash In-Reply-To: <1295542835.78.0.12155244599.issue10959@psf.upfronthosting.co.za> Message-ID: <1295542835.78.0.12155244599.issue10959@psf.upfronthosting.co.za> New submission from Ross Lagerwall : The fix for issue10916 commited in r88022 introduces this line: map_size = st.st_size - offset; If offset > st.st_size, map_size is negative. This should cause the mmap system call to return -1 and set errno. However, given a certain size of offset, since map_size is unsigned it will give a very large map_size and access the resultant mmap object results in a bus error crash. It also gives bogus len(mmap) values. Eg (crashes on a 32bit system): import os, mmap with open("/tmp/rnd", "wb") as f: f.write(b"X" * 115699) with open("/tmp/rnd", "w+b") as f: with mmap.mmap(f.fileno(), 0, offset=2147479552) as m: print(len(m)) for i in m: print(m[i]) Attached is a patch which should fix this issue by raising a value error if offset > st.st_size. ---------- files: mmap_issue.patch keywords: patch messages: 126629 nosy: amaury.forgeotdarc, pitrou, rosslagerwall priority: normal severity: normal status: open title: mmap crash type: crash versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20466/mmap_issue.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 18:28:06 2011 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Thu, 20 Jan 2011 17:28:06 +0000 Subject: [New-bugs-announce] [issue10960] os.stat() does not mention that it follow symlinks by default In-Reply-To: <1295544486.66.0.118119387237.issue10960@psf.upfronthosting.co.za> Message-ID: <1295544486.66.0.118119387237.issue10960@psf.upfronthosting.co.za> New submission from ???? ????????? : Documentation should say about 'following symlink' in this function. Documentation should advice to use os.lstat() in case when it needed. ---------- assignee: docs at python components: Documentation messages: 126631 nosy: docs at python, mmarkk priority: normal severity: normal status: open title: os.stat() does not mention that it follow symlinks by default type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 18:48:58 2011 From: report at bugs.python.org (Ron Adam) Date: Thu, 20 Jan 2011 17:48:58 +0000 Subject: [New-bugs-announce] [issue10961] Pydoc touchups in new browser for 3.2 In-Reply-To: <1295545738.06.0.604274599052.issue10961@psf.upfronthosting.co.za> Message-ID: <1295545738.06.0.604274599052.issue10961@psf.upfronthosting.co.za> New submission from Ron Adam : A collection of small fix's that only effect the new browser mode. * Change title of html pages from "Python ..." to "PyDoc ...". * Fixed unterminated div float for items returned without a header. example: str, None, True, False * Added "topic?key=..." url command to explicitly get topics. This is to avoid the shadowing when an object has the same name as a topic. * Nicer parsing and error handling in the url handler. ---------- components: Library (Lib) files: pydoc_misc_fix.diff keywords: patch messages: 126633 nosy: georg.brandl, ron_adam priority: normal severity: normal status: open title: Pydoc touchups in new browser for 3.2 type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file20467/pydoc_misc_fix.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 21:04:19 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 20 Jan 2011 20:04:19 +0000 Subject: [New-bugs-announce] [issue10962] gdb support broken In-Reply-To: <1295553859.97.0.683428660139.issue10962@psf.upfronthosting.co.za> Message-ID: <1295553859.97.0.683428660139.issue10962@psf.upfronthosting.co.za> New submission from Antoine Pitrou : This happens when I try to debug a Python process (py3k HEAD in pydebug mode): Traceback (most recent call last): File "/home/antoine/py3k/__svn__/python-gdb.py", line 52, in _type_size_t = gdb.lookup_type('size_t') RuntimeError: No type named size_t. ---------- assignee: dmalcolm components: Demos and Tools messages: 126639 nosy: dmalcolm, georg.brandl, pitrou priority: critical severity: normal status: open title: gdb support broken type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 20 21:23:34 2011 From: report at bugs.python.org (Dave Malcolm) Date: Thu, 20 Jan 2011 20:23:34 +0000 Subject: [New-bugs-announce] [issue10963] "subprocess" can raise OSError (EPIPE) when communicating with short-lived processes In-Reply-To: <1295555014.31.0.879687826689.issue10963@psf.upfronthosting.co.za> Message-ID: <1295555014.31.0.879687826689.issue10963@psf.upfronthosting.co.za> New submission from Dave Malcolm : If we start a short-lived process which finishes before we begin communicating with it (e.g. by crashing), we can receive a SIGPIPE due to the receiving process no longer existing. This becomes an EPIPE, which becomes an: OSError: [Errno 32] Broken pipe Arguably this is a bug; if the subprocess could crash, the user currently has to check for it by both monitoring the returncode _and_ catching OSError (then examining for this specific errno), which seems ugly to me. I'm attaching a patch for subprocess which handles this case, masking the OSError within the Popen implementation, so that you have to test for it within the returncode, in one place, rather than wrap every call with a try/except. It could be argued that this is incorrect, as it masks under-reads of stdin by the subprocess. However I believe a sanely-written subprocess ought to indicate success/failure back with its return code. This was originally filed downstream within the Red Hat bugzilla instance as: https://bugzilla.redhat.com/show_bug.cgi?id=667431 The handler part of the patch is based on a patch attached there by Federico Simoncelli; I don't know if he has signed a PSF contributor agreement, however the size of the patch is sufficiently small that I suspect it's not copyrightable, and I've somewhat rewritten it since; I wrote the unit test. ---------- components: Library (Lib) files: py3k-handle-EPIPE-for-short-lived-subprocesses-2011-01-20-001.patch keywords: patch messages: 126643 nosy: dmalcolm priority: normal severity: normal stage: patch review status: open title: "subprocess" can raise OSError (EPIPE) when communicating with short-lived processes versions: Python 3.3 Added file: http://bugs.python.org/file20469/py3k-handle-EPIPE-for-short-lived-subprocesses-2011-01-20-001.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 00:30:33 2011 From: report at bugs.python.org (Russell Owen) Date: Thu, 20 Jan 2011 23:30:33 +0000 Subject: [New-bugs-announce] [issue10964] Mac installer need not add things to /usr/local In-Reply-To: <1295566233.42.0.612397787907.issue10964@psf.upfronthosting.co.za> Message-ID: <1295566233.42.0.612397787907.issue10964@psf.upfronthosting.co.za> New submission from Russell Owen : The Mac installer alters the user's $PATH to put /Library/Frameworks/Python.Framework/Versions/Current/bin on the $PATH before /usr/local/bin and /usr/bin. This is a good idea in my opinion. But the installer *also* installs numerous symlinks in /usr/local/bin. These symlinks are redundant with altering the $PATH. Thus they are redundant. They are also make it difficult to switch versions of python because it's tricky to know which symlinks should be deleted (and the list may depend on the current version of python). This is problem for me because I often have to switch versions of Python while building binary installers for packages such as matplotlib. My request is for the Mac python installer to leave /usr/local/bin alone. For if there is a need to add symlinks to /usr/local/bin that I'm not seeing then my request is for an easy way to switch versions of python or at least get rid of the symlinks, e.g. a python version switcher script or symlink deletion script. ---------- assignee: ronaldoussoren components: Macintosh messages: 126661 nosy: reowen, ronaldoussoren priority: normal severity: normal status: open title: Mac installer need not add things to /usr/local type: feature request versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 00:33:43 2011 From: report at bugs.python.org (Brett Cannon) Date: Thu, 20 Jan 2011 23:33:43 +0000 Subject: [New-bugs-announce] [issue10965] dev task of documenting undocumented APIs In-Reply-To: <1295566423.14.0.859020697485.issue10965@psf.upfronthosting.co.za> Message-ID: <1295566423.14.0.859020697485.issue10965@psf.upfronthosting.co.za> New submission from Brett Cannon : Once the docs are built using Python 3, then the coverage results can be used by people wanting to contribute as something to do. Should also mention in the task that some APIs should probably be private: http://mail.python.org/pipermail/python-dev/2010-November/105476.html . ---------- assignee: brett.cannon components: Documentation messages: 126662 nosy: brett.cannon priority: low severity: normal stage: needs patch status: open title: dev task of documenting undocumented APIs type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 00:40:30 2011 From: report at bugs.python.org (Brett Cannon) Date: Thu, 20 Jan 2011 23:40:30 +0000 Subject: [New-bugs-announce] [issue10966] eliminate use of ImportError implicitly representing TestSkipped In-Reply-To: <1295566830.75.0.786153857799.issue10966@psf.upfronthosting.co.za> Message-ID: <1295566830.75.0.786153857799.issue10966@psf.upfronthosting.co.za> New submission from Brett Cannon : test.regrtest considers an ImportError to be a test to skip. It then uses this info to decide what skipped tests were expected (or not) based on a list kepted in regrtest.py. For detecting compiler failures, an ImportError should be a test error or failure. Tests for optional modules should instead raise TestSkipped directly if an import fails. Something like test.support.optional_import() should be created which raises TestSkipped if the requested module could not be imported. It could also be made optional based on the OS (not sure if it should be inclusive, exclusive, or either). That way the list of expected skips in regrtest.py can be moved into the individual test modules where it belongs. ---------- components: Tests messages: 126663 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: eliminate use of ImportError implicitly representing TestSkipped versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 00:45:45 2011 From: report at bugs.python.org (Brett Cannon) Date: Thu, 20 Jan 2011 23:45:45 +0000 Subject: [New-bugs-announce] [issue10967] move regrtest over to using more unittest infrastructure In-Reply-To: <1295567145.8.0.568957178125.issue10967@psf.upfronthosting.co.za> Message-ID: <1295567145.8.0.568957178125.issue10967@psf.upfronthosting.co.za> New submission from Brett Cannon : test.regrtest is rather old and has not been updated to take advantage of all the latest features in unittest (e.g., test discovery). It might be a rather large undertaking with various bits requiring some changes (e.g., getting away from raising exceptions for skipped tests and instead using unittest.skipIf), but for maintainability it might be good to try to use as much unittest code in regrtest as possible. ---------- components: Tests messages: 126665 nosy: brett.cannon priority: low severity: normal stage: unit test needed status: open title: move regrtest over to using more unittest infrastructure type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 02:44:59 2011 From: report at bugs.python.org (Benjamin VENELLE) Date: Fri, 21 Jan 2011 01:44:59 +0000 Subject: [New-bugs-announce] [issue10968] Timer class inheritance issue Message-ID: <1295574299.43.0.018764263809.issue10968@psf.upfronthosting.co.za> Changes by Benjamin VENELLE : ---------- assignee: collinwinter components: Benchmarks nosy: Kain94, collinwinter priority: normal severity: normal status: open title: Timer class inheritance issue type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 06:28:19 2011 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 21 Jan 2011 05:28:19 +0000 Subject: [New-bugs-announce] [issue10969] Make Tcl recommendation more prominent In-Reply-To: <1295587699.83.0.103417791423.issue10969@psf.upfronthosting.co.za> Message-ID: <1295587699.83.0.103417791423.issue10969@psf.upfronthosting.co.za> New submission from Raymond Hettinger : On the releases page at http://www.python.org/download/releases/3.2/ the note about Tcl needs to be made more prominent for the 32/64 bit Mac OS installer. Right now, it's buried in another page referenced in a footnote at the bottom of the release. I think it is too easy to miss and it is essential for users if they want IDLE or tkinter to work. Recommend adding a link immediately below the 64-bit installer. See below: ------------------------------------------------- We currently support these formats for download: Bzipped source tar ball (3.2rc1) (sig), ~ 11 MB XZ compressed source tar ball (3.2rc1) (sig), ~ 8.5 MB Gzipped source tar ball (3.2rc1) (sig), ~ 13 MB Windows x86 MSI Installer (3.2rc1) (sig) and Visual Studio debug information files (sig) Windows X86-64 MSI Installer (3.2rc1) [1] (sig) and Visual Studio debug information files (sig) Mac OS X 32-bit i386/PPC Installer (3.2rc1) for OS X 10.3 through 10.6 [2] (sig) Mac OS X 64-bit/32-bit Installer (3.2rc1) for Mac OS X 10.6 [2] (sig) (needs ActiveState Tcl 8.5.9 to run IDLE or use Tkinter). ---------- assignee: georg.brandl components: Installation messages: 126694 nosy: georg.brandl, rhettinger priority: normal severity: normal status: open title: Make Tcl recommendation more prominent versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 07:25:16 2011 From: report at bugs.python.org (Mahmoud Abdelkader) Date: Fri, 21 Jan 2011 06:25:16 +0000 Subject: [New-bugs-announce] [issue10970] "string".encode('base64') is not the same as base64.b64encode("string") In-Reply-To: <1295591116.22.0.262504941667.issue10970@psf.upfronthosting.co.za> Message-ID: <1295591116.22.0.262504941667.issue10970@psf.upfronthosting.co.za> New submission from Mahmoud Abdelkader : Given a string, encoding it with .encode('base64') is not the same as using base64's b64encode function. I think this is very unclear and unintuitive. Here's some example code to demonstrate the problem. Before I attempt to submit a patch, is this done for legacy reasons? Are there any reasons to use one over the other? import hmac import hashlib import base64 signature = hmac.new('secret', 'url', hashlib.sha512).digest() assert signature.encode('base64') == base64.b64encode(signature) ---------- components: Library (Lib) messages: 126696 nosy: mahmoudimus priority: normal severity: normal status: open title: "string".encode('base64') is not the same as base64.b64encode("string") versions: Python 2.5, Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 12:14:50 2011 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2011 11:14:50 +0000 Subject: [New-bugs-announce] [issue10971] python Lib/test/regrtest.py -R 3:3: test_zipimport_support fails In-Reply-To: <1295608490.51.0.226657873121.issue10971@psf.upfronthosting.co.za> Message-ID: <1295608490.51.0.226657873121.issue10971@psf.upfronthosting.co.za> New submission from STINNER Victor : "./python Lib/test/regrtest.py test_zipimport_support" pass, but not with the -R option. ---- $ ./python Lib/test/regrtest.py -R 3:3: test_zipimport_support [1/1] test_zipimport_support beginning 6 repetitions 123456 test test_zipimport_support failed -- Traceback (most recent call last): File "/home/haypo/prog/SVN/py3k/Lib/test/test_zipimport_support.py", line 96, in test_inspect_getsource_issue4223 self.assertEqual(inspect.getsource(zip_pkg.foo), test_src) File "/home/haypo/prog/SVN/py3k/Lib/inspect.py", line 693, in getsource lines, lnum = getsourcelines(object) File "/home/haypo/prog/SVN/py3k/Lib/inspect.py", line 682, in getsourcelines lines, lnum = findsource(object) File "/home/haypo/prog/SVN/py3k/Lib/inspect.py", line 530, in findsource raise IOError('could not get source code') IOError: could not get source code 1 test failed: test_zipimport_support ---- ---------- components: Tests messages: 126718 nosy: haypo priority: normal severity: normal status: open title: python Lib/test/regrtest.py -R 3:3: test_zipimport_support fails versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 13:00:45 2011 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jan 2011 12:00:45 +0000 Subject: [New-bugs-announce] [issue10972] zipfile: add unicode option to the choose filename encoding In-Reply-To: <1295611245.09.0.199855932712.issue10972@psf.upfronthosting.co.za> Message-ID: <1295611245.09.0.199855932712.issue10972@psf.upfronthosting.co.za> New submission from STINNER Victor : ZipInfo._encodeFilename() tries cp437 encoding or use UTF-8. It is not possible to decide the encoding. To workaround #10955 (bootstrap issue with python32.zip), it would be nice to be able to create a ZIP file using only UTF-8 filenames. Attached patch adds unicode parameter to ZipFile.write(), ZipFile.writestr() and ZipInfo constructor. ---------- components: Library (Lib), Unicode files: zipfile_unicode.patch keywords: patch messages: 126724 nosy: haypo priority: normal severity: normal status: open title: zipfile: add unicode option to the choose filename encoding versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file20478/zipfile_unicode.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 15:27:41 2011 From: report at bugs.python.org (Nestor Aguilera) Date: Fri, 21 Jan 2011 14:27:41 +0000 Subject: [New-bugs-announce] =?utf-8?b?W2lzc3VlMTA5NzNdICfDsScgbm90IHdv?= =?utf-8?q?rking_with_IDLE_3=2E2rc1_-_OSX_10=2E6=2E6?= In-Reply-To: <1295620061.05.0.0288010484186.issue10973@psf.upfronthosting.co.za> Message-ID: <1295620061.05.0.0288010484186.issue10973@psf.upfronthosting.co.za> New submission from Nestor Aguilera : When trying to type '?' in idle 3.2 (no problem in terminal), python "quits unexpectedly" when started from terminal: $ idle3 2011-01-21 11:21:55.883 Python[5228:a07] setCanCycle: is deprecated. Please use setCollectionBehavior instead 2011-01-21 11:21:55.890 Python[5228:a07] setCanCycle: is deprecated. Please use setCollectionBehavior instead 2011-01-21 11:21:55.891 Python[5228:a07] setCanCycle: is deprecated. Please use setCollectionBehavior instead 2011-01-21 11:22:08.777 Python[5228:a07] An uncaught exception was raised 2011-01-21 11:22:08.779 Python[5228:a07] *** -[NSCFString characterAtIndex:]: Range or index out of bounds 2011-01-21 11:22:08.781 Python[5228:a07] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFString characterAtIndex:]: Range or index out of bounds' *** Call stack at first throw: ( 0 CoreFoundation 0x00007fff829c47b4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x00007fff816300f3 objc_exception_throw + 45 2 CoreFoundation 0x00007fff829c45d7 +[NSException raise:format:arguments:] + 103 3 CoreFoundation 0x00007fff829c4564 +[NSException raise:format:] + 148 4 Foundation 0x00007fff839c15e1 -[NSCFString characterAtIndex:] + 97 5 Tk 0x00000001012ba035 -[TKApplication(TKKeyEvent) tkProcessKeyEvent:] + 664 6 Tk 0x00000001012c0b38 TkMacOSXEventsCheckProc + 349 7 Tcl 0x0000000101175667 Tcl_DoOneEvent + 316 8 _tkinter.so 0x000000010077d801 Tkapp_MainLoop + 177 9 Python 0x00000001000b2b62 PyEval_EvalFrameEx + 30530 10 Python 0x00000001000b34ca PyEval_EvalCodeEx + 1770 11 Python 0x00000001000b19e3 PyEval_EvalFrameEx + 26051 12 Python 0x00000001000b1bfd PyEval_EvalFrameEx + 26589 13 Python 0x00000001000b34ca PyEval_EvalCodeEx + 1770 14 Python 0x00000001000b37df PyEval_EvalCode + 63 15 Python 0x00000001000da19b PyRun_FileExFlags + 187 16 Python 0x00000001000da469 PyRun_SimpleFileExFlags + 521 17 Python 0x00000001000ef253 Py_Main + 3059 18 Python 0x0000000100000e5f 0x0 + 4294970975 19 Python 0x0000000100000d04 0x0 + 4294970628 ) terminate called after throwing an instance of 'NSException' Abort trap #---------------------------------------------- The welcome in idle 3.2 is: Python 3.2rc1 (r32rc1:88040, Jan 15 2011, 13:31:22) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "copyright", "credits" or "license()" for more information. #---------------------------------------------- I cannot start IDLE by double-clicking its icon in the Finder. Best, N?stor Aguilera ---------- components: IDLE messages: 126739 nosy: naguilera priority: normal severity: normal status: open title: '?' not working with IDLE 3.2rc1 - OSX 10.6.6 type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 19:40:55 2011 From: report at bugs.python.org (Nestor Aguilera) Date: Fri, 21 Jan 2011 18:40:55 +0000 Subject: [New-bugs-announce] [issue10974] IDLE 3.2 not loading on double-click in Finder, OSX 10.6 In-Reply-To: <1295635255.29.0.478257321345.issue10974@psf.upfronthosting.co.za> Message-ID: <1295635255.29.0.478257321345.issue10974@psf.upfronthosting.co.za> New submission from Nestor Aguilera : Here is the report from "Console" (date/time removed): [0x0-0x1a11a1].org.python.IDLE[5541] Traceback (most recent call last): [0x0-0x1a11a1].org.python.IDLE[5541] File "/Applications/Python 3.2/IDLE.app/Contents/Resources/idlemain.py", line 73, in [0x0-0x1a11a1].org.python.IDLE[5541] main() [0x0-0x1a11a1].org.python.IDLE[5541] File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/PyShell.py", line 1388, in main [0x0-0x1a11a1].org.python.IDLE[5541] shell = flist.open_shell() [0x0-0x1a11a1].org.python.IDLE[5541] File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/PyShell.py", line 277, in open_shell [0x0-0x1a11a1].org.python.IDLE[5541] self.pyshell = PyShell(self) [0x0-0x1a11a1].org.python.IDLE[5541] File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/PyShell.py", line 813, in __init__ [0x0-0x1a11a1].org.python.IDLE[5541] OutputWindow.__init__(self, flist, None, None) [0x0-0x1a11a1].org.python.IDLE[5541] File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/OutputWindow.py", line 16, in __init__ [0x0-0x1a11a1].org.python.IDLE[5541] EditorWindow.__init__(self, *args) [0x0-0x1a11a1].org.python.IDLE[5541] File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/EditorWindow.py", line 267, in __init__ [0x0-0x1a11a1].org.python.IDLE[5541] self.update_recent_files_list() [0x0-0x1a11a1].org.python.IDLE[5541] File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/EditorWindow.py", line 777, in update_recent_files_list [0x0-0x1a11a1].org.python.IDLE[5541] rf_list = rf_list_file.readlines() [0x0-0x1a11a1].org.python.IDLE[5541] File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/encodings/ascii.py", line 26, in decode [0x0-0x1a11a1].org.python.IDLE[5541] return codecs.ascii_decode(input, self.errors)[0] [0x0-0x1a11a1].org.python.IDLE[5541] UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 55: ordinal not in range(128) com.apple.launchd.peruser.501[168] ([0x0-0x1a11a1].org.python.IDLE[5541]) Exited with exit code: 1 Thanks, N?stor Aguilera ---------- components: IDLE messages: 126764 nosy: naguilera priority: normal severity: normal status: open title: IDLE 3.2 not loading on double-click in Finder, OSX 10.6 type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 19:46:04 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 21 Jan 2011 18:46:04 +0000 Subject: [New-bugs-announce] [issue10975] #10961: Pydoc touchups in new 3.2 Web server (issue4090042) In-Reply-To: <00221532cc70620113049a5fa977@google.com> Message-ID: <00221532cc70620113049a5fa977@google.com> New submission from ?ric Araujo : Some comments. Haven?t tested the patch yet. http://codereview.appspot.com/4090042/diff/1/Lib/pydoc.py File Lib/pydoc.py (right): http://codereview.appspot.com/4090042/diff/1/Lib/pydoc.py#newcode2507 Lib/pydoc.py:2507:
Does this work fine with common Web browsers, including not-most-recent versions, and various resolutions? (?fine? being defined as ?not worse than before the patch?) http://codereview.appspot.com/4090042/diff/1/Lib/pydoc.py#newcode2591 Lib/pydoc.py:2591: return '%s' % (name, name) I see no reason for polluting the key value with ?.html? http://codereview.appspot.com/4090042/diff/1/Lib/pydoc.py#newcode2713 Lib/pydoc.py:2713: raise TypeError('unknown content type %r' % ([url, content_type])) You can remove the extraneous parens around the list. http://codereview.appspot.com/4090042/diff/1/Lib/test/test_pydoc.py File Lib/test/test_pydoc.py (right): http://codereview.appspot.com/4090042/diff/1/Lib/test/test_pydoc.py#newcode431 Lib/test/test_pydoc.py:431: ("", "PyDoc: Index of Modules"), I?m not sure ?PyDoc? is better than ?Python?. What about ?Python Doc?? Very clear and still short. http://codereview.appspot.com/4090042/ ---------- messages: 126765 nosy: eric.araujo priority: normal severity: normal status: open title: #10961: Pydoc touchups in new 3.2 Web server (issue4090042) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 21 20:01:49 2011 From: report at bugs.python.org (hhas) Date: Fri, 21 Jan 2011 19:01:49 +0000 Subject: [New-bugs-announce] [issue10976] json.loads() throws TypeError on bytes object In-Reply-To: <1295636509.41.0.0138366952356.issue10976@psf.upfronthosting.co.za> Message-ID: <1295636509.41.0.0138366952356.issue10976@psf.upfronthosting.co.za> New submission from hhas : json.loads() accepts strings but errors on bytes objects. Documentation and API indicate that both should work. Review of json/__init__.py code shows that the loads() function's 'encoding' arg is ignored and no decoding takes place before the object is passed to JSONDecoder.decode() Tested on Python 3.1.2 and Python 3.2rc1; fails on both. Example: ################################################# #!/usr/local/bin/python3.2 import json print(json.loads('123')) # 123 print(json.loads(b'123')) # /Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/json/decoder.py:325: # TypeError: can't use a string pattern on a bytes-like object print(json.loads(b'123', encoding='utf-8')) # /Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/json/decoder.py:325: # TypeError: can't use a string pattern on a bytes-like object ################################################# Patch attached. ---------- components: Library (Lib) files: json.diff keywords: patch messages: 126772 nosy: hhas priority: normal severity: normal status: open title: json.loads() throws TypeError on bytes object type: behavior versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20481/json.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 00:49:39 2011 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 21 Jan 2011 23:49:39 +0000 Subject: [New-bugs-announce] [issue10977] Concrete object C API needs abstract path for subclasses of builtin types In-Reply-To: <1295653779.62.0.836506069174.issue10977@psf.upfronthosting.co.za> Message-ID: <1295653779.62.0.836506069174.issue10977@psf.upfronthosting.co.za> New submission from Raymond Hettinger : Currently, the concrete object C API bypasses any methods defined on subclasses of builtin types. It has long been accepted that subclasses of builtin types need to override many methods rather than just a few because the type itself was implemented with direct internal calls. This work-around requires extra work but still makes it possible to create a consistent subclass (a case-insensitive dictionary for example). However, there is another problem with this workaround. Any subclassed builtin may still be bypassed by other functions and methods using the concrete C API. For example, the OrderedDict class overrides enough dict methods to make itself internally consistent and fully usable by all pure python code. However, any builtin or extension using PyDict_SetItem() or PyDict_DelItem() will update the OrderedDict's internal unordered dict and bypass all the logic keeping dict ordering invariants intact. Note, this problem would still impact OrderedDict even if it were rewritten in C. The concrete calls would directly access the original dict structure and ignore any of the logic implemented in the subclass (whether coded in pure python or in C). Since OrderedDict is written in pure python, the consequence of having its invariants violated would result in disorganization, but not in a crash. However if OrderedDict were rewritten in C, augmenting the inherited data structure with its own extra state, then this problem could result in seg-faulting. Note this is only one example. Pretty much any subclass of a builtin type that adds additional state is vulnerable to a concrete C API that updates only part of the state while leaving the extra state information in an inconsistent state. Another example would be a list subclass that kept extra state tracking the number of None objects contained within. There is no way to implement that subclass, either in C or pure python, even if every method were overridden, that wouldn't be rendered inconsistent by an external tool using PyList_SetItem(). My recommendation is to find all of the mutating methods for the concrete C API and add an alternate path for subclasses. The alternate path should use the abstract API. Pseudo-code for PyList_SetItem(): if type(obj) is list: # proceed as currently implemented else: # use PyObject_SetItem() adapting the # function parameters and return values if necessary # to match the API for PyList_SetItem(). else: raise BadInternalCall('object should be a list') ---------- components: Interpreter Core messages: 126800 nosy: rhettinger priority: normal severity: normal status: open title: Concrete object C API needs abstract path for subclasses of builtin types type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 01:15:36 2011 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 22 Jan 2011 00:15:36 +0000 Subject: [New-bugs-announce] [issue10978] Add optional argument to Semaphore.release for releasing multiple threads In-Reply-To: <1295655336.58.0.55708711889.issue10978@psf.upfronthosting.co.za> Message-ID: <1295655336.58.0.55708711889.issue10978@psf.upfronthosting.co.za> New submission from Raymond Hettinger : Call sem.release(5) would have the same effect as: with lock: for i in range(5): sem.release() The use case is when a single semaphore is holding up multiple threads and needs to release them all. According to "The Little Book of Semaphores ", this is a common design pattern. Basic patch attached. If the proposal meets with acceptance, will add tests and a doc update. ---------- components: Library (Lib) files: sem.diff keywords: patch messages: 126804 nosy: rhettinger priority: normal severity: normal status: open title: Add optional argument to Semaphore.release for releasing multiple threads type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file20483/sem.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 05:13:31 2011 From: report at bugs.python.org (Brandon Craig Rhodes) Date: Sat, 22 Jan 2011 04:13:31 +0000 Subject: [New-bugs-announce] [issue10979] setUpClass exception causes explosion with "-b" In-Reply-To: <1295669611.84.0.453494131357.issue10979@psf.upfronthosting.co.za> Message-ID: <1295669611.84.0.453494131357.issue10979@psf.upfronthosting.co.za> New submission from Brandon Craig Rhodes : Normally, unittest cleanly reports an exception in a setUpClass method. But if I place the attached test in a directory by itself and then run "python -m unittest discover -b" from inside of the same directory, then instead of being shown the setUpClass exception I am instead shown a long traceback because unittest seems to think that it has put a stringIO in place of sys.stdout but a file is there instead. ---------- components: Library (Lib) files: test_example.py messages: 126816 nosy: brandon-rhodes priority: normal severity: normal status: open title: setUpClass exception causes explosion with "-b" type: crash versions: Python 2.7 Added file: http://bugs.python.org/file20484/test_example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 13:45:54 2011 From: report at bugs.python.org (Armin Ronacher) Date: Sat, 22 Jan 2011 12:45:54 +0000 Subject: [New-bugs-announce] [issue10980] http.server Header Unicode Bug In-Reply-To: <1295700354.03.0.333269896981.issue10980@psf.upfronthosting.co.za> Message-ID: <1295700354.03.0.333269896981.issue10980@psf.upfronthosting.co.za> New submission from Armin Ronacher : I have a critical bugfix that should make it into Python 3.2 even when it's in release candidate state. Currently http.server.BaseHTTPServer encodes headers with ASCII charset. This is at least in violation with PEP 3333 which demands that latin1 is used. Because HTTP itself suggests latin1 (iso-8859-1) I strongly recommend changing this in BaseHTTPServer and not wsgiref. The attached patch fixes that in a backwards compatible fashion. ---------- assignee: georg.brandl components: Library (Lib) files: http-server-unicode.patch keywords: patch messages: 126832 nosy: aronacher, georg.brandl priority: normal severity: normal stage: patch review status: open title: http.server Header Unicode Bug type: behavior Added file: http://bugs.python.org/file20486/http-server-unicode.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 13:49:12 2011 From: report at bugs.python.org (David Caro) Date: Sat, 22 Jan 2011 12:49:12 +0000 Subject: [New-bugs-announce] [issue10981] options starting with -- match substrings In-Reply-To: <1295700552.8.0.933174530734.issue10981@psf.upfronthosting.co.za> Message-ID: <1295700552.8.0.933174530734.issue10981@psf.upfronthosting.co.za> New submission from David Caro : When parsing option like --optionname, --option will match it too example: >>> import argparse >>> parser = argparse.ArgumentParser() >>> parser = argparse.ArgumentParser() >>> parser.add_argument('--superstring') _StoreAction(option_strings=['--superstring'], dest='superstring', nargs=None, const=None, default=None, type=None, choices=None, help=None, metavar=None) >>> parser.parse_args(['--super','value']) Namespace(superstring='value') I'm using argparse 1.1 with python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39), on ubuntu 10.10 32bit ---------- messages: 126833 nosy: David.Caro priority: normal severity: normal status: open title: options starting with -- match substrings _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 19:03:06 2011 From: report at bugs.python.org (k1h) Date: Sat, 22 Jan 2011 18:03:06 +0000 Subject: [New-bugs-announce] [issue10982] asyncore timeouts do not work correctly In-Reply-To: <1295719386.38.0.705218895334.issue10982@psf.upfronthosting.co.za> Message-ID: <1295719386.38.0.705218895334.issue10982@psf.upfronthosting.co.za> New submission from k1h : Asyncore for the versions of Python examined do not check for the empty sequences select.select returns to indicate a timeout. The attached patch served my immediate needs, but no effort was made to verify that all scenarios were covered or that other issues weren't introduced. ---------- components: Library (Lib) files: asyncore_timeout_patch_with_example.txt messages: 126846 nosy: k1h priority: normal severity: normal status: open title: asyncore timeouts do not work correctly versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20487/asyncore_timeout_patch_with_example.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 22 22:49:21 2011 From: report at bugs.python.org (nooB) Date: Sat, 22 Jan 2011 21:49:21 +0000 Subject: [New-bugs-announce] [issue10983] Errors in http.client.HTTPConnection class (python3) In-Reply-To: <1295732961.38.0.859825723182.issue10983@psf.upfronthosting.co.za> Message-ID: <1295732961.38.0.859825723182.issue10983@psf.upfronthosting.co.za> New submission from nooB : In python 3.x http.client.HTTPConnection class, I saw few problems. 1) `_tunnel_headers` not initialized in the __init__ method. This causes `set_tunnel` method to raise `AttributeError` when called without `headers` keyword argument. 2) In `_tunnel` method, `self._tunnel_headers.iteritems()` has been used instead of `self._tunnel_headers.items()`, which caused AttributeError. 3) In `_tunnel` method, the CONNECT request is incomplete and hangs. self.send(b'\r\n') is missing after sending the headers. ---------- messages: 126857 nosy: nooB priority: normal severity: normal status: open title: Errors in http.client.HTTPConnection class (python3) versions: Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 00:02:00 2011 From: report at bugs.python.org (Chris Lasher) Date: Sat, 22 Jan 2011 23:02:00 +0000 Subject: [New-bugs-announce] [issue10984] argparse add_mutually_exclusive_group should accept existing arguments to register conflicts In-Reply-To: <1295737320.83.0.942830837874.issue10984@psf.upfronthosting.co.za> Message-ID: <1295737320.83.0.942830837874.issue10984@psf.upfronthosting.co.za> New submission from Chris Lasher : argparse supports registering conflicting arguments, however, it does so in a way that an argument may belong to at most one group of conflicting arguments. The inspiration for this bug is Stack Overflow question #4770576. http://stackoverflow.com/questions/4770576/does-argparse-python-support-mutually-exclusive-groups-of-arguments The most straightforward use case argparse can not accommodate is the following: the user has three flags, '-a', '-b', and '-c'. The flag '-b' is incompatible with both '-a' and with '-c', however, '-a' and '-c' are compatible with each other. Current practice is to register a conflict by first defining a conflict group with parser.add_mutually_exclusive_group(), and then create new arguments within that group using group.add_argument(). Because the programmer is not allowed to create the argument prior to creating the group, an argument cannot be registered in two exclusive groups. I feel it would be much more useful to be given the option to create exclusive groups after the programmer has defined and created the options, as is the design for ConflictsOptionParser http://pypi.python.org/pypi/ConflictsOptionParser/ ---------- components: Library (Lib) messages: 126862 nosy: gotgenes priority: normal severity: normal status: open title: argparse add_mutually_exclusive_group should accept existing arguments to register conflicts type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 01:18:09 2011 From: report at bugs.python.org (Brett Cannon) Date: Sun, 23 Jan 2011 00:18:09 +0000 Subject: [New-bugs-announce] [issue10985] test_sys triggers a fatal python error when run under coverage.py In-Reply-To: <1295741889.19.0.432522991902.issue10985@psf.upfronthosting.co.za> Message-ID: <1295741889.19.0.432522991902.issue10985@psf.upfronthosting.co.za> New submission from Brett Cannon : If you run test_sys under coverage.py with ``./python.exe -m coverage run --pylib Lib/test/regrtest.py test_sys`` you get:: Fatal Python error: Cannot recover from stack overflow Have not taken the time to try to figure out exactly what code is triggering the recursion, but coverage.py is being used w/o its extension coverage support. Could be caused by coverage.py, but I'm a bit surprised that it's a fatal error instead of a recursion limit exception. ---------- messages: 126865 nosy: brett.cannon priority: normal severity: normal stage: unit test needed status: open title: test_sys triggers a fatal python error when run under coverage.py type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 03:47:00 2011 From: report at bugs.python.org (Benjamin VENELLE) Date: Sun, 23 Jan 2011 02:47:00 +0000 Subject: [New-bugs-announce] [issue10986] traceback's rendering behavior while throwing custom exception In-Reply-To: <1295750820.31.0.636288532577.issue10986@psf.upfronthosting.co.za> Message-ID: <1295750820.31.0.636288532577.issue10986@psf.upfronthosting.co.za> New submission from Benjamin VENELLE : Hi, >From few days, I've acknowledge when throwing an exception, the last traceback entry is always related to the raise statement. This is ok when the exception takes source from a non fail-safe code. But when an exception is raised due to a function's inputs sanity check (like an assertion error) the last traceback entry is non-sense. I've done a script to spot this behavior. Is there a way to prevent last traceback rendering (not suppressing) while exception is displayed without explicit call to traceback.print_exception ? If not, it would be useful to have a boolean declared in Exception's classes which will allow last traceback entry rendering or not. ---------- components: Interpreter Core files: traceback_rendering.py messages: 126871 nosy: Kain94 priority: normal severity: normal status: open title: traceback's rendering behavior while throwing custom exception type: feature request versions: Python 3.1 Added file: http://bugs.python.org/file20488/traceback_rendering.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 07:06:10 2011 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 23 Jan 2011 06:06:10 +0000 Subject: [New-bugs-announce] [issue10987] Bizarre pickle -- exception interaction bug In-Reply-To: <1295762770.11.0.0669999171717.issue10987@psf.upfronthosting.co.za> Message-ID: <1295762770.11.0.0669999171717.issue10987@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Tool/scripts/find_recursionlimit.py includes test_cpickle() which, like the other test_xxx functions, is supposed to raise a RuntimeError when the recursion limit is reached. It appears to work correctly on 3.1 and I presume previously. On 3.2, test_cpickle() hangs. Here is much reduced code that shows the behavior: import itertools import io import _pickle # extracted from 'def test_cpickle' and condensed: l = None for n in itertools.count(): try: raise KeyError except KeyError: for i in range(100): l = [l] print(n,i) _pickle.Pickler(io.BytesIO(), protocol=-1).dump(l) The added print line prints 0,99 1,99, ... indefinitely. If the recursive list l is added to the print function, the attempt to create repr(l) raises a runtime error at n = 9. If we remove the try-except part: l = None for n in itertools.count(): for i in range(100): l = [l] print(n,i) _pickle.Pickler(io.BytesIO(), protocol=-1).dump(l) *pickle* now raises a RuntimeError, as expected in the original context, at n=4! 1. I do not actually know which behavior is buggy. I suppose the next step would be to capture and not toss the pickle output to see what is the difference. 2. At least for the present, I think the call to test_cpickle should be commented out in find_recursionlimit.py. There seems to be other pickle and recursive structure issues, like #9269, but I did not see any the same as this. ---------- files: frl_pickle1.py messages: 126874 nosy: belopolsky, pitrou, terry.reedy priority: normal severity: normal status: open title: Bizarre pickle -- exception interaction bug type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file20489/frl_pickle1.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 19:38:05 2011 From: report at bugs.python.org (Joshua Arnold) Date: Sun, 23 Jan 2011 18:38:05 +0000 Subject: [New-bugs-announce] [issue10988] Descriptor protocol documentation for super bindings is incorrect In-Reply-To: <1295807885.2.0.206629380861.issue10988@psf.upfronthosting.co.za> Message-ID: <1295807885.2.0.206629380861.issue10988@psf.upfronthosting.co.za> New submission from Joshua Arnold : In 'Doc/reference/datamodel.rst', the 'Invoking Descriptors' documentation specifies the following behavior for super objects: [snip] Super Binding If ``a`` is an instance of :class:`super`, then the binding ``super(B, obj).m()`` searches ``obj.__class__.__mro__`` for the base class ``A`` immediately preceding ``B`` and then invokes the descriptor with the call: ``A.__dict__['m'].__get__(obj, A)``. [snip] In the above paragrah, the call: A.__dict__['m'].__get__(obj, A) is incorrect. In reality, the descriptor is invoked via: A.__dict__['m'].__get__(obj, obj.__class__) Loosely speaking, the 'owner' argument is set to the subclass associated with the super object, not the superclass. There is a similar error in the 'Descriptor HowTo Guide' under 'Invoking Descriptors' (Strictly speaking, the specification is inaccurate on some other points. It assumes obj is not a class and doesn't state that the entire mro preceding 'B' is searched for 'm'. But those may be considered simplifications for the sake of brevity) I considered reporting this as a bug in the implementation rather than the specification. But I think the implementation's algorithm is the correct one. In particular, it yields the desired behavior for classmethods In any case, the current behavior has been around for a while (it was the fix for issue #535444, dating back to 2.2) Code demonstrating the current behavior: class Desc(object): def __get__(self, instance, owner): return owner class A(object): attr = Desc() class B(A): pass class C(B): pass instance = C() assert super(B,instance).attr == C assert super(B,C).attr == C #According to the specification, the assertions should be: #assert super(B,instance).attr == A #assert super(B,C).attr == A ---------- assignee: docs at python components: Documentation messages: 126895 nosy: Joshua.Arnold, docs at python priority: normal severity: normal status: open title: Descriptor protocol documentation for super bindings is incorrect versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 23 23:02:05 2011 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jan 2011 22:02:05 +0000 Subject: [New-bugs-announce] [issue10989] ssl.SSLContext(True).load_verify_locations(None, True) segfault In-Reply-To: <1295820125.73.0.864692220479.issue10989@psf.upfronthosting.co.za> Message-ID: <1295820125.73.0.864692220479.issue10989@psf.upfronthosting.co.za> New submission from STINNER Victor : ssl.SSLContext(True).load_verify_locations(None, True) does segfault. Py_DECREF(cafile_bytes) in Modules/_ssl.c:1686 should be replaced by Py_XDECREF(cafile_bytes). ---------- components: Library (Lib) messages: 126901 nosy: haypo, pitrou priority: normal severity: normal status: open title: ssl.SSLContext(True).load_verify_locations(None, True) segfault versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 00:21:16 2011 From: report at bugs.python.org (Brett Cannon) Date: Sun, 23 Jan 2011 23:21:16 +0000 Subject: [New-bugs-announce] [issue10990] tests mutating sys.gettrace() w/o re-instating previous state In-Reply-To: <1295824876.68.0.687534068337.issue10990@psf.upfronthosting.co.za> Message-ID: <1295824876.68.0.687534068337.issue10990@psf.upfronthosting.co.za> New submission from Brett Cannon : The attached patch adds resource monitoring to test.regrtest to detect which tests are changing the trace function w/o putting back to what it was previously. The tests listed below are thus all being naughty. This is a meta-issue to help track which tests need to be changed to stop this behavior. test_doctest test_exceptions test_io test_pdb test_pickle test_pickletools test_richcmp test_runpy test_scope test_sys_settrace test_zipimport_support ---------- components: Tests files: sys_gettrace_monitor.diff keywords: patch messages: 126908 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: tests mutating sys.gettrace() w/o re-instating previous state type: behavior versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file20498/sys_gettrace_monitor.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 00:31:12 2011 From: report at bugs.python.org (Brett Cannon) Date: Sun, 23 Jan 2011 23:31:12 +0000 Subject: [New-bugs-announce] [issue10991] trace fails when test imported a temporary file In-Reply-To: <1295825472.67.0.685273364418.issue10991@psf.upfronthosting.co.za> Message-ID: <1295825472.67.0.685273364418.issue10991@psf.upfronthosting.co.za> New submission from Brett Cannon : If you run ``test.regrtest -T`` you will discover that (at least) test_importlib and test_runpy prevent coverage data from being written out as 'trace' will try to find files which no longer exist. Both test suites create temp files, import them, and then delete them. Unfortunately 'trace' doesn't ignore that fact and throws an exception that the temporary files are gone. Since the file is simply gone it probably makes sense to have 'trace' just print out a warning that the file could not be found and move on. ---------- components: Library (Lib) messages: 126909 nosy: brett.cannon priority: normal severity: normal stage: unit test needed status: open title: trace fails when test imported a temporary file type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 03:27:06 2011 From: report at bugs.python.org (Brett Cannon) Date: Mon, 24 Jan 2011 02:27:06 +0000 Subject: [New-bugs-announce] [issue10992] tests failing when run under coverage In-Reply-To: <1295836026.73.0.339636680883.issue10992@psf.upfronthosting.co.za> Message-ID: <1295836026.73.0.339636680883.issue10992@psf.upfronthosting.co.za> New submission from Brett Cannon : A bunch of tests fail when run under coverage (trend seems to be refcount tests). This is to act as a meta-issue to keep track of what tests need to be fixed. [fail under both coverage.py and regrtest -T] test_ctypes test_descr test_gc test_metaclass test_pydoc test_trace [coverage.py only] test_genexps test_sys [regrtest -T only] test_array test_importlib test_runpy ---------- components: Tests messages: 126913 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: tests failing when run under coverage type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 11:51:43 2011 From: report at bugs.python.org (Tanakorn Leesatapornwongsa) Date: Mon, 24 Jan 2011 10:51:43 +0000 Subject: [New-bugs-announce] [issue10993] HTTPSConnection does not close when call close() method In-Reply-To: <1295866303.79.0.709048263214.issue10993@psf.upfronthosting.co.za> Message-ID: <1295866303.79.0.709048263214.issue10993@psf.upfronthosting.co.za> New submission from Tanakorn Leesatapornwongsa : With this code on python 2.6, I found that HTTPSConnection does not close connection properly. from httplib import HTTPSConnection for i in range(1000): https = HTTPSConnection("google.com") https.connect() https.request("GET", "/") response = https.getresponse() response.close() https.close() print i After searching python library, I guess that in ssl.py, implementation of close() method of SSLSocket is wrong. socket.close(self) should not be called when self._makefile_refs < 1 but should be call when self._makefile_refs == 1, isn't it? I modified the code, made the patch and attached it with this issue. ---------- components: Library (Lib) files: ssl.py.patch keywords: patch messages: 126919 nosy: tanakorn priority: normal severity: normal status: open title: HTTPSConnection does not close when call close() method type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file20501/ssl.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 14:43:40 2011 From: report at bugs.python.org (Maciej Fijalkowski) Date: Mon, 24 Jan 2011 13:43:40 +0000 Subject: [New-bugs-announce] [issue10994] implementation details in sys module In-Reply-To: <1295876620.3.0.027428786588.issue10994@psf.upfronthosting.co.za> Message-ID: <1295876620.3.0.027428786588.issue10994@psf.upfronthosting.co.za> New submission from Maciej Fijalkowski : sys module documentation (as it is online) has some things that in my opinion should be marked as implementation details, but are not. Feel free to counter why not. Some of them has info it should be used for specialized purposes only, but IMO it's not the same as not mandatory for other implementations. Temporary list: _clear_type_cache dllhandle getrefcount getdlopenflags (?) getsizeof - it might be not well defined on other implementations setdlopenflags api_version ---------- assignee: docs at python components: Documentation messages: 126925 nosy: docs at python, fijall priority: normal severity: normal status: open title: implementation details in sys module type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 15:23:46 2011 From: report at bugs.python.org (Steffen Daode Nurpmeso) Date: Mon, 24 Jan 2011 14:23:46 +0000 Subject: [New-bugs-announce] [issue10995] mailbox.py open() calls don't set encoding In-Reply-To: <1295879026.46.0.299345130238.issue10995@psf.upfronthosting.co.za> Message-ID: <1295879026.46.0.299345130238.issue10995@psf.upfronthosting.co.za> New submission from Steffen Daode Nurpmeso : I'm using the en_GB.UTF-8 locale and thus the entire I/O layer defaults to use UTF-8 encoding. Perfect. The problem is that mailboxes are *not* and *never* in UTF-8, generally speaking, according to RFC mail standards! So i suggest that mailbox.py either offers additional 'encoding="latin1"' constructor arguments or always uses "latin1" in open() calls. This suffices to make mailbox.py usable - i.e., the mailbox will be loaded/saved without causing encoder errors, and email.py will behave correctly according to message *content* anyway! P.S.: i am far from being a Python(1) freak and feel a bit lost on *.python.org, so i might have blown the wrong whistles too load. Sorry, if this is the case. Thanks for python(1), it's damn slow and i love C and Perl. ;-) ---------- components: Library (Lib) messages: 126930 nosy: Steffen.Daode.Nurpmeso priority: normal severity: normal status: open title: mailbox.py open() calls don't set encoding type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 18:50:59 2011 From: report at bugs.python.org (Daniel Urban) Date: Mon, 24 Jan 2011 17:50:59 +0000 Subject: [New-bugs-announce] [issue10996] Typo in What's New in 3.2 In-Reply-To: <1295891459.95.0.208045787052.issue10996@psf.upfronthosting.co.za> Message-ID: <1295891459.95.0.208045787052.issue10996@psf.upfronthosting.co.za> New submission from Daniel Urban : In http://docs.python.org/dev/py3k/whatsnew/3.2.html#abc the example has two typos: farenheit -> fahrenheit celsium -> celsius ---------- assignee: docs at python components: Documentation messages: 126938 nosy: docs at python, durban priority: normal severity: normal status: open title: Typo in What's New in 3.2 type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 19:35:16 2011 From: report at bugs.python.org (Ned Deily) Date: Mon, 24 Jan 2011 18:35:16 +0000 Subject: [New-bugs-announce] [issue10997] Duplicate entries in IDLE "Recent Files" menu item on OS X In-Reply-To: <1295894116.03.0.647571188002.issue10997@psf.upfronthosting.co.za> Message-ID: <1295894116.03.0.647571188002.issue10997@psf.upfronthosting.co.za> New submission from Ned Deily : When IDLE is run with an OS X Aqua Tk (Carbon 8.4 or Cocoa 8.5), using the File -> Recent Files menu item to open a previously used file causes that file to show up a second time in the updated menu item and with the same keyboard shortcut. With X11-based Tk on OS X, no duplicate is seen. The problem stems from a difference in the way the Tk versions generate sub menus. With the X11 Tk the sub menu appears to start with a separator in menu index 0 and the first file is added in index 1. With Aqua Tk, there is no separator and the first file is in index 0. The code in IDLE to update the menu deletes from 1 to END so, with Aqua Tk, the file name inserted into index 0 is not removed. The attached patch fixes the problem with Aqua Tk and appears to cause no problems with a current X11 Tk 8.5 on OS X. Before committing it, though, it should be tested on Windows, which I'm not currently set up to do. ---------- assignee: ned.deily files: issue_idle_dup_recent.patch keywords: patch messages: 126941 nosy: ned.deily priority: normal severity: normal status: open title: Duplicate entries in IDLE "Recent Files" menu item on OS X type: behavior versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20504/issue_idle_dup_recent.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 20:25:50 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 24 Jan 2011 19:25:50 +0000 Subject: [New-bugs-announce] [issue10998] Remove last traces of -Q / sys.flags.division_warning / Py_DivisionWarningFlag In-Reply-To: <1295897150.32.0.288530737397.issue10998@psf.upfronthosting.co.za> Message-ID: <1295897150.32.0.288530737397.issue10998@psf.upfronthosting.co.za> New submission from ?ric Araujo : The -Q command-line option has been removed in Python 3 but there are some leftovers. Attached patch removes them; tests pass; please review. I think 3.1 should be fixed too, since no sane program should use those leftovers. I removed the now-pointless tests in test_cmd_line. They were not failing; this may be a bug in verify_valid_flag, out of scope for this report. While I was editing the table used to document sys.flags, I added some link-generating markup (to the respective option doc) and made the table markup easier to read and edit. I can make those changes in another commit if you prefer it. ---------- assignee: eric.araujo components: Interpreter Core files: division_warning.diff keywords: needs review, patch messages: 126943 nosy: benjamin.peterson, eric.araujo, georg.brandl priority: normal severity: normal stage: commit review status: open title: Remove last traces of -Q / sys.flags.division_warning / Py_DivisionWarningFlag type: behavior versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20505/division_warning.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 20:41:15 2011 From: report at bugs.python.org (R. David Murray) Date: Mon, 24 Jan 2011 19:41:15 +0000 Subject: [New-bugs-announce] [issue10999] os.chflags refers to stat constants, but the constants are not documented in the stat module In-Reply-To: <1295898075.1.0.406467023745.issue10999@psf.upfronthosting.co.za> Message-ID: <1295898075.1.0.406467023745.issue10999@psf.upfronthosting.co.za> New submission from R. David Murray : Title pretty much says it all. The constants are there in the stat module, but they aren't documented. When they are documented the mentions in the os.chflags entry can be turned into cross reference links. ---------- assignee: docs at python messages: 126947 nosy: docs at python, r.david.murray priority: normal severity: normal stage: needs patch status: open title: os.chflags refers to stat constants, but the constants are not documented in the stat module type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 21:07:58 2011 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 24 Jan 2011 20:07:58 +0000 Subject: [New-bugs-announce] [issue11000] Doc: ast.parse parses source, not just expressions In-Reply-To: <1295899678.27.0.449949701251.issue11000@psf.upfronthosting.co.za> Message-ID: <1295899678.27.0.449949701251.issue11000@psf.upfronthosting.co.za> New submission from Terry J. Reedy : "ast.parse(expr, filename='', mode='exec') Parse an expression into an AST node. Equivalent to compile(expr, filename, mode, ast.PyCF_ONLY_AST)." but "compile(source, ...) Compile the source into a code or AST object. ... The mode argument specifies what kind of code must be compiled; it can be 'exec' if source consists of a sequence of statements," and indeed, with all three versions, >>> import ast >>> e3=ast.parse('x=1; y=2\nif x: print(y)') >>> o3 = compile(e3,'','exec') >>> exec(o3) 2 >>> print(x,y) (1, 2) Attached patch (untested) changes doc and doc string. Inquiry: I suspect that the filename is *not* attached to the ast. (In any case, it must be explicitly supplied to a subsequent compile() call.) If so, it is a useless parameter and the api and doc should be parse(source, mode) ... Equivalent to compile(source, '', ... If so, and failing such a change, should the doc warn people to not bother supplying a filename arg? I also wonder whether the mode arg has any effect on the ast. If not, same question. ---------- assignee: docs at python components: Documentation files: zast.diff keywords: patch messages: 126952 nosy: docs at python, georg.brandl, terry.reedy priority: normal severity: normal status: open title: Doc: ast.parse parses source, not just expressions versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20506/zast.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 24 23:27:45 2011 From: report at bugs.python.org (Luke Plant) Date: Mon, 24 Jan 2011 22:27:45 +0000 Subject: [New-bugs-announce] [issue11001] Various obvious errors in cookies documentation In-Reply-To: <1295908065.55.0.221906287574.issue11001@psf.upfronthosting.co.za> Message-ID: <1295908065.55.0.221906287574.issue11001@psf.upfronthosting.co.za> New submission from Luke Plant : Docs for SimpleCookie, BaseCookie.value_encode and BaseCookie.value_decode are obviously incorrect. Attempt at patch attached. The error has existed in every Python version I've seen, I've tagged the ones I believe can receive fixes, sorry if I've made a mistake. Thanks. ---------- assignee: docs at python components: Documentation files: http_cookies_doc_corrections.diff keywords: patch messages: 126962 nosy: docs at python, spookylukey priority: normal severity: normal status: open title: Various obvious errors in cookies documentation versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20507/http_cookies_doc_corrections.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 05:44:24 2011 From: report at bugs.python.org (Anthony Long) Date: Tue, 25 Jan 2011 04:44:24 +0000 Subject: [New-bugs-announce] [issue11002] 'Upload' link on Files page is broken In-Reply-To: <1295930664.52.0.312765274224.issue11002@psf.upfronthosting.co.za> Message-ID: <1295930664.52.0.312765274224.issue11002@psf.upfronthosting.co.za> New submission from Anthony Long : On pypi, when you are inside of your packages' files area, the link that is attached to 1. Use the setup.py "upload" command. # "upload" is broken, it links to http://www.python.org/doc/dist/package-upload.html which returns a 404. http://d.pr/mmie ---------- assignee: docs at python components: Documentation messages: 126988 nosy: antlong, docs at python priority: normal severity: normal status: open title: 'Upload' link on Files page is broken type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 11:41:56 2011 From: report at bugs.python.org (Jakob Bowyer) Date: Tue, 25 Jan 2011 10:41:56 +0000 Subject: [New-bugs-announce] [issue11003] os.system should be deprecated in favour of subprocess module In-Reply-To: <1295952116.86.0.340970955055.issue11003@psf.upfronthosting.co.za> Message-ID: <1295952116.86.0.340970955055.issue11003@psf.upfronthosting.co.za> New submission from Jakob Bowyer : os.system is broken in several fundamental ways. We already have the subprocess module for accessing other processes, lets send os.system the same way as os.Popen. ---------- components: Library (Lib) messages: 126995 nosy: Jakob.Bowyer priority: normal severity: normal status: open title: os.system should be deprecated in favour of subprocess module 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 Tue Jan 25 13:36:09 2011 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2011 12:36:09 +0000 Subject: [New-bugs-announce] [issue11004] AssertionError on collections.deque().count(1) In-Reply-To: <1295958969.45.0.0394925969904.issue11004@psf.upfronthosting.co.za> Message-ID: <1295958969.45.0.0394925969904.issue11004@psf.upfronthosting.co.za> New submission from STINNER Victor : Attached script, bug.py, ends with: $ python3.2 source2.py deque.remove(x): x not in deque python: ./Modules/_collectionsmodule.c:536: deque_count: Assertion `leftblock->rightlink != ((void *)0)' failed. Abandon (core dumped) ---------- components: Library (Lib) files: bug.py messages: 127001 nosy: haypo priority: normal severity: normal status: open title: AssertionError on collections.deque().count(1) type: crash versions: Python 3.2 Added file: http://bugs.python.org/file20512/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 13:44:28 2011 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jan 2011 12:44:28 +0000 Subject: [New-bugs-announce] [issue11005] Assertion error on RLock._acquire_restore In-Reply-To: <1295959468.18.0.305168366567.issue11005@psf.upfronthosting.co.za> Message-ID: <1295959468.18.0.305168366567.issue11005@psf.upfronthosting.co.za> New submission from STINNER Victor : Attached script (bug2.py) ends with: $ ~/prog/SVN/py3k/python bug2.py python: ./Modules/_threadmodule.c:399: rlock_acquire_restore: Assertion `self->rlock_count == 0' failed. Abandon It should raise a classic Python exception, instead of stopping with a fatal assertion error. ---------- components: Library (Lib) files: bug2.py messages: 127004 nosy: haypo priority: normal severity: normal status: open title: Assertion error on RLock._acquire_restore versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file20513/bug2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 15:30:09 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 25 Jan 2011 14:30:09 +0000 Subject: [New-bugs-announce] [issue11006] warnings with subprocess and pipe2 In-Reply-To: <1295965809.48.0.183733964181.issue11006@psf.upfronthosting.co.za> Message-ID: <1295965809.48.0.183733964181.issue11006@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Since r87651, subprocess can raise a RuntimeWarning if pipe2() fails. I'm not sure there's any point in that, since it's very low-level and it's nothing the user can do about anyway. Ironically, there is no warning if pipe2() is not available at all. ---------- components: Library (Lib) messages: 127011 nosy: georg.brandl, gregory.p.smith, pitrou priority: normal severity: normal status: open title: warnings with subprocess and pipe2 type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 16:12:25 2011 From: report at bugs.python.org (Joshua Blount) Date: Tue, 25 Jan 2011 15:12:25 +0000 Subject: [New-bugs-announce] [issue11007] stack tracebacks should give the relevant class name In-Reply-To: <1295968345.3.0.31737747868.issue11007@psf.upfronthosting.co.za> Message-ID: <1295968345.3.0.31737747868.issue11007@psf.upfronthosting.co.za> New submission from Joshua Blount : When I get a stack traceback, it would be very handy if the traceback gave me the relevant class name (along with all the current information). ---------- components: Interpreter Core messages: 127015 nosy: stickwithjosh priority: normal severity: normal status: open title: stack tracebacks should give the relevant class name 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 Jan 25 18:18:34 2011 From: report at bugs.python.org (Day Barr) Date: Tue, 25 Jan 2011 17:18:34 +0000 Subject: [New-bugs-announce] [issue11008] logging.dictConfig not documented as new in version 2.7 In-Reply-To: <1295975914.25.0.0685930703721.issue11008@psf.upfronthosting.co.za> Message-ID: <1295975914.25.0.0685930703721.issue11008@psf.upfronthosting.co.za> New submission from Day Barr : logging.dictConfig is new in version 2.7 but the documentation does not say this. http://docs.python.org/release/2.7/library/logging.html#logging.dictConfig c.f. NullHandler, also new in version 2.7 and explicitly documented as such: http://docs.python.org/release/2.7/library/logging.html#nullhandler ---------- assignee: docs at python components: Documentation messages: 127024 nosy: daybarr, docs at python priority: normal severity: normal status: open title: logging.dictConfig not documented as new in version 2.7 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 21:24:38 2011 From: report at bugs.python.org (anatoly techtonik) Date: Tue, 25 Jan 2011 20:24:38 +0000 Subject: [New-bugs-announce] [issue11009] urllib.splituser is not documented In-Reply-To: <1295987078.02.0.421774194417.issue11009@psf.upfronthosting.co.za> Message-ID: <1295987078.02.0.421774194417.issue11009@psf.upfronthosting.co.za> New submission from anatoly techtonik : I'm studying old code that uses urllib.splituser() call and can't find description of this function in Python 2.6.6 docs. ---------- assignee: docs at python components: Documentation messages: 127047 nosy: docs at python, techtonik priority: normal severity: normal status: open title: urllib.splituser is not documented versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 22:25:59 2011 From: report at bugs.python.org (onpon4) Date: Tue, 25 Jan 2011 21:25:59 +0000 Subject: [New-bugs-announce] [issue11010] Unicode BOM left in loaded text In-Reply-To: <1295990759.68.0.350940217236.issue11010@psf.upfronthosting.co.za> Message-ID: <1295990759.68.0.350940217236.issue11010@psf.upfronthosting.co.za> New submission from onpon4 : This is for Python 2.7.1. It isn't an issue on 2.6.5 and I haven't tested it on 3.1. Quite simply, the Unicode BOM (unichr(65279)) is included in the text loaded from a UTF-8 text file. This can cause issues in some cases, but is easily worked around by calling "s.strip(unichr(65279))" on the first line of loaded text. ---------- components: IO, Unicode messages: 127055 nosy: onpon4 priority: normal severity: normal status: open title: Unicode BOM left in loaded text type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jan 25 23:32:22 2011 From: report at bugs.python.org (Jason Baker) Date: Tue, 25 Jan 2011 22:32:22 +0000 Subject: [New-bugs-announce] [issue11011] More functools functions In-Reply-To: <1295994742.19.0.341586360497.issue11011@psf.upfronthosting.co.za> Message-ID: <1295994742.19.0.341586360497.issue11011@psf.upfronthosting.co.za> New submission from Jason Baker : I've created a patch that adds some common functional programming tools to functools. I've made the patch to work against Python 3.2, but that may be a bit aggressive. If so, then I can adapt it to work with 3.3. I also wouldn't be opposed to writing some of these in C if there's a performance need. The functions I added are: * flip - flip the first two arguments of a function * const - return a function that always returns the same thing * compose - compose multiple functions together * identity - returns what is passed in to it * trampoline - calls a function and then calls any returned functions. ---------- components: Library (Lib) files: functools.patch keywords: patch messages: 127062 nosy: Jason.Baker priority: normal severity: normal status: open title: More functools functions versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file20520/functools.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 00:25:01 2011 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 Jan 2011 23:25:01 +0000 Subject: [New-bugs-announce] [issue11012] Add log1p(), exp1m(), gamma(), and lgamma() to cmath In-Reply-To: <1295997901.71.0.113497713942.issue11012@psf.upfronthosting.co.za> Message-ID: <1295997901.71.0.113497713942.issue11012@psf.upfronthosting.co.za> New submission from Raymond Hettinger : Where it makes sense, cmath needs to stay in-sync with the math module as much as possible: >>> set(dir(math)) - set(dir(cmath)) {'pow', 'fsum', 'ldexp', 'hypot', 'fabs', 'floor', 'lgamma', 'frexp', 'degrees', 'modf', 'factorial', 'copysign', 'ceil', 'trunc', 'expm1', 'radians', 'atan2', 'erf', 'erfc', 'fmod', 'log1p', 'gamma'} At some point, it may make sense to implement cmath.fsum() along the lines of: c_fsum = lambda iterable: complex(*map(fsum, zip(*((z.real, z.imag) for z in iterable)))) ---------- assignee: mark.dickinson components: Extension Modules messages: 127070 nosy: mark.dickinson, rhettinger priority: normal severity: normal stage: needs patch status: open title: Add log1p(), exp1m(), gamma(), and lgamma() to cmath type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 03:10:32 2011 From: report at bugs.python.org (Geoge R. Goffe) Date: Wed, 26 Jan 2011 02:10:32 +0000 Subject: [New-bugs-announce] [issue11013] Build of CVS version 2.7 fails in readline In-Reply-To: <1296007832.48.0.816263940952.issue11013@psf.upfronthosting.co.za> Message-ID: <1296007832.48.0.816263940952.issue11013@psf.upfronthosting.co.za> New submission from Geoge R. Goffe : Howdy, I just updated my copy of the SVN version of 2.7 and got the following error messages. Did I do something wrong? Regards, George... building dbm using bdb building 'readline' extension gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -g -O0 -Wall -Wstrict-prototypes -I/usr/lsd/Linux/include -I. -IInclude -I./Include -I/usr/local/include -I/usr/local/google/tools/python/release27-maint/Include -I/usr/local/google/tools/python/release27-maint -c /usr/local/google/tools/python/release27-maint/Modules/readline.c -o build/temp.linux-x86_64-2.7-pydebug/usr/local/google/tools/python/release27-maint/Modules/readline.o /usr/local/google/tools/python/release27-maint/Modules/readline.c: In function ?write_history_file?: /usr/local/google/tools/python/release27-maint/Modules/readline.c:147: warning: implicit declaration of function ?history_truncate_file? /usr/local/google/tools/python/release27-maint/Modules/readline.c: In function ?_py_free_history_entry?: /usr/local/google/tools/python/release27-maint/Modules/readline.c:385: warning: passing argument 1 of ?free? discards qualifiers from pointer target type /usr/include/stdlib.h:488: note: expected ?void *? but argument is of type ?const char *? /usr/local/google/tools/python/release27-maint/Modules/readline.c: In function ?py_replace_history?: /usr/local/google/tools/python/release27-maint/Modules/readline.c:436: warning: implicit declaration of function ?replace_history_entry? /usr/local/google/tools/python/release27-maint/Modules/readline.c:436: warning: assignment makes pointer from integer without a cast /usr/local/google/tools/python/release27-maint/Modules/readline.c: In function ?_py_get_history_length?: /usr/local/google/tools/python/release27-maint/Modules/readline.c:523: error: ?HISTORY_STATE? undeclared (first use in this function) /usr/local/google/tools/python/release27-maint/Modules/readline.c:523: error: (Each undeclared identifier is reported only once /usr/local/google/tools/python/release27-maint/Modules/readline.c:523: error: for each function it appears in.) /usr/local/google/tools/python/release27-maint/Modules/readline.c:523: error: ?hist_st? undeclared (first use in this function) /usr/local/google/tools/python/release27-maint/Modules/readline.c:523: warning: implicit declaration of function ?history_get_history_state? /usr/local/google/tools/python/release27-maint/Modules/readline.c: In function ?insert_text?: /usr/local/google/tools/python/release27-maint/Modules/readline.c:628: warning: implicit declaration of function ?rl_insert_text? /usr/local/google/tools/python/release27-maint/Modules/readline.c: In function ?flex_complete?: /usr/local/google/tools/python/release27-maint/Modules/readline.c:847: error: ?rl_completion_suppress_append? undeclared (first use in this function) /usr/local/google/tools/python/release27-maint/Modules/readline.c:853: warning: implicit declaration of function ?rl_completion_matches? /usr/local/google/tools/python/release27-maint/Modules/readline.c:853: error: ?rl_compentry_func_t? undeclared (first use in this function) /usr/local/google/tools/python/release27-maint/Modules/readline.c:853: error: expected expression before ?)? token /usr/local/google/tools/python/release27-maint/Modules/readline.c: In function ?setup_readline?: /usr/local/google/tools/python/release27-maint/Modules/readline.c:886: warning: passing argument 2 of ?rl_bind_key_in_map? from incompatible pointer type /usr/lsd/Linux/include/readline/readline.h:195: note: expected ?int (*)(const char *, int)? but argument is of type ?int (*)(int, int)? /usr/local/google/tools/python/release27-maint/Modules/readline.c:887: warning: passing argument 2 of ?rl_bind_key_in_map? from incompatible pointer type /usr/lsd/Linux/include/readline/readline.h:195: note: expected ?int (*)(const char *, int)? but argument is of type ?int (*)(int, int)? /usr/local/google/tools/python/release27-maint/Modules/readline.c: In function ?readline_until_enter_or_signal?: /usr/local/google/tools/python/release27-maint/Modules/readline.c:940: error: ?rl_catch_signals? undeclared (first use in this function) /usr/local/google/tools/python/release27-maint/Modules/readline.c:979: warning: implicit declaration of function ?rl_free_line_state? /usr/local/google/tools/python/release27-maint/Modules/readline.c:980: warning: implicit declaration of function ?rl_cleanup_after_signal? Python build finished, but the necessary bits to build these modules were not found: bsddb185 dl gdbm imageop sunaudiodev To find the necessary bits, look in setup.py in detect_modules() for the module's name. Failed to build these modules: readline ---------- components: Build messages: 127080 nosy: grgoffe at yahoo.com priority: normal severity: normal status: open title: Build of CVS version 2.7 fails in readline type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 03:27:25 2011 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 Jan 2011 02:27:25 +0000 Subject: [New-bugs-announce] [issue11014] 'filter' argument for Tarfile.add needs to be a keyword-only argument In-Reply-To: <1296008845.92.0.0968306232323.issue11014@psf.upfronthosting.co.za> Message-ID: <1296008845.92.0.0968306232323.issue11014@psf.upfronthosting.co.za> New submission from Raymond Hettinger : In 3.2, tarfile.Tarfile added a 'filter' argument while deprecating the 'exclude' argument that precedes it positionally. The 'filter' argument needs to be keyword-only argument, or any code that uses it positionally will fail when the 'exclude' argument is ultimately removed. ---------- assignee: georg.brandl components: Library (Lib) files: tarfile.patch keywords: patch messages: 127083 nosy: georg.brandl, rhettinger priority: high severity: normal stage: patch review status: open title: 'filter' argument for Tarfile.add needs to be a keyword-only argument type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file20524/tarfile.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 03:46:09 2011 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 26 Jan 2011 02:46:09 +0000 Subject: [New-bugs-announce] [issue11015] Bring test.support docs up to date In-Reply-To: <1296009969.38.0.282241852849.issue11015@psf.upfronthosting.co.za> Message-ID: <1296009969.38.0.282241852849.issue11015@psf.upfronthosting.co.za> New submission from Nick Coghlan : The test.support docs are there to help CPython devs with writing good unit tests more easily. There are a few additions we've made in recent years that haven't made it into the .rst file, so it is easy to miss useful tools if you don't go looking through the module source code. There are some other helper modules (such as test.script_helper) that could also stand to be made easier to find. Fixing this is just a matter of doing a pass through test.support and the test directory looking for things that might be worth mentioning in the test package docs. ---------- assignee: docs at python keywords: easy messages: 127086 nosy: docs at python, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Bring test.support docs up to date type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 11:57:26 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 26 Jan 2011 10:57:26 +0000 Subject: [New-bugs-announce] [issue11016] Add S_ISDOOR to the stat module In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Solaris has an additional kind of special files named doors. The standard headers define the following macro: #define S_ISDOOR(mode) (((mode)&0xF000) == 0xd000) Perhaps it would be nice to include the equivalent in the stat module. (although funnily even the "stat" command doesn't recognize them and displayed "weird file" instead: $ stat /var/run/syslog_door File: `/var/run/syslog_door' Size: 0 Blocks: 0 IO Block: 0 weird file Device: 8bc0000h/146538496d Inode: 44 Links: 1 Access: (0644/Drw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2011-01-26 11:52:34.332492612 +0100 Modify: 2011-01-26 11:52:34.332492612 +0100 Change: 2011-01-26 11:52:34.332499428 +0100 ) ---------- components: Library (Lib) messages: 127100 nosy: jcea, loewis, movement, pitrou priority: normal severity: normal status: open title: Add S_ISDOOR to the stat module type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 13:29:24 2011 From: report at bugs.python.org (hensing) Date: Wed, 26 Jan 2011 12:29:24 +0000 Subject: [New-bugs-announce] [issue11017] optparse: error: invalid integer value In-Reply-To: <1296044964.44.0.826782436299.issue11017@psf.upfronthosting.co.za> Message-ID: <1296044964.44.0.826782436299.issue11017@psf.upfronthosting.co.za> New submission from hensing : OptionParser can't parse int "08" and "09". "8", "9" and "01..07" works. ---------- components: Library (Lib) files: minimal.py messages: 127106 nosy: hensing priority: normal severity: normal status: open title: optparse: error: invalid integer value type: crash versions: Python 2.6 Added file: http://bugs.python.org/file20531/minimal.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 14:36:59 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 26 Jan 2011 13:36:59 +0000 Subject: [New-bugs-announce] [issue11018] typo in test_bz2 In-Reply-To: <1296049019.27.0.765900313708.issue11018@psf.upfronthosting.co.za> Message-ID: <1296049019.27.0.765900313708.issue11018@psf.upfronthosting.co.za> New submission from Antoine Pitrou : This was found by Nadeem in issue5863. Index: Lib/test/test_bz2.py =================================================================== --- Lib/test/test_bz2.py (r?vision 88199) +++ Lib/test/test_bz2.py (copie de travail) @@ -86,7 +86,7 @@ if not str: break text += str - self.assertEqual(text, text) + self.assertEqual(text, self.TEXT) def testRead100(self): # "Test BZ2File.read(100)" ---------- components: Tests messages: 127116 nosy: georg.brandl, pitrou priority: normal severity: normal stage: patch review status: open title: typo in test_bz2 type: behavior versions: Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jan 26 21:57:16 2011 From: report at bugs.python.org (R. David Murray) Date: Wed, 26 Jan 2011 20:57:16 +0000 Subject: [New-bugs-announce] [issue11019] BytesGenerator fails if the Message body is None In-Reply-To: <1296075436.52.0.0716312714806.issue11019@psf.upfronthosting.co.za> Message-ID: <1296075436.52.0.0716312714806.issue11019@psf.upfronthosting.co.za> New submission from R. David Murray : This was discovered by Haypo during work on #9124. I'll attach a patch with test shortly. ---------- assignee: r.david.murray messages: 127139 nosy: r.david.murray priority: high severity: normal stage: commit review status: open title: BytesGenerator fails if the Message body is None type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 00:29:00 2011 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 Jan 2011 23:29:00 +0000 Subject: [New-bugs-announce] [issue11020] Pyclbr broken because of missing 2-to-3 conversion In-Reply-To: <1296084540.01.0.814516700337.issue11020@psf.upfronthosting.co.za> Message-ID: <1296084540.01.0.814516700337.issue11020@psf.upfronthosting.co.za> New submission from Raymond Hettinger : The command line invocation of pyclbr failed because of a 2-to-3 error. The dict.values() call returns a dictview which doesn't support the sort() method. Invoke with: $ python -m pyclbr Lib/collections.py ---------- components: Library (Lib) messages: 127156 nosy: rhettinger priority: high severity: normal stage: patch review status: open title: Pyclbr broken because of missing 2-to-3 conversion type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 00:47:25 2011 From: report at bugs.python.org (David Caro) Date: Wed, 26 Jan 2011 23:47:25 +0000 Subject: [New-bugs-announce] [issue11021] email MIME-Version headers for each part in multipart message In-Reply-To: <1296085645.01.0.978524639714.issue11021@psf.upfronthosting.co.za> Message-ID: <1296085645.01.0.978524639714.issue11021@psf.upfronthosting.co.za> New submission from David Caro : When attaching a subpart to a multipart message, python should follow the recomendations of the rfcs and remove the MIME-Version header of each part, leaving only one MIME-Version header at the beggining of the message. >>> from email.mime.multipart import MIMEMultipart >>> from email.mime.text import MIMEText >>> usermail=MIMEMultipart('alternative') >>> part=MIMEText('text') >>> print part >From nobody Thu Jan 27 00:33:50 2011 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit text >>> usermail.attach(part) >>> print usermail >From nobody Thu Jan 27 00:45:26 2011 Content-Type: multipart/alternative; boundary="===============1006894803==" MIME-Version: 1.0 --===============1006894803== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit text --===============1006894803==-- ---------- components: Library (Lib) messages: 127161 nosy: david.caro priority: normal severity: normal status: open title: email MIME-Version headers for each part in multipart message type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 12:00:25 2011 From: report at bugs.python.org (Steffen Daode Nurpmeso) Date: Thu, 27 Jan 2011 11:00:25 +0000 Subject: [New-bugs-announce] [issue11022] locale.setlocale() doesn't change I/O codec, os.environ[] does In-Reply-To: <1296126025.04.0.965125504096.issue11022@psf.upfronthosting.co.za> Message-ID: <1296126025.04.0.965125504096.issue11022@psf.upfronthosting.co.za> New submission from Steffen Daode Nurpmeso : This bug may be based on same problem as Issue 6203. - My system locale is en_GB.UTF-8. - Given a latin1 text file, open()+ will fail with 'UnicodeDecodeError: 'utf8' codec can't decode byte 0xf6...' - Using locale.setlocale(..., ...) - Re-open causes same error, I/O layer codec has not been changed! - Using os.environ["LC_ALL"] = ... - Re-open works properly, I/O layer codec has been changed. P.S.: i am new to Python, please don't assume i can help in solving the problem! ---------- components: Library (Lib) messages: 127177 nosy: sdaoden priority: normal severity: normal status: open title: locale.setlocale() doesn't change I/O codec, os.environ[] does versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 14:17:15 2011 From: report at bugs.python.org (Alan Isaac) Date: Thu, 27 Jan 2011 13:17:15 +0000 Subject: [New-bugs-announce] [issue11023] pep 227 missing text In-Reply-To: <1296134235.25.0.738218358402.issue11023@psf.upfronthosting.co.za> Message-ID: <1296134235.25.0.738218358402.issue11023@psf.upfronthosting.co.za> New submission from Alan Isaac : In PEP 227 missing text is marked with XXX. Most of this is just calls for examples and elaboration. However under the Implementation section XXX marks a substantive question about the documentation. Fixing this may be low priority, but a tracker search suggested it is currently not even being tracked ... ---------- assignee: docs at python components: Documentation messages: 127184 nosy: aisaac, docs at python priority: normal severity: normal status: open title: pep 227 missing text type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 14:35:01 2011 From: report at bugs.python.org (Sebastian Spaeth) Date: Thu, 27 Jan 2011 13:35:01 +0000 Subject: [New-bugs-announce] [issue11024] imaplib: Time2Internaldate() returns localized strings In-Reply-To: <1296135301.42.0.767818406183.issue11024@psf.upfronthosting.co.za> Message-ID: <1296135301.42.0.767818406183.issue11024@psf.upfronthosting.co.za> New submission from Sebastian Spaeth : imaplib's Time2Internaldate returns invalid (as localized) INTERNALDATE strings. Appending a message with such a time string leads to a: 19 BAD Command Argument Error. 11 (for MS?Exchange IMAP servers) it returned "26-led-2011 18:23:44 +0100", however: http://tools.ietf.org/html/rfc2060.html defines: date_month ::= "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" / "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec" so it expects an English date format. imaplib's Time2Internaldate uses time.strftime() to create the final string which uses the current locale, returning things such as: "26-led-2011 18:23:44 +0100" rather than "26-Jan-2011 18:23:44 +0100". For the right thing to do, we would need to set locale.setlocale(locale.LC_TIME, '') to get English formatting or we would need to use some home-grown parser that hardcodes the proper terms. ---------- components: Library (Lib) messages: 127186 nosy: spaetz priority: normal severity: normal status: open title: imaplib: Time2Internaldate() returns localized strings type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:17:02 2011 From: report at bugs.python.org (Boris FELD) Date: Thu, 27 Jan 2011 14:17:02 +0000 Subject: [New-bugs-announce] [issue11025] Distutils2 install command without setup.py or setup.cfg create an UNKNOWN-UNKNOWN.dist-info distribution In-Reply-To: <1296137822.54.0.488417839066.issue11025@psf.upfronthosting.co.za> Message-ID: <1296137822.54.0.488417839066.issue11025@psf.upfronthosting.co.za> New submission from Boris FELD : Distutils2 install command don't display error if you try to launch it in a directory without setup.py nor setup.cfg files. It install an UNKNOWN-UNKNOWN.dist-info distribution in your site-package with all meta-data file set to UNKNOWN. ---------- assignee: tarek components: Distutils2 files: METADATA messages: 127190 nosy: Boris.FELD, eric.araujo, tarek, tarek-ziade priority: normal severity: normal status: open title: Distutils2 install command without setup.py or setup.cfg create an UNKNOWN-UNKNOWN.dist-info distribution versions: Python 2.6 Added file: http://bugs.python.org/file20545/METADATA _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:35:35 2011 From: report at bugs.python.org (Boris FELD) Date: Thu, 27 Jan 2011 14:35:35 +0000 Subject: [New-bugs-announce] [issue11026] Distutils2 install command fail with python 2.5/2.7 In-Reply-To: <1296138935.4.0.881048172812.issue11026@psf.upfronthosting.co.za> Message-ID: <1296138935.4.0.881048172812.issue11026@psf.upfronthosting.co.za> New submission from Boris FELD : Distutils2 install command fail with both python 2.5 and python 2.7 while it works with python 2.6. $ python -V python 2.5.4 $ python -m "distutils2.run" install usage: run.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: run.py --help [cmd1 cmd2 ...] or: run.py --help-commands or: run.py cmd --help error: Invalid command install ################################ $ python -V Python 2.7.1 $ python -m "distutils2.run" install usage: run.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: run.py --help [cmd1 cmd2 ...] or: run.py --help-commands or: run.py cmd --help error: Invalid command install It fail it a setup.cfg exists or not in the current directory. ---------- assignee: tarek components: Distutils2 messages: 127192 nosy: Boris.FELD, eric.araujo, tarek, tarek-ziade priority: normal severity: normal status: open title: Distutils2 install command fail with python 2.5/2.7 versions: Python 2.5, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:37:05 2011 From: report at bugs.python.org (Kunjesh Kaushik) Date: Thu, 27 Jan 2011 14:37:05 +0000 Subject: [New-bugs-announce] [issue11027] Allow spaces around section header in ConfigParser In-Reply-To: <1296139025.05.0.619488294513.issue11027@psf.upfronthosting.co.za> Message-ID: <1296139025.05.0.619488294513.issue11027@psf.upfronthosting.co.za> New submission from Kunjesh Kaushik : It is often desirable to be able to write a section with spaces around the header, as in "[ default ]" instead of "[default]" for the sake of readability of configuration file. I am not sure if this is the "standard" format of configuration files. The following (attached) patch will achieve the desired result. It is also backward-compatible. Kindly arrange for the patch to be applied to the repository or to a future release. Original Code Location: http://svn.python.org/view/*checkout*/python/branches/release27-maint/Lib/ConfigParser.py?revision=84443 Index: Lib/ConfigParser.py =================================================================== --- Lib/ConfigParser.py (revision 84443) +++ Lib/ConfigParser.py (working copy) @@ -432,7 +432,7 @@ # SECTCRE = re.compile( r'\[' # [ - r'(?P
[^]]+)' # very permissive! + r'\s*(?P
[^]]+)\s*' # very permissive! r'\]' # ] ) OPTCRE = re.compile( ---------- components: Library (Lib) files: allow_spaces_around_section_header.diff keywords: patch messages: 127193 nosy: Kunjesh.Kaushik priority: normal severity: normal status: open title: Allow spaces around section header in ConfigParser type: feature request versions: Python 2.7 Added file: http://bugs.python.org/file20547/allow_spaces_around_section_header.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 15:45:08 2011 From: report at bugs.python.org (alain tty) Date: Thu, 27 Jan 2011 14:45:08 +0000 Subject: [New-bugs-announce] [issue11028] Implement the setup.py -> setup.cfg in mkcfg In-Reply-To: <1296139508.67.0.695480903327.issue11028@psf.upfronthosting.co.za> Message-ID: <1296139508.67.0.695480903327.issue11028@psf.upfronthosting.co.za> New submission from alain tty : It shall be interesting to simplify the building of the setup.cfg from an existing setup.py. A distutils2.mkcfg.load_existing_setup_script function already exists but it raises NotImplementedError. Since taking into account setuptools could be straightforward we propose to add a implementation that takes care of distutils arguments only. ---------- assignee: tarek components: Distutils2 messages: 127197 nosy: alaintty, eric.araujo, tarek, tarek-ziade priority: normal severity: normal status: open title: Implement the setup.py -> setup.cfg in mkcfg type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 18:01:04 2011 From: report at bugs.python.org (Scott M) Date: Thu, 27 Jan 2011 17:01:04 +0000 Subject: [New-bugs-announce] [issue11029] Crash, 2.7.1, Tkinter and threads and line drawing In-Reply-To: <1296147664.2.0.443864502869.issue11029@psf.upfronthosting.co.za> Message-ID: <1296147664.2.0.443864502869.issue11029@psf.upfronthosting.co.za> New submission from Scott M : Running on dual core Windows XP. The function should draw a parabolicish shape for each click on launch. But if you click Launch over and over, very fast, you get bizarre crashes instead: Python.exe has encoutered a problem, yadda. tcl85.dll. It rarely takes many clicks. Apologies for the coding style; this has been hacked down from a larger app. In the console window: Exception in thread Thread-5: Traceback (most recent call last): File "C:\Python27\lib\threading.py", line 530, in __bootstrap_inner self.run() File "C:\Documents and Settings\mayos\Desktop\PMT2\MyProjects\TkinterCrash.py" , line 47, in run self.app.arrival_122((self.target, y, z)) File "C:\Documents and Settings\mayos\Desktop\PMT2\MyProjects\TkinterCrash.py" , line 100, in arrival_122 self.label.config(text= str(message[0])+ " " + str(message[1])) File "C:\Python27\lib\lib-tk\Tkinter.py", line 1202, in configure return self._configure('configure', cnf, kw) File "C:\Python27\lib\lib-tk\Tkinter.py", line 1193, in _configure self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) TclError: invalid command name "source C:/Python27/tcl/tk8.5/menu.tcl" Exception in thread Thread-4: Traceback (most recent call last): File "C:\Python27\lib\threading.py", line 530, in __bootstrap_inner self.run() File "C:\Documents and Settings\mayos\Desktop\PMT2\MyProjects\TkinterCrash.py" , line 47, in run self.app.arrival_122((self.target, y, z)) File "C:\Documents and Settings\mayos\Desktop\PMT2\MyProjects\TkinterCrash.py" , line 125, in arrival_122 self.graph.create_line(self.trackCoordinates[tn], new_yz) File "C:\Python27\lib\lib-tk\Tkinter.py", line 2201, in create_line return self._create('line', args, kw) File "C:\Python27\lib\lib-tk\Tkinter.py", line 2189, in _create *(args + self._options(cnf, kw)))) TclError: invalid command name "line" Also saw: File "C:\Python27\lib\lib-tk\Tkinter.py", line 2201, in create_line return self._create('line', args, kw) File "C:\Python27\lib\lib-tk\Tkinter.py", line 2189, in _create *(args + self._options(cnf, kw)))) TclError: bad option "665.4400009999997": must be addtag, bbox, bind, canvasx, canvasy, cget, configure, coords, create, dchars, delete, dtag, find, focus, gettags, icursor, index, insert, itemcget, itemconfigure, lower, move, postscript, raise, scale, scan, select, type, xview, or yview ---------- components: Tkinter files: TkinterCrash.py messages: 127201 nosy: PythonInTheGrass priority: normal severity: normal status: open title: Crash, 2.7.1, Tkinter and threads and line drawing type: crash versions: Python 2.7 Added file: http://bugs.python.org/file20549/TkinterCrash.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 19:48:57 2011 From: report at bugs.python.org (Sandro Tosi) Date: Thu, 27 Jan 2011 18:48:57 +0000 Subject: [New-bugs-announce] [issue11030] regrtest - allow for relative path with --coverdir In-Reply-To: <1296154137.39.0.416513090061.issue11030@psf.upfronthosting.co.za> Message-ID: <1296154137.39.0.416513090061.issue11030@psf.upfronthosting.co.za> New submission from Sandro Tosi : Hi, following up msg127157 here's a patch to allow for relative path when using --coverdir. The current solution uses getcwd() but since CWD is replaced by a temporary location before calling main(), then the resulting dir is in an unexpected location. using support.SAVECWD we use the saved CWD that's where the script is executed, so the relative path is created/used where expected. ---------- assignee: sandro.tosi components: Tests files: regrtest_coverdir_relative_path-py3k.patch keywords: patch messages: 127207 nosy: sandro.tosi priority: low severity: normal stage: patch review status: open title: regrtest - allow for relative path with --coverdir versions: Python 3.3 Added file: http://bugs.python.org/file20551/regrtest_coverdir_relative_path-py3k.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jan 27 22:49:36 2011 From: report at bugs.python.org (Sandro Tosi) Date: Thu, 27 Jan 2011 21:49:36 +0000 Subject: [New-bugs-announce] [issue11031] regrtest - --testdir, new command-line option to specify alternative test directory In-Reply-To: <1296164976.55.0.598223857745.issue11031@psf.upfronthosting.co.za> Message-ID: <1296164976.55.0.598223857745.issue11031@psf.upfronthosting.co.za> New submission from Sandro Tosi : from msg127153 + msg127157 + msg127172 I prepared this patch to introduce a new cli option to regrtest.py, --testdir DIR, that allows to specify a different location for the directory containing the test files. along the way, I added a description of what STDTESTS and NOTTESTS is and differentiate the call to findtests() if testdir is passed to not use those information. ---------- assignee: sandro.tosi components: Tests files: regrtest_add_testdir-py3k.patch keywords: patch messages: 127227 nosy: sandro.tosi priority: low severity: normal stage: patch review status: open title: regrtest - --testdir, new command-line option to specify alternative test directory versions: Python 3.3 Added file: http://bugs.python.org/file20559/regrtest_add_testdir-py3k.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 00:07:56 2011 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jan 2011 23:07:56 +0000 Subject: [New-bugs-announce] [issue11032] _string: formatter_field_name_split() and formatter_parser doesn't check input type In-Reply-To: <1296169676.06.0.782920211182.issue11032@psf.upfronthosting.co.za> Message-ID: <1296169676.06.0.782920211182.issue11032@psf.upfronthosting.co.za> New submission from STINNER Victor : $ ./python Python 3.2rc1+ (unknown, Jan 18 2011, 00:55:20) >>> import _string >>> _string.formatter_field_name_split(1) python: Objects/stringlib/string_format.h:1347: formatter_field_name_split: Assertion `((((((PyObject*)(self))->ob_type))->tp_flags & ((1L<<28))) != 0)' failed. Abandon $ ./python Python 3.2rc1+ (unknown, Jan 18 2011, 00:55:20) >>> import _string >>> _string.formatter_parser(1) python: Objects/stringlib/string_format.h:1206: formatter_parser: Assertion `((((((PyObject*)(self))->ob_type))->tp_flags & ((1L<<28))) != 0)' failed. Abandon Attached patch fixes both crashes and add tests on the _string module (which has only these two functions). ---------- components: Library (Lib) files: _string.patch keywords: patch messages: 127236 nosy: haypo priority: normal severity: normal status: open title: _string: formatter_field_name_split() and formatter_parser doesn't check input type versions: Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file20562/_string.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 01:07:36 2011 From: report at bugs.python.org (Peter Cai) Date: Fri, 28 Jan 2011 00:07:36 +0000 Subject: [New-bugs-announce] [issue11033] ElementTree.fromstring doesn't work with Unicode In-Reply-To: <1296173256.62.0.363094614198.issue11033@psf.upfronthosting.co.za> Message-ID: <1296173256.62.0.363094614198.issue11033@psf.upfronthosting.co.za> New submission from Peter Cai : xml.etree.ElementTree.fromstring doesn't work with Unicode string. See the code below: >>> from xml.etree import ElementTree >>> t = ElementTree.fromstring(u'?') Traceback (most recent call last): File "", line 1, in File "D:\Python26\lib\xml\etree\ElementTree.py", line 963, in XML parser.feed(text) File "D:\Python26\lib\xml\etree\ElementTree.py", line 1245, in feed self._parser.Parse(data, 0) UnicodeEncodeError: 'ascii' codec can't encode character u'\u8bd7' in position 5 : ordinal not in range(128) ---------- components: XML messages: 127239 nosy: Peter.Cai priority: normal severity: normal status: open title: ElementTree.fromstring doesn't work with Unicode type: crash versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 08:37:36 2011 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 28 Jan 2011 07:37:36 +0000 Subject: [New-bugs-announce] [issue11034] Build problem on Windows with MSVC++ Express 2008 In-Reply-To: <1296200256.35.0.305421418262.issue11034@psf.upfronthosting.co.za> Message-ID: <1296200256.35.0.305421418262.issue11034@psf.upfronthosting.co.za> New submission from Eli Bendersky : On a clean checkout of py3k, I try to open PCBuild/pcbuild.sln with my MSVC++ Express 2008. When opening, a message box pops saying: Solution folders are not supported in this version of the application. Solution folder "Solution Items" will be displayed as unavailable. I go on building following instructions (F7, leaving the default Debug win32 configuration). I get a bunch of LNK1181 errors: 27> LINK : fatal error LNK1181: cannot open input file '.\python32_d.lib' When I try to build the pythoncore project only, I get: 1>c1 : fatal error C1083: Cannot open source file: 'D:\eli\python-py3k-trunk\PCbuild\Win32-temp-Debug\pythoncore\\getbuildinfo2.c': No such file or directory Maybe there's some problem with the make_buildinfo call in the pre-build event? ---------- components: Build messages: 127249 nosy: eli.bendersky, loewis priority: normal severity: normal status: open title: Build problem on Windows with MSVC++ Express 2008 type: compile error versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 10:36:50 2011 From: report at bugs.python.org (Dmitry Groshev) Date: Fri, 28 Jan 2011 09:36:50 +0000 Subject: [New-bugs-announce] [issue11035] Segmentation fault In-Reply-To: <1296207410.47.0.601145412555.issue11035@psf.upfronthosting.co.za> Message-ID: <1296207410.47.0.601145412555.issue11035@psf.upfronthosting.co.za> New submission from Dmitry Groshev : Here is a console output: si14 at si14-work:~/repos/monitoring/root$ python2.7 server.py 127.0.0.1 - - [2011-01-28 12:29:30] "GET /update HTTP/1.1" 200 320 "-" "Python-urllib/2.7" {"seenby":[1],"received":1296207058.993983,"observer":1,"type":"ping","source":102,"time":1296207058.990101,"data":[[1296206970.543701,0.010154962539672852],[1296206980.383922,0.010203123092651367],[1296206990.222841,0.01015615463256836],[1296207000.050695,0.010264873504638672],[1296207009.876834,0.011881113052368164],[1296207019.698611,0.010120153427124023],[1296207029.519147,0.010251045227050781],[1296207039.342266,0.010113000869750977],[1296207049.167352,0.010238885879516602],[1296207058.990089,0.010174989700317383]],"class":"statistics"} 127.0.0.1 - - [2011-01-28 12:30:59] "POST / HTTP/1.1" 200 2 "-" "Python-urllib/2.7" Segmentation fault si14 at si14-work:~/repos/monitoring/root$ I'm not sure that this is a gevent issue, so I'm posting it here. server.py sources are attached. ---------- components: Interpreter Core files: server.py messages: 127266 nosy: Dmitry.Groshev priority: normal severity: normal status: open title: Segmentation fault type: crash versions: Python 2.7 Added file: http://bugs.python.org/file20570/server.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:30:52 2011 From: report at bugs.python.org (Gael Pasgrimaud) Date: Fri, 28 Jan 2011 10:30:52 +0000 Subject: [New-bugs-announce] [issue11036] Allow multiple files in the description-file metadata In-Reply-To: <1296210652.15.0.670840085537.issue11036@psf.upfronthosting.co.za> Message-ID: <1296210652.15.0.670840085537.issue11036@psf.upfronthosting.co.za> New submission from Gael Pasgrimaud : It can be usefull to allow more than one file in the description-file metadata so people can concatenate README and CHANGES file. ---------- assignee: tarek components: Distutils2 messages: 127272 nosy: eric.araujo, gawel, tarek priority: normal severity: normal status: open title: Allow multiple files in the description-file metadata type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:34:50 2011 From: report at bugs.python.org (Sebastien Douche) Date: Fri, 28 Jan 2011 10:34:50 +0000 Subject: [New-bugs-announce] [issue11037] How distutils2 handle namespaces In-Reply-To: <1296210890.87.0.618097241127.issue11037@psf.upfronthosting.co.za> Message-ID: <1296210890.87.0.618097241127.issue11037@psf.upfronthosting.co.za> New submission from Sebastien Douche : Namespace is very useful. In my company, we use a root namespace (sact.*) and a sub-namespace for each big project (sact.nevrax.*, sact.storage.*). ---------- assignee: tarek components: Distutils2 messages: 127274 nosy: eric.araujo, sdouche, tarek priority: normal severity: normal status: open title: How distutils2 handle namespaces _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 11:39:15 2011 From: report at bugs.python.org (Gael Pasgrimaud) Date: Fri, 28 Jan 2011 10:39:15 +0000 Subject: [New-bugs-announce] [issue11038] Some commands should stop if Name and Version are missing In-Reply-To: <1296211155.96.0.0798615868084.issue11038@psf.upfronthosting.co.za> Message-ID: <1296211155.96.0.0798615868084.issue11038@psf.upfronthosting.co.za> New submission from Gael Pasgrimaud : distutils2 commands should stop if at least Name and Version metadatas are not provided in setup.cfg For now you'll get a UNKNOWN-UNKNOWN.tar.gz ---------- assignee: tarek components: Distutils2 messages: 127277 nosy: eric.araujo, gawel, tarek priority: normal severity: normal status: open title: Some commands should stop if Name and Version are missing type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 12:23:25 2011 From: report at bugs.python.org (Konstantin Osipov) Date: Fri, 28 Jan 2011 11:23:25 +0000 Subject: [New-bugs-announce] [issue11039] Use of 'L' specifier is inconsistent when printing long integers In-Reply-To: <1296213805.8.0.5306438252.issue11039@psf.upfronthosting.co.za> Message-ID: <1296213805.8.0.5306438252.issue11039@psf.upfronthosting.co.za> New submission from Konstantin Osipov : I'm using a 64 bit system, but the issue is as well repeatable on 32 bit systems: kostja at shmita:~$ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 0xffffffffffffffff 18446744073709551615L >>> [0xffffffffffffffff] [18446744073709551615L] >>> str(0xffffffffffffffff) '18446744073709551615' >>> str([0xffffffffffffffff]) '[18446744073709551615L]' Notice the 'L' specifier disappears when creating a string from an integer. I.e. depending on conversion order, 'L' specifier is present or absent in the resulting string representation. I don't know the reason why 'L' specifier is necessary at all when printing integers, rather, I'd say it's very harmful, because makes Python program platform-dependent (since int is mapped to C long, 32-bit systems print 'L' where 64-bit systems don't), but please at least make the output consistent! Thanks, -- kostja ---------- components: None messages: 127284 nosy: kostja priority: normal severity: normal status: open title: Use of 'L' specifier is inconsistent when printing long integers versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 12:31:29 2011 From: report at bugs.python.org (Julien Miotte) Date: Fri, 28 Jan 2011 11:31:29 +0000 Subject: [New-bugs-announce] [issue11040] After registering a project to PyPI, classifiers fields aren't displayed. In-Reply-To: <1296214289.89.0.718507704088.issue11040@psf.upfronthosting.co.za> Message-ID: <1296214289.89.0.718507704088.issue11040@psf.upfronthosting.co.za> New submission from Julien Miotte : When I register a project with a setup.cfg with the following classifiers: classifier = Development Status :: 3 - Alpha License :: OSI Approved :: GNU General Public License (GPL) Environment :: X11 Applications :: Qt And using the command: $ python -m distutils2.run register I can't find the classifiers on the PyPI project page, althought they can be found in the PKG-INFO generated by the 'sdist' command. ---------- assignee: tarek components: Distutils2 messages: 127285 nosy: Julien.Miotte, eric.araujo, tarek, tarek-ziade priority: normal severity: normal status: open title: After registering a project to PyPI, classifiers fields aren't displayed. versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 12:39:48 2011 From: report at bugs.python.org (Julien Miotte) Date: Fri, 28 Jan 2011 11:39:48 +0000 Subject: [New-bugs-announce] [issue11041] On the distutils2 documentation, 'requires-python' shouldn't be documented as *multi In-Reply-To: <1296214788.72.0.049703794101.issue11041@psf.upfronthosting.co.za> Message-ID: <1296214788.72.0.049703794101.issue11041@psf.upfronthosting.co.za> New submission from Julien Miotte : On the documentation page: http://distutils2.notmyidea.org/setupcfg.html, one can read : # requires-python: Specifies the Python version the distribution requires. The value is a version number, as described in PEP 345. *optional *multi *environ This is not consistant with the PEP 345 (http://www.python.org/dev/peps/pep-0345/#requires-python), which doesn't specify that this field is of multiple use. Distutils's behaviour on this matter is consistent with the PEP thought, so there's only need to remove the "*multi" in the documentation. ---------- assignee: tarek components: Distutils2 messages: 127287 nosy: Julien.Miotte, eric.araujo, tarek, tarek-ziade priority: normal severity: normal status: open title: On the distutils2 documentation, 'requires-python' shouldn't be documented as *multi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 12:46:18 2011 From: report at bugs.python.org (Julien Miotte) Date: Fri, 28 Jan 2011 11:46:18 +0000 Subject: [New-bugs-announce] [issue11042] [PyPI CSS] Adding project urls onto a project page using register, apparition of an overhead over the title In-Reply-To: <1296215178.29.0.349266521718.issue11042@psf.upfronthosting.co.za> Message-ID: <1296215178.29.0.349266521718.issue11042@psf.upfronthosting.co.za> New submission from Julien Miotte : When adding project urls onto a PyPI project page using the following setup.cfg extract: project_url = Source repository,https://github.com/mike-perdide/qGitFilterBranch And then registering the project with: python -m distutils2.run register Causes a not-so-nice overhead to appear just above the project title. Can be seen in http://pypi.python.org/pypi/qGitFilterBranch/0.9. ---------- assignee: tarek components: Distutils2 messages: 127288 nosy: Julien.Miotte, eric.araujo, tarek, tarek-ziade priority: normal severity: normal status: open title: [PyPI CSS] Adding project urls onto a project page using register, apparition of an overhead over the title _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 12:50:57 2011 From: report at bugs.python.org (Julien Miotte) Date: Fri, 28 Jan 2011 11:50:57 +0000 Subject: [New-bugs-announce] [issue11043] On GNU/Linux (Ubuntu) distutils2.mkcfg shouldn't create an executable setup.cfg In-Reply-To: <1296215457.79.0.848370821924.issue11043@psf.upfronthosting.co.za> Message-ID: <1296215457.79.0.848370821924.issue11043@psf.upfronthosting.co.za> New submission from Julien Miotte : When using the command: $ python -m distutils2.mkcfg To create a new setup.cfg, the resulting setup.cfg has the following permissions: -rwxr-xr-x 1 mike mike 151 2011-01-28 12:47 setup.cfg* I think the permissions should be 644 ---------- assignee: tarek components: Distutils2 messages: 127289 nosy: Julien.Miotte, eric.araujo, tarek, tarek-ziade priority: normal severity: normal status: open title: On GNU/Linux (Ubuntu) distutils2.mkcfg shouldn't create an executable setup.cfg versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 13:00:54 2011 From: report at bugs.python.org (Julien Miotte) Date: Fri, 28 Jan 2011 12:00:54 +0000 Subject: [New-bugs-announce] [issue11044] The description-file isn't handled by distutils2 In-Reply-To: <1296216054.85.0.726988451009.issue11044@psf.upfronthosting.co.za> Message-ID: <1296216054.85.0.726988451009.issue11044@psf.upfronthosting.co.za> New submission from Julien Miotte : When using the description-file field with a README.txt, and then using the 'sdist' command, the generated PKG-INFO file will contain: Description: UNKNOWN Note: when using the description field with a simple string, the generated PKG-INFO file will contain the correct string. ---------- assignee: tarek components: Distutils2 messages: 127291 nosy: Julien.Miotte, eric.araujo, tarek, tarek-ziade priority: normal severity: normal status: open title: The description-file isn't handled by distutils2 versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 14:48:10 2011 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Fri, 28 Jan 2011 13:48:10 +0000 Subject: [New-bugs-announce] [issue11045] shutil._make_tarball In-Reply-To: <1296222490.15.0.786706157889.issue11045@psf.upfronthosting.co.za> Message-ID: <1296222490.15.0.786706157889.issue11045@psf.upfronthosting.co.za> New submission from Tarek Ziad? : This line : logger.info("creating %s" % archive_dir) should check that logger is not None before being called.. ---------- assignee: tarek components: Library (Lib) messages: 127300 nosy: tarek priority: high severity: normal status: open title: shutil._make_tarball type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 15:26:24 2011 From: report at bugs.python.org (Steffen Daode Nurpmeso) Date: Fri, 28 Jan 2011 14:26:24 +0000 Subject: [New-bugs-announce] [issue11046] darwin/MacOS X setup.py hack In-Reply-To: <1296224784.81.0.0525228154056.issue11046@psf.upfronthosting.co.za> Message-ID: <1296224784.81.0.0525228154056.issue11046@psf.upfronthosting.co.za> New submission from Steffen Daode Nurpmeso : I always hated GNU Autoconf and M4. After cloning branches/py3k today i needed two and a half hour to build and compile a Python which includes the readline module. I'll attach a primitive setup.py patch which should better not make it into a release version ... Some more notes on the compilation: Snow Leopard here has SDK's 10.5 and 10.6. I did not understand what was going on, configure does everything to explain me it is using (nonexistent) 10.4. The configure script is checking for OSX 10.5 SDK or later... yes but that doesn't seem to matter. I gave up on hacking (the anyway generated) configure (around line 5532), no matter what i do, i still get CONFIGURE_MACOSX_DEPLOYMENT_TARGET='10.4' Damn! Ooh, Ooh, how nice are plain Makefiles and small-team projects. ---------- components: Build files: DIFF messages: 127304 nosy: sdaoden priority: normal severity: normal status: open title: darwin/MacOS X setup.py hack versions: Python 3.2 Added file: http://bugs.python.org/file20575/DIFF _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 17:53:28 2011 From: report at bugs.python.org (Oren Held) Date: Fri, 28 Jan 2011 16:53:28 +0000 Subject: [New-bugs-announce] [issue11047] Bad description for a change In-Reply-To: <1296233608.02.0.630598474753.issue11047@psf.upfronthosting.co.za> Message-ID: <1296233608.02.0.630598474753.issue11047@psf.upfronthosting.co.za> New submission from Oren Held : In the "what's new in 2.7", there is some mistake in the description of issue 7902. 7902, afaik, disables the fallback to absolute import, when requesting a relative import fails. If I got it right, the description states the opposite. ---------- assignee: docs at python components: Documentation files: whatsnew_issue_7902_fix.patch keywords: patch messages: 127317 nosy: Oren_Held, docs at python priority: normal severity: normal status: open title: Bad description for a change versions: Python 2.7 Added file: http://bugs.python.org/file20577/whatsnew_issue_7902_fix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 18:05:09 2011 From: report at bugs.python.org (Pavel Labushev) Date: Fri, 28 Jan 2011 17:05:09 +0000 Subject: [New-bugs-announce] [issue11048] "import ctypes" causes segfault on read-only filesystem In-Reply-To: <1296234309.62.0.290829997988.issue11048@psf.upfronthosting.co.za> Message-ID: <1296234309.62.0.290829997988.issue11048@psf.upfronthosting.co.za> New submission from Pavel Labushev : "import ctypes" causes segfault on read-only filesystem This regression was introduced in python-2.6.6 and exists in all the later versions. To reproduce run python -c "import ctypes" on read-only filesystem: (gdb) file python3.2 Reading symbols from /usr/bin/python3.2...done. (gdb) run -c "import ctypes" Starting program: /usr/bin/python3.2 -c "import ctypes" [Thread debugging using libthread_db enabled] Program received signal SIGSEGV, Segmentation fault. 0xb7af605c in CThunkObject_dealloc (_self=0xb7b35344) at /var/tmp/portage/dev-lang/python-3.2_pre20110123/work/python-3.2_pre20110123/Modules/_ctypes/callbacks.c:18 18 /var/tmp/portage/dev-lang/python-3.2_pre20110123/work/python-3.2_pre20110123/Modules/_ctypes/callbacks.c: No such file or directory. in /var/tmp/portage/dev-lang/python-3.2_pre20110123/work/python-3.2_pre20110123/Modules/_ctypes/callbacks.c (gdb) bt #0 0xb7af605c in CThunkObject_dealloc (_self=0xb7b35344) at /var/tmp/portage/dev-lang/python-3.2_pre20110123/work/python-3.2_pre20110123/Modules/_ctypes/callbacks.c:18 #1 0xb7af63b4 in _ctypes_alloc_callback (callable=0xb7b10bec, converters=0xb7c4e02c, restype=0xb810c544, flags=257) at /var/tmp/portage/dev-lang/python-3.2_pre20110123/work/python-3.2_pre20110123/Modules/_ctypes/callbacks.c:439 #2 0xb7af1f57 in PyCFuncPtr_new (type=0xb810b0bc, args=0xb7b3618c, kwds=0x0) at /var/tmp/portage/dev-lang/python-3.2_pre20110123/work/python-3.2_pre20110123/Modules/_ctypes/_ctypes.c:3339 #3 0xb7ea2355 in type_call (type=0xb810b0bc, args=0xb7b3618c, kwds=0x0) at Objects/typeobject.c:676 #4 0xb7e4f34e in PyObject_Call (func=0xb810b0bc, arg=0xb7b3618c, kw=0x0) at Objects/abstract.c:2149 #5 0xb7eedee3 in do_call (f=0xb80fdb44, throwflag=0) at Python/ceval.c:4095 #6 call_function (f=0xb80fdb44, throwflag=0) at Python/ceval.c:3898 #7 PyEval_EvalFrameEx (f=0xb80fdb44, throwflag=0) at Python/ceval.c:2673 #8 0xb7ef0639 in PyEval_EvalCodeEx (_co=0xb7b159d0, globals=0xb7bf40b4, locals=0xb7bf40b4, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3311 #9 0xb7ef08b6 in PyEval_EvalCode (co=0xb7b159d0, globals=0xb7bf40b4, locals=0xb7bf40b4) at Python/ceval.c:761 #10 0xb7f0121c in PyImport_ExecCodeModuleWithPathnames (name=0xbfffd9fb "ctypes", co=0xb7b159d0, pathname=0xbfffa89b "/usr/lib/python3.2/ctypes/__pycache__/__init__.cpython-32.pyc", cpathname=0xbfffa89b "/usr/lib/python3.2/ctypes/__pycache__/__init__.cpython-32.pyc") at Python/import.c:809 #11 0xb7f03ce8 in load_source_module (name=, pathname=, fp=0xb8020b28) at Python/import.c:1339 #12 0xb7f044f8 in load_package (name=, pathname=) at Python/import.c:1435 #13 0xb7f04da7 in import_submodule (mod=, subname=, fullname=0xbfffd9fb "ctypes") at Python/import.c:2894 #14 0xb7f050b4 in load_next (mod=, altmod=, p_name=0xbfffd9ec, buf=0xbfffd9fb "ctypes", p_buflen=0xbfffd9f4) at Python/import.c:2706 #15 0xb7f05774 in import_module_level (name=0x0, globals=, locals=0xb7c2035c, fromlist=0xb7f98ca0, level=0) at Python/import.c:2422 #16 0xb7f05d14 in PyImport_ImportModuleLevel (name=0xb7c0f8e8 "ctypes", globals=0xb7c2035c, locals=0xb7c2035c, fromlist=0xb7f98ca0, level=0) at Python/import.c:2474 #17 0xb7ee73c1 in builtin___import__ (self=0xb7c6726c, args=0xb7c7b9bc, kwds=0x0) at Python/bltinmodule.c:168 #18 0xb7e907fe in PyCFunction_Call (func=0xb7c6730c, arg=0xb7c7b9bc, kw=0xb7b35344) at Objects/methodobject.c:84 #19 0xb7e4f34e in PyObject_Call (func=0xb7c6730c, arg=0xb7c7b9bc, kw=0x0) at Objects/abstract.c:2149 #20 0xb7ee802f in PyEval_CallObjectWithKeywords (func=0xb7c6730c, arg=0xb7c7b9bc, kw=0x0) at Python/ceval.c:3755 #21 0xb7eec962 in PyEval_EvalFrameEx (f=0xb8072564, throwflag=0) at Python/ceval.c:2332 #22 0xb7ef0639 in PyEval_EvalCodeEx (_co=0xb7bdb7f0, globals=0xb7c2035c, locals=0xb7c2035c, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3311 #23 0xb7ef08b6 in PyEval_EvalCode (co=0xb7bdb7f0, globals=0xb7c2035c, locals=0xb7c2035c) at Python/ceval.c:761 #24 0xb7f0eabc in run_mod (mod=, filename=, globals=0xb7c2035c, locals=0xb7c2035c, flags=0xbfffefa8, arena=0xb8071030) at Python/pythonrun.c:1760 #25 0xb7f0edf9 in PyRun_StringFlags (str=0xb7bf5330 "import ctypes\n", start=257, globals=0xb7c2035c, locals=0xb7c2035c, flags=0xbfffefa8) at Python/pythonrun.c:1694 #26 0xb7f11006 in PyRun_SimpleStringFlags (command=0xb7bf5330 "import ctypes\n", flags=0xbfffefa8) at Python/pythonrun.c:1267 #27 0xb7f2477c in run_command (argc=3, argv=0xb8001018) at Modules/main.c:258 #28 Py_Main (argc=3, argv=0xb8001018) at Modules/main.c:647 #29 0xb7fffc4f in main (argc=3, argv=0xbffff0d4) at ./Modules/python.c:82 (gdb) quit ---------- assignee: theller components: ctypes messages: 127318 nosy: Arach, Arfrever, theller priority: normal severity: normal status: open title: "import ctypes" causes segfault on read-only filesystem versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 20:05:31 2011 From: report at bugs.python.org (Brett Cannon) Date: Fri, 28 Jan 2011 19:05:31 +0000 Subject: [New-bugs-announce] [issue11049] add tests for test.support In-Reply-To: <1296241531.97.0.670133219758.issue11049@psf.upfronthosting.co.za> Message-ID: <1296241531.97.0.670133219758.issue11049@psf.upfronthosting.co.za> New submission from Brett Cannon : It seems a little negligent that test.support has no tests. The test.test_support name is available in py3k and backporting issues to 2.7 shouldn't be a problem (rare chance something does happen it can be handling manually). There doesn't seem to be any reason not to make sure that proper unit testing is being done short of just laziness on our parts. And if this does occur it should probably be listed as an essential test in regrtest. ---------- components: Tests keywords: easy messages: 127322 nosy: brett.cannon, r.david.murray priority: normal severity: normal stage: needs patch status: open title: add tests for test.support versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 23:30:02 2011 From: report at bugs.python.org (Ivan Egorov) Date: Fri, 28 Jan 2011 22:30:02 +0000 Subject: [New-bugs-announce] [issue11050] email.utils.getaddresses behavior contradicts RFC2822 In-Reply-To: <1296253802.55.0.925837101087.issue11050@psf.upfronthosting.co.za> Message-ID: <1296253802.55.0.925837101087.issue11050@psf.upfronthosting.co.za> New submission from Ivan Egorov : email.utils.getaddresses behaves wrong in following folding cases (outer single quote is not a part of value): '"A\r\n (B)" ' '(A\r\n C) ' The misbehavior occurs in at least 2.6, 2.7 and branches/py3k. Both these strings are RFC 2822 compliant, but current getaddresses() implementation misbehaves on 'quoted-string' and 'comment' containing CRLF. Following references the related RFC sections: http://tools.ietf.org/html/rfc2822#section-3.4 http://tools.ietf.org/html/rfc2822#section-3.2.5 Attachment contains tests and patch for the case. ---------- components: Library (Lib) files: email.utils.getaddresses.patch keywords: patch messages: 127357 nosy: Ivan.Egorov priority: normal severity: normal status: open title: email.utils.getaddresses behavior contradicts RFC2822 type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file20590/email.utils.getaddresses.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jan 28 23:49:33 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 28 Jan 2011 22:49:33 +0000 Subject: [New-bugs-announce] [issue11051] system calls per import In-Reply-To: <1296254973.71.0.897914319387.issue11051@psf.upfronthosting.co.za> Message-ID: <1296254973.71.0.897914319387.issue11051@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Here are the system calls when importing a single pure Python module: stat("/home/antoine/py3k/py3k/Lib/copyreg", 0x7fff1ed1f740) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/copyreg.cpython-32m.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/copyregmodule.cpython-32m.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/copyreg.abi3.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/copyregmodule.abi3.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/copyreg.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/copyregmodule.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/copyreg.py", O_RDONLY) = 5 fstat(5, {st_mode=S_IFREG|0664, st_size=6633, ...}) = 0 open("/home/antoine/py3k/py3k/Lib/__pycache__/copyreg.cpython-32.pyc", O_RDONLY) = 6 fstat(6, {st_mode=S_IFREG|0664, st_size=5595, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f28e6381000 read(6, "l\f\r\n\0\24\212Hc\0\0\0\0\0\0\0\0\0\0\0\0\f\0\0\0@\0\0\0s\307\0"..., 4096) = 4096 fstat(6, {st_mode=S_IFREG|0664, st_size=5595, ...}) = 0 This is per possible directory, which means that it can be repeated for each dir on sys.path: stat("readline", 0x7fff1ed28760) = -1 ENOENT (No such file or directory) open("readline.cpython-32m.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("readlinemodule.cpython-32m.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("readline.abi3.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("readlinemodule.abi3.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("readline.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("readlinemodule.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("readline.py", O_RDONLY) = -1 ENOENT (No such file or directory) open("readline.pyc", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/home/antoine/py3k/py3k/Lib/readline", 0x7fff1ed28760) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/readline.cpython-32m.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/readlinemodule.cpython-32m.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/readline.abi3.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/readlinemodule.abi3.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/readline.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/readlinemodule.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/readline.py", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/readline.pyc", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/home/antoine/py3k/py3k/Lib/plat-linux2", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0 stat("/home/antoine/py3k/py3k/Lib/plat-linux2", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0 stat("/home/antoine/py3k/py3k/Lib/plat-linux2/readline", 0x7fff1ed28760) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/plat-linux2/readline.cpython-32m.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/plat-linux2/readlinemodule.cpython-32m.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/plat-linux2/readline.abi3.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/plat-linux2/readlinemodule.abi3.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/plat-linux2/readline.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/plat-linux2/readlinemodule.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/plat-linux2/readline.py", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/Lib/plat-linux2/readline.pyc", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/home/antoine/py3k/py3k/build/lib.linux-x86_64-3.2", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0 stat("/home/antoine/py3k/py3k/build/lib.linux-x86_64-3.2", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0 stat("/home/antoine/py3k/py3k/build/lib.linux-x86_64-3.2/readline", 0x7fff1ed28760) = -1 ENOENT (No such file or directory) open("/home/antoine/py3k/py3k/build/lib.linux-x86_64-3.2/readline.cpython-32m.so", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0775, st_size=59970, ...}) = 0 futex(0x7f28e605e0ec, FUTEX_WAKE_PRIVATE, 2147483647) = 0 open("/home/antoine/py3k/py3k/build/lib.linux-x86_64-3.2/readline.cpython-32m.so", O_RDONLY) = 4 Something has gone out of control here. Why do we need to check so many alternative locations? ---------- components: Interpreter Core messages: 127359 nosy: barry, loewis, pitrou priority: normal severity: normal status: open title: system calls per import type: performance versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 03:52:58 2011 From: report at bugs.python.org (Ned Deily) Date: Sat, 29 Jan 2011 02:52:58 +0000 Subject: [New-bugs-announce] [issue11052] Fix OS X IDLE menu accelerators for Save As and Save Copy In-Reply-To: <1296269578.92.0.1087041883.issue11052@psf.upfronthosting.co.za> Message-ID: <1296269578.92.0.1087041883.issue11052@psf.upfronthosting.co.za> New submission from Ned Deily : On OS X, the menu accelerators for the Save As and Save Copy As commands are incorrect: Are Should Be Save Cmd-S Cmd-S Save As.. Cmd-S Shift-Cmd-S Save Copy As.. Shift-Cmd-S Option-Cmd-S The attached patch fixes that. It would be good to get into 3.2rc2 as part of the OS X IDLE clean up. ---------- assignee: ned.deily components: IDLE, Macintosh files: issue_osx_menu_accelerators.patch keywords: patch messages: 127371 nosy: georg.brandl, ned.deily priority: high severity: normal stage: commit review status: open title: Fix OS X IDLE menu accelerators for Save As and Save Copy type: behavior versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20593/issue_osx_menu_accelerators.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 04:17:33 2011 From: report at bugs.python.org (Ned Deily) Date: Sat, 29 Jan 2011 03:17:33 +0000 Subject: [New-bugs-announce] [issue11053] OS X IDLE 3 with Tk 8.4 appears to hang with syntax error In-Reply-To: <1296271053.35.0.843403013415.issue11053@psf.upfronthosting.co.za> Message-ID: <1296271053.35.0.843403013415.issue11053@psf.upfronthosting.co.za> New submission from Ned Deily : When IDLE 3 is used with Aqua Tk 8.4 on OS X (as is the case with the 32-bit-only installer for Python 3.1.x or 3.2rc1), if the user tries to run a Python program with a syntax error from an editor window, the Run command causes the IDLE shell window to move to the front, generally obscuring the editor window. For some unknown reason, a slight change between IDLE 2.x and IDLE 3.x causes the resulting modal Syntax Error message window to drop down from and be attached to the menu bar of the Editor Window. With Aqua Tk 8.4, the modal error only responds to a mouse click on the obscured Editor window's menu bar. To an unsuspecting user, it appears that IDLE is hung. In IDLE 2.x, the resulting modal error message is a top-level one, so it appears in a separate, unobscured window, the same as all other error messages in IDLE 2.x and 3.x. From the svn checkin early in the Python 3 development cycle, it is not at all clear why this minor change was made but it causes a major usability problem for OS X users. The attached patch reverts the change in this case restoring the behavior of IDLE 2.x. This fix should be applied to 3.2rc2. ---------- assignee: ned.deily files: issue_syntax_error_message.patch keywords: patch messages: 127375 nosy: benjamin.peterson, georg.brandl, ned.deily priority: release blocker severity: normal stage: commit review status: open title: OS X IDLE 3 with Tk 8.4 appears to hang with syntax error type: behavior versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file20594/issue_syntax_error_message.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 04:47:07 2011 From: report at bugs.python.org (Ned Deily) Date: Sat, 29 Jan 2011 03:47:07 +0000 Subject: [New-bugs-announce] [issue11054] OS X installer build script for 3.2 can no longer build with system Python on OS X 10.5 In-Reply-To: <1296272827.91.0.103223659215.issue11054@psf.upfronthosting.co.za> Message-ID: <1296272827.91.0.103223659215.issue11054@psf.upfronthosting.co.za> New submission from Ned Deily : During the 3.2rc1 release cycle, it was discovered that it was no longer possible to build the 32-bit installer on OS X 10.5 as customary with the system Python 2.5 due to an inadvertent 2.6 feature ("with") added to the OS X installer build script. This unnecessarily complicates the installer build process and violates past attempts to keep the installer script buildable with the system Python and compatible across current Python 2.x and 3.x releases. The attached patch to the installer script removes the "with", properly guards a new Python 3 only build step, and updates the comments and README file. The patched build script has been tested on both OS X 10.5 and 10.6. This patch should be included in 3.2rc2. ---------- assignee: ned.deily components: Build, Macintosh files: issue_synch_installer_py3k.patch keywords: patch messages: 127377 nosy: georg.brandl, ned.deily, ronaldoussoren priority: release blocker severity: normal stage: patch review status: open title: OS X installer build script for 3.2 can no longer build with system Python on OS X 10.5 versions: Python 3.2 Added file: http://bugs.python.org/file20595/issue_synch_installer_py3k.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 05:03:38 2011 From: report at bugs.python.org (Ned Deily) Date: Sat, 29 Jan 2011 04:03:38 +0000 Subject: [New-bugs-announce] [issue11055] OS X IDLE 3.2 Save As menu accelerator opens two Save windows In-Reply-To: <1296273818.82.0.517737090521.issue11055@psf.upfronthosting.co.za> Message-ID: <1296273818.82.0.517737090521.issue11055@psf.upfronthosting.co.za> New submission from Ned Deily : With the menu accelerators corrected (as patched in Issue10940), IDLE 3.2 with Cocoa Tk 8.5 opens two Save As dialog windows instead of one. This doesn't happen when the Save As item is selected with the mouse nor does it happen with Carbon Tk 8.4. The simple workaround is to dismiss the second dialog window. This can be investigated and fixed post 3.2 release. ---------- assignee: ned.deily components: IDLE, Macintosh messages: 127378 nosy: ned.deily priority: normal severity: normal stage: needs patch status: open title: OS X IDLE 3.2 Save As menu accelerator opens two Save windows versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 11:07:26 2011 From: report at bugs.python.org (nw) Date: Sat, 29 Jan 2011 10:07:26 +0000 Subject: [New-bugs-announce] [issue11056] 2to3 fails for inner __metaclass__ class definition In-Reply-To: <1296295646.41.0.555218890155.issue11056@psf.upfronthosting.co.za> Message-ID: <1296295646.41.0.555218890155.issue11056@psf.upfronthosting.co.za> New submission from nw : The attached code is not converted properly. No warning either. Eventually it may be a good idea to reintroduce the old more versatile method. ---------- components: 2to3 (2.x to 3.0 conversion tool) files: test.py messages: 127394 nosy: Nils.Winter priority: normal severity: normal status: open title: 2to3 fails for inner __metaclass__ class definition Added file: http://bugs.python.org/file20598/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 11:38:21 2011 From: report at bugs.python.org (Kelsey) Date: Sat, 29 Jan 2011 10:38:21 +0000 Subject: [New-bugs-announce] [issue11057] Missing DistutilsOptionError In-Reply-To: <1296297501.69.0.98662936413.issue11057@psf.upfronthosting.co.za> Message-ID: <1296297501.69.0.98662936413.issue11057@psf.upfronthosting.co.za> New submission from Kelsey : Missing DistutilsOptionError import in distutil2.config causes the following error: Traceback (most recent call last): File "/opt/OpenPython-2.7.1/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/opt/OpenPython-2.7.1/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/opt/OpenPython-2.7.1/lib/python2.7/site-packages/Distutils2-1.0a3-py2.7.egg/distutils2/run.py", line 181, in main() File "/opt/OpenPython-2.7.1/lib/python2.7/site-packages/Distutils2-1.0a3-py2.7.egg/distutils2/run.py", line 176, in main return commands_main() File "/opt/OpenPython-2.7.1/lib/python2.7/site-packages/Distutils2-1.0a3-py2.7.egg/distutils2/run.py", line 90, in commands_main dist.parse_config_files() File "/opt/OpenPython-2.7.1/lib/python2.7/site-packages/Distutils2-1.0a3-py2.7.egg/distutils2/dist.py", line 307, in parse_config_files return self.config.parse_config_files(filenames) File "/opt/OpenPython-2.7.1/lib/python2.7/site-packages/Distutils2-1.0a3-py2.7.egg/distutils2/config.py", line 193, in parse_config_files self._read_setup_cfg(parser) File "/opt/OpenPython-2.7.1/lib/python2.7/site-packages/Distutils2-1.0a3-py2.7.egg/distutils2/config.py", line 113, in _read_setup_cfg raise DistutilsOptionError(msg) NameError: global name 'DistutilsOptionError' is not defined ---------- assignee: tarek components: Distutils2 messages: 127396 nosy: eric.araujo, kelseyhightower, tarek priority: normal severity: normal status: open title: Missing DistutilsOptionError type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 12:27:01 2011 From: report at bugs.python.org (Kelsey) Date: Sat, 29 Jan 2011 11:27:01 +0000 Subject: [New-bugs-announce] [issue11058] dist directory not created when running sdist command In-Reply-To: <1296300421.59.0.468968378526.issue11058@psf.upfronthosting.co.za> Message-ID: <1296300421.59.0.468968378526.issue11058@psf.upfronthosting.co.za> New submission from Kelsey : When trying to create a source distribution, I get the following error and no stack trace: [openpython:yamlconfig]$ /opt/OpenPython-2.7.1/bin/python -m distutils2.run sdist WARNING:root:warning: no files found matching 's' WARNING:root:warning: no files found matching 'e' WARNING:root:warning: no files found matching 't' WARNING:root:warning: no files found matching 'u' WARNING:root:warning: no files found matching 'p' WARNING:root:warning: no files found matching '.' WARNING:root:warning: no files found matching 'p' WARNING:root:warning: no files found matching 'y' error: dist/yamlconfig-0.3.1.tar.gz: No such file or directory Not sure what all the WARNINGs are for, will file a separate issue for those. ---------- assignee: tarek components: Distutils2 messages: 127401 nosy: eric.araujo, kelseyhightower, tarek priority: normal severity: normal status: open title: dist directory not created when running sdist command type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 13:42:41 2011 From: report at bugs.python.org (Steffen Daode Nurpmeso) Date: Sat, 29 Jan 2011 12:42:41 +0000 Subject: [New-bugs-announce] [issue11059] code.python.org repo failures introduced! In-Reply-To: <1296304961.11.0.1358070149.issue11059@psf.upfronthosting.co.za> Message-ID: <1296304961.11.0.1358070149.issue11059@psf.upfronthosting.co.za> New submission from Steffen Daode Nurpmeso : ... because i don't know where to place this message, i do place it here. Whatever has happened in the last 90 minutes, cloning from code.python.org/hg results in mercurial panics! Please see http://mercurial.selenic.com/bts/issue2239 for more on that. Have a nice weekend. ---------- messages: 127408 nosy: sdaoden priority: normal severity: normal status: open title: code.python.org repo failures introduced! type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 15:55:44 2011 From: report at bugs.python.org (Godefroid Chapelle) Date: Sat, 29 Jan 2011 14:55:44 +0000 Subject: [New-bugs-announce] [issue11060] distutils2 sdist does not complain about version that is not PEP 386 compliant In-Reply-To: <1296312944.75.0.70099754625.issue11060@psf.upfronthosting.co.za> Message-ID: <1296312944.75.0.70099754625.issue11060@psf.upfronthosting.co.za> New submission from Godefroid Chapelle : sdist does not complain about version = 0.4.5dev which is not PEP 386 compliant ---------- assignee: tarek components: Distutils2 messages: 127425 nosy: eric.araujo, gotcha, tarek priority: normal severity: normal status: open title: distutils2 sdist does not complain about version that is not PEP 386 compliant _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 16:20:55 2011 From: report at bugs.python.org (Sebastien Douche) Date: Sat, 29 Jan 2011 15:20:55 +0000 Subject: [New-bugs-announce] [issue11061] Verify command option before parsing config file In-Reply-To: <1296314455.37.0.770288704329.issue11061@psf.upfronthosting.co.za> Message-ID: <1296314455.37.0.770288704329.issue11061@psf.upfronthosting.co.za> New submission from Sebastien Douche : Distutils2 verify command (like sdist) when he use it. A small optimization is add the verification step at launch. ---------- assignee: tarek components: Distutils2 messages: 127432 nosy: eric.araujo, sdouche, tarek priority: normal severity: normal status: open title: Verify command option before parsing config file type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 17:19:36 2011 From: report at bugs.python.org (R. David Murray) Date: Sat, 29 Jan 2011 16:19:36 +0000 Subject: [New-bugs-announce] [issue11062] mailbox fails to round-trip a file to a Babyl mailbox In-Reply-To: <1296317976.28.0.825353703674.issue11062@psf.upfronthosting.co.za> Message-ID: <1296317976.28.0.825353703674.issue11062@psf.upfronthosting.co.za> New submission from R. David Murray : One of the new tests introduced for #9124 fails for the Bably mailbox format. The failing tests pass a file to the add method (test_add_binary_file, test_add_nonascii_binary_file, test_add_text_file_warns). The failing part of the tests have been temporarily disabled for the Bably mailbox format since it is a pre-existing, unreported bug. ---------- components: Library (Lib) keywords: easy messages: 127434 nosy: r.david.murray priority: normal severity: normal stage: needs patch status: open title: mailbox fails to round-trip a file to a Babyl mailbox type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 18:11:00 2011 From: report at bugs.python.org (Keith Dart) Date: Sat, 29 Jan 2011 17:11:00 +0000 Subject: [New-bugs-announce] [issue11063] uuid.py module import has heavy side effects In-Reply-To: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> Message-ID: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> New submission from Keith Dart : When the uuid.py module is simply imported it has the side effect of forking a subprocess (/sbin/ldconfig) and doing a lot of stuff find a uuid implementation by ctypes. This is undesirable in many contexts. It would be better to perform those tasks on demand, when the first UUID is actually requested. In general, imports should avoid unnecessary system call side effects. This also makes testing easier. ---------- components: Library (Lib) messages: 127442 nosy: Keith.Dart priority: normal severity: normal status: open title: uuid.py module import has heavy side effects type: resource usage versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 19:08:52 2011 From: report at bugs.python.org (Dustin Farris) Date: Sat, 29 Jan 2011 18:08:52 +0000 Subject: [New-bugs-announce] [issue11064] abc documentation version conflict In-Reply-To: <1296324532.36.0.0952185002021.issue11064@psf.upfronthosting.co.za> Message-ID: <1296324532.36.0.0952185002021.issue11064@psf.upfronthosting.co.za> New submission from Dustin Farris : Running help(abc) in Python 2.6.1 displays syntax for Py3k. ---------- assignee: docs at python components: Documentation messages: 127453 nosy: docs at python, dustin.farris priority: normal severity: normal status: open title: abc documentation version conflict type: behavior versions: Python 2.6, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 20:12:30 2011 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 29 Jan 2011 19:12:30 +0000 Subject: [New-bugs-announce] [issue11065] Fatal "can't locate locale" errors when zip file with directories is on the PYTHONPATH. In-Reply-To: <1296328350.27.0.0987051728598.issue11065@psf.upfronthosting.co.za> Message-ID: <1296328350.27.0.0987051728598.issue11065@psf.upfronthosting.co.za> New submission from Ned Batchelder : Run this shell script against 3.2, and it will fail. Against 3.1, it succeeds. I've been running tests on Ubuntu 10.10. mkdir -p sub cat >sub/modzip.py < _______________________________________ From report at bugs.python.org Sat Jan 29 22:15:41 2011 From: report at bugs.python.org (Pierre Quentel) Date: Sat, 29 Jan 2011 21:15:41 +0000 Subject: [New-bugs-announce] [issue11066] cgi.py proposals : sys.stdout encoding + rewriting of parsing functions In-Reply-To: <1296335741.52.0.506773731017.issue11066@psf.upfronthosting.co.za> Message-ID: <1296335741.52.0.506773731017.issue11066@psf.upfronthosting.co.za> New submission from Pierre Quentel : Python 3.2rc1 introduced a new version of cgi.py that handles correctly file uploads In this version, the FieldStorage constructor receives an argument "encoding" which is the encoding used by the document holding the submitted form On the CGI script side, there is currently no easy way to print the received form fields with another encoding than sys.stdout.encoding. The proposed version introduces a function, set_stdout_encoding(charset), which can be used in the CGI script to set sys.stdout to an instance of a class that uses the charset encoding. This way, print() will use this encoding. "charset" must be the encoding defined in the content-type header sent by the CGI scrpt This class (IOMix) was written by Glen Linderman and proposed in the 3.2rc1 version, but no consensus could be reached on time for the release Another proposed change is a rewriting of the module-level functions parse() and parse_multipart() : they now use the FieldStorage methods instead ---------- components: Library (Lib) files: cgi_20110129.diff keywords: patch messages: 127487 nosy: quentel priority: normal severity: normal status: open title: cgi.py proposals : sys.stdout encoding + rewriting of parsing functions type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file20612/cgi_20110129.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 22:34:47 2011 From: report at bugs.python.org (Peter Eisentraut) Date: Sat, 29 Jan 2011 21:34:47 +0000 Subject: [New-bugs-announce] [issue11067] Py_LIMITED_API breaks most PySomething_Check() functions In-Reply-To: <1296336887.12.0.12161660566.issue11067@psf.upfronthosting.co.za> Message-ID: <1296336887.12.0.12161660566.issue11067@psf.upfronthosting.co.za> New submission from Peter Eisentraut : When setting Py_LIMITED_API, functions such as PyUnicode_Check() can no longer be used. Example: #define Py_LIMITED_API #include void foo() { PyObject *o; PyUnicode_Check(o); } test.c: In function ?foo?: test.c:9: error: dereferencing pointer to incomplete type PEP 384 contains some nested language that suggests that the _Check macros should be available under the limited API. And it seems to me that they easily could be, if Py_TYPE were implemented as a function instead of a macro. ---------- components: None messages: 127488 nosy: petere priority: normal severity: normal status: open title: Py_LIMITED_API breaks most PySomething_Check() functions versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jan 29 23:21:42 2011 From: report at bugs.python.org (David Meier) Date: Sat, 29 Jan 2011 22:21:42 +0000 Subject: [New-bugs-announce] [issue11068] Python 2.7.1 Idle Segmentation Fault OS X (10.6.6) In-Reply-To: <1296339702.88.0.766799420032.issue11068@psf.upfronthosting.co.za> Message-ID: <1296339702.88.0.766799420032.issue11068@psf.upfronthosting.co.za> New submission from David Meier : After IDLE launches I select 'File->Open' browse to a blank .py file, when I select the particular file I get the segfault below... silverbox:~ user$ (idle&) silverbox:~ user$ Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/run.py", line 93, in main seq, request = rpc.request_queue.get(block=True, timeout=0.05) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/Queue.py", line 177, in get self.not_empty.wait(remaining) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 257, in wait _sleep(delay) TypeError: 'int' object is not callable ---------- components: IDLE messages: 127492 nosy: David.Meier priority: normal severity: normal status: open title: Python 2.7.1 Idle Segmentation Fault OS X (10.6.6) type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 03:36:17 2011 From: report at bugs.python.org (Yakov Blum) Date: Sun, 30 Jan 2011 02:36:17 +0000 Subject: [New-bugs-announce] [issue11069] IDLE crashes when Stack Viewer opened In-Reply-To: <1296354977.38.0.0551219398601.issue11069@psf.upfronthosting.co.za> Message-ID: <1296354977.38.0.0551219398601.issue11069@psf.upfronthosting.co.za> New submission from Yakov Blum : This problem was asked about on Stack Overflow, where there's some more information on it: http://stackoverflow.com/questions/4046021/python-idle-windows-pressing-stack-viewer-exits-all-idle-windows But I didn't see it listed as a bug here. I've also experienced it in Python 3.1.3 ---------- components: IDLE messages: 127509 nosy: Yakov.Blum priority: normal severity: normal status: open title: IDLE crashes when Stack Viewer opened type: crash versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 03:56:04 2011 From: report at bugs.python.org (rmtew) Date: Sun, 30 Jan 2011 02:56:04 +0000 Subject: [New-bugs-announce] [issue11070] test_capi crashes and fails In-Reply-To: <1296356164.16.0.546388773568.issue11070@psf.upfronthosting.co.za> Message-ID: <1296356164.16.0.546388773568.issue11070@psf.upfronthosting.co.za> New submission from rmtew : OS: Windows 7 Compiler: Visual Studio 2008 Build: Win32 (Debug and Release) The main problem is observed in both debug and release builds, and even though the test effectively passes in both it also fails in release build. ** In a debug build I see the following: test_instancemethod (__main__.CAPITest) ... ok test_no_FatalError_infinite_loop (__main__.CAPITest) ... Then a dialog pops up telling me that Python has crashed. The unit test execution pauses until this dialog is dealt with. This then becomes: test_no_FatalError_infinite_loop (__main__.CAPITest) ... ok And the unit tests proceed to pass. ** In a release build I see the following: test_instancemethod (__main__.CAPITest) ... ok test_no_FatalError_infinite_loop (__main__.CAPITest) ... Then the crash dialog also pops up. Dismissing it results in the test failing however. test_no_FatalError_infinite_loop (__main__.CAPITest) ... FAIL ====================================================================== FAIL: test_no_FatalError_infinite_loop (__main__.CAPITest) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib\test\test_capi.py", line 50, in test_no_FatalError_infinite_loop b'Fatal Python error:' AssertionError: b"Fatal Python error: PyThreadState_Get: no current thread\n\r\nThis application has requested the Runtime to terminate it in an unusual way.\nPlease contact the application's support team for more information." != b'Fatal Python error: PyThreadState_Get: no current thread' Is there some information I am missing somewhere (that I have not found via googling) or is this part of the gauntlet of unit test execution on Python now? ---------- components: Tests, Windows messages: 127512 nosy: rmtew priority: normal severity: normal status: open title: test_capi crashes and fails type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jan 30 14:29:45 2011 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 30 Jan 2011 13:29:45 +0000 Subject: [New-bugs-announce] [issue11071] What's New review comments In-Reply-To: <1296394185.46.0.874389567772.issue11071@psf.upfronthosting.co.za> Message-ID: <1296394185.46.0.874389567772.issue11071@psf.upfronthosting.co.za> New submission from Nick Coghlan : Reviewing the What's New docs, this seemed like the easiest way to give Raymond a list of things I noticed: - first sentence in the "ast" module section needs rewording (currently includes fragments from a couple of different phrasings) - in the "dis" module section, dis.dis has also acquired the ability to disassemble source string directly, avoiding the need to compile them manually first (see issue 6507). - in the "dbm" module section, there is another case of a sentence containing fragments from two different phrasings - the new "handler of last resort" functionality in the logging module deserves a mention (see issue 10626 and the explanation at http://docs.python.org/dev/howto/logging.html#what-happens-if-no-configuration-is-provided) - Vinay's rewrite of the logging module docs to be significantly more approachable (by splitting them into the raw logging API docs and the "read-as-much-as-you-need-to" logging HOWTO) is also a notable and welcome change. ---------- assignee: rhettinger components: Documentation messages: 127529 nosy: ncoghlan, rhettinger priority: normal severity: normal status: open title: What's New review comments versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 00:37:31 2011 From: report at bugs.python.org (Giampaolo Rodola') Date: Sun, 30 Jan 2011 23:37:31 +0000 Subject: [New-bugs-announce] [issue11072] Add MLSD command support to ftplib In-Reply-To: <1296430651.22.0.68039486547.issue11072@psf.upfronthosting.co.za> Message-ID: <1296430651.22.0.68039486547.issue11072@psf.upfronthosting.co.za> New submission from Giampaolo Rodola' : >From RFC-3659: The MLST and MLSD commands are intended to standardize the file and directory information returned by the server-FTP process. These commands differ from the LIST command in that the format of the replies is strictly defined although extensible. The patch in attachment adds support for MLSD command. This should ease the development of ftp clients which are forced to parse un-standardized LIST responses via dir() or retrlines() methods to obtain meaningful data for the directory listing. Example: >>> import ftplib >>> from pprint import pprint as pp >>> f = ftplib.FTP() >>> f.connect("localhost") >>> f.login("anonymous") >>> ls = f.mlsd() >>> pp(ls) {'modify': 20100814164724, 'name': 'svnmerge.py', 'perm': 'r', 'size': 90850, 'type': 'file', 'unique': '80718b568'}, {'modify': 20101207185033, 'name': 'README', 'perm': 'r', 'size': 53731, 'type': 'file', 'unique': '80718aafe'}, {'modify': 20100417183215, 'name': 'install-sh', 'perm': 'r', 'size': 7122, 'type': 'file', 'unique': '80718b2d2'}, {'modify': 20110129210053, 'name': 'Include', 'perm': 'el', 'size': 4096, 'type': 'dir', 'unique': '8071a2bc4'}] >>> ---------- files: ftplib_mlsd.patch keywords: patch messages: 127562 nosy: giampaolo.rodola, pitrou priority: normal severity: normal status: open title: Add MLSD command support to ftplib versions: Python 3.3 Added file: http://bugs.python.org/file20623/ftplib_mlsd.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 02:42:52 2011 From: report at bugs.python.org (Roy Smith) Date: Mon, 31 Jan 2011 01:42:52 +0000 Subject: [New-bugs-announce] [issue11073] threading.Thread documentation can be improved In-Reply-To: <1296438172.29.0.214693848128.issue11073@psf.upfronthosting.co.za> Message-ID: <1296438172.29.0.214693848128.issue11073@psf.upfronthosting.co.za> New submission from Roy Smith : The documentation for the threading.Thread constructor says: "target is the callable object to be invoked by the run() method. Defaults to None, meaning nothing is called." This could be improved by explicitly stating that target is called in a static context. As written, it takes a bit of thought (and experimentation) to be sure of that. ---------- assignee: docs at python components: Documentation messages: 127566 nosy: docs at python, roysmith priority: normal severity: normal status: open title: threading.Thread documentation can be improved versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 05:04:11 2011 From: report at bugs.python.org (Brett Cannon) Date: Mon, 31 Jan 2011 04:04:11 +0000 Subject: [New-bugs-announce] [issue11074] fix tokenize so it can be reloaded In-Reply-To: <1296446651.43.0.796363573653.issue11074@psf.upfronthosting.co.za> Message-ID: <1296446651.43.0.796363573653.issue11074@psf.upfronthosting.co.za> New submission from Brett Cannon : The tokenize module stores the built-in open() module in a global assignment statement. Problem is that if you reload the module, that global assignment picks up the module's own open() that came into existence during the initial import. The attached patch fixes this by having tokenize.open() use builtins.open() instead of its own cached global version. ---------- assignee: georg.brandl components: Library (Lib) files: tokenize_reload.diff keywords: easy, patch messages: 127570 nosy: brett.cannon, georg.brandl, haypo priority: normal severity: normal stage: commit review status: open title: fix tokenize so it can be reloaded type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file20624/tokenize_reload.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 06:26:32 2011 From: report at bugs.python.org (Alex McNerney) Date: Mon, 31 Jan 2011 05:26:32 +0000 Subject: [New-bugs-announce] [issue11075] Turtle crash with IDLE on Mac OS X 10.6 In-Reply-To: <1296451592.7.0.220170284749.issue11075@psf.upfronthosting.co.za> Message-ID: <1296451592.7.0.220170284749.issue11075@psf.upfronthosting.co.za> New submission from Alex McNerney : Info: I have Python 2.7.1:86832 (32-bit) installed using ActiveState Tcl/Tk 8.5.9 on Mac OS X 10.6 Problem: Whenever I try to run (from the IDLE) a Python script using the turtle module, the window that shows up will draw anything passed to it, but it will not come to the front using the listen() function, nor will clicking on the window do anything more than cause the spinning beach ball to appear. Because it does not come the the foreground, functions like onkey() and onclick() are completely unusable. However, when said Python script is run from the Terminal, the window is completely responsive. I believe this to be some sort of problem with the IDLE.app Things that I have tried: Tried different versions of tcl/tk: 8.4.19, 8.4.7, 8.5.9 Tried different versions of Python 2.7.1: 32-bit, 32/64-bit, 32-bit compiled from source. Other things that may be useful: This probably has no relevancy, but just in case: In the .mpkg installed Python 2.7.1 (32-bit), the IDLE says the GCC version is 4.0.1 In the source compiled version, it says 4.2.1 It is quite annoying to not be able to use the IDLE to create and test programs using the turtle module. Please help. ---------- assignee: ronaldoussoren components: IDLE, Macintosh, Tkinter messages: 127577 nosy: amcnerney13, ronaldoussoren priority: normal severity: normal status: open title: Turtle crash with IDLE on Mac OS X 10.6 type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 09:05:03 2011 From: report at bugs.python.org (Virgil Dupras) Date: Mon, 31 Jan 2011 08:05:03 +0000 Subject: [New-bugs-announce] [issue11076] Iterable argparse Namespace In-Reply-To: <1296461103.49.0.397676179483.issue11076@psf.upfronthosting.co.za> Message-ID: <1296461103.49.0.397676179483.issue11076@psf.upfronthosting.co.za> New submission from Virgil Dupras : Currently, there is no (documented) way to easily extract arguments in an argparse Namespace as a dictionary. This way, it would me easy to interface a function taking a lot of kwargs like this: >>> args = parser.parse_args() >>> my_function(**dict(args)) There's "_get_kwargs()" but it's a private undocumented method. I guess that making it public would be problematic because of the namespace pollution that would occur. That's why I'm proposing to make it iterable. If it isn't rejected, I'd gladly work on the required patch. ---------- components: Library (Lib) keywords: easy messages: 127582 nosy: vdupras priority: normal severity: normal status: open title: Iterable argparse Namespace type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 16:40:32 2011 From: report at bugs.python.org (Scott M) Date: Mon, 31 Jan 2011 15:40:32 +0000 Subject: [New-bugs-announce] [issue11077] Tkinter is not thread safe. This is a bug. In-Reply-To: <1296488432.58.0.0945320697853.issue11077@psf.upfronthosting.co.za> Message-ID: <1296488432.58.0.0945320697853.issue11077@psf.upfronthosting.co.za> New submission from Scott M : The more I look at GUI support in Python, the more I realize that the lack of basic thread safety in GUI support is simply a bug. I know Java's Swing has the same thread limitation, but that doesn't make it right. Xlib is thread safe. The Windows SDK is thread safe. Python is supposed to be the language that's easy to use, and there is nothing easy about teaching new programmers that they have to mess with queues and timers just to get a basic set of displays running, just because when threads are in use. I'm in the position of teaching folk with little-to-no programming experience, how to script simple applications in Python. The modules they have to use are inherently threaded, and delivery hunks of data from multiple sources to them. The most natural instinct is to put up some graphs and other widgits to display the data, and all of it is completely trivial right up until I have to explain that drawing a line isn't canvas.line(from, to), but becomes an exercise in Queue.Queue and theRoot.after(n, myself), before you even get to learn about widgits. Threading is supposed to simplify problems, not add to them. Having to hack around with special timers and polling, just to get some simple graphs up, is plain unpythonic. Please consider this a bug, a glaring misfeature, in a language that is otherwise a very reasonable choice to get technical but non-programmerish people into toolmaking self-sufficiency. ---------- components: Tkinter messages: 127604 nosy: PythonInTheGrass priority: normal severity: normal status: open title: Tkinter is not thread safe. This is a bug. type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 16:55:33 2011 From: report at bugs.python.org (R. David Murray) Date: Mon, 31 Jan 2011 15:55:33 +0000 Subject: [New-bugs-announce] [issue11078] Have test___all__ check for duplicates In-Reply-To: <1296489333.39.0.726513534716.issue11078@psf.upfronthosting.co.za> Message-ID: <1296489333.39.0.726513534716.issue11078@psf.upfronthosting.co.za> New submission from R. David Murray : Inspired by what happened in issue 8973, I offer the attached patch for test__all__ to have it check the __all__ list for duplicates. Interestingly, the first failure is not in struct, but in os. Obviously the patch can't be applied until the test succeeds, so I'll be coming back to this later. Figured I'd post the test patch in case anyone else wants to play with fixing things before I get to it. ---------- components: Tests files: check_all_for_duplicates.patch keywords: patch messages: 127608 nosy: SilentGhost, pitrou, r.david.murray priority: normal severity: normal stage: needs patch status: open title: Have test___all__ check for duplicates type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file20627/check_all_for_duplicates.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 17:19:03 2011 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 31 Jan 2011 16:19:03 +0000 Subject: [New-bugs-announce] [issue11079] Make OS X entry in Applications like that in Windows In-Reply-To: <1296490743.96.0.234780831636.issue11079@psf.upfronthosting.co.za> Message-ID: <1296490743.96.0.234780831636.issue11079@psf.upfronthosting.co.za> New submission from Raymond Hettinger : In Applications, the 3.2 entry includes: * Python Launcher * IDLE * Update Shell.Profile Command * Extras directory The latter should be dropped (most of the tools only make sense from the command-line) and should be replaced by a link to the docs: file:///Library/Frameworks/Python.framework/Versions/3.2/Resources/English.lproj/Documentation/index.html This setup better matches what we offer in Windows and it makes the docs more accessible. The Windows setup also includes an uninstall option. It would be nice if OS X did the same, but I don't know if that is the way of the Mac. ---------- assignee: ned.deily components: Build messages: 127612 nosy: ned.deily, rhettinger, ronaldoussoren priority: normal severity: normal status: open title: Make OS X entry in Applications like that in Windows versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 17:58:55 2011 From: report at bugs.python.org (Terry M. Topka) Date: Mon, 31 Jan 2011 16:58:55 +0000 Subject: [New-bugs-announce] [issue11080] Win32Serial.read coding error for non-blocking read In-Reply-To: <1296493135.79.0.311076655892.issue11080@psf.upfronthosting.co.za> Message-ID: <1296493135.79.0.311076655892.issue11080@psf.upfronthosting.co.za> New submission from Terry M. Topka : Attempting to read a fixed amount of data when the serial port is configured for non-blocking reads (i.e. self.timeout == 0) will occasionally throw an invalid memory access exception, due to an error in the following code: ### pyserial-2.5-rc2 serialWin32.py Line 219 if self.timeout == 0: n = min(comstat.cbInQue, size) if n > 0: buf = ctypes.create_string_buffer(n) rc = win32.DWORD() err = win32.ReadFile(self.hComPort, buf, size, ctypes.byref(rc), ctypes.byref(self._overlappedRead)) The buffer length passed to win32.ReadFile should be 'n', not 'size'. This may not have been noticed since it is timing dependent: only if additional input is enqueued inbetween accessing the input queue length and the ReadFile call will the inappropriate invalid memory access exception be raised when 'size' is greater than 'n'. ---------- components: Extension Modules, Windows files: serialwin32.py messages: 127619 nosy: tmtopka priority: normal severity: normal status: open title: Win32Serial.read coding error for non-blocking read type: crash versions: 3rd party, Python 2.6 Added file: http://bugs.python.org/file20628/serialwin32.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 18:21:59 2011 From: report at bugs.python.org (SilentGhost) Date: Mon, 31 Jan 2011 17:21:59 +0000 Subject: [New-bugs-announce] [issue11081] from struct import * misses pack_into In-Reply-To: <1296494519.33.0.0318665786587.issue11081@psf.upfronthosting.co.za> Message-ID: <1296494519.33.0.0318665786587.issue11081@psf.upfronthosting.co.za> New submission from SilentGhost : the following issue was introduced in r81947: >>> from struct import * >>> pack_into Traceback (most recent call last): File "", line 1, in pack_into NameError: name 'pack_into' is not defined struct.__all__ has a duplicate entry for "unpack" and misses "pack_into". Patch is attached, test passes. Seems quite innocent to me, could it make into 3.2, George? Related: #8973 and #11078 ---------- components: Library (Lib) files: struct.py.diff keywords: easy, patch messages: 127625 nosy: SilentGhost, belopolsky, georg.brandl, mark.dickinson priority: normal severity: normal status: open title: from struct import * misses pack_into type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file20629/struct.py.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 20:18:12 2011 From: report at bugs.python.org (William Wu) Date: Mon, 31 Jan 2011 19:18:12 +0000 Subject: [New-bugs-announce] [issue11082] ValueError: Content-Length should be specified In-Reply-To: <1296501492.73.0.362770141375.issue11082@psf.upfronthosting.co.za> Message-ID: <1296501492.73.0.362770141375.issue11082@psf.upfronthosting.co.za> New submission from William Wu : I found this bug when I started to trying Python 3.2 release candidate 1. When using urllib.request.urlopen to handle HTTP POST, I got the error message: ValueError: Content-Length should be specified for iterable data of type 'foo=bar' I'll attach the patch and test case. ---------- components: Library (Lib) messages: 127646 nosy: William.Wu priority: normal severity: normal status: open title: ValueError: Content-Length should be specified type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 20:22:23 2011 From: report at bugs.python.org (Federico Culloca) Date: Mon, 31 Jan 2011 19:22:23 +0000 Subject: [New-bugs-announce] [issue11083] threading.Thread - start() rises RuntimeException? In-Reply-To: <1296501743.29.0.748896290236.issue11083@psf.upfronthosting.co.za> Message-ID: <1296501743.29.0.748896290236.issue11083@psf.upfronthosting.co.za> New submission from Federico Culloca : In the threading module documentation, about the start() method of the threading.Thread class, it says that, upon calling start() more then once, a RuntimeException is raised. I couldn't find in the whole documentation other references to this "RuntimeException". Maybe it's RuntimeError? ---------- assignee: docs at python components: Documentation messages: 127647 nosy: Federico.Culloca, docs at python priority: normal severity: normal status: open title: threading.Thread - start() rises RuntimeException? type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 20:37:31 2011 From: report at bugs.python.org (GDR!) Date: Mon, 31 Jan 2011 19:37:31 +0000 Subject: [New-bugs-announce] [issue11084] Serialization of decimal.Decimal to XML-RPC In-Reply-To: <1296502651.44.0.847909816314.issue11084@psf.upfronthosting.co.za> Message-ID: <1296502651.44.0.847909816314.issue11084@psf.upfronthosting.co.za> New submission from GDR! : xmlrpc.client (and xmlrpclib in 2.x) can't serialize instances of Decimal, throwing TypeError instead. Because XML is a textual format, converting from decimal to float may cause loss of data. According to http://www.xmlrpc.com/spec, encoding Decimal as XML-RPC is allowed: "The range of allowable values is implementation-dependent, is not specified." Therefore, including decimal numbers that can not be represented by IEEE double is allowed by the spec. Also, in my opinion, making a numeric type available in standard library unsupported by another part of standard library, is counterintuitive, but it's just my personal point of view. I can provide a patch if this bug report is considered proper. ---------- components: Library (Lib) messages: 127651 nosy: gdr priority: normal severity: normal status: open title: Serialization of decimal.Decimal to XML-RPC type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 20:44:26 2011 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 31 Jan 2011 19:44:26 +0000 Subject: [New-bugs-announce] [issue11085] expose _abcoll as collections.abc In-Reply-To: <1296503066.28.0.738947830383.issue11085@psf.upfronthosting.co.za> Message-ID: <1296503066.28.0.738947830383.issue11085@psf.upfronthosting.co.za> New submission from Raymond Hettinger : For the 3.3, make _abcoll (which is full of the collections abstract base classes) visible as a module called collections.abc and document that as the preferred way to access them. For backwards compatibility, continue to import the names directly into the collections.py namespace so that no one has to change existing code. Background: Experience with teaching ABCs and dealing with bug reports has shown that it is creating some confusion having the long list of abstract APIs commingled with the concrete APIs (for example, seeing collections.Mapping and thinking it is one of the various concrete types in the collections module). If it were to become a practice to write collections.abc.Mapping, it would be immediately clear that an ABC was being used rather than a concrete class like OrderedDict. The other reason to separate them is that the use cases tend to be different. People look to the abstract APIs either for a specification (reference purposes), for mixin methods (aid in building their own classes), or for registration (to control isinstance and issubclass). In contrast, people use concrete APIs directly for managing data. Accordingly, it makes senses to group the two different types of tools into separate toolboxes. ---------- components: Library (Lib) messages: 127652 nosy: rhettinger priority: low severity: normal status: open title: expose _abcoll as collections.abc type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jan 31 21:52:47 2011 From: report at bugs.python.org (Brett Cannon) Date: Mon, 31 Jan 2011 20:52:47 +0000 Subject: [New-bugs-announce] [issue11086] add lib2to3/__main__.py In-Reply-To: <1296507167.64.0.584286117272.issue11086@psf.upfronthosting.co.za> Message-ID: <1296507167.64.0.584286117272.issue11086@psf.upfronthosting.co.za> New submission from Brett Cannon : There is no reason why the 2to3 script can't be gutted and turned into just a stub that uses runpy to call lib2to3.__main__. Also has the nice benefit that one can use ``-m lib2to3`` instead of having to use the 2to3 script. ---------- components: Library (Lib) keywords: easy messages: 127659 nosy: brett.cannon priority: low severity: normal stage: needs patch status: open title: add lib2to3/__main__.py versions: Python 3.3 _______________________________________ Python tracker _______________________________________