From report at bugs.python.org Wed Jun 1 00:48:46 2011 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 May 2011 22:48:46 +0000 Subject: [New-bugs-announce] [issue12230] test_subprocess.test_pass_fds() failed on x86 Tiger 3.x In-Reply-To: <1306882126.33.0.416500122697.issue12230@psf.upfronthosting.co.za> Message-ID: <1306882126.33.0.416500122697.issue12230@psf.upfronthosting.co.za> New submission from STINNER Victor : test_subprocess.test_pass_fds() failed on x86 Tiger 3.x: test test_subprocess failed -- Traceback (most recent call last): File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_subprocess.py", line 1296, in test_pass_fds "fd to be closed passed") AssertionError: {9} is not false : fd to be closed passed http://www.python.org/dev/buildbot/all/builders/x86%20Tiger%203.x/builds/2671/steps/test/logs/stdio The pass_fds parameter of Popen constructor was introduced in #6559. ---------- components: Library (Lib), Tests keywords: buildbot messages: 137396 nosy: haypo, pitrou priority: normal severity: normal status: open title: test_subprocess.test_pass_fds() failed on x86 Tiger 3.x versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 1 01:56:13 2011 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 May 2011 23:56:13 +0000 Subject: [New-bugs-announce] [issue12231] regrtest: add -k and -K options to filter tests by function/file names In-Reply-To: <1306886173.49.0.536773734975.issue12231@psf.upfronthosting.co.za> Message-ID: <1306886173.49.0.536773734975.issue12231@psf.upfronthosting.co.za> New submission from STINNER Victor : Attached patch adds -k/--func-regex and -K/--file-regex options to filter tests by function/file names. It modifies makeSuite() and getTestCaseNames() functions of unittest.loader to add an optional filter argument: callback taking a function name as argument and returning False if the test should be ignored. You can use the new options more than once and their argument are regular expressions (case insensitive). Examples: - "./python -m test -k subprocess -K pass_fds" runs only 1 function of 1 file: test_subprocess.test_pass_fds() - "./python -m test -k os$" runs 1 file: test_os - "./python -m test -K codecencoding" runs 6 files: test_codecencodings_cn, test_codecencodings_hk, test_codecencodings_iso2022, test_codecencodings_jp, test_codecencodings_kr, test_codecencodings_tw ---------- components: Tests files: regrtest_regex.patch keywords: patch messages: 137402 nosy: haypo priority: normal severity: normal status: open title: regrtest: add -k and -K options to filter tests by function/file names versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22216/regrtest_regex.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 1 02:31:40 2011 From: report at bugs.python.org (Thanh Ly) Date: Wed, 01 Jun 2011 00:31:40 +0000 Subject: [New-bugs-announce] [issue12232] embedded python import cmath In-Reply-To: <1306888300.23.0.381408538703.issue12232@psf.upfronthosting.co.za> Message-ID: <1306888300.23.0.381408538703.issue12232@psf.upfronthosting.co.za> New submission from Thanh Ly : Calling Python script from C/C++ seems to work fine until using 'import cmath' causing the C/C++ application to hang. Other modules can be imported such as 'math'. ---------- messages: 137408 nosy: Thanh Ly priority: normal severity: normal status: open title: embedded python import cmath type: crash versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 1 03:39:53 2011 From: report at bugs.python.org (Austin Howard) Date: Wed, 01 Jun 2011 01:39:53 +0000 Subject: [New-bugs-announce] [issue12233] Lists in class objects not independent In-Reply-To: <1306892393.27.0.721356313159.issue12233@psf.upfronthosting.co.za> Message-ID: <1306892393.27.0.721356313159.issue12233@psf.upfronthosting.co.za> New submission from Austin Howard : When creating a class which contains elements that are lists, the lists for different instances of the class are not independent. Calling self.mylist.append(3) inside a class method will update the mylist variable for *all* instances of the class, not just the current instance. Attached is a script which demonstrates this behavior. ---------- components: Interpreter Core files: python_bug.py messages: 137410 nosy: austin1howard priority: normal severity: normal status: open title: Lists in class objects not independent type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file22218/python_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 1 15:03:24 2011 From: report at bugs.python.org (=?utf-8?q?Domen_Ko=C5=BEar?=) Date: Wed, 01 Jun 2011 13:03:24 +0000 Subject: [New-bugs-announce] [issue12234] unittest2 could enable regex debugging for more information In-Reply-To: <1306933404.89.0.697079292496.issue12234@psf.upfronthosting.co.za> Message-ID: <1306933404.89.0.697079292496.issue12234@psf.upfronthosting.co.za> New submission from Domen Ko?ar : When using self.assertRegexpMatches, it would be useful to see where did the matching stop. Maybe using re module debugging flag? ---------- components: Library (Lib) messages: 137432 nosy: iElectric priority: normal severity: normal status: open title: unittest2 could enable regex debugging for more information type: feature request versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 1 17:26:37 2011 From: report at bugs.python.org (Cal Leeming) Date: Wed, 01 Jun 2011 15:26:37 +0000 Subject: [New-bugs-announce] [issue12235] subprocess.check_output throws wrong exception if non executable In-Reply-To: <1306941997.06.0.876478438314.issue12235@psf.upfronthosting.co.za> Message-ID: <1306941997.06.0.876478438314.issue12235@psf.upfronthosting.co.za> New submission from Cal Leeming : If you attempt to call subprocess.check_output() on a file which is not executable, it gives a "file not found" exception, rather than "file not executable". Took me about 3 hours to figure out why it kept saying the file didn't exist, when it clearly did :| ***@***# ls -la ***/src/webapp/tools/grab.sh -rwxr-xr-x 1 *** *** 4398 Apr 19 10:55 ***/src/webapp/tools/grab.sh ***@***# ***/src/webapp/tools/grab.sh bash: ***/src/webapp/tools/grab.sh: /bin/sh^M: bad interpreter: No such file or directory Traceback (most recent call last): File "***/src/webapp/../webapp/idx/fourchan/tasks.py", line 77, in run subprocess.check_output([ DOWNLOAD_BIN, ]) File "/usr/local/lib/python2.7/subprocess.py", line 530, in check_output process = Popen(stdout=PIPE, *popenargs, **kwargs) File "/usr/local/lib/python2.7/subprocess.py", line 672, in __init__ errread, errwrite) File "/usr/local/lib/python2.7/subprocess.py", line 1201, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory Request: None ---------- messages: 137439 nosy: Cal.Leeming priority: normal severity: normal status: open title: subprocess.check_output throws wrong exception if non executable _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 1 20:55:57 2011 From: report at bugs.python.org (Julian Taylor) Date: Wed, 01 Jun 2011 18:55:57 +0000 Subject: [New-bugs-announce] [issue12236] Tkinter __version__ uses subversion substitution In-Reply-To: <1306954557.42.0.779197130773.issue12236@psf.upfronthosting.co.za> Message-ID: <1306954557.42.0.779197130773.issue12236@psf.upfronthosting.co.za> New submission from Julian Taylor : ./Lib/lib-tk/Tkinter.py:33 has this svn keyword substitution: __version__ = "$Revision$" Due to the change to hg this field is not substituted and makes __version__ quite pointless. This affects the python 2.7.2rc1. ---------- components: Tkinter messages: 137455 nosy: jtaylor priority: normal severity: normal status: open title: Tkinter __version__ uses subversion substitution type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 2 11:14:02 2011 From: report at bugs.python.org (de) Date: Thu, 02 Jun 2011 09:14:02 +0000 Subject: [New-bugs-announce] [issue12237] how to open non defult browser? In-Reply-To: <1307006042.24.0.905858439151.issue12237@psf.upfronthosting.co.za> Message-ID: <1307006042.24.0.905858439151.issue12237@psf.upfronthosting.co.za> New submission from de : hi all, I'm using win7, with Ff as default browser. i wont to open url in other browser installed on my PC. i tried: url = 'http://www.google.com' op = webbrowser.get('opera') op.open(url) and i get this error: Traceback (most recent call last): File "", line 1, in op = webbrowser.get('opera') File "C:\Python27\lib\webbrowser.py", line 52, in get raise Error("could not locate runnable browser") Error: could not locate runnable browser can anyone help? ---------- messages: 137469 nosy: hirsh priority: normal severity: normal status: open title: how to open non defult browser? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 2 13:57:40 2011 From: report at bugs.python.org (Niels Heinen) Date: Thu, 02 Jun 2011 11:57:40 +0000 Subject: [New-bugs-announce] [issue12238] Readline module loading in interactive mode In-Reply-To: <1307015860.03.0.129842780518.issue12238@psf.upfronthosting.co.za> Message-ID: <1307015860.03.0.129842780518.issue12238@psf.upfronthosting.co.za> New submission from Niels Heinen : Running the python binary without a script or using the -i flag will start the process in interactive mode. The interactive mode requires an external module to be loaded: readline. Per default behavior, Python also tries to load this module from the current working directory (see also trace below) strcpy(0x7fff17609ed8, ".so") = 0x7fff17609ed8 fopen64("readline.so", "rb" SYS_open("readline.so", 0, 0666) = -2 <... fopen64 resumed> ) = 0 strcpy(0x7fff17609ed8, "module.so") = 0x7fff17609ed8 fopen64("readlinemodule.so", "rb" SYS_open("readlinemodule.so", 0, 0666) The module is imported in Modules/main.c line 663: if ((Py_InspectFlag || ...... isatty(fileno(stdin))) { PyObject *v; v = PyImport_ImportModule("readline"); Why consider this a security bug: basically because you don't expect a program to import a shared library from your current directory _unless_ you explicitly tell it to (e.g. import blah). On a multi user system, someone could plant a malicious shared libraries named "readline.so" in an attempt to hack a user that runs python in interactive mode. The risk obviously _very_ low but nevertheless worth to consider improving by, for example, loading readline with a more strict path? (e.g. python lib directories only?) Niels AN EXAMPLE: ----------- The code below is compiled to readline.so and stored in /tmp: void __attribute__ ((constructor)) _load(); void _load() { printf("DING DONG!\n"); } foo at foo:/tmp$ ls -l /tmp/readline.so -rwxr-x--- 1 nnnnn nnn 7952 Mar 29 16:24 /tmp/readline.so foo at foo:/tmp$ 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. DING DONG! >>> ---------- messages: 137473 nosy: Niels.Heinen priority: normal severity: normal status: open title: Readline module loading in interactive mode type: security versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 2 16:13:44 2011 From: report at bugs.python.org (Mark Mc Mahon) Date: Thu, 02 Jun 2011 14:13:44 +0000 Subject: [New-bugs-announce] [issue12239] msilib VT_EMPTY SummaryInformation properties raise an error (suggest returning None) In-Reply-To: <1307024024.44.0.716968870376.issue12239@psf.upfronthosting.co.za> Message-ID: <1307024024.44.0.716968870376.issue12239@psf.upfronthosting.co.za> New submission from Mark Mc Mahon : Using "some.msi" where the first property is VT_EMPTY Using COM: >>> from win32com.client import gencache >>> com_lib = gencache.EnsureModule('{000C1092-0000-0000-C000-000000000046}', 409, 1, 0) >>> com_msi = com_lib.Installer() >>> db = com_msi.OpenDatabase('some.msi', 0) >>> si = db.GetSummaryInformation(0) >>> repr(si.Property(0)) 'None' Using msilib: >>> import msilib >>> db = msilib.OpenDatabase(r'some.msi', 0) >>> si = db.GetSummaryInformation(0) >>> si.GetProperty(0) Traceback (most recent call last): File "", line 1, in NotImplementedError: result of type 0 I aim to submit a patch that so that SummaryInformation.GetProperty() with a type of VT_EMPTY will return None. ---------- components: Windows messages: 137478 nosy: markm priority: normal severity: normal status: open title: msilib VT_EMPTY SummaryInformation properties raise an error (suggest returning None) versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 2 16:59:39 2011 From: report at bugs.python.org (Erik Bray) Date: Thu, 02 Jun 2011 14:59:39 +0000 Subject: [New-bugs-announce] [issue12240] Allow multiple setup_hooks In-Reply-To: <1307026779.27.0.653754848212.issue12240@psf.upfronthosting.co.za> Message-ID: <1307026779.27.0.653754848212.issue12240@psf.upfronthosting.co.za> New submission from Erik Bray : I have a use case where I have a small library of setup_hook functions for various purposes that are used by multiple projects. Some projects may want to use more than one of these setup_hooks. I can certainly create a wrapper hook for each function that calls all the necessary hooks. But that gets a little tedious and seems unnecessary. In this use case it would be fine if I could just list a set of setup_hooks to be executed in sequence. It is, of course, up the developer to be sure that none of these setup_hooks have conflicting actions. As a temporary workaround I wrote a setup_hook called chain_setup_hooks. I then looks for an option called "setup_hooks" which behaves as I've described. This works fine, though I don't see why setup_hook shouldn't allow multiple values to begin with. ---------- assignee: tarek components: Distutils2 messages: 137479 nosy: alexis, eric.araujo, erik.bray, tarek priority: normal severity: normal status: open title: Allow multiple setup_hooks type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 2 17:25:14 2011 From: report at bugs.python.org (Tim Koopman) Date: Thu, 02 Jun 2011 15:25:14 +0000 Subject: [New-bugs-announce] [issue12241] email.header.Header encoding fails on empty header In-Reply-To: <1307028314.79.0.859095515398.issue12241@psf.upfronthosting.co.za> Message-ID: <1307028314.79.0.859095515398.issue12241@psf.upfronthosting.co.za> New submission from Tim Koopman : Creating an empty header produces an exception when calling the encode function: >>> from email.header import Header >>> Header('', 'iso-8859-1').encode() Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.2/email/header.py", line 317, in encode formatter.feed(lines[0], charset) IndexError: list index out of range According to RFC822, empty headers are valid (and are found in the wild anyway), so this should just work. I've attached a trivial fix that appears to work. ---------- components: Library (Lib) files: header.patch keywords: patch messages: 137480 nosy: ntkoopman priority: normal severity: normal status: open title: email.header.Header encoding fails on empty header type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file22221/header.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 2 17:28:43 2011 From: report at bugs.python.org (Eli Collins) Date: Thu, 02 Jun 2011 15:28:43 +0000 Subject: [New-bugs-announce] [issue12242] distutils2 environment marker for current compiler In-Reply-To: <1307028523.76.0.0549970473948.issue12242@psf.upfronthosting.co.za> Message-ID: <1307028523.76.0.0549970473948.issue12242@psf.upfronthosting.co.za> New submission from Eli Collins : It would be useful to have an environment marker which matched the compiler being used when compiling a C extension. Sometimes different compilers require different options (different lib names, different flags, etc); distutils1 setup.py files which have to deal with this currently go through some convolutions to determine the current compiler, and then dynamically modify extra_compile_args before handing them off to setup. Since packaging is moving to a setup.cfg file, it would be useful to be able to use an environment marker along the lines of 'extra_compile_args = -Dmingw_specific_flag ; packaging.c_compiler == "mingw"', allowing for special options for mingw vs msvc, etc. Since issue 11921 made it sound like environment markers had been expanded to the extensions sections, I'm hoping this isn't too complicated (but don't know the codebase well enough to write a patch myself). ---------- assignee: tarek components: Distutils2 messages: 137481 nosy: alexis, eli.collins, eric.araujo, tarek priority: normal severity: normal status: open title: distutils2 environment marker for current compiler type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 2 17:48:24 2011 From: report at bugs.python.org (Bryce Verdier) Date: Thu, 02 Jun 2011 15:48:24 +0000 Subject: [New-bugs-announce] [issue12243] getpass.getuser works on OSX In-Reply-To: <1307029704.02.0.858553376312.issue12243@psf.upfronthosting.co.za> Message-ID: <1307029704.02.0.858553376312.issue12243@psf.upfronthosting.co.za> New submission from Bryce Verdier : In the docs for getpass: http://docs.python.org/release/2.6.6/library/getpass.html (as an example). It hints that getuser() doesn't work on OSX. I tried this out and it works fine for python 2.6 on 10.6. I have included a patch for this. I believe the cleanest way to handle this is to remove the "Availability" entry as it's no longer necessary. ---------- assignee: docs at python components: Documentation files: getuser.patch keywords: patch messages: 137483 nosy: docs at python, louiscipher priority: normal severity: normal status: open title: getpass.getuser works on OSX versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file22222/getuser.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 2 20:50:57 2011 From: report at bugs.python.org (Santoso Wijaya) Date: Thu, 02 Jun 2011 18:50:57 +0000 Subject: [New-bugs-announce] [issue12244] cStringIO inconsistencies In-Reply-To: <1307040657.77.0.338586690814.issue12244@psf.upfronthosting.co.za> Message-ID: <1307040657.77.0.338586690814.issue12244@psf.upfronthosting.co.za> New submission from Santoso Wijaya : Observe: Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from cStringIO import StringIO >>> result = StringIO('Hello, ') >>> result.write('world') Traceback (most recent call last): File "", line 1, in AttributeError: 'cStringIO.StringI' object has no attribute 'write' >>> >>> result = StringIO() >>> result.write('Hello, world') >>> print result.getvalue() Hello, world >>> >>> from StringIO import StringIO >>> result = StringIO('Hello, ') >>> result.write('world') >>> print result.getvalue() world, >>> Few things: 1. The error message says, "StringI" instead of "StringIO". 2. Why does a cStringIO.StringIO object instantiated with a starter string not have the `write` attribute? 3. Using the pure-Python equivalent, (2) succeeds but it overwrites the starter string? 4. Regardless, (2) and (3) are not consistent with each other. ---------- components: Library (Lib) messages: 137490 nosy: santa4nt priority: normal severity: normal status: open title: cStringIO inconsistencies type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 2 21:47:10 2011 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 02 Jun 2011 19:47:10 +0000 Subject: [New-bugs-announce] [issue12245] Document the meaning of FLT_ROUNDS constants for sys.float_info In-Reply-To: <1307044030.93.0.176037757521.issue12245@psf.upfronthosting.co.za> Message-ID: <1307044030.93.0.176037757521.issue12245@psf.upfronthosting.co.za> New submission from Raymond Hettinger : >>> sys.float_info.rounds 1 ---------- assignee: docs at python components: Documentation messages: 137493 nosy: docs at python, rhettinger priority: normal severity: normal status: open title: Document the meaning of FLT_ROUNDS constants for sys.float_info versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 2 22:09:02 2011 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Thu, 02 Jun 2011 20:09:02 +0000 Subject: [New-bugs-announce] [issue12246] create installation path if it's non-existent In-Reply-To: <1307045342.56.0.466799281748.issue12246@psf.upfronthosting.co.za> Message-ID: <1307045342.56.0.466799281748.issue12246@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : If I happen to not have the directory, $PREFIX/python3.3/site-packages, I get an erroneous message telling me that I don't write permissions. ---------- assignee: tarek components: Distutils2 files: create-dir-if-nonexistent.diff keywords: patch messages: 137495 nosy: alexis, eric.araujo, tarek, tshepang priority: normal severity: normal status: open title: create installation path if it's non-existent versions: Python 3.3 Added file: http://bugs.python.org/file22223/create-dir-if-nonexistent.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 00:49:06 2011 From: report at bugs.python.org (George Patterson) Date: Thu, 02 Jun 2011 22:49:06 +0000 Subject: [New-bugs-announce] [issue12247] Finding subprocess.py depends on how IDLE is opened In-Reply-To: <1307054946.0.0.524877875155.issue12247@psf.upfronthosting.co.za> Message-ID: <1307054946.0.0.524877875155.issue12247@psf.upfronthosting.co.za> New submission from George Patterson : I'm uncertain this is a bug, but it seems persistent over several machines and I can't figure out where the issue lies. Most of my troubleshooting has been on a MacBook Pro with Mac OS X version 10.6.7. I have a simple python script 'test.py': import subprocess subprocess.Popen(['xterm']) If I run this script by opening it in IDLE using the mouse, it crashes. If I run the same script in an IDLE that I launch by typing 'idle' in a terminal, it doesn't crash. What's going on? Is this a bug? Or am I just doing something terribly wrong? Obviously, my interest is not in running this simple script, but it contains the minimum part of the real script which reproduces the error. I've repeated this error on one machine(MacBook Pro with Mac OS X version 10.6.7) using either of two versions of Python, 2.6.6 or 2.7.1. On one machine(Mac Pro OS X version 10.6.7) using Python 2.6.6, on two other machines(IMacs with either OS X version 10.6.7 or 10.6.5) using Python 2.7.1. I include below only the info for the 2.7.1. Python 2.7.1 was the 32-bit version Mac OS X 32-bit i386/PPC Installer (2.7.1) for Mac OS X 10.3 through 10.6 [2] (sig) from here (http://www.python.org/download/releases/2.7.1/). Details: 1. Launch IDLE by right clicking test.py and "open with" IDLE (2.7.1). I "run module". Pasted below are the contents from the Python Shell. Included at the bottom is the sys.path for IDLE opened in this manner. I've also find this error if I open the IDLE located in Applications/Python 2.7/ and then open "test.py" and run it. Python 2.7.1 (r271:86882M, Nov 30 2010, 09:39:13) [GCC 4.0.1 (Apple Inc. build 5494)] on darwin Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> Traceback (most recent call last): File "/Users/georgepatterson/test.py", line 2, in subprocess.Popen(['xterm']) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__ errread, errwrite) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory >>> import sys >>> for p in sys.path: print p /Users/georgepatterson /Users/georgepatterson/Documents /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg /Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages >>> 2. Type "idle" in a terminal window. Open test.py and "run module". When run in this manner, the terminal window is opened properly. I've pasted the contents of the Python Shell below with the sys.path also. In case it matters, "which idle" at the terminal prompt points here /Library/Frameworks/Python.framework/Versions/2.7/bin/idle Python 2.7.1 (r271:86882M, Nov 30 2010, 09:39:13) [GCC 4.0.1 (Apple Inc. build 5494)] on darwin Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> >>> import sys >>> for p in sys.path: print p /Users/georgepatterson /Library/Frameworks/Python.framework/Versions/2.7/bin /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg /Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages >>> ---------- components: IDLE messages: 137497 nosy: George.Patterson priority: normal severity: normal status: open title: Finding subprocess.py depends on how IDLE is opened type: crash versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 01:32:34 2011 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 02 Jun 2011 23:32:34 +0000 Subject: [New-bugs-announce] [issue12248] __dir__ semantics changed in Python 2.7.2 In-Reply-To: <1307057554.2.0.779854000267.issue12248@psf.upfronthosting.co.za> Message-ID: <1307057554.2.0.779854000267.issue12248@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : I'm making this a release blocker for 2.7.2 because I want to ensure that the change is deliberate and appropriate. This is triggered by a bug report in Ubuntu where the change in behavior was noticed: https://bugs.launchpad.net/nova/+bug/791221/+index I have two problems with the change that I'd like to describe. First is the NEWS file entry: - Correct lookup of __dir__ on objects. Among other things, this causes errors besides AttributeError found on lookup to be propagated. This isn't associated with a tracker issue, so it's hard to know why this change was made, or whether there was any discussion of its impact. Second, is this change appropriate for a maintenance release? What problem does it fix and is that worth breaking existing packages for it? I'll attach a simple test program. Run this under 2.7.1 and it works, run it under 2.7.2rc1 and you get a TypeError. ---------- assignee: benjamin.peterson components: Interpreter Core files: foo.py messages: 137500 nosy: barry, benjamin.peterson priority: release blocker severity: normal status: open title: __dir__ semantics changed in Python 2.7.2 type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file22225/foo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 02:08:05 2011 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Fri, 03 Jun 2011 00:08:05 +0000 Subject: [New-bugs-announce] [issue12249] add missing command In-Reply-To: <1307059685.23.0.0593360384194.issue12249@psf.upfronthosting.co.za> Message-ID: <1307059685.23.0.0593360384194.issue12249@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : It's not indicated where one should run the command 'make html' in the "Building the documentation" page, so when it failed for me when running it from the cpython distribution root, I was left a little puzzled, searching where the problem might lie (wasting time). ---------- assignee: docs at python components: Documentation files: add-missing-command.diff keywords: patch messages: 137502 nosy: docs at python, tshepang priority: normal severity: normal status: open title: add missing command versions: Python 3.3 Added file: http://bugs.python.org/file22226/add-missing-command.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 10:02:12 2011 From: report at bugs.python.org (Stefan Krah) Date: Fri, 03 Jun 2011 08:02:12 +0000 Subject: [New-bugs-announce] [issue12250] regrtest: make --timeout explicit In-Reply-To: <1307088132.85.0.485595882281.issue12250@psf.upfronthosting.co.za> Message-ID: <1307088132.85.0.485595882281.issue12250@psf.upfronthosting.co.za> New submission from Stefan Krah : The implicit timeout in regrtest.py makes it harder to write automated test scripts for 3rd party modules. First, you have to remember to set --timeout=0 for long running tests. Then, you have to remember not to use the --timeout option when compiling --without-threads. I'd much prefer that there's no timeout unless explicitly specified. For the buildbots, I think this could be done in the Makefile. ---------- components: Tests messages: 137507 nosy: haypo, michael.foord, skrah priority: normal severity: normal status: open title: regrtest: make --timeout explicit type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 11:47:08 2011 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Fri, 03 Jun 2011 09:47:08 +0000 Subject: [New-bugs-announce] [issue12251] subprocess(..., stdout=sys.stderr) closes stderr for child In-Reply-To: <1307094428.89.0.00113133109323.issue12251@psf.upfronthosting.co.za> Message-ID: <1307094428.89.0.00113133109323.issue12251@psf.upfronthosting.co.za> New submission from ???? ????????? : How to test: ---------------- #! /usr/bin/python import subprocess, sys # will print err to sys.stderr subprocess.call(['rmdir', '/no_such_dir']) # will NOT print err to sys.stderr subprocess.call(['rmdir', '/no_such_dir'], stdout=sys.stderr) ---------------- According to strace, in child process: ----------------- dup2(2, 1) // that's what I expect, okay close(2) // that's I was not expect, so bug here execve(...) ----------------- Bug is in subprocess.py: (search for "dup2" in file) I do not known how to fix correctly. Logick in this module is brain damaged in some places. ----------------------------- # Dup fds for child if p2cread is not None: os.dup2(p2cread, 0) if c2pwrite is not None: os.dup2(c2pwrite, 1) if errwrite is not None: os.dup2(errwrite, 2) # Close pipe fds. Make sure we don't close the same # fd more than once, or standard fds. if p2cread is not None and p2cread not in (0,): os.close(p2cread) if c2pwrite is not None and c2pwrite not in (p2cread, 1): os.close(c2pwrite) if errwrite is not None and errwrite not in (p2cread, c2pwrite, 2): os.close(errwrite) ------------------------- ---------- components: Library (Lib) messages: 137510 nosy: mmarkk priority: normal severity: normal status: open title: subprocess(..., stdout=sys.stderr) closes stderr for child type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 11:55:30 2011 From: report at bugs.python.org (=?utf-8?q?Han=C3=B6fner_Harald?=) Date: Fri, 03 Jun 2011 09:55:30 +0000 Subject: [New-bugs-announce] [issue12252] '\u' in unicode raw string raise an syntax error In-Reply-To: <1307094930.07.0.437131076278.issue12252@psf.upfronthosting.co.za> Message-ID: <1307094930.07.0.437131076278.issue12252@psf.upfronthosting.co.za> New submission from Han?fner Harald : The follow code: s = ur"c:\that\is\a\new\unicode\path" raise the follow error: SyntaxError: (unicode error) 'rawunicodeescape' codec can't decode bytes in position 10-11: truncated \uXXXX That is already corrected in Py 3 builds. ---------- components: Interpreter Core messages: 137511 nosy: HarryH priority: normal severity: normal status: open title: '\u' in unicode raw string raise an syntax error type: compile error versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 17:05:42 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 03 Jun 2011 15:05:42 +0000 Subject: [New-bugs-announce] [issue12253] Document packaging.manifest and packaging.errors In-Reply-To: <1307113542.31.0.0409557566513.issue12253@psf.upfronthosting.co.za> Message-ID: <1307113542.31.0.0409557566513.issue12253@psf.upfronthosting.co.za> New submission from ?ric Araujo : I am working on a patch to document manifest.Manifest methods and list all exceptions defined in errors. ---------- assignee: eric.araujo components: Distutils2, Documentation messages: 137522 nosy: alexis, eric.araujo priority: normal severity: normal status: open title: Document packaging.manifest and packaging.errors versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 17:47:40 2011 From: report at bugs.python.org (Roman Alexeev) Date: Fri, 03 Jun 2011 15:47:40 +0000 Subject: [New-bugs-announce] [issue12254] PEP-3107 has a wrong attribute name for function annotations In-Reply-To: <1307116060.53.0.995138421611.issue12254@psf.upfronthosting.co.za> Message-ID: <1307116060.53.0.995138421611.issue12254@psf.upfronthosting.co.za> New submission from Roman Alexeev : The name of the attribute holding annotations is `__annotations__`, not `func_annotations` as PEP-3107 says. ---------- assignee: docs at python components: Documentation messages: 137532 nosy: Roman.Alexeev, docs at python priority: normal severity: normal status: open title: PEP-3107 has a wrong attribute name for function annotations _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 18:42:25 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 03 Jun 2011 16:42:25 +0000 Subject: [New-bugs-announce] [issue12255] Make VCSes ignore shared libpython In-Reply-To: <1307119345.93.0.971452096543.issue12255@psf.upfronthosting.co.za> Message-ID: <1307119345.93.0.971452096543.issue12255@psf.upfronthosting.co.za> New submission from ?ric Araujo : When compiling with --enable-shared, the libpython file is not ignored by Mercurial (or Bazaar, I guess). Any objection to the attached patch? I used a wildcard, but could also hard-code the full filename with a fixed shared lib number. ---------- assignee: eric.araujo files: ignore-patterns.diff keywords: needs review, patch messages: 137553 nosy: eric.araujo priority: normal severity: normal stage: commit review status: open title: Make VCSes ignore shared libpython versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22234/ignore-patterns.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 18:55:25 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 03 Jun 2011 16:55:25 +0000 Subject: [New-bugs-announce] [issue12256] Link isinstance/issubclass doc to abc module In-Reply-To: <1307120125.95.0.344188720519.issue12256@psf.upfronthosting.co.za> Message-ID: <1307120125.95.0.344188720519.issue12256@psf.upfronthosting.co.za> New submission from ?ric Araujo : Doc/library/functions.rst does not talk about how ABC interact with isinstance or issubclass. This simple patch adds a link. ---------- assignee: eric.araujo components: Documentation files: link-isinstance-to-abc.diff keywords: needs review, patch messages: 137556 nosy: eric.araujo priority: normal severity: normal stage: patch review status: open title: Link isinstance/issubclass doc to abc module versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22235/link-isinstance-to-abc.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 19:08:14 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 03 Jun 2011 17:08:14 +0000 Subject: [New-bugs-announce] [issue12257] Use PYPACKAGING_USE_SDK envvar instead of DISTUTILS_USE_SDK In-Reply-To: <1307120894.91.0.571532721021.issue12257@psf.upfronthosting.co.za> Message-ID: <1307120894.91.0.571532721021.issue12257@psf.upfronthosting.co.za> New submission from ?ric Araujo : packaging still uses the DISTUTILS_USE_SDK environment variable to tweak compilation on Windows. Do we want to change the name? Pro: separates distutils and packaging, con: requires users to set one more var during the transition period. I don?t know if MSSdk is distutils-specific (on which case the same question about renaming or not applies) or if it is a Windows envvar used by many tools (in which case packaging can continue to use it too). ---------- assignee: tarek components: Distutils2 messages: 137559 nosy: alexis, eric.araujo, loewis, tarek priority: normal severity: normal status: open title: Use PYPACKAGING_USE_SDK envvar instead of DISTUTILS_USE_SDK versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 19:14:42 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 03 Jun 2011 17:14:42 +0000 Subject: [New-bugs-announce] [issue12258] Clean up bytes I/O in get_compiler_versions In-Reply-To: <1307121282.55.0.132082573387.issue12258@psf.upfronthosting.co.za> Message-ID: <1307121282.55.0.132082573387.issue12258@psf.upfronthosting.co.za> New submission from ?ric Araujo : get_compiler_versions uses string regexes to match bytes streams returned by subprocess. The test did not catch this because they mock subprocess output with strings in self._exes. We have to decide whether we propagate the bytes object up (and fix two regexes, a comparison and the tests), or to decode the subprocess output to strings. ---------- assignee: tarek components: Distutils2 messages: 137561 nosy: alexis, eric.araujo, tarek priority: normal severity: normal stage: needs patch status: open title: Clean up bytes I/O in get_compiler_versions versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 19:19:55 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 03 Jun 2011 17:19:55 +0000 Subject: [New-bugs-announce] [issue12259] Test and document which compilers can be created on which platform In-Reply-To: <1307121595.57.0.945178123037.issue12259@psf.upfronthosting.co.za> Message-ID: <1307121595.57.0.945178123037.issue12259@psf.upfronthosting.co.za> New submission from ?ric Araujo : When working on the docs for new_compiler, I read that it was possible to get an msvc compiler on Unix. I tried it, even wrote a unit test to make sure it worked, and found out that not all compiler classes can be instantiated on my platform. This should be better documented. ---------- assignee: tarek components: Distutils2 messages: 137562 nosy: alexis, eric.araujo, tarek priority: normal severity: normal status: open title: Test and document which compilers can be created on which platform versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 19:24:21 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 03 Jun 2011 17:24:21 +0000 Subject: [New-bugs-announce] [issue12260] Make install default to user site-packages In-Reply-To: <1307121861.82.0.570588263731.issue12260@psf.upfronthosting.co.za> Message-ID: <1307121861.82.0.570588263731.issue12260@psf.upfronthosting.co.za> New submission from ?ric Araujo : Now that we can break compat in distutils2/packaging, we can change the default install dir to use PEP 370 user site-packages. For users without root, copy-pasting ?pysetup run install_dist? from the docs would Just Work?. This would also avoid the dreadful advice to use sudo on OSes that have their own package manager and don?t want users to muck up with /usr. See also #10745. ---------- assignee: tarek components: Distutils2 messages: 137563 nosy: alexis, eric.araujo, tarek priority: normal severity: normal status: open title: Make install default to user site-packages versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 21:34:56 2011 From: report at bugs.python.org (Tim Lesher) Date: Fri, 03 Jun 2011 19:34:56 +0000 Subject: [New-bugs-announce] [issue12261] urllib.parse docs still refer to urlparse In-Reply-To: <1307129696.46.0.265723026729.issue12261@psf.upfronthosting.co.za> Message-ID: <1307129696.46.0.265723026729.issue12261@psf.upfronthosting.co.za> New submission from Tim Lesher : While most of the occurrences of "urlparse" were corrected to "urllib.parse" when the module was renamed, two were missed: one in the second example, and one in the "See also" note for RFC 3986. ---------- assignee: docs at python components: Documentation messages: 137574 nosy: docs at python, tlesher priority: normal severity: normal status: open title: urllib.parse docs still refer to urlparse type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 3 22:35:48 2011 From: report at bugs.python.org (Jesse Litton) Date: Fri, 03 Jun 2011 20:35:48 +0000 Subject: [New-bugs-announce] [issue12262] Not Inheriting File Descriptors on Windows? In-Reply-To: <1307133348.7.0.486629796214.issue12262@psf.upfronthosting.co.za> Message-ID: <1307133348.7.0.486629796214.issue12262@psf.upfronthosting.co.za> New submission from Jesse Litton <3vi1jl at gmail.com>: On Windows, I've been trying to call a test script that gets its I/O handled via file descriptors 3 & 4 socat EXEC:"python test.py userid",pty,fdin=3,fdout=4 TCP4:server:23,crlf But I'm getting "[Errno 9] Bad file descriptor" when the python script attempts to os.fdopen(3, 'r'). I've tried just piping an echo's output redirected (3<&1 I think... though I might have that backwards as I've tried it every conceivable way) into the script, but I always get the bad file descriptor error. I can create a pipe() in the program I can get an actual FD 3 & 4... but they seem to have no relation to the FD's that were set up by the invoking command-line/script. I'm new to Python - is there something simple I'm overlooking, or is this a known bug that I just haven't been able to find in my last few hours of web searches? I can't believe I would be the only one doing this type of redirection on Windows. Thanks in advance for any guidance/resolution you can offer. ---------- components: Interpreter Core messages: 137582 nosy: 3vi1 priority: normal severity: normal status: open title: Not Inheriting File Descriptors on Windows? type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 5 01:16:18 2011 From: report at bugs.python.org (STINNER Victor) Date: Sat, 04 Jun 2011 23:16:18 +0000 Subject: [New-bugs-announce] [issue12263] punycode codec ignores the error handler argument In-Reply-To: <1307229378.45.0.142684435058.issue12263@psf.upfronthosting.co.za> Message-ID: <1307229378.45.0.142684435058.issue12263@psf.upfronthosting.co.za> New submission from STINNER Victor : b'abc\xff'.decode('punycode', 'ignore') raises the same error than b'abc\xff'.decode('punycode', 'replace') or b'abc\xff'.decode('punycode'): it uses the strict error handler, and simply ignores the error handler. punycodec, as idna, should raise an exception if the error handler is different than strict. ---------- messages: 137666 nosy: haypo priority: normal severity: normal status: open title: punycode codec ignores the error handler argument versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 5 01:31:00 2011 From: report at bugs.python.org (STINNER Victor) Date: Sat, 04 Jun 2011 23:31:00 +0000 Subject: [New-bugs-announce] [issue12264] parser.expr(): reference count error if more than one argument is passed In-Reply-To: <1307230260.08.0.858189035703.issue12264@psf.upfronthosting.co.za> Message-ID: <1307230260.08.0.858189035703.issue12264@psf.upfronthosting.co.za> New submission from STINNER Victor : import parser; parser.expr("a", "b") raises a TypeError('expr() takes at most 1 argument (2 given)') but corrupt also the reference count of an object (I don't know which one): "python: Modules/gcmodule.c:327: visit_decref: Assertion `gc->gc.gc_refs != 0' failed." ---------- components: Library (Lib) messages: 137668 nosy: haypo priority: normal severity: normal status: open title: parser.expr(): reference count error if more than one argument is passed versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 5 04:20:43 2011 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 05 Jun 2011 02:20:43 +0000 Subject: [New-bugs-announce] [issue12265] revamp argument errors In-Reply-To: <1307240443.69.0.736494632157.issue12265@psf.upfronthosting.co.za> Message-ID: <1307240443.69.0.736494632157.issue12265@psf.upfronthosting.co.za> New submission from Benjamin Peterson : This patch completely rewrites errors given for positional error mismatches. The goal is to give more informative and correct errors. Some examples: >>> def f(): pass ... >>> f(1) Traceback (most recent call last): File "", line 1, in TypeError: f() takes 0 positional arguments but 1 was given >>> f(1, kw=4) Traceback (most recent call last): File "", line 1, in TypeError: f() got an unexpected keyword argument 'kw' >>> def f(a, b=2): pass ... >>> f() Traceback (most recent call last): File "", line 1, in TypeError: f() takes from 1 to 2 positional arguments but 0 were given >>> f(1, 2, 3) Traceback (most recent call last): File "", line 1, in TypeError: f() takes from 1 to 2 positional arguments but 3 were given >>> def f(a, *b): pass ... >>> f() Traceback (most recent call last): File "", line 1, in TypeError: f() takes at least 1 positional argument but 0 were given >>> f(kw=4) Traceback (most recent call last): File "", line 1, in TypeError: f() got an unexpected keyword argument 'kw' When keyword-only arguments come into play, things get a bit more complicated. When a positional argument error occurs, it's confusing to report only the positional arguments, but not completely relevant to report keyword-only arguments. I comprise by putting the keyword-only argument information in parenthesis. Tell me if you have a better idea. >>> def f(*, kw): pass ... >>> f() Traceback (most recent call last): File "", line 1, in TypeError: f() requires keyword-only argument 'kw' >>> f(1) Traceback (most recent call last): File "", line 1, in TypeError: f() takes 0 positional arguments but 1 was given >>> f(3, kw=4) Traceback (most recent call last): File "", line 1, in TypeError: f() takes 0 positional arguments but 1 positional arguments (and 1 keyword-only argument) were given ---------- components: Interpreter Core files: argerror.patch keywords: patch messages: 137676 nosy: benjamin.peterson priority: normal severity: normal stage: patch review status: open title: revamp argument errors type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file22252/argerror.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 5 07:54:59 2011 From: report at bugs.python.org (py.user) Date: Sun, 05 Jun 2011 05:54:59 +0000 Subject: [New-bugs-announce] [issue12266] str.capitalize contradicts In-Reply-To: <1307253299.62.0.8609224268.issue12266@psf.upfronthosting.co.za> Message-ID: <1307253299.62.0.8609224268.issue12266@psf.upfronthosting.co.za> New submission from py.user : specification str.capitalize()? Return a copy of the string with its first character capitalized and the rest lowercased. >>> '\u1ffc', '\u1ff3' ('?', '?') >>> '\u1ffc'.isupper() False >>> '\u1ff3'.islower() True >>> s = '\u1ff3\u1ff3\u1ffc\u1ffc' >>> s '????' >>> s.capitalize() '????' >>> A: lower B: title A -> B & !B -> A ---------- components: Interpreter Core messages: 137682 nosy: py.user priority: normal severity: normal status: open title: str.capitalize contradicts versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 5 15:18:54 2011 From: report at bugs.python.org (Tom Whittock) Date: Sun, 05 Jun 2011 13:18:54 +0000 Subject: [New-bugs-announce] [issue12267] Difficult to compile python in Visual Studio 2010 express In-Reply-To: <1307279934.45.0.187127370641.issue12267@psf.upfronthosting.co.za> Message-ID: <1307279934.45.0.187127370641.issue12267@psf.upfronthosting.co.za> New submission from Tom Whittock : The automatic upgrade process included with Microsoft Visual Studio 2010 express is unable to deal with the project files in the python PC folder, due to it not supporting the x64 target. I had to manually edit the project files to remove all references to x64 before being able to upgrade the project. Included is a mercurial patch against the 2.7 line which adds project files for the 2010 express edition. ---------- components: Build files: vs2010-express.patch keywords: patch messages: 137693 nosy: Tom.Whittock priority: normal severity: normal status: open title: Difficult to compile python in Visual Studio 2010 express type: feature request versions: Python 2.7 Added file: http://bugs.python.org/file22255/vs2010-express.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 5 22:39:03 2011 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 05 Jun 2011 20:39:03 +0000 Subject: [New-bugs-announce] [issue12268] file readline & readlines methods can lose data on EINTR In-Reply-To: <1307306343.57.0.342192724444.issue12268@psf.upfronthosting.co.za> Message-ID: <1307306343.57.0.342192724444.issue12268@psf.upfronthosting.co.za> New submission from Gregory P. Smith : The file object readline() and readlines() methods can lose data when an underlying read system call is interrupted. They will abort with an IOError in this case but any incomplete line data they have read will be discarded. readline() and readlines() should never raise an IOError for the EINTR interrupted system call case. They should handle that gracefully, retrying their reads after letting any Python signal handlers run. ---------- assignee: gregory.p.smith files: file-signal-eintr-27.diff keywords: needs review, patch messages: 137714 nosy: gregory.p.smith priority: normal severity: normal status: open title: file readline & readlines methods can lose data on EINTR versions: Python 2.7 Added file: http://bugs.python.org/file22258/file-signal-eintr-27.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 6 03:21:24 2011 From: report at bugs.python.org (Ryan Hollis) Date: Mon, 06 Jun 2011 01:21:24 +0000 Subject: [New-bugs-announce] [issue12269] Crashes on start In-Reply-To: <1307323284.04.0.790241806386.issue12269@psf.upfronthosting.co.za> Message-ID: <1307323284.04.0.790241806386.issue12269@psf.upfronthosting.co.za> New submission from Ryan Hollis : Mac OSX Snow Leopard, Python 2.7, The moment I paste anything into the editor window, it crashes. Also IDLE crashes within a minute or two of opening, wether or not I actually do anything with it after opening it. uninstalled and reinstalled, didnt help ---------- messages: 137724 nosy: Ryan.Hollis priority: normal severity: normal status: open title: Crashes on start _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 6 14:39:36 2011 From: report at bugs.python.org (AJ) Date: Mon, 06 Jun 2011 12:39:36 +0000 Subject: [New-bugs-announce] [issue12270] Please update copyright notice on bugs.python.org to 2011? In-Reply-To: <1307363976.46.0.271724465254.issue12270@psf.upfronthosting.co.za> Message-ID: <1307363976.46.0.271724465254.issue12270@psf.upfronthosting.co.za> New submission from AJ : We are almost in mid-year. :) http://bugs.python.org/ has a copyright notice "1990-2010". Please update it to include 2011. ---------- components: None messages: 137736 nosy: brandmyself priority: normal severity: normal status: open title: Please update copyright notice on bugs.python.org to 2011? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 6 15:01:38 2011 From: report at bugs.python.org (Vincent) Date: Mon, 06 Jun 2011 13:01:38 +0000 Subject: [New-bugs-announce] [issue12271] Python 2.7.x on IA64 running SLES 11 SP1 In-Reply-To: <1307365298.12.0.602165301483.issue12271@psf.upfronthosting.co.za> Message-ID: <1307365298.12.0.602165301483.issue12271@psf.upfronthosting.co.za> New submission from Vincent : Hello everybody, With the same build/compile command, I'm able to have "my" runing python version (2.6.x or 2.7.x) on IA64 server runing SLES 10 SP2/SP3,not on IA64 server runing SLES 11 SP1. I've try with 2.7, 2.7.1 and 2.7.2rc1 version without success. On both configuration types, I've installed all the available libraries, but on SLES 11 SP1, the make resulting message is the following (the complete building messages are in the joined gzip text file): ------------------ ... Python build finished, but the necessary bits to build these modules were not found: _bsddb _sqlite3 _ssl _tkinter bsddb185 bz2 dl imageop readline sunaudiodev zlib To find the necessary bits, look in setup.py in detect_modules() for the module's name. Failed to build these modules: _curses_panel running build_scripts ------------------ Any advice will be welcome. Thanks a lot for your attention and your process. All the best, Vincent ---------- components: Build files: Building_error_SLES11SP1_ia64.txt.gz messages: 137737 nosy: v.claudic at free.fr priority: normal severity: normal status: open title: Python 2.7.x on IA64 running SLES 11 SP1 type: compile error versions: Python 2.7 Added file: http://bugs.python.org/file22263/Building_error_SLES11SP1_ia64.txt.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 6 23:09:35 2011 From: report at bugs.python.org (Jack Eisenbach) Date: Mon, 06 Jun 2011 21:09:35 +0000 Subject: [New-bugs-announce] [issue12272] Python 2.7.1 version conflict for package "Tcl" on Windows 7 In-Reply-To: <1307394575.29.0.810712086892.issue12272@psf.upfronthosting.co.za> Message-ID: <1307394575.29.0.810712086892.issue12272@psf.upfronthosting.co.za> New submission from Jack Eisenbach : I wrote a Tkinter application that runs fine with Python 2.6.5 and 2.6.6 on a Windows 7 (32-bit version) machine. The same app fails with 2.7.1. Below is the debug output: c:\ISS\ledmatrix>led-display.py Traceback (most recent call last): File "ledmatrix.py", line 2263, in LEDMatrix() File "ledmatrix.py", line 1427, in LEDMatrix root = Tk() File "C:\Python26\lib\lib-tk\Tkinter.py", line 1643, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: Can't find a usable init.tcl in the following directories: {C:\Python27\tcl\tcl8.5} C:/Python26/lib/tcl8.5 C:/lib/tcl8.5 C:/lib/tcl8.5 C:/library C:/library C:/tcl8.5.8/library C:/tcl8.5.8/library C:/Python27/tcl/tcl8.5/init.tcl: version conflict for package "Tcl": have 8.5.8, need exactly 8.5.2 version conflict for package "Tcl": have 8.5.8, need exactly 8.5.2 while executing "package require -exact Tcl 8.5.2" (file "C:/Python27/tcl/tcl8.5/init.tcl" line 20) invoked from within "source C:/Python27/tcl/tcl8.5/init.tcl" ("uplevel" body line 1) invoked from within "uplevel #0 [list source $tclfile]" This probably means that Tcl wasn't installed properly. ---------- components: Tkinter messages: 137778 nosy: jackie3 priority: normal severity: normal status: open title: Python 2.7.1 version conflict for package "Tcl" on Windows 7 type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 7 06:12:14 2011 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 07 Jun 2011 04:12:14 +0000 Subject: [New-bugs-announce] [issue12273] Change ast.__version__ calculation to provide consistent ordering In-Reply-To: <1307419934.4.0.45216742345.issue12273@psf.upfronthosting.co.za> Message-ID: <1307419934.4.0.45216742345.issue12273@psf.upfronthosting.co.za> New submission from Nick Coghlan : Benjamin's AST modification checkins switched directly from the SVN revision number (as a string) to the hg revision hash. While that preserves uniqueness, it makes ordering difficult to determine. The last AST version in 3.2 was '82163' (and it was '82160' in 2.7). I would like to change the version number calculation to something like: '9.x.y.zzzzzzz' where 9 is a prefix to get 3.3+ ast.__version__ values to sort higher than earlier versions x.y is the Python version so later versions sort higher than earlier versions in the future zzzzzz is the hg version id, so versions during development of a release remain unique, even if they can't be readily ordered. This would require changes to ast.py (to add the 9.x.y prefix) and to release.py (to check that the 'x.y' prefix is correct in the current release) ---------- assignee: ncoghlan components: Library (Lib) messages: 137786 nosy: benjamin.peterson, brett.cannon, ncoghlan priority: normal severity: normal status: open title: Change ast.__version__ calculation to provide consistent ordering versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 7 08:16:07 2011 From: report at bugs.python.org (Gabriel Genellina) Date: Tue, 07 Jun 2011 06:16:07 +0000 Subject: [New-bugs-announce] [issue12274] "Print window" menu on IDLE aborts whole application In-Reply-To: <1307427367.68.0.910605365077.issue12274@psf.upfronthosting.co.za> Message-ID: <1307427367.68.0.910605365077.issue12274@psf.upfronthosting.co.za> New submission from Gabriel Genellina : On Windows, IDLE closes all open windows and exits completely, without any error message, when selecting the "Print window" menu command. Starting IDLE from inside a console, one can see the error message: Exception in Tkinter callback Traceback (most recent call last): File "D:\apps\python32\lib\tkinter\__init__.py", line 1399, in __call__ return self.func(*args) File "D:\apps\python32\lib\idlelib\IOBinding.py", line 453, in print_window command = idleConf.GetOption('main','General','print-command-win') File "D:\apps\python32\lib\idlelib\configHandler.py", line 245, in GetOption type=type, raw=raw) File "D:\apps\python32\lib\idlelib\configHandler.py", line 54, in Get return self.get(section, option, raw=raw) File "D:\apps\python32\lib\configparser.py", line 789, in get d) File "D:\apps\python32\lib\configparser.py", line 391, in before_get self._interpolate_some(parser, option, L, value, section, defaults, 1) File "D:\apps\python32\lib\configparser.py", line 440, in _interpolate_some "found: %r" % (rest,)) configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found : '%s' It is trying to read this entry from the config-main.def file: [General] print-command-posix=lpr %s print-command-win=start /min notepad /p %s For a ConfigParser file, those %s should be %%s instead. Previous IDLE versions (2.7 and 3.1) read the same entry without problem; I suspect they were using a RawConfigParser or processing the entry in a different way. As a workaround, replacing %s with %%s in config-main.def is enough, until the code gets fixed. ---------- components: IDLE messages: 137789 nosy: gagenellina priority: normal severity: normal status: open title: "Print window" menu on IDLE aborts whole application type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 7 09:10:18 2011 From: report at bugs.python.org (lilydjwg) Date: Tue, 07 Jun 2011 07:10:18 +0000 Subject: [New-bugs-announce] [issue12275] urllib.request.HTTPRedirectHandler won't redirect to a URL with only path but not domain In-Reply-To: <1307430618.09.0.225442782299.issue12275@psf.upfronthosting.co.za> Message-ID: <1307430618.09.0.225442782299.issue12275@psf.upfronthosting.co.za> New submission from lilydjwg : On redirecting to a url like '/login', at around line 556 of request.py it will raise an HTTPError. The sys.verrsion is Python 3.2 (r32:88445, Apr 15 2011, 11:20:08) [GCC 4.5.2 20110127 (prerelease)] on linux2 ---------- components: Library (Lib) messages: 137791 nosy: lilydjwg priority: normal severity: normal status: open title: urllib.request.HTTPRedirectHandler won't redirect to a URL with only path but not domain versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 7 10:48:21 2011 From: report at bugs.python.org (Gabriel Genellina) Date: Tue, 07 Jun 2011 08:48:21 +0000 Subject: [New-bugs-announce] [issue12276] 3.x ignores sys.tracebacklimit=0 In-Reply-To: <1307436501.83.0.59684150491.issue12276@psf.upfronthosting.co.za> Message-ID: <1307436501.83.0.59684150491.issue12276@psf.upfronthosting.co.za> New submission from Gabriel Genellina : Python 3.x doesn't honor sys.tracebacklimit=0 According to http://docs.python.org/py3k/library/sys.html#sys.tracebacklimit when set to 0, it should not print any stack trace, but it does. Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. p3> import sys p3> sys.tracebacklimit = 0 p3> p3> def f(x): ... return f(x-1) if x else 0/0 ... p3> f(5) Traceback (most recent call last): File "", line 1, in File "", line 2, in f File "", line 2, in f File "", line 2, in f File "", line 2, in f File "", line 2, in f File "", line 2, in f ZeroDivisionError: division by zero p3> ---------- components: Interpreter Core files: tracebacklimitbug.py messages: 137792 nosy: gagenellina priority: normal severity: normal status: open title: 3.x ignores sys.tracebacklimit=0 versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file22269/tracebacklimitbug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 7 11:45:51 2011 From: report at bugs.python.org (=?utf-8?q?Bo=C5=A1tjan_Mejak?=) Date: Tue, 07 Jun 2011 09:45:51 +0000 Subject: [New-bugs-announce] [issue12277] Missing comma in os.walk docs In-Reply-To: <1307439951.32.0.810805209718.issue12277@psf.upfronthosting.co.za> Message-ID: <1307439951.32.0.810805209718.issue12277@psf.upfronthosting.co.za> New submission from Bo?tjan Mejak : http://docs.python.org/release/2.6.6/library/os.html?highlight=os.walk#os.walk Click the above link and note the 5th paragraph which goes "By default errors from the listdir() call are ignored." Please fix it to "By default, errors from the listdir() call are ignored." So add a comma after "By default," Thanks. ---------- assignee: docs at python components: Documentation messages: 137795 nosy: Retro, docs at python priority: normal severity: normal status: open title: Missing comma in os.walk docs versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 7 13:16:47 2011 From: report at bugs.python.org (Adam Woodbeck) Date: Tue, 07 Jun 2011 11:16:47 +0000 Subject: [New-bugs-announce] [issue12278] Core mentorship mention in the devguide In-Reply-To: <1307445407.08.0.276007268612.issue12278@psf.upfronthosting.co.za> Message-ID: <1307445407.08.0.276007268612.issue12278@psf.upfronthosting.co.za> New submission from Adam Woodbeck : Jesse requested the devguide be updated to include a mention of the Python Mentors site. The attached patch is my rough draft. ---------- components: Devguide files: help.rst.patch keywords: patch messages: 137807 nosy: adam.woodbeck, ncoghlan priority: normal severity: normal status: open title: Core mentorship mention in the devguide Added file: http://bugs.python.org/file22271/help.rst.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 7 17:48:53 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 07 Jun 2011 15:48:53 +0000 Subject: [New-bugs-announce] [issue12279] Add build_distinfo command to packaging In-Reply-To: <1307461733.49.0.987510653631.issue12279@psf.upfronthosting.co.za> Message-ID: <1307461733.49.0.987510653631.issue12279@psf.upfronthosting.co.za> New submission from ?ric Araujo : In the current packaging module, the PEP 376 .dist-info directory is generated at install time. It should be split into two phases, build_distinfo and install_distinfo, to support at least two use cases: - the develop command, which needs access to .dist-info - the resources API (packaging.database.get_file), which is intended to work from an uninstalled codebase too. The normal directory to put the generated files would be the build directory; however, setuptools? egg_info command generates the file in the same directory as the setup.py file. I?d prefer we avoid it in packaging, for consistency with other build_* commands, and to avoid that every project has to put ?*.dist-info? in their VCS ignore file, but I don?t know if there is a technical reason that constrains setuptools to do so. ---------- assignee: eric.araujo components: Distutils2 keywords: gsoc messages: 137842 nosy: alexis, eric.araujo, higery priority: normal severity: normal stage: needs patch status: open title: Add build_distinfo command to packaging type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 7 23:08:52 2011 From: report at bugs.python.org (Matthew Brunt) Date: Tue, 07 Jun 2011 21:08:52 +0000 Subject: [New-bugs-announce] [issue12280] If statement In-Reply-To: <1307480932.85.0.0272604438661.issue12280@psf.upfronthosting.co.za> Message-ID: <1307480932.85.0.0272604438661.issue12280@psf.upfronthosting.co.za> New submission from Matthew Brunt : i'm very new to python (currently going through a python for beginners book at work to pass the time), and i'm having trouble with an if statement exercise. basically, i'm creating a very simple password program that displays "Access Granted" if the if statement is true. the problem i'm having is that no matter what i set the password to, it seems like it's ignoring the if statement. the code is copied below, and i greatly appreciate any input. # Granted or Denied # Demonstrates an else clause print("Welcome to System Security Inc.") print("-- where security is our middle name\n") password = input("Enter your password: ") if password == "a": print("Access Granted") input("\n\nPress the enter key to exit.") ---------- components: IDLE messages: 137883 nosy: Matthew.Brunt priority: normal severity: normal status: open title: If statement type: performance versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 7 23:48:05 2011 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Jun 2011 21:48:05 +0000 Subject: [New-bugs-announce] [issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later In-Reply-To: <1307483285.51.0.642940083136.issue12281@psf.upfronthosting.co.za> Message-ID: <1307483285.51.0.642940083136.issue12281@psf.upfronthosting.co.za> New submission from STINNER Victor : Starting at Python 3.2, the MBCS codec uses MultiByteToWideChar() to decode bytes using flags=MB_ERR_INVALID_CHARS by default (strict error handler), flags=0 for the ignore error handler, and raise a ValueError for other error handlers. The problem is that the meaning of flags=0 changes with the Windows version: - ignore undecodable bytes until Windows XP - *replace* undecodable bytes for Windows Vista and later We should accept "replace" error handler with flags=0, at least on Windows Vista and later. I don't know if we should only accept "ignore" on Windows <= XP and only "error" on Windows >= Vista, or if the difference should be documented. ---------- components: Unicode messages: 137885 nosy: amaury.forgeotdarc, haypo priority: normal severity: normal status: open title: bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 8 05:10:58 2011 From: report at bugs.python.org (R. David Murray) Date: Wed, 08 Jun 2011 03:10:58 +0000 Subject: [New-bugs-announce] [issue12282] ABCMeta import error during build In-Reply-To: <1307502658.23.0.460185626535.issue12282@psf.upfronthosting.co.za> Message-ID: <1307502658.23.0.460185626535.issue12282@psf.upfronthosting.co.za> New submission from R. David Murray : After a make distclean I'm seeing the following output during a build of default. It is possible my 2.7 install is borked, but I don't understand why python is apparently being called during a gcc step. The build seems to succeed. gcc -pthread -c -g -O0 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE \ -DHGVERSION="\"`LC_ALL=C hg id -i .`\"" \ -DHGTAG="\"`LC_ALL=C hg id -t .`\"" \ -DHGBRANCH="\"`LC_ALL=C hg id -b .`\"" \ -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 62, in import os File "/usr/lib/python2.7/os.py", line 398, in import UserDict File "/usr/lib/python2.7/UserDict.py", line 83, in import _abcoll File "/usr/lib/python2.7/_abcoll.py", line 11, in from abc import ABCMeta, abstractmethod ImportError: cannot import name ABCMeta Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 62, in import os File "/usr/lib/python2.7/os.py", line 398, in import UserDict File "/usr/lib/python2.7/UserDict.py", line 83, in import _abcoll File "/usr/lib/python2.7/_abcoll.py", line 11, in from abc import ABCMeta, abstractmethod ImportError: cannot import name ABCMeta Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 62, in import os File "/usr/lib/python2.7/os.py", line 398, in import UserDict File "/usr/lib/python2.7/UserDict.py", line 83, in import _abcoll File "/usr/lib/python2.7/_abcoll.py", line 11, in from abc import ABCMeta, abstractmethod ImportError: cannot import name ABCMeta ---------- components: Build messages: 137894 nosy: r.david.murray priority: normal severity: normal stage: needs patch status: open title: ABCMeta import error during build versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 8 12:32:32 2011 From: report at bugs.python.org (DDarko) Date: Wed, 08 Jun 2011 10:32:32 +0000 Subject: [New-bugs-announce] [issue12283] python3.2 smtplib _quote_periods In-Reply-To: <1307529152.41.0.398489022746.issue12283@psf.upfronthosting.co.za> Message-ID: <1307529152.41.0.398489022746.issue12283@psf.upfronthosting.co.za> New submission from DDarko : File "/usr/lib/python3.2/smtplib.py", line 166, in _quote_periods def _quote_periods(bindata): return re.sub(br'(?m)^\.', '..', bindata) should be: return re.sub(br'(?m)^\.', b'..', bindata) ---------- components: Extension Modules messages: 137899 nosy: DDarko priority: normal severity: normal status: open title: python3.2 smtplib _quote_periods versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 8 15:39:42 2011 From: report at bugs.python.org (Jonas H.) Date: Wed, 08 Jun 2011 13:39:42 +0000 Subject: [New-bugs-announce] [issue12284] argparse.ArgumentParser: usage example option In-Reply-To: <1307540382.34.0.477677451975.issue12284@psf.upfronthosting.co.za> Message-ID: <1307540382.34.0.477677451975.issue12284@psf.upfronthosting.co.za> New submission from Jonas H. : I'd like to see an `examples` option added to argparse.ArgumentParser as found in many man pages. This could also be done using the `epilog` option, but that misses the "%(proc)s" replacement which makes usage examples like this Example usage: ./script.py option1 option2 impossible. ---------- components: Library (Lib) messages: 137905 nosy: jonash priority: normal severity: normal status: open title: argparse.ArgumentParser: usage example option type: feature request versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 8 15:55:29 2011 From: report at bugs.python.org (Jorgen Skancke) Date: Wed, 08 Jun 2011 13:55:29 +0000 Subject: [New-bugs-announce] [issue12285] Unexpected behavior for 0 or negative processes in multiprocessing.pool() In-Reply-To: <1307541329.07.0.743246465318.issue12285@psf.upfronthosting.co.za> Message-ID: <1307541329.07.0.743246465318.issue12285@psf.upfronthosting.co.za> New submission from Jorgen Skancke : A normal way to start a multiprocessing-pool is like this: Multiprocessing.Pool(processes=some_number). However, if 'some_number' is 0 or negative, Python hangs and must be killed. I would expect an error message of the type: "Number of processes must be at least 1". Attaching a script that reproduces this. I struggled a bit with this for a program that uses cpu_count() - 4 to calculate 'some_number'. Guess what happens when the number of cores is 4 :) Even though the fix is easy (if some_number < 1), it would be nice to be warned about it. ---------- components: Library (Lib) files: multitest_pool.py messages: 137908 nosy: jorgsk priority: normal severity: normal status: open title: Unexpected behavior for 0 or negative processes in multiprocessing.pool() versions: Python 2.6 Added file: http://bugs.python.org/file22283/multitest_pool.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 8 19:39:47 2011 From: report at bugs.python.org (Johann C. Rocholl) Date: Wed, 08 Jun 2011 17:39:47 +0000 Subject: [New-bugs-announce] [issue12286] float('nan') breaks sort() method on a list of floats In-Reply-To: <1307554787.91.0.244945318639.issue12286@psf.upfronthosting.co.za> Message-ID: <1307554787.91.0.244945318639.issue12286@psf.upfronthosting.co.za> New submission from Johann C. Rocholl : >>> l = [1.0, 2.0, 3.0, float('nan'), 4.0, 3.0, 2.0, 1.0] >>> l.sort() >>> l [1.0, 2.0, 3.0, nan, 1.0, 2.0, 3.0, 4.0] The expected result is either of the following: [nan, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0] (similar to None) [1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, nan] (similar to string 'nan') ---------- messages: 137918 nosy: jcrocholl priority: normal severity: normal status: open title: float('nan') breaks sort() method on a list of floats type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 8 22:37:15 2011 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Wed, 08 Jun 2011 20:37:15 +0000 Subject: [New-bugs-announce] [issue12287] ossaudiodev: stack corruption with FD >= FD_SETSIZE In-Reply-To: <1307565435.46.0.191433677292.issue12287@psf.upfronthosting.co.za> Message-ID: <1307565435.46.0.191433677292.issue12287@psf.upfronthosting.co.za> New submission from Charles-Fran?ois Natali : ossaudiodev's writeall method doesn't check that the FD is less than FD_SETSIZE when passing it to FD_SET: since FD_SET typically doesn't do bound check, it will write to a random location in memory (in this case on the stack). I've attached a test that triggers a segfault on my 32-bit Linux box: - you must have an OSS-compatible device as /dev/dsp (if you don't you can use "modprobe snd_pcm_oss") - it tries to increase RLIMIT_NOFILE since it's usually defined to be the same as FD_SETSIZE (1024 on Linux). The script must be run as root for that. A patch is attached. The only other place where I've seen a similar problem is in Module/readline.c: I'm not sure it's worth adding this check there :-) ---------- components: Library (Lib) files: oss_select.diff keywords: needs review, patch messages: 137923 nosy: haypo, neologix, pitrou priority: normal severity: normal stage: patch review status: open title: ossaudiodev: stack corruption with FD >= FD_SETSIZE type: crash versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22284/oss_select.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 8 23:28:03 2011 From: report at bugs.python.org (Tom Middleton) Date: Wed, 08 Jun 2011 21:28:03 +0000 Subject: [New-bugs-announce] [issue12288] Python 2.7.1 tkSimpleDialog initialvalue In-Reply-To: <1307568483.64.0.2959467561.issue12288@psf.upfronthosting.co.za> Message-ID: <1307568483.64.0.2959467561.issue12288@psf.upfronthosting.co.za> New submission from Tom Middleton : Using Tkinter under Python 2.7.1 (Windows XP FWIF) If using the tkSimpleDialog.askinteger() function with an initialvalue = 0, the 0 is not displayed in the dialog box. The same is true for tkSimpleDialog.askfloat(). The cause of this seems to be the following: in Lib\libi-tk\tkSimpleDialog.py (attached for convenience) under class _QueryDialog(Dialog) def body(self, master): w = Label(master, text=self.prompt, justify=LEFT) w.grid(row=0, padx=5, sticky=W) self.entry = Entry(master, name="entry") self.entry.grid(row=1, padx=5, sticky=W+E) if self.initialvalue: self.entry.insert(0, self.initialvalue) self.entry.select_range(0, END) return self.entry The if self.initialvalue will evaluate to a FALSE when the initial value is a 0. Changing this line to: if self.initialvalue is not None: fixed this issue. I am not certain that this is as intended or a bug. ---------- components: Tkinter files: tkSimpleDialog.py messages: 137925 nosy: busfault priority: normal severity: normal status: open title: Python 2.7.1 tkSimpleDialog initialvalue type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file22286/tkSimpleDialog.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 9 01:47:27 2011 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Jun 2011 23:47:27 +0000 Subject: [New-bugs-announce] [issue12289] http.server.CGIHTTPRequestHandler doesn't check if a Python script is executable In-Reply-To: <1307576847.86.0.0933852341785.issue12289@psf.upfronthosting.co.za> Message-ID: <1307576847.86.0.0933852341785.issue12289@psf.upfronthosting.co.za> New submission from STINNER Victor : CGIHTTPRequestHandler.run_cgi() only checks if the script processing the request is executable if the file is not a Python script, but later it uses os.execve(scriptfile, ...) if os has a fork() function. Moreover, the executable() functions checks if os.stat(path).st_mode & 0o111 != 0: this test is wrong if st_mode & 0o111 != 0o111. For example, if the script has mode 0700 and is not owned by the current user, executable() returns True, whereas it should be False. os.access(filename, os.X_OK) should be used instead. I found these issues while trying to understand the following failure on "FreeBSD 7.2 x86 3.x" buildbot: [320/356/2] test_httpservers Traceback (most recent call last): File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/http/server.py", line 1123, in run_cgi OSError: [Errno 13] Permission denied (...) I don't understand how it happens because test_httpservers uses os.chmod(script, 0o777). ---------- components: Library (Lib) messages: 137930 nosy: haypo priority: normal severity: normal status: open title: http.server.CGIHTTPRequestHandler doesn't check if a Python script is executable versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 9 04:21:00 2011 From: report at bugs.python.org (Eugene Toder) Date: Thu, 09 Jun 2011 02:21:00 +0000 Subject: [New-bugs-announce] [issue12290] __setstate__ is called for false values In-Reply-To: <1307586060.34.0.652262251036.issue12290@psf.upfronthosting.co.za> Message-ID: <1307586060.34.0.652262251036.issue12290@psf.upfronthosting.co.za> New submission from Eugene Toder : Pickle documentation [1] says: """ Note: If __getstate__() returns a false value, the __setstate__() method will not be called upon unpickling. """ However, this isn't quite true. This depends on the version of pickle protocol. A small example: >>> class Pockle(object): def __getstate__(self): return 0 def __setstate__(self, state): sys.stdout.write('__setstate__ is called!\n') >>> for p in range(4): sys.stdout.write('protocol %d: ' % p) pickle.loads(pickle.dumps(Pockle(), p)) protocol 0: <__main__.Pockle object at 0x0000000002EAE3C8> protocol 1: <__main__.Pockle object at 0x0000000002EAE358> protocol 2: __setstate__ is called! <__main__.Pockle object at 0x0000000002EAE3C8> protocol 3: __setstate__ is called! <__main__.Pockle object at 0x0000000002EAE358> So for protocols >= 2 setstate is called. This is caused by object.__reduce_ex__ returning different tuples for different protocol versions: >>> for p in range(4): sys.stdout.write('protocol %d: %s\n' % (p, Pockle().__reduce_ex__(p))) protocol 0: (, (, , None)) protocol 1: (, (, , None)) protocol 2: (, (,), 0, None, None) protocol 3: (, (,), 0, None, None) Implementation of reduce_ex for protos 0-1 in copy_reg.py contains the documented check: http://hg.python.org/cpython/file/f1509fc75435/Lib/copy_reg.py#l85 Implementation for proto 2+ in typeobject.c is happy with any value: http://hg.python.org/cpython/file/f1509fc75435/Objects/typeobject.c#l3205 Pickle itself only ignores None, not any false value: http://hg.python.org/cpython/file/f1509fc75435/Lib/pickle.py#l418 I think this is a documentation issue at this point. [1] http://docs.python.org/py3k/library/pickle.html#pickle.object.__setstate__ ---------- components: Library (Lib) messages: 137935 nosy: eltoder priority: normal severity: normal status: open title: __setstate__ is called for false values versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 9 11:10:10 2011 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 09 Jun 2011 09:10:10 +0000 Subject: [New-bugs-announce] [issue12291] file written using marshal in 3.2 can be read by 2.7, but not 3.2 or 3.3 In-Reply-To: <1307610610.3.0.00172759046416.issue12291@psf.upfronthosting.co.za> Message-ID: <1307610610.3.0.00172759046416.issue12291@psf.upfronthosting.co.za> New submission from Vinay Sajip : The attached file 'data.bin' was written using Python 3.2. It can be read by Python 2.7, but in 3.2 and 3.3, after the first object is read, the file pointer is positioned at EOF, causing an error on subsequent reads. A simple test script 'marshtest.py' is below: import marshal import sys f = open('data.bin', 'rb') t = marshal.load(f) print('Python version:', sys.version) print('Object just loaded was:\n%r' % (t,)) print('File position is now at %d' % f.tell()) t = marshal.load(f) print('Object just loaded was:\n%r' % (t,)) print('File position is now at %d' % f.tell()) Results of running it under various Python versions: vinay at eta-natty:~/projects/scratch$ python marshtest.py ('Python version:', '2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) \n[GCC 4.5.2]') Object just loaded was: (u'text', u'alfa', 202, 1.0, '\x00\x00\x00\x01]q\x00K\x03a') File position is now at 52 Object just loaded was: (u'text', u'alfa', 212, 1.0, '\x00\x00\x00\x01]q\x00K\x03a') File position is now at 104 vinay at eta-natty:~/projects/scratch$ python3.2 marshtest.py Python version: 3.2 (r32:88445, Mar 25 2011, 19:28:28) [GCC 4.5.2] Object just loaded was: ('text', 'alfa', 202, 1.0, b'\x00\x00\x00\x01]q\x00K\x03a') File position is now at 53617 Traceback (most recent call last): File "marshtest.py", line 9, in t = marshal.load(f) EOFError: EOF read where object expected vinay at eta-natty:~/projects/scratch$ python3.3 marshtest.py Python version: 3.3a0 (default:8d4d87dd73ae, Apr 2 2011, 14:25:31) [GCC 4.5.2] Object just loaded was: ('text', 'alfa', 202, 1.0, b'\x00\x00\x00\x01]q\x00K\x03a') File position is now at 53617 Traceback (most recent call last): File "marshtest.py", line 9, in t = marshal.load(f) EOFError: EOF read where object expected Note the size of the file is 53617 bytes. vinay at eta-natty:~/projects/scratch$ ls -l data.bin -rw------- 1 vinay vinay 53617 2011-06-09 09:33 data.bin ---------- files: data.bin messages: 137943 nosy: vinay.sajip priority: normal severity: normal status: open title: file written using marshal in 3.2 can be read by 2.7, but not 3.2 or 3.3 versions: Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file22289/data.bin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 9 14:10:26 2011 From: report at bugs.python.org (Ravish) Date: Thu, 09 Jun 2011 12:10:26 +0000 Subject: [New-bugs-announce] [issue12292] bpython In-Reply-To: <1307621426.23.0.78391837262.issue12292@psf.upfronthosting.co.za> Message-ID: <1307621426.23.0.78391837262.issue12292@psf.upfronthosting.co.za> New submission from Ravish : I was trying to install bpython v0.9.7.1(latest version) on python 2.6.5, it works fine. But If i try to install on python v3.2 it's behaviour is quite abnormal. i.e if I run(bpython) from command prompt, I could able to see the fancy window, but If I try to type something immediately it will show as "Segmentation fault". Could you please provide me some suggestion for the above issue. Thanks, ---------- messages: 137956 nosy: ravish112 priority: normal severity: normal status: open title: bpython type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 9 14:21:31 2011 From: report at bugs.python.org (Fredrik Wendt) Date: Thu, 09 Jun 2011 12:21:31 +0000 Subject: [New-bugs-announce] [issue12293] wrong arguments passed to SMTP.sendmail in example In-Reply-To: <1307622091.83.0.868143597112.issue12293@psf.upfronthosting.co.za> Message-ID: <1307622091.83.0.868143597112.issue12293@psf.upfronthosting.co.za> New submission from Fredrik Wendt : On http://docs.python.org/library/email-examples.html#email-examples the current example (v2.7.1) at the bottom incorrectly calls SMTP.sendmail() with a single recipient e-mail address. It should be a list of addresses. ---------- assignee: docs at python components: Documentation messages: 137960 nosy: docs at python, wendt_se priority: normal severity: normal status: open title: wrong arguments passed to SMTP.sendmail in example versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 9 15:59:52 2011 From: report at bugs.python.org (Bugs Fly) Date: Thu, 09 Jun 2011 13:59:52 +0000 Subject: [New-bugs-announce] [issue12294] multiprocessing.Pool: Need a way to find out if work are finished. In-Reply-To: <1307627992.49.0.467043384727.issue12294@psf.upfronthosting.co.za> Message-ID: <1307627992.49.0.467043384727.issue12294@psf.upfronthosting.co.za> New submission from Bugs Fly : The join() method of Pool blocks. So it is not good for finding out if there are still running workers once the pool is closed. There should be a method like is_alive() which don't block, similar to what in Process. Or task_left() which return number of task left. ---------- components: Library (Lib) messages: 137970 nosy: mozbugbox priority: normal severity: normal status: open title: multiprocessing.Pool: Need a way to find out if work are finished. type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 9 17:42:29 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 09 Jun 2011 15:42:29 +0000 Subject: [New-bugs-announce] [issue12295] Fix ResourceWarning in turtledemo help window In-Reply-To: <1307634149.19.0.469203775523.issue12295@psf.upfronthosting.co.za> Message-ID: <1307634149.19.0.469203775523.issue12295@psf.upfronthosting.co.za> New submission from ?ric Araujo : I found a ResourceWarning while using turtledemo and made this patch to fix it. It touches idlelib. ---------- assignee: eric.araujo components: IDLE, Library (Lib) files: fix-turtledemo-help-resourcewarning.diff keywords: needs review, patch messages: 137993 nosy: eric.araujo priority: normal severity: normal stage: patch review status: open title: Fix ResourceWarning in turtledemo help window versions: Python 3.2 Added file: http://bugs.python.org/file22294/fix-turtledemo-help-resourcewarning.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 9 17:45:27 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 09 Jun 2011 15:45:27 +0000 Subject: [New-bugs-announce] [issue12296] Minor clarification in devguide In-Reply-To: <1307634327.28.0.988674687108.issue12296@psf.upfronthosting.co.za> Message-ID: <1307634327.28.0.988674687108.issue12296@psf.upfronthosting.co.za> New submission from ?ric Araujo : I found the wording of one line of the devguide strange and changed it IMO for the better. Please review. ---------- assignee: eric.araujo components: Devguide files: clarify-bwcompat-devguide.diff keywords: needs review, patch messages: 137994 nosy: eric.araujo priority: normal severity: normal stage: patch review status: open title: Minor clarification in devguide versions: 3rd party Added file: http://bugs.python.org/file22295/clarify-bwcompat-devguide.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 9 17:49:11 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 09 Jun 2011 15:49:11 +0000 Subject: [New-bugs-announce] [issue12297] Clarifications to atexit.register and unregister doc In-Reply-To: <1307634551.41.0.658857259056.issue12297@psf.upfronthosting.co.za> Message-ID: <1307634551.41.0.658857259056.issue12297@psf.upfronthosting.co.za> New submission from ?ric Araujo : I wanted to know the behavior of atexit.register with the same function added more than once and found out it is not explicitly documented. I experimented and made a patch to the doc. ---------- assignee: eric.araujo components: Documentation files: atexit-doc.diff keywords: patch messages: 137995 nosy: eric.araujo priority: normal severity: normal stage: patch review status: open title: Clarifications to atexit.register and unregister doc versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22296/atexit-doc.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 9 18:06:52 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 09 Jun 2011 16:06:52 +0000 Subject: [New-bugs-announce] [issue12298] Sphinx glitch in library/functions In-Reply-To: <1307635612.57.0.782200385704.issue12298@psf.upfronthosting.co.za> Message-ID: <1307635612.57.0.782200385704.issue12298@psf.upfronthosting.co.za> New submission from ?ric Araujo : In the summary table at the top of library/functions, the links for frozenset and memoryview do not jump to the definition down in the same file, but link to stdtypes. ---------- assignee: docs at python components: Documentation messages: 137997 nosy: docs at python, eric.araujo, ezio.melotti priority: normal severity: normal status: open title: Sphinx glitch in library/functions versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 9 18:17:50 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 09 Jun 2011 16:17:50 +0000 Subject: [New-bugs-announce] [issue12299] Stop documenting functions added by site as builtins In-Reply-To: <1307636270.04.0.997555638345.issue12299@psf.upfronthosting.co.za> Message-ID: <1307636270.04.0.997555638345.issue12299@psf.upfronthosting.co.za> New submission from ?ric Araujo : I find it harmful that exit, quit and help are documented in library/functions instead of library/constants (under the section ?constants added by the site module?). It leads people to use unqualified help or exit instead of pydoc.help or sys.exit, and that would break under -S. I?d like to move the doc for these functions (and add a link from l/functions to l/constants). ---------- assignee: eric.araujo components: Documentation messages: 138001 nosy: eric.araujo priority: normal severity: normal status: open title: Stop documenting functions added by site as builtins versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 9 18:19:00 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 09 Jun 2011 16:19:00 +0000 Subject: [New-bugs-announce] [issue12300] Document pydoc.help In-Reply-To: <1307636340.19.0.379742788124.issue12300@psf.upfronthosting.co.za> Message-ID: <1307636340.19.0.379742788124.issue12300@psf.upfronthosting.co.za> New submission from ?ric Araujo : The only public function in pydoc is help, and it?s not listed in the module docs. The existing doc in library/functions could be moved to library/pydoc. See also #12299. ---------- assignee: docs at python components: Documentation messages: 138002 nosy: docs at python, eric.araujo priority: normal severity: normal status: open title: Document pydoc.help versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 9 18:22:29 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 09 Jun 2011 16:22:29 +0000 Subject: [New-bugs-announce] [issue12301] Use :data:`sys.thing` instead of ``sys.thing`` throughout In-Reply-To: <1307636549.73.0.554335270504.issue12301@psf.upfronthosting.co.za> Message-ID: <1307636549.73.0.554335270504.issue12301@psf.upfronthosting.co.za> New submission from ?ric Araujo : In a great number of files, the ``code`` markup is used instead of the :data: role, which would create a link to the appropriate definition. Unless someone objects, I would like to change all of them. ---------- assignee: eric.araujo components: Documentation messages: 138004 nosy: eric.araujo priority: normal severity: normal status: open title: Use :data:`sys.thing` instead of ``sys.thing`` throughout versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 10 00:57:43 2011 From: report at bugs.python.org (Michael Mulich) Date: Thu, 09 Jun 2011 22:57:43 +0000 Subject: [New-bugs-announce] [issue12302] pysetup run test In-Reply-To: <1307660263.81.0.443171517723.issue12302@psf.upfronthosting.co.za> Message-ID: <1307660263.81.0.443171517723.issue12302@psf.upfronthosting.co.za> New submission from Michael Mulich : A package's metadata (dist-info) should be available to it while running the test command (pysetup run test)? The use case: I've written a test for a function that is supposed to find the default configuration or one provided in a users local area (or {userbase} as sysconfig puts it). As part of the test, I'm ensuring that the forcibly found default config is loaded correctly. The function that finds the configuration uses sysconfig paths (sysconfig.get_paths) which rely on the packaging database (PEP 376 API now in packaging.database). To find the default config, or resource in packaging terms, I'm using the packaging.database.get_file_path, which requires the distribution metadata (dist-info) be available within the Python path, because it must lookup the RESOURCES file. I've started work, in my local clone. We lack a unittest for this case. I'll be writing it some time within the next few days. I'd like to know where this RESOURCES file came from? I don't recall, nor see mention of it in PEP 376. I would also have expected to find something in packaging.command.install_distinfo command related to this file. The install_distinfo command is lacking this logic. I'll add it after the first half of this case working. ---------- assignee: tarek components: Distutils2 messages: 138032 nosy: alexis, eric.araujo, michael.mulich, tarek priority: normal severity: normal status: open title: pysetup run test type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 10 00:57:45 2011 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Jun 2011 22:57:45 +0000 Subject: [New-bugs-announce] [issue12303] expose sigwaitinfo() and sigtimedwait() in the signal module In-Reply-To: <1307660265.02.0.784529954936.issue12303@psf.upfronthosting.co.za> Message-ID: <1307660265.02.0.784529954936.issue12303@psf.upfronthosting.co.za> New submission from STINNER Victor : Python 3.3 adds timeout arguments to communicate() and wait() methods of subprocess.Popen, acquire() method of threading.Lock, and maybe more. I like (optional) timeouts, and so it would be nice to have sigtimedwait(). If we expose sigtimedwait(), it's trivial to expose sigwaitinfo(), so should expose both. ---------- components: Extension Modules messages: 138033 nosy: haypo priority: normal severity: normal status: open title: expose sigwaitinfo() and sigtimedwait() in the signal module versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 10 01:00:56 2011 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Jun 2011 23:00:56 +0000 Subject: [New-bugs-announce] [issue12304] expose signalfd(2) in the signal module In-Reply-To: <1307660456.9.0.497118052372.issue12304@psf.upfronthosting.co.za> Message-ID: <1307660456.9.0.497118052372.issue12304@psf.upfronthosting.co.za> New submission from STINNER Victor : "Linux offers the signalfd syscall since 2.6.22 (with minor changes afterwards). This call allows signals to be handled as bytes read out of a file descriptor, rather than as interruptions to the flow of a program. Quite usefully, this file descriptor can be select()'d on (or poll()'d, epoll()'d, etc) alongside other "normal" file descriptors. In order to effectively use signalfd(), the signals in question must be blocked, though. So it makes sense to expose sigprocmask(2) at the same time, in order to allow this blocking to be set up." This message is copy/pasted from #8407 (msg103182). I created the issue because #8407 contains much more than signalfd(). ---------- components: Extension Modules messages: 138034 nosy: exarkun, haypo priority: normal severity: normal status: open title: expose signalfd(2) in the signal module versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 10 02:32:15 2011 From: report at bugs.python.org (Eric Snow) Date: Fri, 10 Jun 2011 00:32:15 +0000 Subject: [New-bugs-announce] [issue12305] Building PEPs doesn't work on Python 3 In-Reply-To: <1307665935.0.0.179187869363.issue12305@psf.upfronthosting.co.za> Message-ID: <1307665935.0.0.179187869363.issue12305@psf.upfronthosting.co.za> New submission from Eric Snow : I found that the .py files are all 2.x. If I get a chance I will write up a patch a little later. This is similar to issue #10224. Incidently, not having done any documentation work before, I didn't realize that docutils isn't in the stdlib. ---------- messages: 138043 nosy: ericsnow priority: normal severity: normal status: open title: Building PEPs doesn't work on Python 3 type: compile error versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 10 02:51:04 2011 From: report at bugs.python.org (Torsten Landschoff) Date: Fri, 10 Jun 2011 00:51:04 +0000 Subject: [New-bugs-announce] [issue12306] zlib: Expose zlibVersion to query runtime version of zlib In-Reply-To: <1307667064.6.0.30417035015.issue12306@psf.upfronthosting.co.za> Message-ID: <1307667064.6.0.30417035015.issue12306@psf.upfronthosting.co.za> New submission from Torsten Landschoff : I am currently fighting a curious problem in using zlib from Python: Decompression completes but sometimes the resulting output does not match a sha224 hash of the expected output. I deployed a zlib 1.2.5 with our PyInstaller output but the problem persists. I would like to check that the program is actually using the right zlib version. zlib provides the function zlibVersion to access the actual run time version. The attached patch exposes this function from the zlib module. I also added a unit test to check that the function is there and the output matches ZLIB_VERSION (which should match on the build machine). ---------- components: Library (Lib) files: zlibversion.diff keywords: patch messages: 138044 nosy: torsten priority: normal severity: normal status: open title: zlib: Expose zlibVersion to query runtime version of zlib type: feature request versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22307/zlibversion.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 10 07:50:38 2011 From: report at bugs.python.org (Eric Snow) Date: Fri, 10 Jun 2011 05:50:38 +0000 Subject: [New-bugs-announce] [issue12307] Inconsistent formatting of section titles in PEP 0 In-Reply-To: <1307685038.6.0.993227913919.issue12307@psf.upfronthosting.co.za> Message-ID: <1307685038.6.0.993227913919.issue12307@psf.upfronthosting.co.za> New submission from Eric Snow : The formatting for the title of the "Index by Category" section is different from the formatting for the title of the "Numerical Index" section. Not sure if there is a reason behind this, but here's a patch: diff --git a/pep0/output.py b/pep0/output.py --- a/pep0/output.py +++ b/pep0/output.py @@ -169,7 +169,7 @@ print>>output, unicode(pep) print>>output print>>output - print>>output, u" Numerical Index" + print>>output, u"Numerical Index" print>>output write_column_headers(output) prev_pep = 0 ---------- messages: 138050 nosy: ericsnow priority: normal severity: normal status: open title: Inconsistent formatting of section titles in PEP 0 versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 10 08:05:38 2011 From: report at bugs.python.org (Eric Snow) Date: Fri, 10 Jun 2011 06:05:38 +0000 Subject: [New-bugs-announce] [issue12308] Add link to PEP 0 for topical index in wiki In-Reply-To: <1307685938.0.0.639002265247.issue12308@psf.upfronthosting.co.za> Message-ID: <1307685938.0.0.639002265247.issue12308@psf.upfronthosting.co.za> New submission from Eric Snow : A couple of months back I started a page on the wiki for a topical index of PEPs from PEP 0 [1]. I got tired of reading through PEPs trying to see if one related to what I was working on. I found myself wishing there was a topical index of all the PEPs. The wiki page is the result. Since it is relatively more dynamic an index than those in PEP 0, I figured it wouldn't work to add it there. However, I had gotten some support for adding a link to that wiki page to PEP 0, so here's a patch that does so. I was not sure that the URL should be in the intro, so the patch puts it in its own section right above the Index by Category. The structure of the wiki page is satisfactory, I hope, and I was able to populate a handful of topics I could think of. I did not get to very many of the standards-track PEPs. Still, I think it's a good start and worth linking to in PEP 0. [1] http://wiki.python.org/moin/Topically_Organized_PEP_List ---------- files: pep0.diff keywords: patch messages: 138052 nosy: ericsnow priority: normal severity: normal status: open title: Add link to PEP 0 for topical index in wiki versions: Python 3.3 Added file: http://bugs.python.org/file22310/pep0.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 10 11:02:03 2011 From: report at bugs.python.org (STINNER Victor) Date: Fri, 10 Jun 2011 09:02:03 +0000 Subject: [New-bugs-announce] [issue12309] os.environ was modified by test_packaging In-Reply-To: <1307696523.79.0.913575304812.issue12309@psf.upfronthosting.co.za> Message-ID: <1307696523.79.0.913575304812.issue12309@psf.upfronthosting.co.za> New submission from STINNER Victor : [ 20/356] test_packaging (...) Warning -- os.environ was modified by test_packaging Seen on x86 Tiger buildbot: http://www.python.org/dev/buildbot/all/builders/x86%20Tiger%203.x/builds/2723/steps/test/logs/stdio There is also a resource warning: .../Lib/packaging/pypi/simple.py:86: ResourceWarning: unclosed return wrapped(self, *args, **kwargs) ---------- components: Tests messages: 138058 nosy: haypo, tarek priority: normal severity: normal status: open title: os.environ was modified by test_packaging versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 10 11:11:53 2011 From: report at bugs.python.org (STINNER Victor) Date: Fri, 10 Jun 2011 09:11:53 +0000 Subject: [New-bugs-announce] [issue12310] Segfault in test_multiprocessing In-Reply-To: <1307697113.9.0.00979334615642.issue12310@psf.upfronthosting.co.za> Message-ID: <1307697113.9.0.00979334615642.issue12310@psf.upfronthosting.co.za> New submission from STINNER Victor : test_multiprocessing segfaults in a loop. The crash occurs in _Condition.release() on waiter.release(), called from Queue._finalize_close(). Possible related changes: - a5c8b6ebe895: new sigwait() test using thread (issue #8407) - 6d6099f7fe89: add sentinels to multiprocessing (issue #9205) Example of a crash: [333/356/1] test_multiprocessing Fatal Python error: Segmentation fault Thread 0x01cde800: File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/threading.py", line 237 in wait File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/queues.py", line 252 in _feed File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/threading.py", line 690 in run File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/threading.py", line 737 in _bootstrap_inner File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/threading.py", line 710 in _bootstrap Current thread 0xa000d000: File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/threading.py", line 298 in notify File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/queues.py", line 227 in _finalize_close File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/util.py", line 202 in __call__ File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/process.py", line 270 in _bootstrap File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/forking.py", line 133 in __init__ File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/process.py", line 134 in start File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/pool.py", line 220 in _repopulate_pool File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/pool.py", line 157 in __init__ File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/multiprocessing/__init__.py", line 231 in Pool File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_multiprocessing.py", line 2186 in test_main File "./Lib/test/regrtest.py", line 1043 in runtest_inner File "./Lib/test/regrtest.py", line 841 in runtest File "./Lib/test/regrtest.py", line 668 in main File "./Lib/test/regrtest.py", line 1618 in There are approximatively 698 crashes in last tests on "x86 Tiger 3.x"! http://www.python.org/dev/buildbot/all/builders/x86%20Tiger%203.x/builds/2722/steps/test/logs/stdio Most occured on Queue._finalize_close() -> _Condition.release() -> waiter.release(). ---------- messages: 138060 nosy: haypo, pitrou priority: normal severity: normal status: open title: Segfault in test_multiprocessing _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 10 11:21:27 2011 From: report at bugs.python.org (Albert Zeyer) Date: Fri, 10 Jun 2011 09:21:27 +0000 Subject: [New-bugs-announce] [issue12311] memory leak with self-referencing dict In-Reply-To: <1307697687.04.0.359368964586.issue12311@psf.upfronthosting.co.za> Message-ID: <1307697687.04.0.359368964586.issue12311@psf.upfronthosting.co.za> New submission from Albert Zeyer : The attached Python script leaks memory. It is clear that there is a reference circle (`__dict__` references `self`) but `gc.collect()` should find this. ---------- components: Interpreter Core files: py_dict_refcount_test.py messages: 138062 nosy: Albert.Zeyer priority: normal severity: normal status: open title: memory leak with self-referencing dict type: resource usage versions: Python 3.2 Added file: http://bugs.python.org/file22311/py_dict_refcount_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 10 17:23:58 2011 From: report at bugs.python.org (tanushree) Date: Fri, 10 Jun 2011 15:23:58 +0000 Subject: [New-bugs-announce] [issue12312] is ok In-Reply-To: Message-ID: New submission from tanushree : thank u very much for registering me . ---------- messages: 138082 nosy: tanushree.ghosal at gmail.com priority: normal severity: normal status: open title: is ok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 10 18:08:02 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 10 Jun 2011 16:08:02 +0000 Subject: [New-bugs-announce] [issue12313] make install misses packaging module In-Reply-To: <1307722082.95.0.13819638115.issue12313@psf.upfronthosting.co.za> Message-ID: <1307722082.95.0.13819638115.issue12313@psf.upfronthosting.co.za> New submission from ?ric Araujo : Here?s a patch adding Lib/packaging subdirectories to Makefile.pre.in. Because of our extensive tests for pypi-related code, the list is huge. Maybe it should use a call to find(1) instead of using a fragile manually-maintained list, so I?m asking here. ---------- components: Installation files: add-packaging-makefile.pre.in.diff keywords: patch messages: 138096 nosy: eric.araujo priority: normal severity: normal stage: patch review status: open title: make install misses packaging module type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file22316/add-packaging-makefile.pre.in.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 10 18:19:09 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 10 Jun 2011 16:19:09 +0000 Subject: [New-bugs-announce] [issue12314] regrtest checks (os.environ, sys.path, etc.) are hard to use In-Reply-To: <1307722749.85.0.48203387339.issue12314@psf.upfronthosting.co.za> Message-ID: <1307722749.85.0.48203387339.issue12314@psf.upfronthosting.co.za> New submission from ?ric Araujo : When regrtest tells me that os.environ was modified by test_packaging, it?s very hard to find which test is responsible. The -vv output is hard to read: it prints four dictionaries, which I have to visually delineate, copy, paste, pretty-print and diff to find what?s changed. Then I edit the source code of regrtest so that it fails earlier, or I add a debug print in the packaging.util code that touches os.environ. I?d like regrtest to tell me what exactly was changed, and where. For the first request, I think each checked object could use a type-specific method, for example _compare_dict would see if any value was changed and if keys are different, and print only that info. ---------- components: Tests messages: 138101 nosy: eric.araujo priority: normal severity: normal status: open title: regrtest checks (os.environ, sys.path, etc.) are hard to use versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 10 21:22:56 2011 From: report at bugs.python.org (harobed) Date: Fri, 10 Jun 2011 19:22:56 +0000 Subject: [New-bugs-announce] [issue12315] Improve http.client.HTTPResponse.read documentation In-Reply-To: <1307733776.17.0.904388798994.issue12315@psf.upfronthosting.co.za> Message-ID: <1307733776.17.0.904388798994.issue12315@psf.upfronthosting.co.za> New submission from harobed : This is a patch to improve http.client.HTTPResponse.read documentation. What do you think about ? ---------- assignee: docs at python components: Documentation files: improve_http.client_documentation.patch keywords: patch messages: 138129 nosy: docs at python, harobed priority: normal severity: normal status: open title: Improve http.client.HTTPResponse.read documentation versions: Python 3.3 Added file: http://bugs.python.org/file22321/improve_http.client_documentation.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 11 00:01:24 2011 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Fri, 10 Jun 2011 22:01:24 +0000 Subject: [New-bugs-announce] [issue12316] test_signal: test_sigwait_thread failure on FreeBSD 6.4 buildbot In-Reply-To: <1307743284.62.0.757542886858.issue12316@psf.upfronthosting.co.za> Message-ID: <1307743284.62.0.757542886858.issue12316@psf.upfronthosting.co.za> New submission from Charles-Fran?ois Natali : http://www.python.org/dev/buildbot/all/builders/x86 FreeBSD 6.4 3.x/builds/1570/steps/test/logs/stdio """ [ 29/356] test_signal Fatal error 'mutex is on list' at line 540 in file /usr/src/lib/libpthread/thread/thr_mutex.c (errno = 22) test test_signal failed -- Traceback (most recent call last): File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_signal.py", line 669, in test_sigwait_thread self.check_sigwait(test, signal.SIGUSR1) File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_signal.py", line 632, in check_sigwait self.assertEqual(os.waitpid(pid, 0), (pid, 0)) AssertionError: Tuples differ: (50592, 134) != (50592, 0) First differing element 1: 134 0 - (50592, 134) ? ^^^ + (50592, 0) ? ^ """ Fatal error 'mutex is on list' at line 540 in file /usr/src/lib/libpthread/thread/thr_mutex.c (errno = 22) In a multi-threaded program, we're only allowed to call async-safe functions between fork() and exec() in the child process (well, taken literaly this means we shouldn't run Python at all after fork...). It looks like FreeBSD 6.4 doesn't like new threads after fork() : http://unix.derkeiler.com/Mailing-Lists/FreeBSD/hackers/2008-03/msg00108.html test_sigwait_thread should either be skipped on FreeBSD 6 (it seems to pass on FreeBSD 7), or removed altogether. ---------- components: Tests messages: 138138 nosy: haypo, neologix priority: normal severity: normal status: open title: test_signal: test_sigwait_thread failure on FreeBSD 6.4 buildbot type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 11 21:18:14 2011 From: report at bugs.python.org (Giampaolo Rodola') Date: Sat, 11 Jun 2011 19:18:14 +0000 Subject: [New-bugs-announce] [issue12317] inspect.getabsfile() is not documented Message-ID: <1307819894.17.0.481142115694.issue12317@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- assignee: giampaolo.rodola nosy: giampaolo.rodola priority: normal severity: normal status: open title: inspect.getabsfile() is not documented versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 12 00:02:51 2011 From: report at bugs.python.org (=?utf-8?q?Filip_Gruszczy=C5=84ski?=) Date: Sat, 11 Jun 2011 22:02:51 +0000 Subject: [New-bugs-announce] [issue12318] list + tuple inconsistency In-Reply-To: <1307829771.92.0.859008661902.issue12318@psf.upfronthosting.co.za> Message-ID: <1307829771.92.0.859008661902.issue12318@psf.upfronthosting.co.za> New submission from Filip Gruszczy?ski : You can do this: >>> [1] + (1,) Traceback (most recent call last): File "", line 1, in TypeError: can only concatenate list (not "tuple") to list But you can do this: >>> result = [1] >>> result += (1,) >>> result [1, 1] Is it the expected behaviour, that += does implicit coercion? ---------- messages: 138185 nosy: gruszczy priority: normal severity: normal status: open title: list + tuple inconsistency versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 12 12:47:13 2011 From: report at bugs.python.org (harobed) Date: Sun, 12 Jun 2011 10:47:13 +0000 Subject: [New-bugs-announce] [issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data In-Reply-To: <1307875633.83.0.874379254828.issue12319@psf.upfronthosting.co.za> Message-ID: <1307875633.83.0.874379254828.issue12319@psf.upfronthosting.co.za> New submission from harobed : Hi, HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data. Exemple, I can't do PUT request with chunk transfert. Regards, Stephane ---------- components: Library (Lib) messages: 138203 nosy: harobed priority: normal severity: normal status: open title: [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data versions: Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 12 15:54:56 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 12 Jun 2011 13:54:56 +0000 Subject: [New-bugs-announce] [issue12320] test_packaging failures In-Reply-To: <1307886896.56.0.892165985484.issue12320@psf.upfronthosting.co.za> Message-ID: <1307886896.56.0.892165985484.issue12320@psf.upfronthosting.co.za> New submission from Antoine Pitrou : The 3.x buildbots are red following the latest commits: ====================================================================== ERROR: test_cfg_to_args (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/packaging/tests/test_util.py", line 499, in test_cfg_to_args self.write_file('setup.cfg', SETUP_CFG % opts) File "/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/packaging/tests/support.py", line 163, in write_file f.write(content) UnicodeEncodeError: 'ascii' codec can't encode character '\xc9' in position 114: ordinal not in range(128) ====================================================================== FAIL: test_user_site (packaging.tests.test_command_install_dist.InstallTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/packaging/tests/test_command_install_dist.py", line 93, in test_user_site self._test_user_site() File "/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/packaging/tests/test_command_install_dist.py", line 122, in _test_user_site self.assertTrue(os.path.exists(self.user_base)) AssertionError: False is not true ---------- assignee: eric.araujo components: Library (Lib), Tests messages: 138207 nosy: eric.araujo, pitrou priority: critical severity: normal stage: needs patch status: open title: test_packaging failures type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 13 11:49:21 2011 From: report at bugs.python.org (patrick vrijlandt) Date: Mon, 13 Jun 2011 09:49:21 +0000 Subject: [New-bugs-announce] [issue12321] documentation of ElementTree.find In-Reply-To: <1307958561.6.0.547513151308.issue12321@psf.upfronthosting.co.za> Message-ID: <1307958561.6.0.547513151308.issue12321@psf.upfronthosting.co.za> New submission from patrick vrijlandt : >From the python docs for version 3.2: 19.12.3. ElementTree Objects find(match) [...] Same as getroot().find(match). [...] This is not true: tree.find accepts an absolute path (like "/*") , whereas element.find doesn't. Also applies to findall and findtext. ---------- components: XML messages: 138228 nosy: patrick.vrijlandt priority: normal severity: normal status: open title: documentation of ElementTree.find type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 13 12:02:49 2011 From: report at bugs.python.org (patrick vrijlandt) Date: Mon, 13 Jun 2011 10:02:49 +0000 Subject: [New-bugs-announce] [issue12322] ElementPath 1.3 expressions documentation In-Reply-To: <1307959369.7.0.162667287307.issue12322@psf.upfronthosting.co.za> Message-ID: <1307959369.7.0.162667287307.issue12322@psf.upfronthosting.co.za> New submission from patrick vrijlandt : Python 3.2 supports ElementPath version 1.3. The relevant documentation is http://effbot.org/zone/element-xpath.htm. It says: .. (New in 1.3) Selects the parent element. However, a CHANGES document says: The engine also provides limited support for the ".." parent operator; you can use it inside the subtree, but it cannot go above the target element (the element you called "find" on). The normal documentation should document the limitation. ---------- components: XML messages: 138229 nosy: patrick.vrijlandt priority: normal severity: normal status: open title: ElementPath 1.3 expressions documentation type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 13 12:11:33 2011 From: report at bugs.python.org (patrick vrijlandt) Date: Mon, 13 Jun 2011 10:11:33 +0000 Subject: [New-bugs-announce] [issue12323] ElementPath 1.3 expressions In-Reply-To: <1307959893.21.0.719611338142.issue12323@psf.upfronthosting.co.za> Message-ID: <1307959893.21.0.719611338142.issue12323@psf.upfronthosting.co.za> New submission from patrick vrijlandt : >From http://effbot.org/zone/element-xpath.htm: [position] (New in 1.3) Selects all elements that are located at the given position. The position can be either an integer (1 is the first position), the expression ?last()? (for the last position), or a position relative to last() (e.g. ?last()-1? for the second to last position). This predicate must be preceeded by a tag name. Testing shows, that [0] is accepted, and seems to be [last()]. However [-1] selects no elements. I think these expressions should raise an exception. (Or the feature should be 0-based and behave like python list indices) ---------- components: XML messages: 138230 nosy: patrick.vrijlandt priority: normal severity: normal status: open title: ElementPath 1.3 expressions type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 13 12:18:26 2011 From: report at bugs.python.org (DDarko) Date: Mon, 13 Jun 2011 10:18:26 +0000 Subject: [New-bugs-announce] [issue12324] [3.2] sorted(big dict) In-Reply-To: <1307960306.32.0.147615969917.issue12324@psf.upfronthosting.co.za> Message-ID: <1307960306.32.0.147615969917.issue12324@psf.upfronthosting.co.za> New submission from DDarko : I added an example to reproduce the bug. >From the command line the same code: Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) [GCC 4.5.2] on linux2 $ python sort_test.py Everything fine. Python 3.2 (r32:88445, Mar 25 2011, 19:28:28) [GCC 4.5.2] on linux2 $ python3 sort_test.py Traceback (most recent call last): File "sort_test.py", line 1821, in r = sorted(d.items(), key=operator.itemgetter(1), reverse=1) TypeError: unorderable types: dict() < dict() ---------- files: sort_test.py messages: 138231 nosy: DDarko priority: normal severity: normal status: open title: [3.2] sorted(big dict) type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file22339/sort_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 13 14:24:51 2011 From: report at bugs.python.org (Cal Leeming) Date: Mon, 13 Jun 2011 12:24:51 +0000 Subject: [New-bugs-announce] [issue12325] regex matches incorrectly on literal dot (99.9% confirmed) In-Reply-To: <1307967891.59.0.313731178226.issue12325@psf.upfronthosting.co.za> Message-ID: <1307967891.59.0.313731178226.issue12325@psf.upfronthosting.co.za> New submission from Cal Leeming : I believe I might have found a bug in the Python re libraries. Here is a complete debug of what is happening (my apologies for the nature of the actual text). I have ran this regex through RegexBuddy (and a few other tools), and all of them do the correct action (which is to not do any replacement), apart from Python. I haven't yet tried this in another language. ------------ ORIGINAL TEXT ------------ >>313229176 me and a buddy and his girlfriend were watching tv once and this blabbering idiot starts talking about this scientific study she heard about where they built a fake city and only one guy didn't know that it was a fake. we all paused for a second and i said "the truman show?" and she says "yeah! that was the name of it!" me my buddy and his girlfriend all catch eyes and are baffled at how stupid she was ---------------------------------------- ------------ TEXT AFTER REGEX SUB ------------ me and a buddy and his girlfriend were http://watching.tv once and this blabbering idiot starts talking about this scientific study she heard about where they built a fake city and only one guy didn't know that it was a fake.we all paused for a second and i said "the truman show?" and she says "yeah! that was the name of it!" me my buddy and his girlfriend all catch eyes and are baffled at how stupid she was ----------------------------------------------- ----------- REPLACED TEXT ----------- watching tv http://watching.tv ----------------------------------------------- ---- REGEX ---- _t = re.compile(r"(^| )((?:[\w\-]{2,}?\.|)(?:[\w\-]{2,}?)(?:\.com|\.net|\.org|\.co\.uk|\.tv|\.ly))", flags = re.IGNORECASE | re.MULTILINE | re.DEBUG) ---- COMMAND ---- _t.sub("\\1http://\\2", original_message_here) ---- REGEX DEBUG ---- subpattern 1 branch at at_beginning or literal 32 subpattern 2 subpattern None branch min_repeat 2 65535 in category category_word literal 45 literal 46 or subpattern None min_repeat 2 65535 in category category_word literal 45 subpattern None literal 46 branch literal 99 literal 111 literal 109 or literal 110 literal 101 literal 116 or literal 111 literal 114 literal 103 or literal 99 literal 111 literal 46 literal 117 literal 107 or literal 116 literal 118 or literal 108 literal 121 ---------- components: Regular Expressions messages: 138234 nosy: Cal.Leeming priority: normal severity: normal status: open title: regex matches incorrectly on literal dot (99.9% confirmed) versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 13 16:34:42 2011 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Mon, 13 Jun 2011 14:34:42 +0000 Subject: [New-bugs-announce] [issue12326] Linux 3: tests should avoid using sys.platform == 'linux2' In-Reply-To: <1307975682.23.0.138592930251.issue12326@psf.upfronthosting.co.za> Message-ID: <1307975682.23.0.138592930251.issue12326@psf.upfronthosting.co.za> New submission from Charles-Fran?ois Natali : Linus recently decided that the next Linux kernel version would 3.0 [1]. As a consequence, sys.platform (which is actually MACHDEP) will be 'linux3' on machines running Linux 3 kernels, and tests checking explicitely against 'linux2' will either break and won't run. A quick grep through the code base returns only a couple problematic places, but this should definitely be fixed. For information, here's a - probably incomplete - list of such occurrences: """ ./Lib/test/test_logging.py: if sys.platform in ('linux2', 'darwin'): ./Lib/test/test_sysconfig.py: sys.platform = 'linux2' ./Lib/test/regrtest.py: 'linux2': ./Lib/test/test_socket.py: if sys.platform == 'linux2': ./Lib/test/test_tarfile.py: if sys.platform == "linux2": ./Lib/distutils/tests/test_bdist_rpm.py: if sys.platform != 'linux2': ./Lib/distutils/tests/test_bdist_rpm.py: if sys.platform != 'linux2': ./Lib/distutils/tests/test_util.py: sys.platform = 'linux2' ./Lib/packaging/tests/test_config.py: inotify (0.0.1); sys.platform == 'linux2' ./Lib/packaging/tests/test_config.py: "inotify (0.0.1); sys.platform == 'linux2'"] ./setup.py: if (platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6', """ [1] http://thread.gmane.org/gmane.linux.kernel/1147415 ---------- messages: 138251 nosy: neologix priority: normal severity: normal stage: needs patch status: open title: Linux 3: tests should avoid using sys.platform == 'linux2' type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 13 19:50:09 2011 From: report at bugs.python.org (harobed) Date: Mon, 13 Jun 2011 17:50:09 +0000 Subject: [New-bugs-announce] [issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object In-Reply-To: <1307987409.37.0.379147237937.issue12327@psf.upfronthosting.co.za> Message-ID: <1307987409.37.0.379147237937.issue12327@psf.upfronthosting.co.za> New submission from harobed : Hi, in httplib.HTTPConnection._send_request (Python 2.6) in httplib.HTTPConnection._set_content_length (Python 2.7) and http.client.HTTPConnection._set_content_length (Python 3.3) there are something like that : try: thelen = str(len(body)) except TypeError as te: # If this is a file-like object, try to # fstat its file descriptor try: thelen = str(os.fstat(body.fileno()).st_size) except (AttributeError, OSError): # Don't send a length if this failed if self.debuglevel > 0: print("Cannot stat!!") If I put StringIO object in body and I do : >>> len(body) AttributeError: StringIO instance has no attribute '__len__' I haven't TypeError. I think we need to replace : try: thelen = str(len(body)) except TypeError as te: by : if hasattr(body, "read"): ... # it's file-like object else: ... # it's string object What do you think about ? ---------- components: Library (Lib) messages: 138264 nosy: harobed priority: normal severity: normal status: open title: in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object versions: Python 2.6, Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 13 20:53:16 2011 From: report at bugs.python.org (sbt) Date: Mon, 13 Jun 2011 18:53:16 +0000 Subject: [New-bugs-announce] [issue12328] multiprocessing's overlapped PipeConnection on Windows In-Reply-To: <1307991196.59.0.849860111943.issue12328@psf.upfronthosting.co.za> Message-ID: <1307991196.59.0.849860111943.issue12328@psf.upfronthosting.co.za> New submission from sbt : There are some problems with the new Windows overlapped implementation of PipeConnection in the default branch. 1) poll(0) can return False when an empty string is in the pipe: if the next message in the pipe is b"" then PeekNamedPipe() returns (0, 0) which is indistiguishable from the case where the pipe is empty. This affects versions 2.6-3.2 of Python on Windows as well. For old versions I would just document the fact that poll() will fail to see that there is data in the pipe if the next message is an empty string. In practice this is not a big deal since pipes are primarily used for pickled objects which will never be the empty string. 2) _poll() forgets to check self._buffered, so it can return False even if there is buffered data. 3) Even if (2) is fixed, _poll() with a non-zero timeout can mess up message boundaries if the pipe contains messages of length zero or one. To fix this overlapped_GetOverlappedResult() needs to be changed to not swallow and forget ERROR_MORE_DATA errors. 4) In _poll() there is a race condition: if the read operation completes after WaitForMultipleObjects() timesout, but before the operation is cancelled, then the data read will be discarded. 5) The code assumes that if CancelIo()/CancelIoEx() returns successfully then the OVERLAPPED structure and associated buffer may be deallocated immediately. But the documentation says that if CancelIo()/CancelIoEx() succeeds then cancellation has only been *requested*: http://msdn.microsoft.com/en-us/library/aa363792%28v=vs.85%29.aspx If [CancelIoEx()] succeeds, the return value is nonzero. The cancel operation for all pending I/O operations issued by the calling thread for the specified file handle was successfully *requested*. The application must not free or reuse the OVERLAPPED structure associated with the canceled I/O operations until they have *completed*. The thread can use the GetOverlappedResult function to determine when the I/O operations themselves have been completed. We should wait for cancellation to *complete* by using GetOverlappedResult(..., TRUE), otherwise we risk a crash. If the operation was cancelled then FALSE is returned with GetLastError() == ERROR_OPERATION_ABORTED. I would suggest making it a programming error for the overlapped object to be deallocated while the operation is still pending, and to print a RuntimeError if that happens. (This does not prevent us from still trying to prevent a crash using CancelIoEx().) 6) Not a bug exactly, but poll(timeout) is no longer interruptible with Ctrl-C. This also means that Queue.get() is no longer interruptible. -- The unit tests attached pass on Unix. On Windows versions up to 3.2, only test_empty_string fails. On Windows version 3.3 all three fail. ---------- components: Extension Modules files: test_pipe_poll.py messages: 138268 nosy: jnoller, pitrou, sbt priority: normal severity: normal status: open title: multiprocessing's overlapped PipeConnection on Windows type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22345/test_pipe_poll.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 14 00:04:10 2011 From: report at bugs.python.org (Hans Peter de Koning) Date: Mon, 13 Jun 2011 22:04:10 +0000 Subject: [New-bugs-announce] [issue12329] XHTML entity apos missing in htmlentitydefs In-Reply-To: <1308002650.66.0.942536008369.issue12329@psf.upfronthosting.co.za> Message-ID: <1308002650.66.0.942536008369.issue12329@psf.upfronthosting.co.za> New submission from Hans Peter de Koning : In module htmlentitydefs.py the following XHTML-1 entity is missing from dict name2codepoint: 'apos': 0x0027, # apostrophe, U+0027 ISOnum Above line should be added after line 72: 'ang': 0x2220, # angle, U+2220 ISOamso ---------- components: Extension Modules messages: 138282 nosy: hp.dekoning priority: normal severity: normal status: open title: XHTML entity apos missing in htmlentitydefs versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 14 01:28:20 2011 From: report at bugs.python.org (Julian) Date: Mon, 13 Jun 2011 23:28:20 +0000 Subject: [New-bugs-announce] [issue12330] Named set methods on collections.Set and dict view objects In-Reply-To: <1308007700.37.0.290981721685.issue12330@psf.upfronthosting.co.za> Message-ID: <1308007700.37.0.290981721685.issue12330@psf.upfronthosting.co.za> New submission from Julian : collections.Set / collections.MutableSet do not provide any of the named set methods, nor do dict view objects (neither as viewkeys and friends create them nor in py3). They obviously implement the operator methods correctly, but besides the fact that they're not fully implementing the set API, .union, .difference, and .intersection, for example, take *args to do arbitrary unions / difference / intersections, so there's at least one functionality gap too (nothing a for loop can't fix but, yeah). I've attached a very quick example diff'ing the methods which I ran on 2.7 and 3.2. In searching around for a reason, or at least some documentation or acknowledgement that this is intentional, I see there's an offhand comment on Issue7771 (I apologize in advance if this didn't deserve its own ticket then). Issue9212 was accepted as "an oversight" and is related, so I hope that it's worth the clarification as to whether 1. we (you :) are planning / willing to do this fix on 2.7, or 3.2, or 2. if this is desired for some reason, in which case consider this simply a documentation request and perhaps a dupe of 7771 then. Now that I've been long winded thanks for your time :). ---------- components: Library (Lib) files: namedmeths.py messages: 138286 nosy: Julian priority: normal severity: normal status: open title: Named set methods on collections.Set and dict view objects type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file22358/namedmeths.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 14 10:25:05 2011 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 14 Jun 2011 08:25:05 +0000 Subject: [New-bugs-announce] [issue12331] lib2to3 tests write into protected directory In-Reply-To: <1308039905.35.0.844130092935.issue12331@psf.upfronthosting.co.za> Message-ID: <1308039905.35.0.844130092935.issue12331@psf.upfronthosting.co.za> New submission from Vinay Sajip : Some of the tests for lib2to3 write into folders which are protected in an installed Python. This means that regression tests fail when run on an installed Python, even though they run wihtout these errors on a source build. I think writes should be done into temp files, so that you can run regressions on installed Pythons. Example failure: ====================================================================== ERROR: test_refactor_file (lib2to3.tests.test_refactor.TestRefactoringTool) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python3.3/lib2to3/tests/test_refactor.py", line 190, in check_file_refactoring rt.refactor_file(test_file, True) File "/usr/local/lib/python3.3/lib2to3/refactor.py", line 353, in refactor_file write=write, encoding=encoding) File "/usr/local/lib/python3.3/lib2to3/refactor.py", line 518, in processed_file self.write_file(new_text, filename, old_text, encoding) File "/usr/local/lib/python3.3/lib2to3/refactor.py", line 530, in write_file f = _open_with_encoding(filename, "w", encoding=encoding) IOError: [Errno 13] Permission denied: '/usr/local/lib/python3.3/lib2to3/tests/data/fixers/parrot_example.py' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.3/lib2to3/tests/test_refactor.py", line 200, in test_refactor_file self.check_file_refactoring(test_file, _DEFAULT_FIXERS) File "/usr/local/lib/python3.3/lib2to3/tests/test_refactor.py", line 194, in check_file_refactoring with open(test_file, "wb") as fp: IOError: [Errno 13] Permission denied: '/usr/local/lib/python3.3/lib2to3/tests/data/fixers/parrot_example.py' ---------- components: 2to3 (2.x to 3.0 conversion tool), Tests messages: 138302 nosy: benjamin.peterson, vinay.sajip priority: normal severity: normal status: open title: lib2to3 tests write into protected directory versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 14 15:39:23 2011 From: report at bugs.python.org (Carmine Paolino) Date: Tue, 14 Jun 2011 13:39:23 +0000 Subject: [New-bugs-announce] [issue12332] Float division In-Reply-To: <1308058763.8.0.977949116716.issue12332@psf.upfronthosting.co.za> Message-ID: <1308058763.8.0.977949116716.issue12332@psf.upfronthosting.co.za> New submission from Carmine Paolino : Trying to run this simple script: for i in range(10): print(i*0.2) when i is 3, the result given is 0.6000000000000001. What could the problem be? ---------- components: Interpreter Core messages: 138311 nosy: cancelliere priority: normal severity: normal status: open title: Float division type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 14 16:26:47 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 14 Jun 2011 14:26:47 +0000 Subject: [New-bugs-announce] [issue12333] test_packaging failures under Solaris In-Reply-To: <1308061607.43.0.119074494077.issue12333@psf.upfronthosting.co.za> Message-ID: <1308061607.43.0.119074494077.issue12333@psf.upfronthosting.co.za> New submission from Antoine Pitrou : The problem is that tearDown() tries to rmdir() the current directory, which is forbidden under Solaris and returns EINVAL: >>> os.getcwd() '/home/antoine/t/t' >>> os.rmdir("/home/antoine/t/t") Traceback (most recent call last): File "", line 1, in OSError: [Errno 22] Invalid argument: '/home/antoine/t/t' >>> os.chdir('..') >>> os.rmdir("/home/antoine/t/t") >>> Extract of rmdir (2) manpage: EINVAL The directory to be removed is the current directory, or the final component of path is ".". See e.g. http://www.python.org/dev/buildbot/all/builders/x86%20OpenIndiana%203.x: ====================================================================== ERROR: test_cfg_to_args (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmpe5bnmg/tmp_41r35' ====================================================================== ERROR: test_change_root (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmptqqcy4/tmp8k_szg' ====================================================================== ERROR: test_convert_path (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmpz76w6g/tmpehqobf' ====================================================================== ERROR: test_dont_write_bytecode (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmpfou_50/tmp8m6foa' ====================================================================== ERROR: test_find_exe_version (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmp8qchh_/tmpask38f' ====================================================================== ERROR: test_find_packages (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmpm0qhvv/tmp8t42l2' ====================================================================== ERROR: test_get_compiler_versions (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmpou061r/tmph8fa0r' ====================================================================== ERROR: test_import_nested_first_time (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmp6iygts/tmpy8btph' ====================================================================== ERROR: test_newer (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmpkyznct/tmpfj4aiy' ====================================================================== ERROR: test_resolve_name (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmpz_s22i/tmp7am_yk' ====================================================================== ERROR: test_rfc822_escape (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmpbo_555/tmpnavzar' ====================================================================== ERROR: test_run_2to3_on_code (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmphtln_2/tmpib4b_x' ====================================================================== ERROR: test_run_2to3_on_doctests (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmpi1r8bp/tmp444dq2' ====================================================================== ERROR: test_server_empty_registration (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmpqy_wif/tmp7tbq0t' /export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/pypi/simple.py:86: ResourceWarning: unclosed return wrapped(self, *args, **kwargs) Warning -- logging._handlerList was modified by test_packaging test test_packaging failed -- multiple errors occurred ====================================================================== ERROR: test_server_registration (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmpink626/tmpzqcvqs' ====================================================================== ERROR: test_spawn (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmpohv3t5/tmpjpol8_' ====================================================================== ERROR: test_split_quoted (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmp00p03n/tmpvxwrl5' ====================================================================== ERROR: test_strtobool (packaging.tests.test_util.UtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/test_util.py", line 147, in tearDown super(UtilTestCase, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 225, in tearDown super(EnvironRestorer, self).tearDown() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/packaging/tests/support.py", line 128, in tearDown shutil.rmtree(self._basetempdir, os.name in ('nt', 'cygwin')) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 278, in rmtree rmtree(fullname, ignore_errors, onerror) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 287, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/shutil.py", line 285, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/tmp/tmppwqypq/tmp8vywqv' ---------- assignee: eric.araujo components: Distutils2 messages: 138315 nosy: alexis, eric.araujo, pitrou priority: high severity: normal stage: needs patch status: open title: test_packaging failures under Solaris type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 14 17:04:04 2011 From: report at bugs.python.org (Reinhard Engel) Date: Tue, 14 Jun 2011 15:04:04 +0000 Subject: [New-bugs-announce] [issue12334] Strange sort error In-Reply-To: <1308063844.27.0.122131679299.issue12334@psf.upfronthosting.co.za> Message-ID: <1308063844.27.0.122131679299.issue12334@psf.upfronthosting.co.za> New submission from Reinhard Engel : # Strange sort error # lst1 and lst 2 produce different results, but should be same # lst1 should sort by length of items, but doesn't, lst2 does! lst0 = ['ab-get-ratings-max', 'ab-get-ratings-min', 'ab-rate-position', 'accum', 'add-cops', 'add-new-dice', 'add-passing-move', 'add-plants', 'add-two', 'add-widget'] print lst0 lst1 = sorted(lst0, lambda x, y: len(y) > len(x)) print lst1 lst2 = sorted(lst0, lambda x, y: len(y) - len(x)) print lst2 ---------- messages: 138322 nosy: rengel priority: normal severity: normal status: open title: Strange sort error type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 14 22:57:31 2011 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 14 Jun 2011 20:57:31 +0000 Subject: [New-bugs-announce] [issue12335] pysetup create will clobber an existing setup.cfg In-Reply-To: <1308085051.29.0.289061158176.issue12335@psf.upfronthosting.co.za> Message-ID: <1308085051.29.0.289061158176.issue12335@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : I have both a setup.py and a setup.cfg in my package. I wanted to use `pysetup create` to add the new packaging stanzas to my setup.cfg, but instead, pysetup clobbered everything. I think it should instead append (or prepend) the new stuff to the existing file. ---------- components: Library (Lib) messages: 138348 nosy: barry priority: normal severity: normal status: open title: pysetup create will clobber an existing setup.cfg versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 14 23:58:19 2011 From: report at bugs.python.org (STINNER Victor) Date: Tue, 14 Jun 2011 21:58:19 +0000 Subject: [New-bugs-announce] [issue12336] tkinter.test.test_ttk.test_widgets.test_select() failure on FreeBSD 6.4 3.x In-Reply-To: <1308088699.26.0.99920721974.issue12336@psf.upfronthosting.co.za> Message-ID: <1308088699.26.0.99920721974.issue12336@psf.upfronthosting.co.za> New submission from STINNER Victor : test test_ttk_guionly failed -- Traceback (most recent call last): File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/tkinter/test/test_ttk/test_widgets.py", line 674, in test_select self.assertTrue(success) AssertionError: [] is not true http://www.python.org/dev/buildbot/all/builders/x86%20FreeBSD%206.4%203.x/builds/1579/steps/test/logs/stdio This buildbot is very slow. See also #11925 and #10736. ---------- components: Tests, Tkinter keywords: buildbot messages: 138353 nosy: haypo priority: normal severity: normal status: open title: tkinter.test.test_ttk.test_widgets.test_select() failure on FreeBSD 6.4 3.x versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 15 06:59:53 2011 From: report at bugs.python.org (Fan Decheng) Date: Wed, 15 Jun 2011 04:59:53 +0000 Subject: [New-bugs-announce] [issue12337] Need real TextIOWrapper for stdin/stdout In-Reply-To: <1308113993.07.0.688068575261.issue12337@psf.upfronthosting.co.za> Message-ID: <1308113993.07.0.688068575261.issue12337@psf.upfronthosting.co.za> New submission from Fan Decheng : Since "-u" is made default and binary stdio implemented in 3.2, many of my scripts cannot run directly in Python 3.2, because they expect "\n" from stdin, but on Windows "\r\n" is got. Since that binary stdio being default is necessary for features like CGI, what I am expecting is to get a real TextIOWrapper for stdin, so that I can still use my old code. Besides, type(sys.stdio) should no longer say TextIOWrapper, because TextIOWrapper implies the conversion from "\r\n" to "\n". Steps to reproduce: In Python 3.2: >>> import sys >>> type(sys.stdin) >>> sys.stdin.readline() a 'a\r\n' >>> type(sys.stdout) Expected result: There should be some form of text support, such as textstream(sys.stdin).readline(). Also type(sys.stdin) should not say something like "TextIOWrapper". Same for sys.stdout. ---------- components: IO messages: 138356 nosy: r_mosaic priority: normal severity: normal status: open title: Need real TextIOWrapper for stdin/stdout type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 15 15:24:28 2011 From: report at bugs.python.org (sbt) Date: Wed, 15 Jun 2011 13:24:28 +0000 Subject: [New-bugs-announce] [issue12338] multiprocessing.util._eintr_retry doen't recalculate timeouts In-Reply-To: <1308144268.86.0.218604754177.issue12338@psf.upfronthosting.co.za> Message-ID: <1308144268.86.0.218604754177.issue12338@psf.upfronthosting.co.za> New submission from sbt : multiprocessing.util._eintr_retry is only used to wrap select.select, but it fails to recalculate timeouts. Also, it will never retry the function it wraps because of a missing "import errno". I think it would be better to just implement the retrying version of select directly. ---------- messages: 138364 nosy: sbt priority: normal severity: normal status: open title: multiprocessing.util._eintr_retry doen't recalculate timeouts _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 15 15:42:01 2011 From: report at bugs.python.org (Piotr Czachur) Date: Wed, 15 Jun 2011 13:42:01 +0000 Subject: [New-bugs-announce] [issue12339] logging.Formatter.format() assumes exception to support str() method which is not true for many libraries. In-Reply-To: <1308145321.11.0.0545021570949.issue12339@psf.upfronthosting.co.za> Message-ID: <1308145321.11.0.0545021570949.issue12339@psf.upfronthosting.co.za> New submission from Piotr Czachur : If I want my application to be bullet-proof against external libraries that can (and often do) raise Exception(u'nonascii'), I cannot use python's logger.exception() directly, as it will end up with UnicodeDecodeError. The reason is hidden in Formatter.format() which does: s = self._fmt % record.__dict__ One can use his own formatter that can handle UnicodeDecodeError, but many users are quite unaware of such issue and it would be great if Python can handle it by itself. Here is a simple case. >>> e = Exception(u'?') >>> logging.basicConfig() >>> logging.getLogger('general').exception(u'?') ? None >>> logging.getLogger('general').exception(e) Traceback (most recent call last): File "/usr/lib/python2.7/logging/__init__.py", line 842, in emit msg = self.format(record) File "/usr/lib/python2.7/logging/__init__.py", line 719, in format return fmt.format(record) File "/usr/lib/python2.7/logging/__init__.py", line 467, in format s = self._fmt % record.__dict__ UnicodeEncodeError: 'ascii' codec can't encode character u'\u0105' in position 0: ordinal not in range(128) Logged from file , line 1 >>> unicode(e) u'\u0105' >>> str(e) Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\u0105' in position 0: ordinal not in range(128) >>> ---------- components: Library (Lib) messages: 138369 nosy: Piotr.Czachur priority: normal severity: normal status: open title: logging.Formatter.format() assumes exception to support str() method which is not true for many libraries. type: feature request versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 15 17:41:55 2011 From: report at bugs.python.org (OscarL) Date: Wed, 15 Jun 2011 15:41:55 +0000 Subject: [New-bugs-announce] [issue12340] Access violation when using the C version of the io module In-Reply-To: <1308152515.03.0.630952257185.issue12340@psf.upfronthosting.co.za> Message-ID: <1308152515.03.0.630952257185.issue12340@psf.upfronthosting.co.za> New submission from OscarL : This is on Windows XP SP2. Using Python 2.7.1 and 2.7.2. While executing the unit tests of the PySerial package, version 2.5 (http://pypi.python.org/pypi/pyserial) one of the tests fails when using the C version of the io module ("io"), but pass if the pure Python version is used ("_pyio.py"). The specific test case in question is: test_iolib.py. When executed like: > python test_iolib.py loop:// the test fails with the following traceback: ---- Traceback (most recent call last): File "C:\pyserial-2.5\test\test_iolib.py", line 68, in test_hello_raw self.failUnlessEqual(hello, unicode("hello\n")) AssertionError: u'' != u'hello\n' ---- And Windows shows a crash report dialog, with the following information: ---- AppName: python.exe AppVer: 0.0.0.0 ModName: python27.dll ModVer: 2.7.2150.1013 Offset: 00089f57 Exception Information Code: 0xc0000005 Flags: 0x00000000 Record: 0x0000000000000000 Address: 0x000000001e089f57 ---- As said above, if in the said test case, instead of "import io" one does "import _pyio as io", the crash does not happens, and the test succeeds. ---------- components: IO messages: 138382 nosy: OscarL priority: normal severity: normal status: open title: Access violation when using the C version of the io module type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 15 18:42:17 2011 From: report at bugs.python.org (Sandro Tosi) Date: Wed, 15 Jun 2011 16:42:17 +0000 Subject: [New-bugs-announce] [issue12341] Some additions to .hgignore In-Reply-To: <1308156137.45.0.893152397766.issue12341@psf.upfronthosting.co.za> Message-ID: <1308156137.45.0.893152397766.issue12341@psf.upfronthosting.co.za> New submission from Sandro Tosi : following http://docs.python.org/devguide/coverage.html doc you'll end up with several "new" files/dirs in your checkout: - .coverage, used by coveragepy to save its info - coverage/ , the symlink to coveragepy/coverage - htmlcov/ , the dir where the coverage HTML pages are written I think they should be added to .hgignore so that hg st won't show them, and the attached patch just does it. It's meant for 'default' but should there be no problem to backport it to previous branches. ---------- assignee: sandro.tosi components: None files: hgignore_additions-default.patch keywords: patch messages: 138386 nosy: sandro.tosi priority: low severity: normal stage: patch review status: open title: Some additions to .hgignore type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file22371/hgignore_additions-default.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 15 23:00:00 2011 From: report at bugs.python.org (wujek) Date: Wed, 15 Jun 2011 21:00:00 +0000 Subject: [New-bugs-announce] [issue12342] characters with ord above 65535 fail conversion with str.format for '{:c}' in IDLE In-Reply-To: <1308171600.34.0.388895530939.issue12342@psf.upfronthosting.co.za> Message-ID: <1308171600.34.0.388895530939.issue12342@psf.upfronthosting.co.za> New submission from wujek : The following code produces an exception: print('{:c}'.format(65536)) when executed in Idle 3.2. The stack trace: >>> print('{:c}'.format(65536)) Traceback (most recent call last): File "", line 1, in print('{:c}'.format(65536)) File "/usr/lib/python3.2/idlelib/PyShell.py", line 1231, in write self.shell.write(s, self.tags) File "/usr/lib/python3.2/idlelib/PyShell.py", line 1213, in write OutputWindow.write(self, s, tags, "iomark") File "/usr/lib/python3.2/idlelib/OutputWindow.py", line 40, in write self.text.insert(mark, s, tags) File "/usr/lib/python3.2/idlelib/Percolator.py", line 25, in insert self.top.insert(index, chars, tags) File "/usr/lib/python3.2/idlelib/ColorDelegator.py", line 79, in insert self.delegate.insert(index, chars, tags) File "/usr/lib/python3.2/idlelib/PyShell.py", line 316, in insert UndoDelegator.insert(self, index, chars, tags) File "/usr/lib/python3.2/idlelib/UndoDelegator.py", line 81, in insert self.addcmd(InsertCommand(index, chars, tags)) File "/usr/lib/python3.2/idlelib/UndoDelegator.py", line 116, in addcmd cmd.do(self.delegate) File "/usr/lib/python3.2/idlelib/UndoDelegator.py", line 219, in do text.insert(self.index1, self.chars, self.tags) File "/usr/lib/python3.2/idlelib/ColorDelegator.py", line 79, in insert self.delegate.insert(index, chars, tags) File "/usr/lib/python3.2/idlelib/WidgetRedirector.py", line 104, in __call__ return self.tk_call(self.orig_and_operation + args) ValueError: unsupported character Seems to work fine in a terminal (Gnome-terminal in this case): >>> print('{:c}'.format(0x10000)) ? (my font doesn't have the glyph, but otherwise it works) Python version: >>> print(sys.version) 3.2 (r32:88445, Mar 25 2011, 19:56:22) [GCC 4.5.2] Os: wujek at home:~$ uname -a Linux studio 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux wujek at home:~$ cat /etc/issue Ubuntu 11.04 ---------- components: IDLE, IO messages: 138389 nosy: wujek.srujek priority: normal severity: normal status: open title: characters with ord above 65535 fail conversion with str.format for '{:c}' in IDLE type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 16 03:26:08 2011 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Thu, 16 Jun 2011 01:26:08 +0000 Subject: [New-bugs-announce] [issue12343] Python 2.7.2 regression: ssl.SSLError: [Errno 2] _ssl.c:503: The operation did not complete (read) In-Reply-To: <1308187568.46.0.159826705626.issue12343@psf.upfronthosting.co.za> Message-ID: <1308187568.46.0.159826705626.issue12343@psf.upfronthosting.co.za> New submission from Jes?s Cea Avi?n : Combining non-blocking SSL sockets and "select()" raises "ssl.SSLError: [Errno 2] _ssl.c:503: The operation did not complete (read)" in Python 2.7.2, but works OK in 2.7.1, 2.6.* and previous. This test shows the issue: """ import ssl import socket import select s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.connect(("gmail.com", 443)) s.setblocking(0) s = ssl.wrap_socket(s) s.write("GET / HTTP/1.0\r\nHost: gmail.com\r\n\r\n") select.select([s], [], []) s.read(9999999) print "OK!" """ Under python 2.6 and 2.7.1 I get "OK", but under 2.7.2 I get: """ Traceback (most recent call last): File "z.py", line 8, in s = ssl.wrap_socket(s) File "/usr/local/lib/python2.7/ssl.py", line 372, in wrap_socket ciphers=ciphers) File "/usr/local/lib/python2.7/ssl.py", line 134, in __init__ self.do_handshake() File "/usr/local/lib/python2.7/ssl.py", line 296, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [Errno 2] _ssl.c:503: The operation did not complete (read) """ Changing the order between the "s.setblocking()" and the "ssl.wrap_socket()" seems to solve the issue in this particular code sample, but this seems to be a serious regression in 2.7.2. I have programs in production here where changing the order doesn't solve the exception :-(. Dead in the water! :-( ---------- components: Extension Modules messages: 138408 nosy: jcea priority: critical severity: normal stage: needs patch status: open title: Python 2.7.2 regression: ssl.SSLError: [Errno 2] _ssl.c:503: The operation did not complete (read) type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 16 04:08:25 2011 From: report at bugs.python.org (higery) Date: Thu, 16 Jun 2011 02:08:25 +0000 Subject: [New-bugs-announce] [issue12344] A kind of 'reinitialize_command' function which can initialize a command with key-value pair should be added for Command class In-Reply-To: <1308190105.67.0.431736719114.issue12344@psf.upfronthosting.co.za> Message-ID: <1308190105.67.0.431736719114.issue12344@psf.upfronthosting.co.za> New submission from higery : There is a 'reinitialize_command' function in setuptools' command class which can initialize a command with a key-value pair, but it seems that distutils2/packaging does not yet have this function. I think it's useful in the condition that we want to run some commands with some options initialized. For instance, if we want to run 'build_ext' command with its 'inplace' option initialized, we can use : self.reinitialize_command('build_ext', inplace=1), and then self.run_command('build_ext') . ---------- assignee: tarek components: Distutils2 messages: 138409 nosy: alexis, eric.araujo, higery, tarek priority: normal severity: normal status: open title: A kind of 'reinitialize_command' function which can initialize a command with key-value pair should be added for Command class type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 16 05:10:30 2011 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 16 Jun 2011 03:10:30 +0000 Subject: [New-bugs-announce] [issue12345] Add math.tau In-Reply-To: <1308193830.26.0.803614362003.issue12345@psf.upfronthosting.co.za> Message-ID: <1308193830.26.0.803614362003.issue12345@psf.upfronthosting.co.za> New submission from Nick Coghlan : I'd like to add a new constant to the math module: tau = 2*math.pi Rather than repeating all the reasons for why tau makes more sense than pi as the fundamental circle constant, I'll just refer interested readers to http://tauday.com/ ---------- keywords: easy messages: 138412 nosy: ncoghlan priority: normal severity: normal stage: needs patch status: open title: Add math.tau type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 16 10:14:24 2011 From: report at bugs.python.org (Graeme Winter) Date: Thu, 16 Jun 2011 08:14:24 +0000 Subject: [New-bugs-announce] [issue12346] Python 2.7.2 source code build (release) depends on mercurial In-Reply-To: <1308212064.93.0.160132143903.issue12346@psf.upfronthosting.co.za> Message-ID: <1308212064.93.0.160132143903.issue12346@psf.upfronthosting.co.za> New submission from Graeme Winter : Trying to build 2.7.2 from source on RHEL5 32 bit get errors: gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE \ -DSVNVERSION="\"`LC_ALL=C svnversion .`\"" \ -DHGVERSION="\"`LC_ALL=C hg id -i .`\"" \ -DHGTAG="\"`LC_ALL=C hg id -t .`\"" \ -DHGBRANCH="\"`LC_ALL=C hg id -b .`\"" \ -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c hg identify: option -i not recognized hg identify: option -t not recognized hg identify: option -b not recognized ./Modules/getbuildinfo.c: In function ?Py_GetBuildInfo?: ./Modules/getbuildinfo.c:45: error: missing terminating " character ./Modules/getbuildinfo.c:45: error: expected expression before ?)? token ./Modules/getbuildinfo.c:46: error: missing terminating " character ./Modules/getbuildinfo.c:46: error: missing terminating " character ./Modules/getbuildinfo.c:47: error: missing terminating " character ./Modules/getbuildinfo.c:47: error: missing terminating " character ./Modules/getbuildinfo.c:53: error: ?buildinfo? undeclared (first use in this function) ./Modules/getbuildinfo.c:53: error: (Each undeclared identifier is reported only once ./Modules/getbuildinfo.c:53: error: for each function it appears in.) ./Modules/getbuildinfo.c: In function ?_Py_hgversion?: ./Modules/getbuildinfo.c:72: error: missing terminating " character ./Modules/getbuildinfo.c:72: warning: ?return? with no value, in function returning non-void ./Modules/getbuildinfo.c: In function ?_Py_hgidentifier?: ./Modules/getbuildinfo.c:79: error: missing terminating " character ./Modules/getbuildinfo.c:79: error: expected expression before ?;? token ./Modules/getbuildinfo.c:83: error: missing terminating " character ./Modules/getbuildinfo.c:83: error: expected expression before ?;? token make: *** [Modules/getbuildinfo.o] Error 1 gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE \ -DSVNVERSION="\"`LC_ALL=C svnversion .`\"" \ -DHGVERSION="\"`LC_ALL=C hg id -i .`\"" \ -DHGTAG="\"`LC_ALL=C hg id -t .`\"" \ -DHGBRANCH="\"`LC_ALL=C hg id -b .`\"" \ -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c hg identify: option -i not recognized hg identify: option -t not recognized hg identify: option -b not recognized ./Modules/getbuildinfo.c: In function ?Py_GetBuildInfo?: ./Modules/getbuildinfo.c:45: error: missing terminating " character ./Modules/getbuildinfo.c:45: error: expected expression before ?)? token ./Modules/getbuildinfo.c:46: error: missing terminating " character ./Modules/getbuildinfo.c:46: error: missing terminating " character ./Modules/getbuildinfo.c:47: error: missing terminating " character ./Modules/getbuildinfo.c:47: error: missing terminating " character ./Modules/getbuildinfo.c:53: error: ?buildinfo? undeclared (first use in this function) ./Modules/getbuildinfo.c:53: error: (Each undeclared identifier is reported only once ./Modules/getbuildinfo.c:53: error: for each function it appears in.) ./Modules/getbuildinfo.c: In function ?_Py_hgversion?: ./Modules/getbuildinfo.c:72: error: missing terminating " character ./Modules/getbuildinfo.c:72: warning: ?return? with no value, in function returning non-void ./Modules/getbuildinfo.c: In function ?_Py_hgidentifier?: ./Modules/getbuildinfo.c:79: error: missing terminating " character ./Modules/getbuildinfo.c:79: error: expected expression before ?;? token ./Modules/getbuildinfo.c:83: error: missing terminating " character ./Modules/getbuildinfo.c:83: error: expected expression before ?;? token make: *** [Modules/getbuildinfo.o] Error 1 Would assume it is bad form for a release source bundle to depend on mercurial? Diffs against version of getbuildinfo.c from 2.7.1 indicate that this is a new dependency: $ find . -name 'getbuildinfo.c' | xargs diff -u --- ./Python-2.7.2/Modules/getbuildinfo.c 2011-06-11 16:46:27.000000000 +0100 +++ ./Python-2.7.1/Modules/getbuildinfo.c 2010-05-09 15:46:46.000000000 +0100 @@ -28,30 +28,15 @@ #define SVNVERSION "$WCRANGE$$WCMODS?M:$" #endif -/* XXX Only unix build process has been tested */ -#ifndef HGVERSION -#define HGVERSION "" -#endif -#ifndef HGTAG -#define HGTAG "" -#endif -#ifndef HGBRANCH -#define HGBRANCH "" -#endif - const char * Py_GetBuildInfo(void) { - static char buildinfo[50 + sizeof(HGVERSION) + - ((sizeof(HGTAG) > sizeof(HGBRANCH)) ? - sizeof(HGTAG) : sizeof(HGBRANCH))]; - const char *revision = _Py_hgversion(); + static char buildinfo[50]; + const char *revision = Py_SubversionRevision(); const char *sep = *revision ? ":" : ""; - const char *hgid = _Py_hgidentifier(); - if (!(*hgid)) - hgid = "default"; + const char *branch = Py_SubversionShortBranch(); PyOS_snprintf(buildinfo, sizeof(buildinfo), - "%s%s%s, %.20s, %.9s", hgid, sep, revision, + "%s%s%s, %.20s, %.9s", branch, sep, revision, DATE, TIME); return buildinfo; } @@ -65,21 +50,3 @@ return svnversion; /* it was interpolated, or passed on command line */ return "Unversioned directory"; } - -const char * -_Py_hgversion(void) -{ - return HGVERSION; -} - -const char * -_Py_hgidentifier(void) -{ - const char *hgtag, *hgid; - hgtag = HGTAG; - if ((*hgtag) && strcmp(hgtag, "tip") != 0) - hgid = hgtag; - else - hgid = HGBRANCH; - return hgid; -} ---------- components: Build messages: 138417 nosy: Graeme.Winter priority: normal severity: normal status: open title: Python 2.7.2 source code build (release) depends on mercurial type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 16 16:22:14 2011 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Thu, 16 Jun 2011 14:22:14 +0000 Subject: [New-bugs-announce] [issue12347] add an "extras" in packaging.pypi.simple.Crawler In-Reply-To: <1308234134.22.0.149772690275.issue12347@psf.upfronthosting.co.za> Message-ID: <1308234134.22.0.149772690275.issue12347@psf.upfronthosting.co.za> New submission from Tarek Ziad? : It occurs to me that our Crawler don't allow us to specify extra locations, like easy_install or pypi We should add that and let the crawler look up to these places because the index ---------- messages: 138439 nosy: alexis, tarek priority: normal severity: normal status: open title: add an "extras" in packaging.pypi.simple.Crawler versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 16 17:21:07 2011 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Thu, 16 Jun 2011 15:21:07 +0000 Subject: [New-bugs-announce] [issue12348] case sensitivness in packaging.pypi.simple.Crawler In-Reply-To: <1308237667.78.0.20758863265.issue12348@psf.upfronthosting.co.za> Message-ID: <1308237667.78.0.20758863265.issue12348@psf.upfronthosting.co.za> New submission from Tarek Ziad? : the PyPI server deals with the package names case issue: if you get webob, it'll find WebOb. That's not true for mirrors, so we need to fallback to the global index when "webob" is not found under simple/webob/, and look for the name with a different case. ---------- messages: 138449 nosy: alexis, tarek priority: high severity: normal status: open title: case sensitivness in packaging.pypi.simple.Crawler type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 16 22:20:26 2011 From: report at bugs.python.org (Sandro Tosi) Date: Thu, 16 Jun 2011 20:20:26 +0000 Subject: [New-bugs-announce] [issue12349] Typo in 3.2 "What's New": WGSI / WSGI In-Reply-To: <1308255626.38.0.351857502668.issue12349@psf.upfronthosting.co.za> Message-ID: <1308255626.38.0.351857502668.issue12349@psf.upfronthosting.co.za> New submission from Sandro Tosi : Following up http://mail.python.org/pipermail/docs/2011-June/004729.html, here's a patch to correct the WGSI/WSGI typo in 3.2 "What's new" (to be applied in 3.2 and default). ---------- assignee: docs at python components: Documentation files: 3.2_whatsnew_WSGI-3.2.patch keywords: patch messages: 138465 nosy: docs at python, sandro.tosi priority: low severity: normal stage: patch review status: open title: Typo in 3.2 "What's New": WGSI / WSGI versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22381/3.2_whatsnew_WSGI-3.2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 16 22:28:47 2011 From: report at bugs.python.org (Lars Wirzenius) Date: Thu, 16 Jun 2011 20:28:47 +0000 Subject: [New-bugs-announce] [issue12350] Improve stat_result.st_blocks and st_blksize documentation In-Reply-To: <1308256127.22.0.581997138097.issue12350@psf.upfronthosting.co.za> Message-ID: <1308256127.22.0.581997138097.issue12350@psf.upfronthosting.co.za> New submission from Lars Wirzenius : Attached patch adds a few words to the os.stat documentation for the st_blocks and st_blksize fields to clarify them. ---------- assignee: docs at python components: Documentation files: stat_result.patch keywords: patch messages: 138467 nosy: docs at python, liw priority: normal severity: normal status: open title: Improve stat_result.st_blocks and st_blksize documentation versions: Python 2.7 Added file: http://bugs.python.org/file22382/stat_result.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 16 22:49:57 2011 From: report at bugs.python.org (Sandro Tosi) Date: Thu, 16 Jun 2011 20:49:57 +0000 Subject: [New-bugs-announce] [issue12351] Update URL for pycrypto project In-Reply-To: <1308257397.7.0.688141477172.issue12351@psf.upfronthosting.co.za> Message-ID: <1308257397.7.0.688141477172.issue12351@psf.upfronthosting.co.za> New submission from Sandro Tosi : Following up http://mail.python.org/pipermail/docs/2011-June/004728.html, here's a patch (appliable on 2.7, 3.1, 3.2 and default) to update the pycrypto URL to its new home. ---------- assignee: docs at python components: Documentation files: pycrypto_new_url-2.7.patch keywords: patch messages: 138470 nosy: docs at python, sandro.tosi priority: low severity: normal stage: patch review status: open title: Update URL for pycrypto project versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22383/pycrypto_new_url-2.7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 17 15:19:48 2011 From: report at bugs.python.org (greg.ath) Date: Fri, 17 Jun 2011 13:19:48 +0000 Subject: [New-bugs-announce] [issue12352] multiprocessing.Value() hangs In-Reply-To: <1308316788.45.0.312348703073.issue12352@psf.upfronthosting.co.za> Message-ID: <1308316788.45.0.312348703073.issue12352@psf.upfronthosting.co.za> New submission from greg.ath : Hi, My multithreaded application uses multithreading.Value() to ensure thread-safe operations on shared data. For unexpected reasons, after some change in my code, the function will consistently hang. I did a gdb backtrace of the hanging process, and I discovered that the multiprocessing.head.py tries to acquire twice a same non recursive lock. The first aquire is done in the "malloc" function: #61 call_function (f= Frame 0x13be190, for file /usr/lib/python2.6/multiprocessing/heap.py, line 173, in malloc (self=, _allocated_blocks=set([... The second aquire is done in the "free" function: #3 0x00000000004a7c5e in call_function (f= Frame 0x1662d50, for file /usr/lib/python2.6/multiprocessing/heap.py, line 155, in free (self=, _allocated_blocks=set([... I don't understand the link between these two method calls, so I am unable to write an easy script to reproduce the problem. I would say that some garbage collection was done within the malloc, which called the free. Python 2.6.5 Linux dev 2.6.32-25-server #45-Ubuntu SMP Sat Oct 16 20:06:58 UTC 2010 x86_64 GNU/Linux ---------- components: None files: gdb_stack.txt messages: 138506 nosy: greg.ath priority: normal severity: normal status: open title: multiprocessing.Value() hangs type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file22393/gdb_stack.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 17 17:40:06 2011 From: report at bugs.python.org (Bryan Jacobs) Date: Fri, 17 Jun 2011 15:40:06 +0000 Subject: [New-bugs-announce] [issue12353] argparse cannot handle empty arguments In-Reply-To: <1308325206.77.0.428682614263.issue12353@psf.upfronthosting.co.za> Message-ID: <1308325206.77.0.428682614263.issue12353@psf.upfronthosting.co.za> New submission from Bryan Jacobs : Parsing arguments with argparse fails with an IndexError when one of the arguments is the empty string (''). This is caused by an access to the zero'th element of the argument value, without a preceding length check. Fixed by the below patch: Index: Lib/argparse.py =================================================================== --- Lib/argparse.py +++ Lib/argparse.py @@ -1967,7 +1967,7 @@ class ArgumentParser(_AttributeHolder, _ for arg_string in arg_strings: # for regular arguments, just add them back into the list - if arg_string[0] not in self.fromfile_prefix_chars: + if len(arg_string) == 0 or arg_string[0] not in self.fromfile_prefix_chars: new_arg_strings.append(arg_string) # replace arguments referencing files with the file content ---------- components: Library (Lib) messages: 138515 nosy: bjacobs priority: normal severity: normal status: open title: argparse cannot handle empty arguments type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 17 20:16:14 2011 From: report at bugs.python.org (=?utf-8?q?Filip_Gruszczy=C5=84ski?=) Date: Fri, 17 Jun 2011 18:16:14 +0000 Subject: [New-bugs-announce] [issue12354] packaging.pypi.simple docs use both client and crawler variable, which might be confusing In-Reply-To: <1308334574.8.0.60329566716.issue12354@psf.upfronthosting.co.za> Message-ID: <1308334574.8.0.60329566716.issue12354@psf.upfronthosting.co.za> New submission from Filip Gruszczy?ski : In documentation for packaging.pypi.simple in first code snippet crawler variable is created on which further operations will be performed. However in all next snippets there is client variable, which is a little confusing on first sight. This could be consistent throughout the whole page. ---------- assignee: docs at python components: Distutils2, Documentation messages: 138538 nosy: alexis, docs at python, eric.araujo, gruszczy priority: normal severity: normal status: open title: packaging.pypi.simple docs use both client and crawler variable, which might be confusing versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 17 22:13:32 2011 From: report at bugs.python.org (=?utf-8?q?Filip_Gruszczy=C5=84ski?=) Date: Fri, 17 Jun 2011 20:13:32 +0000 Subject: [New-bugs-announce] [issue12355] Crawler doesn't follow redirection In-Reply-To: <1308341612.08.0.583643190206.issue12355@psf.upfronthosting.co.za> Message-ID: <1308341612.08.0.583643190206.issue12355@psf.upfronthosting.co.za> New submission from Filip Gruszczy?ski : When looking at issue #12348 I have noticed following behaviour: from packaging.pypi.simple import Crawler c = Crawler() c.get_releases('webob') Traceback (most recent call last): File "test_crawl.py", line 3, in c.get_releases('webob') File "/home/gruszczy/Projects/python/Lib/packaging/pypi/simple.py", line 192, in get_releases raise ProjectNotFound packaging.pypi.errors.ProjectNotFound This is because when request for /simple/webob/ is made 301 is returned to /simple/WebOb/ and HttpError raised, which is silenced and returned: except urllib.error.HTTPError as v: return v Wouldn't it be good to do something about? How about crawler following redirects? ---------- assignee: tarek components: Distutils2 messages: 138547 nosy: alexis, eric.araujo, gruszczy, tarek priority: normal severity: normal status: open title: Crawler doesn't follow redirection type: crash versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 18 02:45:31 2011 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 18 Jun 2011 00:45:31 +0000 Subject: [New-bugs-announce] [issue12356] more argument error improving In-Reply-To: <1308357931.79.0.860556100237.issue12356@psf.upfronthosting.co.za> Message-ID: <1308357931.79.0.860556100237.issue12356@psf.upfronthosting.co.za> New submission from Benjamin Peterson : After completing #12265, it was pointed out to me that the error message is still not perfect: >>> def f(a, b, c=3, d=4, e=6, f=3, g=32): pass ... >>> f(1, f=4, d=90) Traceback (most recent call last): File "", line 1, in TypeError: f() takes from 2 to 7 positional arguments but 3 were given Here is a new patch. Some samples: >>> def f(a): pass ... >>> f() Traceback (most recent call last): File "", line 1, in TypeError: f() missing 1 required positional argument: 'a' >>> def f(a, b): pass ... >>> f() Traceback (most recent call last): File "", line 1, in TypeError: f() missing 2 required positional arguments: 'a' and 'b' >>> def f(a, b, c): pass ... >>> f() Traceback (most recent call last): File "", line 1, in TypeError: f() missing 3 required positional arguments: 'a', 'b', and 'c >>> def f(a, b, c, d): pass >>> f() Traceback (most recent call last): File "", line 1, in TypeError: f() missing 4 required positional arguments: 'a', 'b', 'c', and 'd' Same with kwonly: >>> def f(*, w): pass ... >>> f() Traceback (most recent call last): File "", line 1, in TypeError: f() missing 1 required keyword-only argument: 'w' >>> def f(*, a, b, c, d, e): pass ... >>> f() Traceback (most recent call last): File "", line 1, in TypeError: f() missing 5 required keyword-only arguments: 'a', 'b', 'c', 'd', and 'e' For too many positional arguments, the old (new) error is retained: >>> def f(a): pass ... >>> f(1, 2, 3) Traceback (most recent call last): File "", line 1, in TypeError: f() takes 1 positional argument but 3 were given >>> f(3, 4, 5) Traceback (most recent call last): File "", line 1, in TypeError: f() takes from 1 to 2 positional arguments but 3 were given ---------- components: Interpreter Core files: argerror.patch keywords: patch messages: 138563 nosy: benjamin.peterson priority: normal severity: normal stage: patch review status: open title: more argument error improving type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file22399/argerror.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 18 11:25:35 2011 From: report at bugs.python.org (anatoly techtonik) Date: Sat, 18 Jun 2011 09:25:35 +0000 Subject: [New-bugs-announce] [issue12357] Python dist modifications for secure PyPI uploads In-Reply-To: <1308389135.03.0.407441500692.issue12357@psf.upfronthosting.co.za> Message-ID: <1308389135.03.0.407441500692.issue12357@psf.upfronthosting.co.za> New submission from anatoly techtonik : This is the master ticket to support secure uploads of Python packages to PyPI servers using standard Python distribution. Please, add issue12226 as a first child. ---------- assignee: tarek components: Distutils, Distutils2, Installation messages: 138576 nosy: alexis, eric.araujo, tarek, techtonik priority: normal severity: normal status: open title: Python dist modifications for secure PyPI uploads type: security versions: Python 2.6, Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 18 11:34:00 2011 From: report at bugs.python.org (anatoly techtonik) Date: Sat, 18 Jun 2011 09:34:00 +0000 Subject: [New-bugs-announce] [issue12358] validate server certificate when uploading packages to PyPI In-Reply-To: <1308389640.44.0.96724424469.issue12358@psf.upfronthosting.co.za> Message-ID: <1308389640.44.0.96724424469.issue12358@psf.upfronthosting.co.za> New submission from anatoly techtonik : Please add this as a child of master issue12357. When default protocol to upload to PyPI is switched to HTTPS in issue12226, the next step is to validate the certificate. Certificate validation requires that we will either: 1. distribute root CACert certificate with Python (for some reason it is not included/trusted on Windows platform) 2. acquire certificate for PyPI servers from party trusted by default, so that system certificates can be used for validation ---------- messages: 138578 nosy: techtonik priority: normal severity: normal status: open title: validate server certificate when uploading packages to PyPI type: security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 18 16:34:55 2011 From: report at bugs.python.org (anatoly techtonik) Date: Sat, 18 Jun 2011 14:34:55 +0000 Subject: [New-bugs-announce] [issue12359] tutorial: Module search path description is incorrect In-Reply-To: <1308407695.09.0.303681719961.issue12359@psf.upfronthosting.co.za> Message-ID: <1308407695.09.0.303681719961.issue12359@psf.upfronthosting.co.za> New submission from anatoly techtonik : http://docs.python.org/tutorial/modules.html#the-module-search-path Module search path order description is misleading. When a module named spam is imported, the interpreter searches for a file named spam.py in the directory of the script with import instruction, not in the current directory. ---------- assignee: docs at python components: Documentation messages: 138584 nosy: docs at python, techtonik priority: normal severity: normal status: open title: tutorial: Module search path description is incorrect versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 18 22:11:13 2011 From: report at bugs.python.org (Martin Marcher) Date: Sat, 18 Jun 2011 20:11:13 +0000 Subject: [New-bugs-announce] [issue12360] Doc Typo In-Reply-To: <1308427873.33.0.846212256461.issue12360@psf.upfronthosting.co.za> Message-ID: <1308427873.33.0.846212256461.issue12360@psf.upfronthosting.co.za> New submission from Martin Marcher : Slight typo in the docs. I don't quite know how to work with mercurial. Hope it'll just work to merge the bitbucket link. Typo is here: http://docs.python.org/py3k/library/asyncore.html#asyncore.dispatcher.handle_accepted (but also present in tip) The parameter is named *sock*, but the docs talk about *conn*. regards Martin hg diff -r 9569d8c4c781 diff -r 9569d8c4c781 Doc/library/asyncore.rst --- a/Doc/library/asyncore.rst Sat Jun 18 13:02:42 2011 -0400 +++ b/Doc/library/asyncore.rst Sat Jun 18 22:08:42 2011 +0200 @@ -157,7 +157,7 @@ Called on listening channels (passive openers) when a connection has been established with a new remote endpoint that has issued a :meth:`connect` - call for the local endpoint. *conn* is a *new* socket object usable to + call for the local endpoint. *sock* is a *new* socket object usable to send and receive data on the connection, and *address* is the address bound to the socket on the other end of the connection. ---------- assignee: docs at python components: Documentation hgrepos: 30 messages: 138594 nosy: docs at python, martin.marcher priority: normal severity: normal status: open title: Doc Typo versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 19 01:37:00 2011 From: report at bugs.python.org (Jacob Perkins) Date: Sat, 18 Jun 2011 23:37:00 +0000 Subject: [New-bugs-announce] [issue12361] Memory Leak in File Logging In-Reply-To: <1308440220.9.0.536544421463.issue12361@psf.upfronthosting.co.za> Message-ID: <1308440220.9.0.536544421463.issue12361@psf.upfronthosting.co.za> New submission from Jacob Perkins : I have a custom proxy server that was using a WatchedFileHandler for logging requests (the files were rotated with logrotate). It was leaking memory, and I had to use supervisord's memmon plugin to restart it whenever it exceed a certain threshold. I eventually tried disabling the WatchedFileHandler, and memory usage flattened out. I also have a StreamHandler logging the requests, so I have to conclude the leak is in WatchedFileHandler or FileHandler. This is with Python 2.6.6. ---------- components: Library (Lib) messages: 138620 nosy: japerk priority: normal severity: normal status: open title: Memory Leak in File Logging type: resource usage versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 19 13:54:29 2011 From: report at bugs.python.org (CrouZ) Date: Sun, 19 Jun 2011 11:54:29 +0000 Subject: [New-bugs-announce] [issue12362] General Windows stdout redirection not working In-Reply-To: <1308484469.07.0.183679087602.issue12362@psf.upfronthosting.co.za> Message-ID: <1308484469.07.0.183679087602.issue12362@psf.upfronthosting.co.za> New submission from CrouZ : Steps to repeat: * Create the script foo.py consisting of the line: print("foo") * Run: foo.py > bar Behavior: 2.7.2: The file bar is created but empty. Prints the following message on exit: close failed in file object destructor: sys.excepthook is missing lost sys.stderr 3.1.4: The file bar is created but empty. No printouts indicating that something went wrong. Expected behavior: All: The file bar has the content foo. Additional information: sys.stdout, and probably also sys.stderr, do not appear to be set up properly. 2.7.2: stdout is set to a file but performing any operations on it throws the exception: IOError: [Errno 9] Bad file descriptor 3.1.4: stdout is set to None Workaround: All: python foo.py > bar Used software: Windows 7 Ultimate SP1 x64 (6.1.7601) Python 2.7.2 and 3.1.4 installed with the msi-installer including Registering Extensions. ---------- components: Windows messages: 138626 nosy: CrouZ priority: normal severity: normal status: open title: General Windows stdout redirection not working type: crash versions: Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 19 19:21:45 2011 From: report at bugs.python.org (STINNER Victor) Date: Sun, 19 Jun 2011 17:21:45 +0000 Subject: [New-bugs-announce] [issue12363] test_signal.test_without_siginterrupt() sporadic failures on FreeBSD 6.4 In-Reply-To: <1308504105.8.0.100099791428.issue12363@psf.upfronthosting.co.za> Message-ID: <1308504105.8.0.100099791428.issue12363@psf.upfronthosting.co.za> New submission from STINNER Victor : ====================================================================== FAIL: test_siginterrupt_on (test.test_signal.SiginterruptTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_signal.py", line 396, in test_siginterrupt_on self.assertTrue(i) AssertionError: False is not true http://www.python.org/dev/buildbot/all/builders/x86%20FreeBSD%206.4%203.x/builds/1586/steps/test/logs/stdio http://www.python.org/dev/buildbot/all/builders/x86%20FreeBSD%206.4%203.x/builds/1587/steps/test/logs/stdio ---------- messages: 138647 nosy: haypo, neologix priority: normal severity: normal status: open title: test_signal.test_without_siginterrupt() sporadic failures on FreeBSD 6.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 19 19:25:15 2011 From: report at bugs.python.org (STINNER Victor) Date: Sun, 19 Jun 2011 17:25:15 +0000 Subject: [New-bugs-announce] [issue12364] Timeout (1 hour) in test_concurrent_futures.tearDown() on sparc solaris10 gcc 3.x In-Reply-To: <1308504315.81.0.454658658034.issue12364@psf.upfronthosting.co.za> Message-ID: <1308504315.81.0.454658658034.issue12364@psf.upfronthosting.co.za> New submission from STINNER Victor : [271/356/1] test_concurrent_futures Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/multiprocessing/queues.py", line 268, in _feed send(obj) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/multiprocessing/connection.py", line 229, in send self._send_bytes(memoryview(buf)) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/multiprocessing/connection.py", line 423, in _send_bytes self._send(struct.pack("=i", len(buf))) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/multiprocessing/connection.py", line 392, in _send n = write(self._handle, buf) OSError: [Errno 32] Broken pipe Timeout (1:00:00)! Thread 0x00000954: File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/threading.py", line 237 in wait File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/multiprocessing/queues.py", line 252 in _feed File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/threading.py", line 690 in run File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/threading.py", line 737 in _bootstrap_inner File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/threading.py", line 710 in _bootstrap Thread 0x00000953: File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/multiprocessing/forking.py", line 146 in poll File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/multiprocessing/forking.py", line 166 in wait File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/multiprocessing/process.py", line 150 in join File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/concurrent/futures/process.py", line 208 in shutdown_worker File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/concurrent/futures/process.py", line 264 in _queue_management_worker File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/threading.py", line 690 in run File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/threading.py", line 737 in _bootstrap_inner File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/threading.py", line 710 in _bootstrap Thread 0x00000001: File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/threading.py", line 237 in wait File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/threading.py", line 851 in join File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/concurrent/futures/process.py", line 395 in shutdown File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_concurrent_futures.py", line 67 in tearDown File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/unittest/case.py", line 407 in _executeTestPart File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/unittest/case.py", line 463 in run File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/unittest/case.py", line 514 in __call__ File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/unittest/suite.py", line 105 in run File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/unittest/suite.py", line 67 in __call__ File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/unittest/suite.py", line 105 in run File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/unittest/suite.py", line 67 in __call__ File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 1166 in run File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 1254 in _run_suite File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 1280 in run_unittest File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_concurrent_futures.py", line 628 in test_main File "./Lib/test/regrtest.py", line 1043 in runtest_inner File "./Lib/test/regrtest.py", line 841 in runtest File "./Lib/test/regrtest.py", line 668 in main File "./Lib/test/regrtest.py", line 1618 in *** Error code 1 make: Fatal error: Command failed for target `buildbottest' program finished with exit code 1 See commit e6e7e42efdc2 of the issue #12310. ---------- components: Tests messages: 138648 nosy: haypo, neologix, pitrou priority: normal severity: normal status: open title: Timeout (1 hour) in test_concurrent_futures.tearDown() on sparc solaris10 gcc 3.x versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 19 19:26:05 2011 From: report at bugs.python.org (Jeff McNeil) Date: Sun, 19 Jun 2011 17:26:05 +0000 Subject: [New-bugs-announce] [issue12365] URLopener should support context manager protocol In-Reply-To: <1308504365.98.0.668285563314.issue12365@psf.upfronthosting.co.za> Message-ID: <1308504365.98.0.668285563314.issue12365@psf.upfronthosting.co.za> New submission from Jeff McNeil : Per discussion within Issue10050, URLopener ought to support the context manager protocol. That allows more idiomatic usage and doesn't require calls to contextlib.closing for use with the 'with' statement. If agreed, I'll create a patch. ---------- components: Library (Lib) messages: 138649 nosy: mcjeff priority: normal severity: normal status: open title: URLopener should support context manager protocol versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 19 22:20:47 2011 From: report at bugs.python.org (Michael Mulich) Date: Sun, 19 Jun 2011 20:20:47 +0000 Subject: [New-bugs-announce] [issue12366] packaging.pypi.dist should abstract download errors. In-Reply-To: <1308514847.32.0.497265184581.issue12366@psf.upfronthosting.co.za> Message-ID: <1308514847.32.0.497265184581.issue12366@psf.upfronthosting.co.za> New submission from Michael Mulich : packaging.pypi.dist should abstract download errors, especially those from external sources. Download errors are currently reported from urllib. We should probably be using packaging.errors.PackagingPyPIError in this situation. Other suggestions? Example case: sake version 0.0.0 has a external download URL that throws a 404 (see also http://pypi.python.org/simple/sake/). When attempting to download this release, we receive a ValueError from urllib, which is not very detailed and could mean a number of things. Traceback (most recent call last): ... [dev project] ... File ".../cpython/Lib/packaging/pypi/dist.py", line 167, in download .download(path=temp_path) File ".../cpython/Lib/packaging/pypi/dist.py", line 302, in download path + "/" + archive_name) File ".../cpython/Lib/urllib/request.py", line 150, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File ".../cpython/Lib/urllib/request.py", line 1600, in retrieve block = fp.read(bs) ValueError: read of closed file ---------- assignee: tarek components: Distutils2 messages: 138658 nosy: alexis, eric.araujo, michael.mulich, tarek priority: normal severity: normal status: open title: packaging.pypi.dist should abstract download errors. type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 19 22:22:18 2011 From: report at bugs.python.org (STINNER Victor) Date: Sun, 19 Jun 2011 20:22:18 +0000 Subject: [New-bugs-announce] [issue12367] select.error has no errno attribute In-Reply-To: <1308514938.77.0.387292853061.issue12367@psf.upfronthosting.co.za> Message-ID: <1308514938.77.0.387292853061.issue12367@psf.upfronthosting.co.za> New submission from STINNER Victor : It would be nice to have a errno attribute for select.error. I don't know if select.errno should inherit from OSError, WindowsError or nothing. See also the PEP 3151: http://www.python.org/dev/peps/pep-3151/#common-errnos-with-select-error ---------- messages: 138659 nosy: haypo, pitrou priority: normal severity: normal status: open title: select.error has no errno attribute versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 19 23:08:19 2011 From: report at bugs.python.org (Michael Mulich) Date: Sun, 19 Jun 2011 21:08:19 +0000 Subject: [New-bugs-announce] [issue12368] packaging.pypi.simple.Crawler assumes external download links are ok to follow In-Reply-To: <1308517699.95.0.568809306044.issue12368@psf.upfronthosting.co.za> Message-ID: <1308517699.95.0.568809306044.issue12368@psf.upfronthosting.co.za> New submission from Michael Mulich : The packaging.pypi.simple.Crawler blindly follows external download URLs. The crawler should honor a list of allowed hosts (see also the hosts parameter) before attempting to download from an external source. ?ric Araujo has also pointed out that established tools like easy_install and pip provide ways of allowing/restricting by host. ---------- assignee: tarek components: Distutils2 messages: 138663 nosy: alexis, eric.araujo, michael.mulich, tarek priority: normal severity: normal status: open title: packaging.pypi.simple.Crawler assumes external download links are ok to follow type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 20 00:03:38 2011 From: report at bugs.python.org (Adam Woodbeck) Date: Sun, 19 Jun 2011 22:03:38 +0000 Subject: [New-bugs-announce] [issue12369] Revised core mentorship section of help.rst In-Reply-To: <1308521018.32.0.427730069007.issue12369@psf.upfronthosting.co.za> Message-ID: <1308521018.32.0.427730069007.issue12369@psf.upfronthosting.co.za> New submission from Adam Woodbeck : Here is the latest update to the devguide's help.rst for your consideration. It includes Nick's tweaks to what I originally submitted. ---------- components: Devguide files: help.rst.patch keywords: patch messages: 138668 nosy: adam.woodbeck, ncoghlan priority: normal severity: normal status: open title: Revised core mentorship section of help.rst versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file22410/help.rst.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 20 00:28:30 2011 From: report at bugs.python.org (Michael Foord) Date: Sun, 19 Jun 2011 22:28:30 +0000 Subject: [New-bugs-announce] [issue12370] Use of super overwrites use of __class__ in class namespace In-Reply-To: <1308522510.81.0.637011547356.issue12370@psf.upfronthosting.co.za> Message-ID: <1308522510.81.0.637011547356.issue12370@psf.upfronthosting.co.za> New submission from Michael Foord : In Python 3 the following code prints "False" because the use of super() has caused the __class__ descriptor to be omitted from the class namespace. Remove the use of super and it prints "True". class X(object): def __init__(self): super().__init__() @property def __class__(self): return int print (isinstance(X(), int)) ---------- messages: 138670 nosy: michael.foord priority: normal severity: normal status: open title: Use of super overwrites use of __class__ in class namespace type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 20 09:41:58 2011 From: report at bugs.python.org (olrait) Date: Mon, 20 Jun 2011 07:41:58 +0000 Subject: [New-bugs-announce] [issue12371] datetime.now() bug In-Reply-To: Message-ID: New submission from olrait : Hello Everybody. I write you because I found a bug in datetime.now(). (tested in Python 2.6.6 -r266:84297, Aug 24 2010, 18:46:32-win32) This bug is that sometime doesn??t return milliseconds. The code to reproduce the bug is: you have to wait a lot of time (from 20 minutes to 2 hours) from datetime import datetime while True: a=str(datetime.now()) try: b=a.split(".")[1] print b except: print "exception a=%s (if you see in this case there are not the milliseconds) " % (str(a)) break I new in this . Programing and python specially. Best Regards Martin Maqueira ---------- files: unnamed messages: 138689 nosy: olrait priority: normal severity: normal status: open title: datetime.now() bug Added file: http://bugs.python.org/file22412/unnamed _______________________________________ Python tracker _______________________________________ -------------- next part --------------

??

Hello Everybody.

??

I write you because I found a bug in datetime.now(). (tested in Python 2.6.6 -r266:84297, Aug 24 2010, 18:46:32-win32) This bug is that sometime doesn??t return milliseconds.

??

The code to reproduce the bug is: you have to wait a lot of time (from 20 minutes to 2 hours)

??

??

from datetime import datetime

while True:

?????????????????????? a=str(datetime.now())

?????????????????????? try:

?????????????????????????????????????????????? b=a.split(".")[1]

?????????????????????????????????????????????? print b

?????????????????????? except:

?????????????????????????????????????????????? print "exception a=%s (if you see in this case there are not the milliseconds) " % (str(a))

?????????????????????????????????????????????? break

??

??

I new in this . Programing and python specially.

??

Best Regards


Martin Maqueira

??

From report at bugs.python.org Mon Jun 20 10:56:08 2011 From: report at bugs.python.org (reshmi george) Date: Mon, 20 Jun 2011 08:56:08 +0000 Subject: [New-bugs-announce] [issue12372] semaphore errors on AIX 7.1 In-Reply-To: <1308560168.88.0.791994577012.issue12372@psf.upfronthosting.co.za> Message-ID: <1308560168.88.0.791994577012.issue12372@psf.upfronthosting.co.za> New submission from reshmi george : The same problem that was reported in issue 9700 is appearing on AIX 7.1. The following message has been seen when running multi-process python program: sem_trywait: Permission denied sem_post: Permission denied sem_wait: Permission denied sem_post: Permission denied It can be easily corrected by defining HAVE_BROKEN_POSIX_SEMAPHORES for AIX 7, like it is done for AIX 6. ---------- messages: 138693 nosy: reshmi.george priority: normal severity: normal status: open title: semaphore errors on AIX 7.1 versions: Python 2.6, Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 20 11:58:06 2011 From: report at bugs.python.org (Aleksey Zhurbitsky) Date: Mon, 20 Jun 2011 09:58:06 +0000 Subject: [New-bugs-announce] [issue12373] Duplicate packets in Multicast Receiver In-Reply-To: <1308563886.51.0.770044615776.issue12373@psf.upfronthosting.co.za> Message-ID: <1308563886.51.0.770044615776.issue12373@psf.upfronthosting.co.za> New submission from Aleksey Zhurbitsky : I use http://svn.python.org/projects/python/trunk/Demo/sockets/mcast.py to receive multicast stream. When i run one instance of this script to receive certain multicats stream all is fine, but when i run two instance of this script simultaneously to join different multicats stream whith same port - starts mess. Each script gets his packets and packets from other multicast group. Examples of multicast groups: rtp://224.1.1.1:1234 rtp://224.1.1.2:1234 I also try to use other code to recive multicast but got the same result - http://stackoverflow.com/questions/6387535/duplicate-packets-in-python-multicast-receiver ---------- components: Demos and Tools, Library (Lib) messages: 138696 nosy: Aleksey Zhurbitsky priority: normal severity: normal status: open title: Duplicate packets in Multicast Receiver type: behavior versions: Python 2.6, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 20 17:15:11 2011 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 20 Jun 2011 15:15:11 +0000 Subject: [New-bugs-announce] [issue12374] Execution model should explain compile vs definition vs execution time In-Reply-To: <1308582911.55.0.701954968644.issue12374@psf.upfronthosting.co.za> Message-ID: <1308582911.55.0.701954968644.issue12374@psf.upfronthosting.co.za> New submission from Nick Coghlan : The current execution model documentation in the Language Reference doesn't clearly explain the multiple phases of code execution: 1. Compilation time (statement by statement in the main module and at the interactive prompt, all at once for module import and the exec() and compile() builtins) 2. Definition time for function statements (i.e. when the function statement itself is executed) 3. Execution time for function and generator bodies (i.e. when a function is called and when next() is invoked on a generator) ---------- messages: 138728 nosy: ncoghlan priority: normal severity: normal status: open title: Execution model should explain compile vs definition vs execution time _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 20 18:23:35 2011 From: report at bugs.python.org (Erik Bray) Date: Mon, 20 Jun 2011 16:23:35 +0000 Subject: [New-bugs-announce] [issue12375] Add packages_root to sys.path for hooks In-Reply-To: <1308587015.96.0.883651483706.issue12375@psf.upfronthosting.co.za> Message-ID: <1308587015.96.0.883651483706.issue12375@psf.upfronthosting.co.za> New submission from Erik Bray : I just saw issue11637 [Add cwd to sys.path for hooks] and was reminded that this would also be useful (and in fact necessary if hook code is in a package that's under some root other than cwd). On a related matter, the current use of Distribution.package_dir is confusing. Sometimes it's assumed to be a string, though in other parts of the code it's assumed to be a dict to support multiple package dirs--something which I thought was going away. ---------- assignee: tarek components: Distutils2 messages: 138737 nosy: alexis, eric.araujo, erik.bray, tarek priority: normal severity: normal status: open title: Add packages_root to sys.path for hooks versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 20 19:39:14 2011 From: report at bugs.python.org (Ben Ranker) Date: Mon, 20 Jun 2011 17:39:14 +0000 Subject: [New-bugs-announce] [issue12376] unittest.TextTestResult.__init__ breaks under complex __mro__ In-Reply-To: <1308591554.84.0.206840920137.issue12376@psf.upfronthosting.co.za> Message-ID: <1308591554.84.0.206840920137.issue12376@psf.upfronthosting.co.za> New submission from Ben Ranker : TextTestResult.__init__(...) calls super(TextTestResult, self).__init__() with no args. If a custom TextTestResult descendant has a complex inheritance hierarchy that puts another class between TextTestResult and TestResult in the __mro__, then that class doesn't receive the common stream, descriptions, and verbosity args. If it needs them to function then the __init__ chain explodes. See attached breakunit.py for an example of this. ---------- components: Library (Lib) files: breakunit.py messages: 138744 nosy: branker priority: normal severity: normal status: open title: unittest.TextTestResult.__init__ breaks under complex __mro__ type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file22418/breakunit.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 20 21:20:43 2011 From: report at bugs.python.org (Erik Bray) Date: Mon, 20 Jun 2011 19:20:43 +0000 Subject: [New-bugs-announce] [issue12377] Clean up packages_root option In-Reply-To: <1308597643.18.0.622949056011.issue12377@psf.upfronthosting.co.za> Message-ID: <1308597643.18.0.622949056011.issue12377@psf.upfronthosting.co.za> New submission from Erik Bray : This issue was first mentioned in issue12375. The Distribution.package_dir attribute (which also appears in a few commands) is not used in a consistent manner. Some code expects it to be a string, while other code expects it to be a dict. I believe the correct behavior now is for it to be a string, since only one root directory for Python packages is allowed in packaging. Eric Araujo also points out that packages_root and the associated package_dir attribute are misnamed: They also point to the root for any Python modules. I'm not sure what a better name would be though--I'm tempted to suggest "source_dir", but that seems a little broad since it doesn't necessarily include C extension source. ---------- assignee: tarek components: Distutils2 messages: 138747 nosy: alexis, eric.araujo, erik.bray, tarek priority: normal severity: normal status: open title: Clean up packages_root option versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 20 21:44:24 2011 From: report at bugs.python.org (Joe Shaw) Date: Mon, 20 Jun 2011 19:44:24 +0000 Subject: [New-bugs-announce] [issue12378] smtplib.SMTP_SSL leaks socket connections on SSL error In-Reply-To: <1308599064.12.0.317669798103.issue12378@psf.upfronthosting.co.za> Message-ID: <1308599064.12.0.317669798103.issue12378@psf.upfronthosting.co.za> New submission from Joe Shaw : Start a non-SSL server on port 2525: $ python -m smtpd -n -c DebuggingServer localhost:2525 In another terminal, fire up a python interpreter and run the following code: >>> import smtplib >>> s = smtplib.SMTP_SSL("localhost", 2525) [...] ssl.SSLError: [Errno 1] _ssl.c:480: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol The underlying socket connection is still open, but you can't access it or close it: $ lsof -P -p 76318 | grep 2525 Python 76318 joeshaw 3u IPv4 0x09a9fb18 0t0 TCP localhost:64328->localhost:2525 (ESTABLISHED) This wreaks havoc if you're trying to write a unit test using the smtpd module and asyncore in a thread and try to clean up after yourself. The code inside SMTP_SSL looks something like this (on 2.6.5 anyway): def _get_socket(self, host, port, timeout): if self.debuglevel > 0: print>>stderr, 'connect:', (host, port) new_socket = socket.create_connection((host, port), timeout) new_socket = ssl.wrap_socket(new_socket, self.keyfile, self.certfile) self.file = SSLFakeFile(new_socket) return new_socket Something like: new_socket = socket.create_connection((host, port), timeout) try: new_socket = ssl.wrap_socket(new_socket, self.keyfile, self.certfile) except: new_socket.close() raise self.file = SSLFakeFile(new_socket) return new_socket I think will do the trick. ---------- components: Library (Lib) messages: 138753 nosy: joeshaw priority: normal severity: normal status: open title: smtplib.SMTP_SSL leaks socket connections on SSL error type: resource usage versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 20 22:00:53 2011 From: report at bugs.python.org (Roumen Petrov) Date: Mon, 20 Jun 2011 20:00:53 +0000 Subject: [New-bugs-announce] [issue12379] build outside source fail in head In-Reply-To: <1308600053.87.0.881101721168.issue12379@psf.upfronthosting.co.za> Message-ID: <1308600053.87.0.881101721168.issue12379@psf.upfronthosting.co.za> New submission from Roumen Petrov : correct is -I$(srcdir)/Include ---------- components: Build messages: 138755 nosy: rpetrov priority: normal severity: normal status: open title: build outside source fail in head versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 21 05:50:10 2011 From: report at bugs.python.org (py.user) Date: Tue, 21 Jun 2011 03:50:10 +0000 Subject: [New-bugs-announce] [issue12380] bytearray center, ljust, rjust don't accept a bytearray as the fill character In-Reply-To: <1308628210.93.0.613061897988.issue12380@psf.upfronthosting.co.za> Message-ID: <1308628210.93.0.613061897988.issue12380@psf.upfronthosting.co.za> New submission from py.user : >>> bytearray(b'abc').rjust(10, b'*') bytearray(b'*******abc') >>> bytearray(b'abc').rjust(10, bytearray(b'*')) Traceback (most recent call last): File "", line 1, in TypeError: must be a byte string of length 1, not bytearray >>> ---------- components: Interpreter Core messages: 138769 nosy: py.user priority: normal severity: normal status: open title: bytearray center, ljust, rjust don't accept a bytearray as the fill character type: behavior versions: Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 21 05:57:17 2011 From: report at bugs.python.org (py.user) Date: Tue, 21 Jun 2011 03:57:17 +0000 Subject: [New-bugs-announce] [issue12381] bytearray methods count, find, index don't support None as in slice notation In-Reply-To: <1308628637.29.0.156287318778.issue12381@psf.upfronthosting.co.za> Message-ID: <1308628637.29.0.156287318778.issue12381@psf.upfronthosting.co.za> New submission from py.user : >>> bytearray(b'abc').count(bytearray(b''), None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__ method >>> bytearray(b'abc').find(bytearray(b''), None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__ method >>> bytearray(b'abc').index(bytearray(b''), None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__ method and duplicate issues (endswith and startswith): >>> bytearray(b'abc').endswith(bytearray(b''), None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__ method >>> bytearray(b'abc').startswith(bytearray(b''), None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__ method >>> ---------- components: Interpreter Core messages: 138770 nosy: py.user priority: normal severity: normal status: open title: bytearray methods count, find, index don't support None as in slice notation type: behavior versions: Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 21 14:12:17 2011 From: report at bugs.python.org (Robin Jarry) Date: Tue, 21 Jun 2011 12:12:17 +0000 Subject: [New-bugs-announce] [issue12382] [msilib] Ambiguous exception message when trying to open a non existing MSI database In-Reply-To: <1308658337.05.0.630810191443.issue12382@psf.upfronthosting.co.za> Message-ID: <1308658337.05.0.630810191443.issue12382@psf.upfronthosting.co.za> New submission from Robin Jarry : When trying to open a non existing MSI database, an obscure "unknown error 6e" is raised. Could it be possible to get a more explicit message such as "File not found" or whatever ? Thanks :) Here is a example: -------------------------------- D:\>ll total 0 drwxr-xr-x 4 tcinteg Administ 0 Nov 30 2010 RECYCLER drwxr-xr-x 0 tcinteg Administ 0 Jul 6 2009 System Volume Information drwxr-xr-x 4 tcinteg Administ 0 Apr 29 16:03 TC drwxr-xr-x 3 tcinteg Administ 0 Apr 29 15:43 stgloc D:\>python Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import msilib >>> db = msilib.OpenDatabase("I_Do_Not_Exist.msi", msilib.MSIDBOPEN_READONLY) Traceback (most recent call last): File "", line 1, in _msi.MSIError: unknown error 6e >>> ---------- components: Library (Lib) messages: 138781 nosy: Robin.Jarry, loewis priority: normal severity: normal status: open title: [msilib] Ambiguous exception message when trying to open a non existing MSI database type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 21 16:36:02 2011 From: report at bugs.python.org (Thomas Wouters) Date: Tue, 21 Jun 2011 14:36:02 +0000 Subject: [New-bugs-announce] [issue12383] subprocess.Popen(..., env={}) fails to pass empty env. In-Reply-To: <1308666962.05.0.419958842608.issue12383@psf.upfronthosting.co.za> Message-ID: <1308666962.05.0.419958842608.issue12383@psf.upfronthosting.co.za> New submission from Thomas Wouters : The addition of the _posixsubprocess module in 3.2 introduced a change of behaviour when passing an empty dict (or other false value besides None) as env: python3.1 -c 'import subprocess; print(subprocess.Popen(["env"], env={}, stdout=subprocess.PIPE).communicate())' (b'', None) python3.2 -c 'import subprocess; print(subprocess.Popen(["env"], env={}, stdout=subprocess.PIPE).communicate())' (b'LC_MONETARY=C\nSHELL=/bin/bash\nTERM=scr....', None) The test for 'env' being the default (None) is not explicit enough. ---------- assignee: gregory.p.smith components: Library (Lib) files: subprocess.diff.txt keywords: needs review, patch messages: 138787 nosy: gregory.p.smith, twouters priority: high severity: normal stage: patch review status: open title: subprocess.Popen(..., env={}) fails to pass empty env. type: behavior versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22419/subprocess.diff.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 21 22:00:41 2011 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 21 Jun 2011 20:00:41 +0000 Subject: [New-bugs-announce] [issue12384] difflib.SequenceMatcher and Match: code and doc bugs In-Reply-To: <1308686441.84.0.396418173173.issue12384@psf.upfronthosting.co.za> Message-ID: <1308686441.84.0.396418173173.issue12384@psf.upfronthosting.co.za> New submission from Terry J. Reedy : The basic problem: in 2.6, a namedtuple was introduced to difflib from collections import namedtuple as _namedtuple Match = _namedtuple('Match', 'a b size') and used for the return values of SeqeunceMatcher.get_longest_match and .get_matching_blocks. Code, docstrings, and docs were only partially updated to match. Code: def get_matching_blocks(self): """Return list of triples describing matching subsequences. Each triple is of the form (i, j, n), and means that ...''' if self.matching_blocks is not None: return self.matching_blocks ... self.matching_blocks = non_adjacent return map(Match._make, self.matching_blocks) The two returns are different because only the second was changed. The obvious fix is to change the first to match. Or perhaps self.matching_blocks (an undocumented cache) should be the map object. Docstring and doc for .find_longest_match(): Both start "Find longest matching block ... returns (i, j, k) such that ... " Doc (bug not docstring) explicitly says at the *bottom* of the entry "This method returns a named tuple Match(a, b, size)." which is different from (i,j,n). For 2.7, the note is preceded by "Changed in version 2.6:" The examples show the change before it is described. I think that the current return should be accurately described at the *top* of the entry, not the bottom. 2.7 would then end with "Changed in version 2.6: return Match instead of tuple." Docstring and doc for .get_matching_blocks(): See code snippet above for beginning of text. Unlike .find_longest_match, there is no mention of the changed return. In 2.7, it is a list of Match triples. In 3.x, it is an iterable (Map) of Match triples, because of the change in map() return. For the latter reason, the example in the 3.x doc must be changed to >>> list(s.get_matching_blocks()) The docstring was already changed to pass doctest. The untested doc was not. I am not sure how to properly document the use of a namedtuple in the stdlib. Raymond, what do you think? ---------- assignee: rhettinger components: Documentation, Library (Lib) messages: 138799 nosy: rhettinger, terry.reedy priority: normal severity: normal status: open title: difflib.SequenceMatcher and Match: code and doc bugs type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 22 01:35:00 2011 From: report at bugs.python.org (py.user) Date: Tue, 21 Jun 2011 23:35:00 +0000 Subject: [New-bugs-announce] [issue12385] the help for bytearray.maketrans describes bytes.maketrans In-Reply-To: <1308699300.81.0.100519829981.issue12385@psf.upfronthosting.co.za> Message-ID: <1308699300.81.0.100519829981.issue12385@psf.upfronthosting.co.za> New submission from py.user : help(bytearray.maketrans) maketrans(...) B.maketrans(frm, to) -> translation table Return a translation table (a bytes object of length 256) suitable for use in bytes.translate where each byte in frm is mapped to the byte at the same position in to. The strings frm and to must be of the same length. ---------- assignee: docs at python components: Documentation messages: 138808 nosy: docs at python, py.user priority: normal severity: normal status: open title: the help for bytearray.maketrans describes bytes.maketrans versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 22 13:22:25 2011 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 22 Jun 2011 11:22:25 +0000 Subject: [New-bugs-announce] [issue12386] packaging fails in install_distinfo when writing RESOURCES In-Reply-To: <1308741745.2.0.628902356429.issue12386@psf.upfronthosting.co.za> Message-ID: <1308741745.2.0.628902356429.issue12386@psf.upfronthosting.co.za> New submission from Vinay Sajip : This part of install_distinf.run(): if install_data.get_resources_out() != []: resources_path = os.path.join(self.distinfo_dir, 'RESOURCES') logger.info('creating %s', resources_path) with open(resources_path, 'wb') as f: writer = csv.writer(f, delimiter=',', lineterminator='\n', quotechar='"') for tuple in install_data.get_resources_out(): writer.writerow(tuple) fails at the writerow line: creating /tmp/venv/lib/python3.3/site-packages/nemo-0.1.dist-info/METADATA creating /tmp/venv/lib/python3.3/site-packages/nemo-0.1.dist-info/INSTALLER creating /tmp/venv/lib/python3.3/site-packages/nemo-0.1.dist-info/REQUESTED creating /tmp/venv/lib/python3.3/site-packages/nemo-0.1.dist-info/RESOURCES Traceback (most recent call last): File "/tmp/venv/bin/pysetup3", line 5, in sys.exit(main()) File "/usr/local/lib/python3.3/packaging/run.py", line 678, in main return dispatcher() File "/usr/local/lib/python3.3/packaging/run.py", line 667, in __call__ return func(self, self.args) File "/usr/local/lib/python3.3/packaging/run.py", line 204, in wrapper return f(*args, **kwargs) File "/usr/local/lib/python3.3/packaging/run.py", line 247, in _install if install_local_project(target): File "/usr/local/lib/python3.3/packaging/install.py", line 125, in install_local_project return _run_install_from_dir(path) File "/usr/local/lib/python3.3/packaging/install.py", line 160, in _run_install_from_dir func(source_dir) File "/usr/local/lib/python3.3/packaging/install.py", line 90, in _run_packaging_install dist.run_command('install_dist') File "/usr/local/lib/python3.3/packaging/dist.py", line 761, in run_command cmd_obj.run() File "/usr/local/lib/python3.3/packaging/command/install_dist.py", line 526, in run self.run_command(cmd_name) File "/usr/local/lib/python3.3/packaging/command/cmd.py", line 329, in run_command self.distribution.run_command(command) File "/usr/local/lib/python3.3/packaging/dist.py", line 761, in run_command cmd_obj.run() File "/usr/local/lib/python3.3/packaging/command/install_distinfo.py", line 116, in run writer.writerow(tuple) TypeError: 'str' does not support the buffer interface I think the open(resources_path) should use 'w' rather than 'wb' as the open mode. Relevant part of setup.cfg: resources = virtualenvwrapper.sh = {scripts} I know I can put it in the scripts = section, but I'm testing having something in resources, which ought to work ... ---------- assignee: tarek components: Distutils2, Library (Lib) messages: 138821 nosy: alexis, eric.araujo, tarek, vinay.sajip priority: normal severity: normal status: open title: packaging fails in install_distinfo when writing RESOURCES versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 22 19:59:58 2011 From: report at bugs.python.org (Jacob VB) Date: Wed, 22 Jun 2011 17:59:58 +0000 Subject: [New-bugs-announce] [issue12387] IDLE save hotkey problem In-Reply-To: <1308765598.77.0.79184481064.issue12387@psf.upfronthosting.co.za> Message-ID: <1308765598.77.0.79184481064.issue12387@psf.upfronthosting.co.za> New submission from Jacob VB : IDLE (for Python 3.2) fails to save using the ctrl-s keyboard shortcut when caps-lock is enabled, and instead only saves when ctrl-shift-s is pressed. When caps-lock is disabled, all shortcuts work normally. ---------- components: IDLE messages: 138828 nosy: Jacob.VB priority: normal severity: normal status: open title: IDLE save hotkey problem type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 22 23:37:42 2011 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 22 Jun 2011 21:37:42 +0000 Subject: [New-bugs-announce] [issue12388] cannot specify recursive extra_files in packaging setup.cfg In-Reply-To: <1308778662.94.0.774064324312.issue12388@psf.upfronthosting.co.za> Message-ID: <1308778662.94.0.774064324312.issue12388@psf.upfronthosting.co.za> New submission from Vinay Sajip : When given a section like [files] extra_files = somedir/** only the first-level contents of somedir and included in the tarball created when you run "pysetup3 run sdist". Ideally, the entire tree below somedir should be included. A real example is referenced in https://gist.github.com/1041219 ---------- assignee: tarek components: Distutils2, Library (Lib) messages: 138836 nosy: alexis, eric.araujo, tarek, vinay.sajip priority: normal severity: normal status: open title: cannot specify recursive extra_files in packaging setup.cfg type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 23 01:07:36 2011 From: report at bugs.python.org (Vladimir Rutsky) Date: Wed, 22 Jun 2011 23:07:36 +0000 Subject: [New-bugs-announce] [issue12389] typo in urllib: missing space after dot at sentence end In-Reply-To: <1308784056.05.0.196763325672.issue12389@psf.upfronthosting.co.za> Message-ID: <1308784056.05.0.196763325672.issue12389@psf.upfronthosting.co.za> New submission from Vladimir Rutsky : There is a typo in urllib module documentation: missing space after dot at sentence end. Please see attached path for details. ---------- assignee: docs at python components: Documentation files: urllib-typo-space-after-dot.patch keywords: patch messages: 138838 nosy: docs at python, rutsky priority: normal severity: normal status: open title: typo in urllib: missing space after dot at sentence end versions: Python 2.7 Added file: http://bugs.python.org/file22425/urllib-typo-space-after-dot.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 23 05:02:45 2011 From: report at bugs.python.org (Joesph) Date: Thu, 23 Jun 2011 03:02:45 +0000 Subject: [New-bugs-announce] [issue12390] urllib.parse.urlencode encoding lists as strings In-Reply-To: <1308798165.99.0.217904560432.issue12390@psf.upfronthosting.co.za> Message-ID: <1308798165.99.0.217904560432.issue12390@psf.upfronthosting.co.za> New submission from Joesph : """ Per the documentation urlencode is supposed to encode a structure returned by parse_qs back to a query string. However, urlencode appears to not be processing the lists associated with each key. Example: """ import urllib.parse dictQuery = urllib.parse.parse_qs('a=b&b=c&c=d&c=e', strict_parsing=True, encoding='iso8859-1') assert isinstance(dictQuery,dict) assert isinstance(dictQuery['a'],list) strQuery = urllib.parse.urlencode(dictQuery, encoding='iso8859-1') print(strQuery) """ Outputs: a=%5B%27b%27%5D&c=%5B%27d%27%2C+%27e%27%5D&b=%5B%27c%27%5D Which means: a=['b']&c=['d', 'e']&b=['c'] Expected: a=b&c=d&c=e&b=c """ ---------- components: Library (Lib) messages: 138850 nosy: someone3x7 priority: normal severity: normal status: open title: urllib.parse.urlencode encoding lists as strings type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 23 09:43:36 2011 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 23 Jun 2011 07:43:36 +0000 Subject: [New-bugs-announce] [issue12391] packaging install fails to clean up temp files In-Reply-To: <1308815016.03.0.685993126745.issue12391@psf.upfronthosting.co.za> Message-ID: <1308815016.03.0.685993126745.issue12391@psf.upfronthosting.co.za> New submission from Vinay Sajip : There are a number of places in packaging.install where temporary directories are created, but never cleaned up: 1. In _move_files, if no destination path is passed in, one is created using mkdtemp(), but it's not clear where this would be deleted. Moreover, it's never called without a path and not part of the public API, so it would make sense to always expect a destination to be passed in (and update the docstring to match) 2. install_local_project, in the case of an archive, unpacks it into a mkdtemp()'d directory, but never deletes that directory later. 3. install_dists() also calls mkdtemp() if a path is not passed in, but it's not clear where this would be deleted. This should be changed to always require a path to be passed in. The install_from_infos accepts None as an install path and passes that to install_dists, but why are we being so generous? It's not asking a lot to be given an explicit path to install to. Note: the DistInfo class in packaging.pypi.dist also does this kind of thing (in the download and unpack methods) - it would seem sensible to make similar changes there. ---------- assignee: tarek components: Distutils2, Library (Lib) messages: 138860 nosy: alexis, eric.araujo, tarek, vinay.sajip priority: normal severity: normal status: open title: packaging install fails to clean up temp files type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 24 00:56:01 2011 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Jun 2011 22:56:01 +0000 Subject: [New-bugs-announce] [issue12392] pthread_kill() doesn't work on the main thread on FreeBSD6 In-Reply-To: <1308869761.72.0.972861691614.issue12392@psf.upfronthosting.co.za> Message-ID: <1308869761.72.0.972861691614.issue12392@psf.upfronthosting.co.za> New submission from STINNER Victor : pthread_kill() doesn't work on the main thread on FreeBSD6: sending a signal to the main thread does nothing. It works on the main thread just after the creation of the first thread. PyThread__init_thread() has 3 implementations in Python/thread_pthread.h: - call pthread_init() - create a dummy thread (no-op) and join it - do nothing pthread_init() doesn't exist on FreeBSD6. If the dummy thread implementation is used, pthread_kill() works directly on the main thread at startup. ---------- messages: 138875 nosy: haypo, neologix priority: normal severity: normal status: open title: pthread_kill() doesn't work on the main thread on FreeBSD6 versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 24 10:53:25 2011 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 24 Jun 2011 08:53:25 +0000 Subject: [New-bugs-announce] [issue12393] Packaging should provide support for extensible categories In-Reply-To: <1308905605.65.0.75321405353.issue12393@psf.upfronthosting.co.za> Message-ID: <1308905605.65.0.75321405353.issue12393@psf.upfronthosting.co.za> New submission from Vinay Sajip : Some installation locations are platform-dependent and cannot be categorised into a small but fixed number of categories. This is particularly true for the Windows ecosystem - PowerShell, Office, SharePoint all have specific locations where files need to be installed for interoperability with them. This can be catered for by a pre-hook for install_data, but some very small core changes are needed: 1. In the install_data constructor, initialise self.categories to an empty dictionary. 2. In install_data.expand_categories, add a "local_vars.update(self.categories)" after the "local_vars = get_paths()" statement. Just these small changes are sufficient to allow sufficient control over custom installation locations. For projects that need custom categories, they just need to do the necessary setup in an install_data pre-hook: def pre_install_data(cmd): cmd.categories['customcategory'] = '/path/for/my/custom/category' I have this working in the pythonv branch, and if the feature request is accepted I can work up a patch including changes to docs, tests etc. ---------- assignee: tarek components: Distutils2, Library (Lib) messages: 138895 nosy: alexis, eric.araujo, tarek, vinay.sajip priority: normal severity: normal status: open title: Packaging should provide support for extensible categories type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 24 11:14:24 2011 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 24 Jun 2011 09:14:24 +0000 Subject: [New-bugs-announce] [issue12394] Packaging should provide better support for executable scripts on Windows In-Reply-To: <1308906864.25.0.392964418022.issue12394@psf.upfronthosting.co.za> Message-ID: <1308906864.25.0.392964418022.issue12394@psf.upfronthosting.co.za> New submission from Vinay Sajip : At present, packaging support for scripts on Windows is the same as for any other system. This is sub-optimal, for the following reasons: 1. Windows doesn't support #! lines to find the correct executable for a script. On a system with multiple Python versions and scripts written for particular versions, support for locating the correct needs to be present. 2. Windows has two types of executables - console applications and GUI applications - and Windows users expect correct usage of either python.exe or pythonw.exe, depending on the individual script being run. Setuptools (and therefore Distribute) support these requirements by installing a script "demo", on Windows, as "demo.exe" and "demo-script.py" (or "demo-script.pyw"), where demo.exe is a stock Windows executable (either console or GUI) which invokes the appropriate Python executable on the "demo-script.py[w]" file. Packaging should provide a similar mechanism, which can be implemented very simply by changing the build_scripts command appropriately. It should work like this: 1. When writing a script, the developer simply provides a #!line as normal, but if intended for deployment on Windows, ensures the executable is named as "pythonw" rather than "python". The script should have no extension, as would be for case for a script Linux or OS X. 2. On Windows, the build-scripts command will build the script as it does now - substituting the correct executable for the #! line - but on Windows, instead of writing the script out as e.g. "demo", it will write it as either "demo-script.py" or "demo-script.pyw" (depending on whether the #! line had "pythonw" in it or not), and will also write a stock executable (either console or GUI, depending) with the corresponding name "demo.exe". 3. Since install_scripts just copies files from the build directory, there shouldn't need to be any changes here. The stock executables can be the same as Distribute uses (setuptools/cli.exe and setuptools/gui.exe), if there is no licensing (or other) issue with having them in Python. If there is such an issue, they can be written from scratch to do the same job (it's just one C file). I have this working in the pythonv branch, and if this feature request is accepted then I can work up a patch with test and doc changes. (The build_scripts changes are quite straightforward.) ---------- assignee: tarek components: Distutils2, Library (Lib) messages: 138896 nosy: alexis, eric.araujo, tarek, vinay.sajip priority: normal severity: normal status: open title: Packaging should provide better support for executable scripts on Windows type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 24 13:41:10 2011 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 24 Jun 2011 11:41:10 +0000 Subject: [New-bugs-announce] [issue12395] packaging remove fails under Windows In-Reply-To: <1308915670.23.0.449812169984.issue12395@psf.upfronthosting.co.za> Message-ID: <1308915670.23.0.449812169984.issue12395@psf.upfronthosting.co.za> New submission from Vinay Sajip : "pysetup3 remove projectX" fails on Windows. The reason is that the RECORD file can't be moved, as it's still open (we're using a generator in list_installed_files). Apart from fixing that, a related annoyance is that you get the [Error 32] The process cannot access the file because it is being used by another process but, of course, it doesn't tell you *which* file it failed on. So the error message needs to say which file(s) couldn't be moved. ---------- assignee: tarek components: Distutils2, Library (Lib) messages: 138917 nosy: alexis, eric.araujo, tarek, vinay.sajip priority: normal severity: normal status: open title: packaging remove fails under Windows type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 24 14:46:43 2011 From: report at bugs.python.org (Ned Batchelder) Date: Fri, 24 Jun 2011 12:46:43 +0000 Subject: [New-bugs-announce] [issue12397] re match object methods have no docstrings In-Reply-To: <1308919603.82.0.975273627438.issue12397@psf.upfronthosting.co.za> Message-ID: <1308919603.82.0.975273627438.issue12397@psf.upfronthosting.co.za> New submission from Ned Batchelder : If I have a match object in hand, and ask for help on its methods, there is no information: >>> m = re.match("a", "a") >>> help(m.group) Help on built-in function group: group(...) >>> ---------- messages: 138937 nosy: nedbat priority: normal severity: normal status: open title: re match object methods have no docstrings type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 24 17:39:53 2011 From: report at bugs.python.org (sorin) Date: Fri, 24 Jun 2011 15:39:53 +0000 Subject: [New-bugs-announce] [issue12398] Sending binary data with a POST request in httplib can cause Unicode exceptions In-Reply-To: <1308929993.57.0.810230060664.issue12398@psf.upfronthosting.co.za> Message-ID: <1308929993.57.0.810230060664.issue12398@psf.upfronthosting.co.za> New submission from sorin : It looks that Python 2.7 changes did induce some important bugs into httplib due to to implicit str-unicode encoding/decoding. One clear example is that PyAMF library doesn't work with Python 2.7 because it is not able to generate binary data POST responses. Please check http://dev.pyamf.org/ticket/823 (partial trackback, full in above bug) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 937, in endheaders self._send_output(message_body) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 795, in _send_output msg += message_body ---------- messages: 138953 nosy: sorin priority: normal severity: normal status: open title: Sending binary data with a POST request in httplib can cause Unicode exceptions type: crash versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 24 18:06:00 2011 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 24 Jun 2011 16:06:00 +0000 Subject: [New-bugs-announce] [issue12399] make cell var initialization more efficient In-Reply-To: <1308931560.13.0.00225198817974.issue12399@psf.upfronthosting.co.za> Message-ID: <1308931560.13.0.00225198817974.issue12399@psf.upfronthosting.co.za> New submission from Benjamin Peterson : Initializing cell variables currently involves 2 nested loops every function call. This patch makes that process much more efficient by saving information which doesn't change every function call to the code object. ---------- components: Interpreter Core files: bettercells.patch keywords: patch messages: 138956 nosy: benjamin.peterson, ncoghlan priority: normal severity: normal stage: patch review status: open title: make cell var initialization more efficient type: performance versions: Python 3.3 Added file: http://bugs.python.org/file22442/bettercells.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 24 22:45:59 2011 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Jun 2011 20:45:59 +0000 Subject: [New-bugs-announce] [issue12400] regrtest: always run tests in verbose mode, but hide the output on success In-Reply-To: <1308948359.28.0.0557364005771.issue12400@psf.upfronthosting.co.za> Message-ID: <1308948359.28.0.0557364005771.issue12400@psf.upfronthosting.co.za> New submission from STINNER Victor : Sporadic issues are difficult to analyze on the buildbots because sometimes a test fails, but when it runs again in verbose mode... it doesn't fail anymore. Typical example: =============================== [ 99/356/1] test_smtplib Re-running test test_smtplib in verbose mode (...) testTimeoutValue (test.test_smtplib.GeneralTests) ... ok testBasic (test.test_smtplib.DebuggingServerTests) ... test test_smtplib failed -- multiple errors occurred; run in verbose mode for details ok testHELP (test.test_smtplib.DebuggingServerTests) ... ok testNOOP (test.test_smtplib.DebuggingServerTests) ... ok testNotImplemented (test.test_smtplib.DebuggingServerTests) ... ok (...) ---------------------------------------------------------------------- Ran 32 tests in 23.664s OK =============================== I propose to always run the tests in verbose mode, write the output into a buffer, but only display the output on failure (or ignore the output on success). Attached patch simplifies regrtest.py usage: replace 4 verbose levels (no verbose option, -v, -w, -W) by only 2 (no verbose option, -v). Always display the full output in case of an error (as we used -w before): no more "multiple error occured" without output trap, no more "oh, rerunning the test doesn't fail" trap. The -v option works as before (directly write the output in verbose mode). regrtest is much more verbose than before in case of a failure, but I prefer too much information than no information when I try to debug something. If it is too much verbose by default, I can try to use 3 verbose levels (e.g. don't display the full output if only one test failed). If the patch is accepted, the devguide should also be patched. ---------- components: Tests files: regrtest_verbose.patch keywords: patch messages: 138981 nosy: ezio.melotti, georg.brandl, haypo, pitrou, r.david.murray priority: normal severity: normal status: open title: regrtest: always run tests in verbose mode, but hide the output on success versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22446/regrtest_verbose.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 24 23:57:56 2011 From: report at bugs.python.org (Henry Precheur) Date: Fri, 24 Jun 2011 21:57:56 +0000 Subject: [New-bugs-announce] [issue12401] unset PYTHON* environment variables when running tests In-Reply-To: <1308952676.91.0.708236346954.issue12401@psf.upfronthosting.co.za> Message-ID: <1308952676.91.0.708236346954.issue12401@psf.upfronthosting.co.za> New submission from Henry Precheur : "make test" calls Python with the -E option which ignore the PYTHON* environment variables, but Python sub-processes aren't necessarily called with the -E options. For example test_displayhook_unencodable in test_cmd_line. This created problems with my own PYTHONSTARTUP script. I see 2 solutions to this problems: 1. Fix the tests that might be affected by such problems, by adding the -E option everywhere needed. 2. Fix the Makefile and unset all the PYTHON* environment variables in it. I think that solution #2 is better. Fixing the tests can be done today, but the authors of future tests might not be aware of this issue. By fixing the Makefile we prevent this problem to occur again in the future. ---------- components: Tests messages: 138993 nosy: henry.precheur priority: normal severity: normal status: open title: unset PYTHON* environment variables when running tests type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 25 00:45:07 2011 From: report at bugs.python.org (Miki Tebeka) Date: Fri, 24 Jun 2011 22:45:07 +0000 Subject: [New-bugs-announce] [issue12402] Overriding code.InteractiveConsole.write does not work In-Reply-To: <1308955507.7.0.876307843842.issue12402@psf.upfronthosting.co.za> Message-ID: <1308955507.7.0.876307843842.issue12402@psf.upfronthosting.co.za> New submission from Miki Tebeka : Consider the following code: import code class Console(code.InteractiveConsole): def write(self, data): print("DATA: {0}".format(data)) c = Console() c.interact() Then enter "1" at the prompt. The output will be 1 (and not DATA: 1). If you create an error (such as 1/0), then the error lines will be prefixed by DATA. ---------- components: Library (Lib) messages: 138998 nosy: tebeka priority: normal severity: normal status: open title: Overriding code.InteractiveConsole.write does not work type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 25 01:55:44 2011 From: report at bugs.python.org (Miki Tebeka) Date: Fri, 24 Jun 2011 23:55:44 +0000 Subject: [New-bugs-announce] [issue12403] Allow overriding of writing to stdout in code.InteractiveConsole In-Reply-To: <1308959744.93.0.261089879651.issue12403@psf.upfronthosting.co.za> Message-ID: <1308959744.93.0.261089879651.issue12403@psf.upfronthosting.co.za> New submission from Miki Tebeka : Currently, code.InteractiveConsole lets your override "write" which is the error stream. Allow overriding of "normal" (stdout) writing as well. This will enable to spawn interpreters into custom stdin/stdout. See twisted.manhole for example, very useful. ---------- messages: 139004 nosy: tebeka priority: normal severity: normal status: open title: Allow overriding of writing to stdout in code.InteractiveConsole type: feature request versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 25 09:02:57 2011 From: report at bugs.python.org (Akira Kitada) Date: Sat, 25 Jun 2011 07:02:57 +0000 Subject: [New-bugs-announce] [issue12404] c99 code in mmapmodule In-Reply-To: <1308985377.16.0.872851940652.issue12404@psf.upfronthosting.co.za> Message-ID: <1308985377.16.0.872851940652.issue12404@psf.upfronthosting.co.za> New submission from Akira Kitada : Modules/mmapmodule.c contains code that makes it incompatible with C89 compiler. People using recent gcc can check this by running following commands. $ ./configure CFLAGS='-Wdeclaration-after-statement' && make Attached patch fixes the issue. (verified on Linux 2.6.39-2-amd64 with gcc 4.6.1) ---------- components: Build files: c89compat_mmap.patch keywords: patch messages: 139020 nosy: akitada priority: normal severity: normal status: open title: c99 code in mmapmodule type: compile error versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file22453/c89compat_mmap.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 25 11:48:25 2011 From: report at bugs.python.org (Vinay Sajip) Date: Sat, 25 Jun 2011 09:48:25 +0000 Subject: [New-bugs-announce] [issue12405] packaging does not record/remove directories it creates In-Reply-To: <1308995305.23.0.132392157923.issue12405@psf.upfronthosting.co.za> Message-ID: <1308995305.23.0.132392157923.issue12405@psf.upfronthosting.co.za> New submission from Vinay Sajip : pysetup3 install should not only record files that it installs, but also any directories it creates. pysetup3 remove should then delete those directories (if empty after removing their installed contents). ---------- assignee: tarek components: Distutils2, Library (Lib) messages: 139035 nosy: alexis, eric.araujo, tarek, vinay.sajip priority: normal severity: normal status: open title: packaging does not record/remove directories it creates type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 25 11:59:10 2011 From: report at bugs.python.org (Vinay Sajip) Date: Sat, 25 Jun 2011 09:59:10 +0000 Subject: [New-bugs-announce] [issue12406] msi.py needs updating for Python 3.3 In-Reply-To: <1308995950.75.0.288905614048.issue12406@psf.upfronthosting.co.za> Message-ID: <1308995950.75.0.288905614048.issue12406@psf.upfronthosting.co.za> New submission from Vinay Sajip : I know it's early days yet, but I've tried to create an MSI for Python 3.3. I was able to do so, but I had to make some changes to msi.py (patch attached). ---------- components: Build, Demos and Tools, Windows files: msi.py.diff keywords: patch messages: 139036 nosy: loewis, vinay.sajip priority: normal severity: normal status: open title: msi.py needs updating for Python 3.3 type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file22455/msi.py.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 25 13:02:08 2011 From: report at bugs.python.org (Cesare Di Mauro) Date: Sat, 25 Jun 2011 11:02:08 +0000 Subject: [New-bugs-announce] [issue12407] test_subinterps fails on Windows In-Reply-To: <1308999728.78.0.684048233766.issue12407@psf.upfronthosting.co.za> Message-ID: <1308999728.78.0.684048233766.issue12407@psf.upfronthosting.co.za> New submission from Cesare Di Mauro : This test fails on Windows because it tries to change the working folder to an empty string. Anyway, even changing: os.chdir(basepath) with: os.chdir(basepath or '.') it fails because the subprocess tries to execute an ELF file ('Modules/_testembed') which Windows isn't able to handle. ---------- components: Tests, Windows files: test_capi.py.patch keywords: patch messages: 139044 nosy: brian.curtin, cdimauro, pitrou priority: normal severity: normal status: open title: test_subinterps fails on Windows type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file22456/test_capi.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 25 13:23:47 2011 From: report at bugs.python.org (Cesare Di Mauro) Date: Sat, 25 Jun 2011 11:23:47 +0000 Subject: [New-bugs-announce] [issue12408] Relative import used on test_future5 In-Reply-To: <1309001027.05.0.416660264126.issue12408@psf.upfronthosting.co.za> Message-ID: <1309001027.05.0.416660264126.issue12408@psf.upfronthosting.co.za> New submission from Cesare Di Mauro : Executing test_future5 fails: D:\CPython>PCbuild\python_d.exe Lib\test\test_future5.py Traceback (most recent call last): File "Lib\test\test_future5.py", line 6, in from . import support ValueError: Attempted relative import in non-package [51279 refs] Tested on Windows 7. ---------- components: Tests files: test_future5.py.patch keywords: patch messages: 139046 nosy: cdimauro priority: normal severity: normal status: open title: Relative import used on test_future5 type: behavior versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22457/test_future5.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 25 15:36:08 2011 From: report at bugs.python.org (Sandro Tosi) Date: Sat, 25 Jun 2011 13:36:08 +0000 Subject: [New-bugs-announce] [issue12409] Moving "Documenting Python" to Devguide In-Reply-To: <1309008968.0.0.644952507743.issue12409@psf.upfronthosting.co.za> Message-ID: <1309008968.0.0.644952507743.issue12409@psf.upfronthosting.co.za> New submission from Sandro Tosi : Hi! We have the devguide now, and it should be the place where to look for references and docs about contributing to Python, that means also for the documentation. In the official Python doc we have a section "Documenting Python" (http://docs.python.org/py3k/documenting/index.html) and I think it should be merged into the devguide - what's your opinion on that? ---------- assignee: docs at python components: Documentation messages: 139062 nosy: brett.cannon, docs at python, ezio.melotti, georg.brandl, sandro.tosi priority: normal severity: normal status: open title: Moving "Documenting Python" to Devguide _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 25 16:49:35 2011 From: report at bugs.python.org (mouad) Date: Sat, 25 Jun 2011 14:49:35 +0000 Subject: [New-bugs-announce] [issue12410] Create a new helper function that enable to test that an operation don't hang more than a given timeout. In-Reply-To: <1309013375.96.0.63412212065.issue12410@psf.upfronthosting.co.za> Message-ID: <1309013375.96.0.63412212065.issue12410@psf.upfronthosting.co.za> New submission from mouad : While working on issue #12157 [http://bugs.python.org/issue12157], I needed a function that make sure that an operation will not hang forever, for this reason i have create this helper function that support the context manager protocol and accept a timeout as an argument and raise an IOError if the operation didn't terminate before that timeout. ---------- components: Tests files: operation_timeout.patch keywords: patch messages: 139075 nosy: mouad priority: normal severity: normal status: open title: Create a new helper function that enable to test that an operation don't hang more than a given timeout. type: feature request versions: Python 3.2 Added file: http://bugs.python.org/file22467/operation_timeout.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 25 17:09:08 2011 From: report at bugs.python.org (Jonas Wagner) Date: Sat, 25 Jun 2011 15:09:08 +0000 Subject: [New-bugs-announce] [issue12411] cgi.parse_multipart is broken on 3.x In-Reply-To: <1309014548.2.0.906650270303.issue12411@psf.upfronthosting.co.za> Message-ID: <1309014548.2.0.906650270303.issue12411@psf.upfronthosting.co.za> New submission from Jonas Wagner : While writing tests for the cgi module I came across what looks like a conversion bug. cgi.parse_multipart is comparing values it reads from a binary file like with a string literal: line = fp.readline() ... if line.startswith("--"): This patch adds fixes the issue and adds test for it. ---------- components: Library (Lib) files: cgi-coverage.diff keywords: patch messages: 139082 nosy: jonas.wagner priority: normal severity: normal status: open title: cgi.parse_multipart is broken on 3.x type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file22470/cgi-coverage.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 25 17:54:50 2011 From: report at bugs.python.org (Francisco Garcia) Date: Sat, 25 Jun 2011 15:54:50 +0000 Subject: [New-bugs-announce] [issue12412] non defined representation for pwd.struct_passwd In-Reply-To: <1309017290.05.0.556727126165.issue12412@psf.upfronthosting.co.za> Message-ID: <1309017290.05.0.556727126165.issue12412@psf.upfronthosting.co.za> New submission from Francisco Garcia : pwd.struct_passwd has different representations in cpython 2.7.2 and pypy 1.5 A unit test from cpython might enforce the same representation across interpreters: >>> print pwd.getpwuid(os.getuid()) Current cpython output: pwd.struct_passwd(pw_name='demo_user', pw_passwd='********', pw_uid=1001, pw_gid=100, pw_gecos='demo_user', pw_dir='/Users/demo_user', pw_shell='/bin/bash') Current pypy output ('demo_user', '********', 1001, 100, 'demo_user', '/Users/demo_user', '/bin/bash') ---------- messages: 139090 nosy: fgarciar priority: normal severity: normal status: open title: non defined representation for pwd.struct_passwd type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 26 01:53:31 2011 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sat, 25 Jun 2011 23:53:31 +0000 Subject: [New-bugs-announce] [issue12413] make faulthandler dump traceback of child processes In-Reply-To: <1309046011.52.0.650507172396.issue12413@psf.upfronthosting.co.za> Message-ID: <1309046011.52.0.650507172396.issue12413@psf.upfronthosting.co.za> New submission from Charles-Fran?ois Natali : As noted in issue #11870, making faulthandler capable of dumping child processes' tracebacks could be a great aid in debugging tricky deadlocks involving for example multiprocessing and subprocess. Since there's no portable way to find out child processes, a possible idea would be to make the handler send a signal to its process group if the current process is the process group leader. Advantages: - simple - async-safe Drawbacks: - since all the processes receive the signal at the same time, their outputs will be interleaved (we could maybe add a random sleep before dumping the traceback?) - children not part of the same process group (for example those who called setsid() or setpgrp()) won't be handled I'm not sure how this would work out on Windows, but I don't event know if Windows has a notion of child processes or process groups... ---------- components: Library (Lib) messages: 139132 nosy: haypo, neologix priority: normal severity: normal stage: needs patch status: open title: make faulthandler dump traceback of child processes type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 26 05:53:21 2011 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 26 Jun 2011 03:53:21 +0000 Subject: [New-bugs-announce] [issue12414] getsizeof() on code objects is wrong In-Reply-To: <1309060401.87.0.459388249467.issue12414@psf.upfronthosting.co.za> Message-ID: <1309060401.87.0.459388249467.issue12414@psf.upfronthosting.co.za> New submission from Benjamin Peterson : sys.getsizeof() on a code object returns on the size of the code struct, not the arrays and tuples which it references. ---------- components: Interpreter Core messages: 139142 nosy: benjamin.peterson priority: normal severity: normal status: open title: getsizeof() on code objects is wrong type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 26 08:29:38 2011 From: report at bugs.python.org (Philip Olson) Date: Sun, 26 Jun 2011 06:29:38 +0000 Subject: [New-bugs-announce] [issue12415] Missing: How to checkout the Doc sources In-Reply-To: <1309069778.19.0.06342861361.issue12415@psf.upfronthosting.co.za> Message-ID: <1309069778.19.0.06342861361.issue12415@psf.upfronthosting.co.za> New submission from Philip Olson : I was unable to determine how to download the Python documentation source files (for building via Sphinx) but did figure out the following: hg clone http://hg.python.org/cpython cd cpython/Doc make html Where to get the Doc sources deserves a mention here: http://docs.python.org/dev/documenting/building.html I don't know this topic so won't propose a patch, but building.txt should mention where/how to get 'Doc' before the 'cd Doc' example. ---------- assignee: docs at python components: Documentation messages: 139147 nosy: docs at python, philip priority: normal severity: normal status: open title: Missing: How to checkout the Doc sources _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 27 01:50:47 2011 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 26 Jun 2011 23:50:47 +0000 Subject: [New-bugs-announce] [issue12416] packaging does not have hooks callable during distribution removal In-Reply-To: <1309132247.11.0.698244418605.issue12416@psf.upfronthosting.co.za> Message-ID: <1309132247.11.0.698244418605.issue12416@psf.upfronthosting.co.za> New submission from Vinay Sajip : In general it is possible for an installation to make certain system changes other than the record of files written during an installation (for example, under Windows, there may be distribution-specific Windows registry updates). There seems to be no hook that's called when a distribution is removed, which would allow distribution-specific cleanup code to be called (e.g. to undo Windows registry changes). Such a hook should be provided. ---------- assignee: tarek components: Distutils2, Library (Lib) messages: 139230 nosy: alexis, eric.araujo, tarek, vinay.sajip priority: normal severity: normal status: open title: packaging does not have hooks callable during distribution removal type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 27 09:31:42 2011 From: report at bugs.python.org (Paul Hildebrandt) Date: Mon, 27 Jun 2011 07:31:42 +0000 Subject: [New-bugs-announce] [issue12417] Inappropriate copyright on profile files In-Reply-To: <1309159902.95.0.523889608619.issue12417@psf.upfronthosting.co.za> Message-ID: <1309159902.95.0.523889608619.issue12417@psf.upfronthosting.co.za> New submission from Paul Hildebrandt : profile.py and pstats.py have an inappropriate copyright for some. These files were contributed by a company that was acquired by Disney. I have a patch that has passed Disney legal to resolve the problem. The following is the cogent part of a conversation between Matthias Klose and myself. He is including information about the issue: http://mail.python.org/pipermail/python-dev/2005-February/051450.html """ The current license for the Python profiler is not conforming to the DFSG (Debian free software guidelines). http://www.python.org/doc/current/lib/node829.html states "This permission is explicitly restricted to the copying and modification of the software to remain in Python, compiled Python, or other languages (such as C) wherein the modified or derived code is exclusively imported into a Python module." The DFSG, http://www.debian.org/doc/debian-policy/ch-archive.html#s-dfsg, third paragraph state: "Derived Works The license must allow modifications and derived works, and must allow them to be distributed under the same terms as the license of the original software." - Does somebody knows about the history of this license, why it is more restricted than the Python license? - Is there a chance to change the license for these two modules (profile.py, pstats.py)? """ ---------- components: Library (Lib) messages: 139240 nosy: Paul.Hildebrandt priority: normal severity: normal status: open title: Inappropriate copyright on profile files _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 27 14:02:19 2011 From: report at bugs.python.org (Steve Langasek) Date: Mon, 27 Jun 2011 12:02:19 +0000 Subject: [New-bugs-announce] [issue12418] python should inherit the library search path from the compiler for stdlib extensions In-Reply-To: <1309176139.38.0.221668771682.issue12418@psf.upfronthosting.co.za> Message-ID: <1309176139.38.0.221668771682.issue12418@psf.upfronthosting.co.za> New submission from Steve Langasek : related to http://bugs.python.org/issue11715 python 2.7 and 3.1 now include a patch for behavior specific to Ubuntu and Debian to search in multiarch directories for libraries needed for building stdlib extensions. This distro-specific patch is unnecessary if instead python could just query and use the default search path from the compiler. With gcc, it's possible to query the list of built-in library directories with: $ gcc -print-search-dirs | sed -n -e's/libraries: =//p' | sed -e's/:/\n/g' | xargs -n1 readlink -f and the include directories with: $ gcc -v -E - < /dev/null 2>&1 | awk '/^#include/,/^End of search/ {i=1} i==1 && /^ / {print}' (additional filtering, to exclude compiler-internal directories, may be sensible.) Having python query and use these directories when searching for libraries would make the build system more robust in a variety of circumstances. ---------- components: Build messages: 139259 nosy: vorlon priority: normal severity: normal status: open title: python should inherit the library search path from the compiler for stdlib extensions type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 27 14:27:57 2011 From: report at bugs.python.org (Floris Bruynooghe) Date: Mon, 27 Jun 2011 12:27:57 +0000 Subject: [New-bugs-announce] [issue12419] Add ident parameter to SysLogHandler In-Reply-To: <1309177677.59.0.756868126424.issue12419@psf.upfronthosting.co.za> Message-ID: <1309177677.59.0.756868126424.issue12419@psf.upfronthosting.co.za> New submission from Floris Bruynooghe : It would be nice if the SysLogHandler also accepted an "ident" parameter in line with the syslog.openlog() function. This simply prepends the string passed in as "ident" to each log message which currently needs to be implemented with a log filter which modifies the record. ---------- components: Library (Lib) messages: 139260 nosy: flub priority: normal severity: normal status: open title: Add ident parameter to SysLogHandler type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 27 14:33:17 2011 From: report at bugs.python.org (Henry Precheur) Date: Mon, 27 Jun 2011 12:33:17 +0000 Subject: [New-bugs-announce] [issue12420] distutils crashes if PATH is not defined In-Reply-To: <1309177997.74.0.17903211546.issue12420@psf.upfronthosting.co.za> Message-ID: <1309177997.74.0.17903211546.issue12420@psf.upfronthosting.co.za> New submission from Henry Precheur : The function find_executable crashes if PATH is not defined. I admit that it's an extreme case, but it's probably better to on the safe side of things. What about using the current directory only if PATH is not defined? This seems to be a reasonable workaround. ---------- assignee: tarek components: Distutils, Distutils2 files: fix_empty_path.diff keywords: patch messages: 139261 nosy: alexis, eric.araujo, henry.precheur, tarek priority: normal severity: normal status: open title: distutils crashes if PATH is not defined versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file22492/fix_empty_path.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 27 14:53:37 2011 From: report at bugs.python.org (Henry Precheur) Date: Mon, 27 Jun 2011 12:53:37 +0000 Subject: [New-bugs-announce] [issue12421] Use PYTHON when calling Parser/asdl_c.py In-Reply-To: <1309179217.52.0.471772835314.issue12421@psf.upfronthosting.co.za> Message-ID: <1309179217.52.0.471772835314.issue12421@psf.upfronthosting.co.za> New submission from Henry Precheur : Parser/asdl_c.py uses `/usr/bin/env python' as an interpreter. But Python executable is not always `python'. With OpenBSD's ports, CPython's interpreters are installed as pythonX.Y. There's a variable PYTHON in the Makefile, that's what should be used. This way make PYTHON=python2.7 works on OpenBSD. The attached patch fixes that. Note that the executable bit and the hashbang can be removed from asdl_c.py if the patch is applied. ---------- components: Build files: fix_ASDLGEN.diff keywords: patch messages: 139264 nosy: henry.precheur priority: normal severity: normal status: open title: Use PYTHON when calling Parser/asdl_c.py versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file22494/fix_ASDLGEN.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 27 17:29:44 2011 From: report at bugs.python.org (Alex Gaynor) Date: Mon, 27 Jun 2011 15:29:44 +0000 Subject: [New-bugs-announce] [issue12422] When deepcopying, don't store immutable objects in the memo dict In-Reply-To: <1309188584.96.0.531711570592.issue12422@psf.upfronthosting.co.za> Message-ID: <1309188584.96.0.531711570592.issue12422@psf.upfronthosting.co.za> New submission from Alex Gaynor : All storing immutable objects in the memo dict does is slow stuff down, due to having a larger hash table, and on some other Python's causing hilarious levels of GC pressure. Using http://paste.pocoo.org/show/421310/ as a benchmark, CPython get's a 2x speedup on the deepcopy portion, and PyPy a 20x. Patch is attached. ---------- components: Library (Lib) files: d.diff keywords: patch messages: 139300 nosy: alex priority: normal severity: normal status: open title: When deepcopying, don't store immutable objects in the memo dict versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file22497/d.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 27 19:48:58 2011 From: report at bugs.python.org (Kamil Kisiel) Date: Mon, 27 Jun 2011 17:48:58 +0000 Subject: [New-bugs-announce] [issue12423] signal handler dpes Message-ID: <1309196938.32.0.378849463972.issue12423@psf.upfronthosting.co.za> Changes by Kamil Kisiel : ---------- nosy: kisielk priority: normal severity: normal status: open title: signal handler dpes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 28 02:12:46 2011 From: report at bugs.python.org (Eli Collins) Date: Tue, 28 Jun 2011 00:12:46 +0000 Subject: [New-bugs-announce] [issue12424] distutils2: extension section uses bad environment marker separator In-Reply-To: <1309219966.78.0.835295932694.issue12424@psf.upfronthosting.co.za> Message-ID: <1309219966.78.0.835295932694.issue12424@psf.upfronthosting.co.za> New submission from Eli Collins : The _pop_values() function in packaging.config uses "--" as the environment marker separator when parsing extension sections. This doesn't match PEP 345, or how the metadata section is currently parsed, both of which use ";" instead. Also, "--" is frequently found in compiler option strings, which will probably cause conflicts in the future. The attached patch changes _pop_values() and related unit tests to use ";" as the separator, as well as tries to clarify some of _pop_values()'s internal comments. ---------- assignee: tarek components: Distutils2 messages: 139339 nosy: alexis, eli.collins, eric.araujo, tarek priority: normal severity: normal status: open title: distutils2: extension section uses bad environment marker separator type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 28 09:38:27 2011 From: report at bugs.python.org (Dirkjan Ochtman) Date: Tue, 28 Jun 2011 07:38:27 +0000 Subject: [New-bugs-announce] [issue12425] gettext breaks on empty plural-forms value In-Reply-To: <1309246707.61.0.397995745183.issue12425@psf.upfronthosting.co.za> Message-ID: <1309246707.61.0.397995745183.issue12425@psf.upfronthosting.co.za> New submission from Dirkjan Ochtman : See https://bugzilla.redhat.com/show_bug.cgi?id=692632 for more details and a proposed patch. ---------- components: Library (Lib) messages: 139347 nosy: djc priority: normal severity: normal status: open title: gettext breaks on empty plural-forms value versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 28 10:50:03 2011 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Jun 2011 08:50:03 +0000 Subject: [New-bugs-announce] [issue12426] packaging.tests.test_command_install_dist.InstallTestCase failure In-Reply-To: <1309251003.31.0.392399705206.issue12426@psf.upfronthosting.co.za> Message-ID: <1309251003.31.0.392399705206.issue12426@psf.upfronthosting.co.za> New submission from STINNER Victor : FAIL: test_user_site (packaging.tests.test_command_install_dist.InstallTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/packaging/tests/test_command_install_dist.py", line 93, in test_user_site self._test_user_site() File "/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/packaging/tests/test_command_install_dist.py", line 122, in _test_user_site self.assertTrue(os.path.exists(self.user_base)) AssertionError: False is not true http://www.python.org/dev/buildbot/all/builders/AMD64%20Gentoo%20Wide%203.x/builds/1988/steps/test/logs/stdio ---------- assignee: tarek components: Distutils2, Tests messages: 139351 nosy: alexis, eric.araujo, haypo, tarek priority: normal severity: normal status: open title: packaging.tests.test_command_install_dist.InstallTestCase failure versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 28 11:14:10 2011 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 28 Jun 2011 09:14:10 +0000 Subject: [New-bugs-announce] [issue12427] packaging register fails because "POST data should be bytes" In-Reply-To: <1309252450.32.0.523517261738.issue12427@psf.upfronthosting.co.za> Message-ID: <1309252450.32.0.523517261738.issue12427@psf.upfronthosting.co.za> New submission from Vinay Sajip : vinay at eta-natty:~/projects/nemo$ pysetup3 run register running register Registering nemo to http://pypi.python.org/pypi Traceback (most recent call last): File "/usr/local/bin/pysetup3", line 4, in sys.exit(main()) File "/usr/local/lib/python3.3/packaging/run.py", line 678, in main return dispatcher() File "/usr/local/lib/python3.3/packaging/run.py", line 667, in __call__ return func(self, self.args) File "/usr/local/lib/python3.3/packaging/run.py", line 204, in wrapper return f(*args, **kwargs) File "/usr/local/lib/python3.3/packaging/run.py", line 344, in _run dist.run_command(cmd, dispatcher.command_options[cmd]) File "/usr/local/lib/python3.3/packaging/dist.py", line 761, in run_command cmd_obj.run() File "/usr/local/lib/python3.3/packaging/command/register.py", line 63, in run self.send_metadata() File "/usr/local/lib/python3.3/packaging/command/register.py", line 167, in send_metadata auth) File "/usr/local/lib/python3.3/packaging/command/register.py", line 267, in post_to_server result = opener.open(req) File "/usr/local/lib/python3.3/urllib/request.py", line 367, in open req = meth(req) File "/usr/local/lib/python3.3/urllib/request.py", line 1075, in do_request_ raise TypeError("POST data should be bytes" TypeError: POST data should be bytes or an iterable of bytes. It cannot be str. vinay at eta-natty:~/projects/nemo$ ---------- assignee: tarek components: Distutils2, Library (Lib) messages: 139352 nosy: alexis, eric.araujo, tarek, vinay.sajip priority: high severity: normal status: open title: packaging register fails because "POST data should be bytes" type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 28 12:07:18 2011 From: report at bugs.python.org (Brian Thorne) Date: Tue, 28 Jun 2011 10:07:18 +0000 Subject: [New-bugs-announce] [issue12428] functools test coverage In-Reply-To: <1309255638.21.0.342456839611.issue12428@psf.upfronthosting.co.za> Message-ID: <1309255638.21.0.342456839611.issue12428@psf.upfronthosting.co.za> New submission from Brian Thorne : The test coverage for functools was down around ~60%, this is a patch to bring that up to ~98%. Made two changes to the Lib/functools.py file itself: 1) Moved the Python implementation of partial into Lib/functools.py from Lib/test/test_functools.py which gets imported over the same as the Python implementation of cmp_to_key. 2) In order to allow the blocking of _functools, I grouped and moved the import functions from of _functools to the end of the file. In the test_functools.py file: 3) Added two new tests to TestLRU. 4) Add testing of Python implementation of cmp_to_key. I copied how test_warnings.py tests C and Python implementations of the same function. 5) Made the importing of functools itself far less clear ---------- components: Tests files: functools.diff keywords: patch messages: 139353 nosy: Thorney, ncoghlan, rhettinger priority: normal severity: normal status: open title: functools test coverage type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file22505/functools.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 28 13:23:47 2011 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Jun 2011 11:23:47 +0000 Subject: [New-bugs-announce] [issue12429] test_io.check_interrupted_write() sporadic failures on FreeBSD 6 on Python 2.7/3.2 In-Reply-To: <1309260227.84.0.740113314895.issue12429@psf.upfronthosting.co.za> Message-ID: <1309260227.84.0.740113314895.issue12429@psf.upfronthosting.co.za> New submission from STINNER Victor : test_io.check_interrupted_write() has two threads and a pipe: - reader (thread): read one byte from the pipe - writer (main thread): write 1 MB into the pipe An alarm (SIGALRM) is scheduled in one second. The writer blocks because the pipe buffer is smaller than 1 MB, but it is supposed to fill the pipe. The reader is supposed to exit quickly: the writer wrote a least one byte. The test fails *sometimes* on FreeBSD 6: [ 85/352] test_io Exception in thread Thread-274: Traceback (most recent call last): File "/usr/home/db3l/buildarea/3.2.bolen-freebsd/build/Lib/threading.py", line 736, in _bootstrap_inner self.run() File "/usr/home/db3l/buildarea/3.2.bolen-freebsd/build/Lib/threading.py", line 689, in run self._target(*self._args, **self._kwargs) File "/usr/home/db3l/buildarea/3.2.bolen-freebsd/build/Lib/test/test_io.py", line 2660, in _read s = os.read(r, 1) OSError: [Errno 4] Interrupted system call It is a race condition, this buildbot is very slow. The reader has maybe not enough time to read 1 byte. The test was fixed in Python 3.3 (#11859) by adding pthread_sigmask() (issue #8407) and using it in the test: commit 28b9702a83d1. The problem looks to be specific of FreeBSD 6 and 7 (according to #11859). The easiest solution is to skip the test on these platforms. To workaround the lack of pthread_sigmark(), we can use two processes instead of two threads. But it is maybe too much work just to fix a bug in a test (the bug is not in Python). ---------- components: IO, Tests messages: 139355 nosy: haypo, neologix priority: normal severity: normal status: open title: test_io.check_interrupted_write() sporadic failures on FreeBSD 6 on Python 2.7/3.2 versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 28 13:55:03 2011 From: report at bugs.python.org (Seppo Yli-Olli) Date: Tue, 28 Jun 2011 11:55:03 +0000 Subject: [New-bugs-announce] [issue12430] Pip fails to fetch from mirror if PyPi checksum times out In-Reply-To: <1309262103.36.0.291566083366.issue12430@psf.upfronthosting.co.za> Message-ID: <1309262103.36.0.291566083366.issue12430@psf.upfronthosting.co.za> New submission from Seppo Yli-Olli : Checksums need to be mirrored as well, otherwise having mirrors is a waste of money because PyPi main server being slow ends up with whole download failing. If this is the wrong bug tracker, please advice me to the right one so this can be resolved. ---------- components: None files: pip.log messages: 139357 nosy: Seppo.Yli-Olli priority: normal severity: normal status: open title: Pip fails to fetch from mirror if PyPi checksum times out versions: Python 2.7 Added file: http://bugs.python.org/file22507/pip.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 28 15:37:28 2011 From: report at bugs.python.org (Jon Siddle) Date: Tue, 28 Jun 2011 13:37:28 +0000 Subject: [New-bugs-announce] [issue12431] urllib2.Request.get_full_url() broken in newer versions of Python In-Reply-To: <1309268248.69.0.295956213219.issue12431@psf.upfronthosting.co.za> Message-ID: <1309268248.69.0.295956213219.issue12431@psf.upfronthosting.co.za> New submission from Jon Siddle : Issue8280 fixed an issue where the fragment was being sent to the server (and returned by get_selector). Unfortunately the fix means that the "full" URL stored in the Request no longer includes the fragment either. This is in contradiction to the documentation which states: Request.get_full_url() Return the URL given in the constructor. Yet: >>> import urllib2 >>> urllib2.Request("http://host/path#fragment").get_full_url() 'http://host/path' The particular use case is a custom scheme handler, which should be able to use the whole of the opaque part of the URL to operate. Ie, our code wants to do something like this: urllib2.Request("foo://opaquestring#opaquestring").get_full_url() ---------- messages: 139361 nosy: jonsiddle priority: normal severity: normal status: open title: urllib2.Request.get_full_url() broken in newer versions of Python type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 28 16:38:15 2011 From: report at bugs.python.org (Vincent Legoll) Date: Tue, 28 Jun 2011 14:38:15 +0000 Subject: [New-bugs-announce] [issue12432] remove a bunch of unused imports in Lib In-Reply-To: <1309271895.63.0.491805316904.issue12432@psf.upfronthosting.co.za> Message-ID: <1309271895.63.0.491805316904.issue12432@psf.upfronthosting.co.za> New submission from Vincent Legoll : Using pylint I found some unused imports in Lib. I filtered the most obvious ones by hand to produce the attached patch. Should I submit individual patches, one for each file, so as to ease review ? ---------- components: Library (Lib) files: unused-imports-2.patch keywords: patch messages: 139362 nosy: vincele priority: normal severity: normal status: open title: remove a bunch of unused imports in Lib versions: Python 3.4 Added file: http://bugs.python.org/file22508/unused-imports-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 28 17:40:19 2011 From: report at bugs.python.org (Garrett Cooper) Date: Tue, 28 Jun 2011 15:40:19 +0000 Subject: [New-bugs-announce] [issue12433] make clean doesn't clean up static libraries on 2.x In-Reply-To: <1309275619.55.0.00676218612249.issue12433@psf.upfronthosting.co.za> Message-ID: <1309275619.55.0.00676218612249.issue12433@psf.upfronthosting.co.za> New submission from Garrett Cooper : Running 'make clean' leaves libpython*.a behind. The attached patch removes it when make clean is run. This was resolved on py3k, not trunk; the attached patch matches what was done on py3k. ---------- components: Build files: cleanup-libpython-dot-a-trunk.patch keywords: patch messages: 139364 nosy: yaneurabeya priority: normal severity: normal status: open title: make clean doesn't clean up static libraries on 2.x type: compile error versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file22509/cleanup-libpython-dot-a-trunk.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 28 21:22:58 2011 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 28 Jun 2011 19:22:58 +0000 Subject: [New-bugs-announce] [issue12434] Strengthen 2.7 io types warning In-Reply-To: <1309288978.39.0.732754105333.issue12434@psf.upfronthosting.co.za> Message-ID: <1309288978.39.0.732754105333.issue12434@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Trying 3.2 code with 2.7, I got this (greatly simplified): from __future__ import print_function from io import StringIO print('hello world', file=StringIO()) Traceback... TypeError: string argument expected, got 'str' (StringIO.StringIO works fine, of course.) This was initially confusing. Suggestion: after "Note Since this module has been designed primarily for Python 3.x, you have to be aware that all uses of ?bytes? in this document refer to the str type (of which bytes is an alias), and all uses of ?text? refer to the unicode type. " add 'String' in exception messages may also mean the unicode type." ---------- assignee: docs at python components: Documentation keywords: easy messages: 139374 nosy: docs at python, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Strengthen 2.7 io types warning versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 29 00:25:17 2011 From: report at bugs.python.org (Brian Hare) Date: Tue, 28 Jun 2011 22:25:17 +0000 Subject: [New-bugs-announce] [issue12435] Input function does not strip trailing '\r' from string input In-Reply-To: <1309299917.58.0.776675076833.issue12435@psf.upfronthosting.co.za> Message-ID: <1309299917.58.0.776675076833.issue12435@psf.upfronthosting.co.za> New submission from Brian Hare : In Windows, using python 3.2, the built-input function does not strip the trailing '\r' from the string input: Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> input('Enter > ') Enter > abcde 'abcde\r' >>> This behavior does not appear in IDLE but does appear in a free-standing command window. While the docs only say that the trailing newline is dropped, the 2.6 docs for raw_input have exactly the same wording and the carriage return is dropped: Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> raw_input('Enter > ') Enter > abcde 'abcde' >>> ---------- components: Windows messages: 139379 nosy: BKHare priority: normal severity: normal status: open title: Input function does not strip trailing '\r' from string input type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 29 01:56:35 2011 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 28 Jun 2011 23:56:35 +0000 Subject: [New-bugs-announce] [issue12436] Provide reference to detailed installation instructions In-Reply-To: <1309305395.29.0.101516779086.issue12436@psf.upfronthosting.co.za> Message-ID: <1309305395.29.0.101516779086.issue12436@psf.upfronthosting.co.za> New submission from Nick Coghlan : The Boston Python Workshop folks have some detailed step-by-step instructions on getting Python up and running ([1]). Given that this can be a pain point for new users (primarily on Windows), it may be good to reference these instructions from the official docs. (Alternatively, we could use them as the basis for a "HOWTO" in the official docs and update release.py to adjust the relevant links. That's a lot more work than just adding a link, though) [1] http://openhatch.org/wiki/Boston_Python_Workshop_3/Friday ---------- assignee: docs at python components: Documentation messages: 139381 nosy: docs at python, ncoghlan priority: normal severity: normal status: open title: Provide reference to detailed installation instructions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 29 02:07:07 2011 From: report at bugs.python.org (Matt Joiner) Date: Wed, 29 Jun 2011 00:07:07 +0000 Subject: [New-bugs-announce] [issue12437] _ctypes.dlopen does not include errno in OSError In-Reply-To: <1309306027.41.0.167603787283.issue12437@psf.upfronthosting.co.za> Message-ID: <1309306027.41.0.167603787283.issue12437@psf.upfronthosting.co.za> New submission from Matt Joiner : _ctypes.dlopen is not including the errno when it raises OSError. This occurs when attempting to load a library that doesn't exist, the error string given is clearly generated from an ENOENT. joiner at dbssyd800:~$ python3 dlopen_raise.py None somelib.so: cannot open shared object file: No such file or directory ---------- components: ctypes files: dlopen_raise.py messages: 139382 nosy: anacrolix priority: normal severity: normal status: open title: _ctypes.dlopen does not include errno in OSError type: behavior versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file22512/dlopen_raise.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 29 03:06:31 2011 From: report at bugs.python.org (=?utf-8?q?Jo=C3=A3o_Bernardo?=) Date: Wed, 29 Jun 2011 01:06:31 +0000 Subject: [New-bugs-announce] [issue12438] getpass error on idle In-Reply-To: <1309309591.85.0.564668230133.issue12438@psf.upfronthosting.co.za> Message-ID: <1309309591.85.0.564668230133.issue12438@psf.upfronthosting.co.za> New submission from Jo?o Bernardo : The getpass function is raising an error when first used on idle (Python 3.2 and 2.7.1) The next time it'll work "as expected" (it echoes the data, but idle is just for testing purposes so no problems here) >>> from getpass import getpass >>> p = getpass() Traceback (most recent call last): File "", line 1, in p = getpass() File "/usr/lib/python3.2/getpass.py", line 55, in unix_getpass passwd = fallback_getpass(prompt, stream) File "/usr/lib/python3.2/getpass.py", line 114, in fallback_getpass stacklevel=2) File "/usr/lib/python3.2/idlelib/PyShell.py", line 62, in idle_showwarning lineno, file=file, line=line)) TypeError: idle_formatwarning() got an unexpected keyword argument 'file' >>> p = getpass() Warning: Password input may be echoed. Password: ok >>> p 'ok' >>> Looking at the "/usr/lib/python3.2/idlelib/PyShell.py" file the "idle_formatwarning" function don't have the "file" argument so it should be revomed from the function call at line 61: file.write(warnings.formatwarning(message, category, filename, lineno, file=file, line=line)) ---------- components: IDLE messages: 139385 nosy: JBernardo priority: normal severity: normal status: open title: getpass error on idle type: crash versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 29 11:35:25 2011 From: report at bugs.python.org (Yoav Weiss) Date: Wed, 29 Jun 2011 09:35:25 +0000 Subject: [New-bugs-announce] [issue12439] BaseHTTPServer's send_reponse adds extra "\r\n" when using HTTPMessage in input In-Reply-To: <1309340125.43.0.831188381846.issue12439@psf.upfronthosting.co.za> Message-ID: <1309340125.43.0.831188381846.issue12439@psf.upfronthosting.co.za> New submission from Yoav Weiss : I'm using BaseHTTPServer's send_response (from within a class that inherits BaseHTTPRequestHandler) with the following: self.send_response(response.code, response.headers) self.end_headers() self.wfile.write(content) self.wfile.flush() When response is a httplib's HTTPResponse object, and its headers inherits from rfc822.Message. What I see is that message is printed as is, including all the headers trailing "\r\n", after which the send_response method (BaseHTTPServer.py:381) adds another "\r\n". Then send_response adds the "Server" and "Date" headers. Since the headers before Server & Date include "\r\n\r\n", Date & server are considered by the browser as the content. Am I misusing BaseHTTPServer? If not, this is a bug and "\r\n" should be removed from line 381, or added only after a check that shows they are not already there at the headers end, or in case there are no input headers. ---------- components: Library (Lib) messages: 139401 nosy: Yoav.Weiss priority: normal severity: normal status: open title: BaseHTTPServer's send_reponse adds extra "\r\n" when using HTTPMessage in input type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 29 12:12:59 2011 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Jun 2011 10:12:59 +0000 Subject: [New-bugs-announce] [issue12440] test_ssl.test_options() failure on Snow Leopard: can't clear options before OpenSSL 0.9.8m In-Reply-To: <1309342379.37.0.935876078434.issue12440@psf.upfronthosting.co.za> Message-ID: <1309342379.37.0.935876078434.issue12440@psf.upfronthosting.co.za> New submission from STINNER Victor : Seen on "AMD64 Snow Leopard 2 3.x" buildbot: ===================================================================== ERROR: test_options (test.test_ssl.ContextTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/test/test_ssl.py", line 81, in f return func(*args, **kwargs) File "/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/test/test_ssl.py", line 362, in test_options ctx.options = (ctx.options & ~ssl.OP_NO_SSLv2) | ssl.OP_NO_TLSv1 ValueError: can't clear options before OpenSSL 0.9.8m http://www.python.org/dev/buildbot/all/builders/AMD64%20Snow%20Leopard%202%203.x/builds/581/steps/test/logs/stdio I think that the regression was introduced by one of the following build (build 571 didn't run the test suite): http://www.python.org/dev/buildbot/all/builders/AMD64%20Snow%20Leopard%202%203.x/builds/571 http://www.python.org/dev/buildbot/all/builders/AMD64%20Snow%20Leopard%202%203.x/builds/572 ---------- components: Library (Lib) messages: 139403 nosy: haypo, pitrou priority: normal severity: normal status: open title: test_ssl.test_options() failure on Snow Leopard: can't clear options before OpenSSL 0.9.8m versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 29 13:18:39 2011 From: report at bugs.python.org (Juanjo Alvarez) Date: Wed, 29 Jun 2011 11:18:39 +0000 Subject: [New-bugs-announce] [issue12441] _GLOBAL_DEFAULT_TIMEOUT remains as an object() in HTTPConnection and the connection hangs In-Reply-To: <1309346319.84.0.970353674809.issue12441@psf.upfronthosting.co.za> Message-ID: <1309346319.84.0.970353674809.issue12441@psf.upfronthosting.co.za> New submission from Juanjo Alvarez : I was testing a jsonrpc server using a small Python client. I noticed that sometimes when the RPC returned some long test, the response object returned by URLOpener.open(), in my case an HTTPResponse, would hang about 70% of the time when calling read() on a RPC method returning more text than usual (a string of about 4000 bytes). Investigating it I noticed that on HTTPConnection.connect, the self.timeout value was "object". I tried to hardcode some value on the method first line, changing the "self.timeout" for "5": self.sock = socket.create_connection((self.host,self.port),self.timeout, self.source_address) Then suddenly the call to the RPC works 100% of the time, and I don't mean that it timeouts, it just works and doesn't hangs. So the workaround that I'm using is to call socket.setdefaulttimeout in my client code. I saw that the default value in HTTPConnection for self.timeout is socket._GLOBAL_DEFAULT_TIMEOUT which is initialized as an "object()" and remains that way on my HTTPConnection.connect call. My guess is that when the RPC call is not very fast, the system checks the socket timeout and then it hangs if the value is an object, so the longer the text returned by the RPC, the higher the chance that the read() hangs. ---------- components: IO messages: 139406 nosy: juanjux priority: normal severity: normal status: open title: _GLOBAL_DEFAULT_TIMEOUT remains as an object() in HTTPConnection and the connection hangs type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 29 18:55:39 2011 From: report at bugs.python.org (Giampaolo Rodola') Date: Wed, 29 Jun 2011 16:55:39 +0000 Subject: [New-bugs-announce] [issue12442] shutil.disk_usage() In-Reply-To: <1309366539.23.0.219360747776.issue12442@psf.upfronthosting.co.za> Message-ID: <1309366539.23.0.219360747776.issue12442@psf.upfronthosting.co.za> New submission from Giampaolo Rodola' : Patch in attachment adds a new disk_usage() function to shutil module which retrieves total, used and free disk space given a certain path plus the percentage usage. See original discussion on python-ideas ml: http://mail.python.org/pipermail/python-ideas/2011-June/010480.htm ---------- assignee: giampaolo.rodola components: Library (Lib) files: diskusage.patch keywords: needs review, patch messages: 139439 nosy: giampaolo.rodola, pitrou, rhettinger priority: normal severity: normal stage: patch review status: open title: shutil.disk_usage() type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file22517/diskusage.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 29 20:51:17 2011 From: report at bugs.python.org (Jean-Paul Calderone) Date: Wed, 29 Jun 2011 18:51:17 +0000 Subject: [New-bugs-announce] [issue12443] locale.setlocale(locale.LC_ALL, locale.getlocale()) fails for some locales In-Reply-To: <1309373477.02.0.58527022305.issue12443@psf.upfronthosting.co.za> Message-ID: <1309373477.02.0.58527022305.issue12443@psf.upfronthosting.co.za> New submission from Jean-Paul Calderone : Consider this transcript from OS X 10.6: >>> import locale >>> locale.getlocale() (None, None) >>> locale.setlocale(locale.LC_ALL, _) 'C' >>> locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') 'en_US.UTF-8' >>> locale.getlocale() ('en_US', 'UTF8') >>> locale.setlocale(locale.LC_ALL, _) Traceback (most recent call last): File "", line 1, in File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/locale.py", line 494, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting >>> OS X does not recognize 'en_US.UTF8', only 'en_US.UTF-8'. However, when passed a tuple, the locale module tries to normalize the values. It ends up turning the result of getlocale from ('en_US', 'UTF-8') into 'en_US.UTF8'. ---------- assignee: ronaldoussoren components: Extension Modules, Library (Lib), Macintosh messages: 139445 nosy: exarkun, ronaldoussoren priority: normal severity: normal status: open title: locale.setlocale(locale.LC_ALL, locale.getlocale()) fails for some locales type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 29 22:56:37 2011 From: report at bugs.python.org (Peter Eisentraut) Date: Wed, 29 Jun 2011 20:56:37 +0000 Subject: [New-bugs-announce] [issue12444] accept sets or collections for str.strip/lstrip/rstrip In-Reply-To: <1309380997.61.0.864474637719.issue12444@psf.upfronthosting.co.za> Message-ID: <1309380997.61.0.864474637719.issue12444@psf.upfronthosting.co.za> New submission from Peter Eisentraut : It appears to be a pretty common mistake to think that the argument of str.strip/lstrip/rstrip is a substring rather than a set of characters. To allow a more clearer notation, it would be nice if these functions also accepted an argument other than a string, for example a set or any collection. Then you could write, for example: a.strip({'a', 'b', 'c'}) I suggest to either add support for sets specifically, or more generally anything that supports the "in" operator. I can try to code it up if it sounds acceptable. ---------- components: Library (Lib) messages: 139449 nosy: petere priority: normal severity: normal status: open title: accept sets or collections for str.strip/lstrip/rstrip type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 30 02:03:10 2011 From: report at bugs.python.org (Julian) Date: Thu, 30 Jun 2011 00:03:10 +0000 Subject: [New-bugs-announce] [issue12445] dict view values objects are missing tp_richcmp and tp_as_number In-Reply-To: <1309392190.89.0.80399053449.issue12445@psf.upfronthosting.co.za> Message-ID: <1309392190.89.0.80399053449.issue12445@psf.upfronthosting.co.za> New submission from Julian : dict view values() objects are missing tp_richcmp and tp_as_sequence, and the tests for those were incomplete, which means that on 2.7 and 3.2 (and on current head) viewvalues / values objects don't compare correctly. Without indication, I assume this is not the desired behavior. Looks like the cause is that the dictview_richcompare function was written to expect a set-like object, and nothing was written for values. I've modified it to accept any view object and do the appropriate check. One thing I'm unsure of, which I'm sure one of you will help with, is what the desired behavior is on what values() view objects actually *should* be equal to. Being that there isn't a multiset object, and that I couldn't find any resource, I assumed that they only should be equal to other values() objects, not any of the other (ordered) containers. If that's incorrect, or if I need to discuss that on the mailing list, please let me know. A patch to fix both is attached with the correction to the unit test, hope I did this correctly. I assume this needs to be backported to 2.7, but I figured I'd ask about that first. (Test suite runs without errors on current 3.3 head with this patch for me). dictview_richcompare also needs unit tests for the NotImplemented error that it should return, but I didn't want to convolute this patch, please let me know if I should put that in here, or file another ticket, or neither. Thanks! ---------- components: Interpreter Core files: viewvalues_compare.patch keywords: patch messages: 139455 nosy: Julian priority: normal severity: normal status: open title: dict view values objects are missing tp_richcmp and tp_as_number type: behavior versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file22518/viewvalues_compare.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 30 03:43:26 2011 From: report at bugs.python.org (Thomas Barnet-Lamb) Date: Thu, 30 Jun 2011 01:43:26 +0000 Subject: [New-bugs-announce] [issue12446] StreamReader Readlines In-Reply-To: <1309398206.26.0.914481831308.issue12446@psf.upfronthosting.co.za> Message-ID: <1309398206.26.0.914481831308.issue12446@psf.upfronthosting.co.za> New submission from Thomas Barnet-Lamb : It appears that StreamReader's readlines method behaves in a strange manner if the StreamReader has, in a previous read operation, decoded more characters than the user asked for; this happens when both the chars and size parameters are used, but only in some circumstances. See the following: Python 2.7.2 (default, Jun 26 2011, 02:56:25) [GCC 4.0.1 (Apple Inc. build 5490)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import codecs >>> >>> ## First make a file ... with codecs.open('temp.tmp','wb', encoding='utf8') as f: ... f.write(u'This\u00ab is a test line\nThis is another test line\n') ... >>> >>> ## Now open it for reading ... UTF8Reader = codecs.getreader('utf-8') >>> with UTF8Reader(codecs.open('temp.tmp','rb')) as f: ... print(repr(f.read(size=5, chars=5))) ... print(f.readlines()) ... u'This\xab' [u' is '] # The expected output is # u'This\xab' # [u' is a test line\n', u'This is another test line\n'] I believe the culprit is codecs.py, line 466-467 (the two starred lines below). I think they ought to be replaced with 'pass'. if chars < 0: if size < 0: * if self.charbuffer: * break elif len(self.charbuffer) >= size: break Best wishes, Thomas PS - I will apologize in advance for any oversights or mistakes in the formatting etc. of this bug report---this is my first time! ---------- components: Unicode messages: 139457 nosy: Thomas.Barnet-Lamb priority: normal severity: normal status: open title: StreamReader Readlines versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 30 07:45:42 2011 From: report at bugs.python.org (Matt Joiner) Date: Thu, 30 Jun 2011 05:45:42 +0000 Subject: [New-bugs-announce] [issue12447] ~True is not False In-Reply-To: <1309412742.21.0.0834751390952.issue12447@psf.upfronthosting.co.za> Message-ID: <1309412742.21.0.0834751390952.issue12447@psf.upfronthosting.co.za> New submission from Matt Joiner : Given there is no ! operator in Python, I next tried ~ (despite that I'm after a logical not). This came as a surprise: >>> bool(~True) True >>> bool(~False) True >>> bool(~~False) False >>> ~True, ~~True, ~False, ~~False (-2, 1, -1, 0) Is there any consideration to "fixing" this? Is int(True) 1 due to C? Why is it preferred over -1? It seems more appropriate to me that True have: def __invert__(self): return False def __int__(self): return 1 # or even -1 This also "fixes" this case too: >>> -True -1 ---------- components: Interpreter Core messages: 139458 nosy: anacrolix priority: normal severity: normal status: open title: ~True is not False type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 30 08:20:26 2011 From: report at bugs.python.org (Matt Joiner) Date: Thu, 30 Jun 2011 06:20:26 +0000 Subject: [New-bugs-announce] [issue12448] smtplib's __main__ doesn't flush when prompting In-Reply-To: <1309414826.92.0.939740795599.issue12448@psf.upfronthosting.co.za> Message-ID: <1309414826.92.0.939740795599.issue12448@psf.upfronthosting.co.za> New submission from Matt Joiner : The smptlib module's __main__ doesn't flush stdout when prompting: sys.stdout.write(prompt + ": ") return sys.stdin.readline().strip() stdout is usually line buffered, and so running python3 smptlib.py doesn't actually prompt the user. The line `sys.stdout.flush()` needs to be added. ---------- components: Library (Lib) messages: 139461 nosy: anacrolix priority: normal severity: normal status: open title: smtplib's __main__ doesn't flush when prompting type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 30 09:31:58 2011 From: report at bugs.python.org (Ram Rachum) Date: Thu, 30 Jun 2011 07:31:58 +0000 Subject: [New-bugs-announce] [issue12449] Add accelerator "F" to button "Finish" in all MSI installers made by bdist_msi In-Reply-To: <1309419118.82.0.901696442421.issue12449@psf.upfronthosting.co.za> Message-ID: <1309419118.82.0.901696442421.issue12449@psf.upfronthosting.co.za> New submission from Ram Rachum : I noticed that in MSI installers downloaded from PyPI don't have an accelerator on the Finish button. Please add an accelerator on it. (I think that "F" is the accepted one.) ---------- assignee: tarek components: Distutils messages: 139463 nosy: cool-RR, eric.araujo, tarek priority: normal severity: normal status: open title: Add accelerator "F" to button "Finish" in all MSI installers made by bdist_msi type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 30 10:19:17 2011 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Thu, 30 Jun 2011 08:19:17 +0000 Subject: [New-bugs-announce] [issue12450] Use the Grisu algorithms to convert floats to strings In-Reply-To: <1309421957.37.0.89091198831.issue12450@psf.upfronthosting.co.za> Message-ID: <1309421957.37.0.89091198831.issue12450@psf.upfronthosting.co.za> New submission from Amaury Forgeot d'Arc : Reported by Michael Ford in msg139402: http://www.serpentine.com/blog/2011/06/29/here-be-dragons-advances-in-problems-you-didnt-even-know-you-had/ describes a new algorithm for float<->str conversions. It would be interesting to see if it is better/faster than the current dtoa. ---------- components: Interpreter Core messages: 139466 nosy: amaury.forgeotdarc, mark.dickinson, michael.foord, rhettinger priority: normal severity: normal status: open title: Use the Grisu algorithms to convert floats to strings type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 30 14:20:51 2011 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Jun 2011 12:20:51 +0000 Subject: [New-bugs-announce] [issue12451] open: avoid the locale encoding when possible In-Reply-To: <1309436451.46.0.759652312058.issue12451@psf.upfronthosting.co.za> Message-ID: <1309436451.46.0.759652312058.issue12451@psf.upfronthosting.co.za> New submission from STINNER Victor : open() uses the locale encoding in Python 3 when opening text file if the encoding argument is not specified (implicit). Some functions use locale encoding, but it's not the right encoding. I see at least three cases where the encoding should be changed: - UTF-8 should be used instead for portability: it's a bug in the module - ASCII must be used instead: the module doesn't support non-ASCII characters (old file formats, old network protocols, some fields of a document, etc.) - ASCII can be used instead: it's just a micro-optimization, the ASCII encoding is a little bit faster To detect the usage of the implicit locale encoding, some functions can be monkeypatched: - builtins.open, io.open, _pyio.open - io.TextIOWrapper, _pyio.TextIOWrapper - more functions using directly or indirectly open/TextIOWrapper may be patched to emit the warning earlier Attached open_hook.patch implements these hooks (hacks?) in the site module: it emits a ResourceWarning. Use python -Werror to raise an error if the locale encoding is used implicitly. If you really want to use the locale encoding, use encoding='locale' to make quiet the warning. Quite all functions in Python uses the implicit locale encoding. For example, Python doesn't start with the patch and -Werror. If you use -Werror, you have to patch *all* calls to open()/TextIOWrapper to be able to locate real bugs, or the program will stop before hitting the real problems. Each time you have to check what is the real expected encoding, it takes a lot of time. I started this huge project. I'm using ASCII most of the time (especially in Python tests), I don't know if it's correct. It will require a second step to ensure that the function really don't use/support non-ASCII characters. I will use this issue for my commits, attach patches, and more generally discuss this topic. ---------- components: Unicode files: open_hook.patch keywords: patch messages: 139473 nosy: haypo priority: normal severity: normal status: open title: open: avoid the locale encoding when possible versions: Python 3.3 Added file: http://bugs.python.org/file22520/open_hook.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 30 16:39:21 2011 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Jun 2011 14:39:21 +0000 Subject: [New-bugs-announce] [issue12452] reuse plistlib in sysconfig; deprecation process in plistlib In-Reply-To: <1309444761.1.0.605266895542.issue12452@psf.upfronthosting.co.za> Message-ID: <1309444761.1.0.605266895542.issue12452@psf.upfronthosting.co.za> New submission from STINNER Victor : sysconfig uses regex to parse the a .plist file (format based on XML), /System/Library/CoreServices/SystemVersion.plist: the plistlib module can be used instead. I rebuild my patched Python from scatch (make distclean) and I didn't notice any bootstrap issue. The platform module does already use plistlib to parse SystemVersion.plist. => sysconfig_plistlib.patch I also noticed that Plist and Dict emit PendingDeprecationWarning since Python 3.1. It's maybe time to switch to DeprecationWarning? test_plistlib doesn't use these classes, and there are not documented. => plistlib_deprecation.patch ---------- components: Library (Lib) files: sysconfig_plistlib.patch keywords: patch messages: 139481 nosy: haypo priority: normal severity: normal status: open title: reuse plistlib in sysconfig; deprecation process in plistlib versions: Python 3.3 Added file: http://bugs.python.org/file22521/sysconfig_plistlib.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 30 17:16:21 2011 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Jun 2011 15:16:21 +0000 Subject: [New-bugs-announce] [issue12453] test_import.test_failing_import_sticks() sporadic failures In-Reply-To: <1309446981.3.0.601023155331.issue12453@psf.upfronthosting.co.za> Message-ID: <1309446981.3.0.601023155331.issue12453@psf.upfronthosting.co.za> New submission from STINNER Victor : The following test fails sometimes. I don't know on which buildbot it occurs. The last failure is on "x86 XP-5 3.x": ====================================================================== FAIL: test_failing_import_sticks (test.test_import.ImportTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\Buildslave\3.x.moore-windows\build\lib\test\test_import.py", line 185, in test_failing_import_sticks self.assertRaises(ZeroDivisionError, __import__, TESTFN) AssertionError: ZeroDivisionError not raised by __import__ http://www.python.org/dev/buildbot/all/builders/x86%20XP-5%203.x/builds/3085/steps/test/logs/stdio ---------- components: Tests messages: 139492 nosy: haypo priority: normal severity: normal status: open title: test_import.test_failing_import_sticks() sporadic failures versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 30 18:35:53 2011 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Jun 2011 16:35:53 +0000 Subject: [New-bugs-announce] [issue12454] mailbox: use ASCII to read/write .mh_sequences files In-Reply-To: <1309451753.0.0.932089944066.issue12454@psf.upfronthosting.co.za> Message-ID: <1309451753.0.0.932089944066.issue12454@psf.upfronthosting.co.za> New submission from STINNER Victor : The MH class uses the locale encoding to read and write .mh_sequences files. According to R. David Murray, ASCII can be safetly used instead. Extract of our discussion on IRC: bitdancer> haypo: that's one of the cases where using locale is probably correct, even though I'd rather it used utf-8. bitdancer> haypo: for nmh it is ASCII, for whatever that is worth. bitdancer> I base this on the fact that the pick command says that a utf-8 character is invalid. bitdancer> for a sequence name. bitdancer> Which is the only thing other than numbers that goes in a sequences files. Jerub> I concurr (was reading code) ---------- components: Library (Lib) files: mailbox.patch keywords: patch messages: 139502 nosy: haypo, r.david.murray priority: normal severity: normal status: open title: mailbox: use ASCII to read/write .mh_sequences files versions: Python 3.3 Added file: http://bugs.python.org/file22526/mailbox.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 30 21:23:38 2011 From: report at bugs.python.org (Cal Leeming) Date: Thu, 30 Jun 2011 19:23:38 +0000 Subject: [New-bugs-announce] [issue12455] urllib2 Request() forces capitalize() on header names, breaking some requests In-Reply-To: <1309461818.92.0.299415077626.issue12455@psf.upfronthosting.co.za> Message-ID: <1309461818.92.0.299415077626.issue12455@psf.upfronthosting.co.za> New submission from Cal Leeming : I came up against a problem today whilst trying to submit a request to a remote API. The header needed to contain: 'Content-MD5' : "md5here" But the urllib2 Request() forces capitalize() on all header names, and transformed it into "Content-Md5", which in turn made the remote web server ignore the header and break the request (as the remote side is case sensitive, of which we don't have any control over). I attempted to get smart by using the following patch: class _str(str): def capitalize(s): print s return s _headers = {_str("Content-MD5") : 'md5here'} But this failed to work: ---HEADERS--- {'Content-MD5': 'nts0yj7AdzJALyNOxafDyA=='} ---URLLIB2 DEBUG--- send: 'POST /api/v1 m HTTP/1.1\r\nContent-Md5: nts0yj7AdzJALyNOxafDyA==\r\n\r\n\r\n' Upon inspecting the urllib2.py source, I found 3 references to capitalize() which seem to cause this problem, but it seems impossible to monkey patch, nor fix without forking. Therefore, I'd like to +1 a feature request to have an extra option at the time of the request being opened, to bypass the capitalize() on header names (maybe, header_keep_original = True or something). And, if anyone could suggest a possible monkey patch (which doesn't involve forking huge chunks of code), that'd be good too :) Thanks Cal ---------- components: Library (Lib) messages: 139512 nosy: Cal.Leeming priority: normal severity: normal status: open title: urllib2 Request() forces capitalize() on header names, breaking some requests type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________