From report at bugs.python.org Thu Sep 1 00:42:41 2011 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 31 Aug 2011 22:42:41 +0000 Subject: [New-bugs-announce] [issue12874] Rearrange descriptions of builtin types Message-ID: <1314830561.27.0.909082052318.issue12874@psf.upfronthosting.co.za> New submission from Nick Coghlan : Section 4 of the Standard Library reference currently includes the two following sections (amongst others): 4.6. Sequence Types ? str, bytes, bytearray, list, tuple, range 4.9. memoryview type This is crazy - memoryview, a fairly niche type, gets its own second tier section on the main table of contents, while str, one of the most important types in Python, is tucked away under the generic "Sequence Type" heading? I propose that these sections be rearranged as: 4.6 Sequence Types - list, tuple, range 4.7 Text Types - str 4.8 Binary Data Types - bytes, bytearray, memoryview The Set Types and Mapping Types sections would slide down to sections 4.9 and 4.10 to make room for the two new sections. ---------- assignee: docs at python components: Documentation messages: 143284 nosy: docs at python, ncoghlan priority: normal severity: normal status: open title: Rearrange descriptions of builtin types versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 1 07:17:08 2011 From: report at bugs.python.org (Eli Bendersky) Date: Thu, 01 Sep 2011 05:17:08 +0000 Subject: [New-bugs-announce] [issue12875] backport re.compile flags default value documentation Message-ID: <1314854228.49.0.163476055978.issue12875@psf.upfronthosting.co.za> New submission from Eli Bendersky : In the 2.7 docs, re.compile has this signature: re.compile(pattern[, flags]) >From here it isn't clear what the default value of 'flags' is, to be able to write code like this: re.compile(pattern, re.I if options['ignore_case'] else ) Of course, looking at the source shows immediately that the default flag value is 0 (which is kind-of implied by the flags being a bit-OR of flags, but not mentioned explicitly). I saw that in the latest 3K docs, it is documented properly: re.compile(pattern, flags=0) Naturally this applies to other methods of 're' that take 'flags'. I hope I'm not missing something and this really is just a documentation issue. If no objections arise, I will commit a fix to the docs of 're' in 2.7 ---------- assignee: docs at python components: Documentation messages: 143300 nosy: docs at python, eli.bendersky, ezio.melotti, pitrou priority: normal severity: normal status: open title: backport re.compile flags default value documentation versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 1 12:42:21 2011 From: report at bugs.python.org (Wong Wah Meng) Date: Thu, 01 Sep 2011 10:42:21 +0000 Subject: [New-bugs-announce] [issue12876] Make Test Error : ImportError: No module named _sha256 Message-ID: <1314873741.02.0.732192179897.issue12876@psf.upfronthosting.co.za> New submission from Wong Wah Meng : Hi there, I just build python 2.7.1 on my HP 11.31 Itanium 64 bit machine using gcc. When I finished the build and run "make test". It gives me error as depicted below:- $ ./python Lib/test/regrtest.py -v Traceback (most recent call last): File "Lib/test/regrtest.py", line 157, in import random File "/home/r32813/Build/2.7.1/Python-2.7.1/Lib/random.py", line 49, in import hashlib as _hashlib File "/home/r32813/Build/2.7.1/Python-2.7.1/Lib/hashlib.py", line 136, in globals()[__func_name] = __get_hash(__func_name) File "/home/r32813/Build/2.7.1/Python-2.7.1/Lib/hashlib.py", line 74, in __get_builtin_constructor import _sha256 ImportError: No module named _sha256 This is the server information. $ uname -a HP-UX zmy02hp3 B.11.31 U ia64 3240906838 unlimited-user license Here is other information in the configure.log file. Target: ia64-hp-hpux11.23 Configured with: /tmp/gcc-4.4.3.tar.gz/gcc-4.4.3/configure --host=ia64-hp-hpux11.23 --target=ia64-hp-hpux11.23 --build=ia64-hp-hpux11.23 --prefix=/opt/hp- gcc-4.4.3 --with-gnu-as --without-gnu-ld --enable-threads=posix --enable-languages=c,c++ --with-gmp=/proj/opensrc/be/ia64-hp-hpux11.23 --with-mpfr=/proj/o pensrc/be/ia64-hp-hpux11.23 SED=/usr/bin/sed Thread model: posix ---------- components: Tests messages: 143315 nosy: wah meng priority: normal severity: normal status: open title: Make Test Error : ImportError: No module named _sha256 type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 1 15:38:33 2011 From: report at bugs.python.org (Jonas H.) Date: Thu, 01 Sep 2011 13:38:33 +0000 Subject: [New-bugs-announce] [issue12877] Popen(...).stdout.seek(...) throws "Illegal seek" Message-ID: <1314884313.21.0.764506702479.issue12877@psf.upfronthosting.co.za> New submission from Jonas H. : from subprocess import Popen, PIPE p = Popen(['ls'], stdout=PIPE) p.wait() p.stdout.seek(0) Traceback (most recent call last): File "t.py", line 5, in p.stdout.seek(0) IOError: [Errno 29] Illegal seek Python 2.7.2, Arch Linux x86-64 (Kernel 3.0) ---------- messages: 143323 nosy: jonash priority: normal severity: normal status: open title: Popen(...).stdout.seek(...) throws "Illegal seek" versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 1 20:47:09 2011 From: report at bugs.python.org (Eric Promislow) Date: Thu, 01 Sep 2011 18:47:09 +0000 Subject: [New-bugs-announce] [issue12878] io.StringIO doesn't provide a __dict__ field Message-ID: <1314902829.02.0.266212831864.issue12878@psf.upfronthosting.co.za> New submission from Eric Promislow : I see that going from Python 3.1.1 to 3.1.2 instances of io.StringIO no longer have a __dict__ field. Why? Is this to make them unpicklable? ---------- components: IO messages: 143344 nosy: ericp priority: normal severity: normal status: open title: io.StringIO doesn't provide a __dict__ field type: behavior versions: Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 1 21:55:41 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Sep 2011 19:55:41 +0000 Subject: [New-bugs-announce] [issue12879] "method-wrapper" objects are difficult to inspect Message-ID: <1314906941.68.0.862588142823.issue12879@psf.upfronthosting.co.za> New submission from Antoine Pitrou : This is a bit unhelpful: >>> s = io.StringIO() >>> s.__getattribute__ >>> dir(s.__getattribute__) Traceback (most recent call last): File "", line 1, in TypeError: object does not provide __dir__ ---------- components: Interpreter Core messages: 143349 nosy: amaury.forgeotdarc, benjamin.peterson, pitrou priority: normal severity: normal status: open title: "method-wrapper" objects are difficult to inspect type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 2 04:34:11 2011 From: report at bugs.python.org (Meador Inge) Date: Fri, 02 Sep 2011 02:34:11 +0000 Subject: [New-bugs-announce] [issue12880] ctypes: clearly document how structure bit fields are allocated Message-ID: <1314930851.91.0.112444630543.issue12880@psf.upfronthosting.co.za> New submission from Meador Inge : As issues like issue6069 and issue11920 allude to, figuring out how 'ctypes' allocates bit-fields is not very clear. The documentation should be enhanced to flesh this out in more detail. As an example, Microsoft documents the VC++ implementation in a reasonably clear manner ( http://msdn.microsoft.com/en-us/library/ewwyfdbe(v=vs.71).aspx ). ---------- assignee: docs at python components: Documentation messages: 143369 nosy: docs at python, meadori, terry.reedy, vladris priority: normal severity: normal stage: needs patch status: open title: ctypes: clearly document how structure bit fields are allocated type: feature request versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 2 05:50:52 2011 From: report at bugs.python.org (Meador Inge) Date: Fri, 02 Sep 2011 03:50:52 +0000 Subject: [New-bugs-announce] [issue12881] ctypes: segfault with large structure field names Message-ID: <1314935452.01.0.397268917791.issue12881@psf.upfronthosting.co.za> New submission from Meador Inge : Reproduced on Fedora 15 with tip Python: [meadori at motherbrain cpython]$ ./python Python 3.3.0a0 (default:3102951cc1ce+, Sep 1 2011, 22:19:06) [GCC 4.6.0 20110603 (Red Hat 4.6.0-10)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes [68588 refs] >>> class S(ctypes.Structure): ... _fields_ = [('x' * 10000000, ctypes.c_int)] ... Segmentation fault (core dumped) ---------- components: ctypes messages: 143376 nosy: amaury.forgeotdarc, belopolsky, meadori priority: normal severity: normal stage: needs patch status: open title: ctypes: segfault with large structure field names type: crash versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 2 07:17:11 2011 From: report at bugs.python.org (Abhijit Bhattacharjee) Date: Fri, 02 Sep 2011 05:17:11 +0000 Subject: [New-bugs-announce] [issue12882] mmap crash on Windows Message-ID: <1314940631.31.0.750108382526.issue12882@psf.upfronthosting.co.za> New submission from Abhijit Bhattacharjee : The following Code causes Python to crash import os import mmap data = mmap.mmap(open(,"r+").fileno(),os.path.getsize()) assuming is present in the current working directory ---------- components: Interpreter Core, Windows messages: 143378 nosy: itabhijitb priority: normal severity: normal status: open title: mmap crash on Windows type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 2 12:04:02 2011 From: report at bugs.python.org (Michael Sulyaev) Date: Fri, 02 Sep 2011 10:04:02 +0000 Subject: [New-bugs-announce] [issue12883] xml.sax.xmlreader.AttributesImpl allows empty string as attribute names Message-ID: <1314957842.78.0.391568748992.issue12883@psf.upfronthosting.co.za> New submission from Michael Sulyaev : I can get not-well-formed XML output (attribute name must not be empty string): AttributeImpl must ignore dict entries that may not be cast to valid XML attributes. Code: #!/usr/bin/python from xml.sax.xmlreader import AttributesImpl as Attrs from xml.sax.saxutils import XMLGenerator as Gen g = Gen() a = Attrs(dict([('k1','v1'),('','v_for_empty_name')])) g.startDocument() g.startElement('root',a) g.endElement('root') g.endDocument() print ---------- components: XML messages: 143391 nosy: Michael.Sulyaev priority: normal severity: normal status: open title: xml.sax.xmlreader.AttributesImpl allows empty string as attribute names type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 2 15:40:40 2011 From: report at bugs.python.org (VUIUI) Date: Fri, 02 Sep 2011 13:40:40 +0000 Subject: [New-bugs-announce] [issue12884] Re Message-ID: <1314970840.62.0.309443881007.issue12884@psf.upfronthosting.co.za> Changes by VUIUI : ---------- files: unnamed nosy: VUIUI priority: normal severity: normal status: open title: Re Added file: http://bugs.python.org/file23087/unnamed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 2 15:57:23 2011 From: report at bugs.python.org (Alexander Dutton) Date: Fri, 02 Sep 2011 13:57:23 +0000 Subject: [New-bugs-announce] [issue12885] distutils.filelist.findall() fails on broken symlink in Py2.x Message-ID: <1314971843.03.0.797964996491.issue12885@psf.upfronthosting.co.za> New submission from Alexander Dutton : If there are any broken symlinks in the same directory as a setup.py when e.g. sdist is run, findall() will fall over when attempting to os.stat() the symlink: Traceback (most recent call last): File "setup.py", line 81, in run _sdist.run(self) File "/usr/lib/python2.6/distutils/command/sdist.py", line 144, in run self.get_file_list() File "/usr/lib/python2.6/distutils/command/sdist.py", line 238, in get_file_list self.filelist.findall() File "/usr/lib/python2.6/distutils/filelist.py", line 47, in findall self.allfiles = findall(dir) File "/usr/lib/python2.6/distutils/filelist.py", line 297, in findall stat = os.stat(fullname) OSError: [Errno 2] No such file or directory: 'debian/tmp/usr/share/somepath/somesymlink' Solutions would include replacing the call to os.stat() with one to os.lstat() (probably backwards-incompatible), or trying one and then the other. This bug is present in Pythons 2.6.6 (Debian 6.0.2) and 2.7 (Fedora 14). When attempting to reproduce in Python 3.1.2 (on Fedora) no error was encountered. However, looking at distutils/filelist.py, the same unadulterated call to os.stat() is present. I'll presume that for whatever reason distutils in Py3.1.2 never has cause to stat my broken symlink. ---------- assignee: tarek components: Distutils messages: 143399 nosy: Alexander.Dutton, eric.araujo, tarek priority: normal severity: normal status: open title: distutils.filelist.findall() fails on broken symlink in Py2.x type: behavior versions: Python 2.6, Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 2 16:33:27 2011 From: report at bugs.python.org (=?utf-8?q?Hei=C3=B0ar_Rafn_Har=C3=B0arson?=) Date: Fri, 02 Sep 2011 14:33:27 +0000 Subject: [New-bugs-announce] [issue12886] datetime.strptime parses input wrong Message-ID: <1314974007.55.0.285568781981.issue12886@psf.upfronthosting.co.za> New submission from Hei?ar Rafn Har?arson : When using datetime.strptime or time.strptime to parse string representing timestamp with the format string '%Y%m%dT%H%M%S' then a strange behavior happens when the input string does not contain the seconds: the minute part is split and first digit used as minutes and second digit as seconds ! According to documentation %M shall contain Minute as a decimal number [00,59] and %S shall contain Second as a decimal number [00,61] Here are few examples to show this: ------------------ Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> datetime.datetime.strptime('20110817T1234','%Y%m%dT%H%M%S') datetime.datetime(2011, 8, 17, 12, 3, 4) =>ERROR no seconds in input string: minute=3, second=4 =>I would expect exception ValueError or datetime.datetime(2011, 8, 17, 12, 34, 00) >>> datetime.datetime.strptime('20110817T123456','%Y%m%dT%H%M%S') datetime.datetime(2011, 8, 17, 12, 34, 56) =>CORRECT >>> datetime.datetime.strptime('20110817T123456','%Y%m%dT%H%M') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.6/_strptime.py", line 328, in _strptime data_string[found.end():]) ValueError: unconverted data remains: 56 =>CORRECT >>> datetime.datetime.strptime('20110817T1234','%Y%m%dT%H%M') datetime.datetime(2011, 8, 17, 12, 34) => CORRECT ------------------ I have tested this with python 2.6 and 2.7 This also happens on when playing with %H%M format string and omit minutes from the input. ---------- components: Library (Lib) messages: 143400 nosy: heidar.rafn priority: normal severity: normal status: open title: datetime.strptime parses input wrong type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 2 20:13:00 2011 From: report at bugs.python.org (Sandro Tosi) Date: Fri, 02 Sep 2011 18:13:00 +0000 Subject: [New-bugs-announce] [issue12887] Documenting all SO_* constants in socket module Message-ID: <1314987180.49.0.607596056761.issue12887@psf.upfronthosting.co.za> New submission from Sandro Tosi : spinning off msg142613 - it would be interesting to have in the socket module documentation also an explanation of all the several SO_ flags available; even a compact table could be ok; or even a link to a remote reference for them. ---------- assignee: docs at python components: Documentation messages: 143428 nosy: docs at python, eric.araujo, ezio.melotti, sandro.tosi priority: normal severity: normal stage: needs patch status: open title: Documenting all SO_* constants in socket module versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 2 23:08:40 2011 From: report at bugs.python.org (Yves Dorfsman) Date: Fri, 02 Sep 2011 21:08:40 +0000 Subject: [New-bugs-announce] [issue12888] html.parser.HTMLParser.unescape works only with the first 128 entities Message-ID: <1314997720.87.0.621504034674.issue12888@psf.upfronthosting.co.za> New submission from Yves Dorfsman : html.parser.HTMLParser.unescape works only with the first 128 entities, it leaves the other ones as they are. ---------- components: None messages: 143434 nosy: yves at zioup.com priority: normal severity: normal status: open title: html.parser.HTMLParser.unescape works only with the first 128 entities versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 3 01:07:33 2011 From: report at bugs.python.org (=?utf-8?q?Dr=2E_Georg_Str=C3=B6hlein?=) Date: Fri, 02 Sep 2011 23:07:33 +0000 Subject: [New-bugs-announce] [issue12889] struct.pack('d'... problem Message-ID: <1315004853.67.0.138940038832.issue12889@psf.upfronthosting.co.za> New submission from Dr. Georg Str?hlein : Hi all, I think there is a long-standing bug (it has made it into books on Google...) in the struct.pack() function, at least if the 'd' format string is selected. On both Win and Ubuntu the string returned for pack('!d',1.2345) is '?\xf3\xc0\x83\x12n\x97\x8d', whereas the correct 8 (!!) bytes are 3F F3 C0 83 12 6E 97 8D. Link to a published VBA UDF for Excel is in the file; that UDF reproduces the examples given in wikipedia on the IEEE 754 / DP pages correctly. Regards, Schorsch ---------- files: python-error.txt messages: 143443 nosy: SchorschMCMLX priority: normal severity: normal status: open title: struct.pack('d'... problem type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file23090/python-error.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 3 04:22:01 2011 From: report at bugs.python.org (Jeff McNeil) Date: Sat, 03 Sep 2011 02:22:01 +0000 Subject: [New-bugs-announce] [issue12890] cgitb displays

tags when executed in text mode Message-ID: <1315016521.13.0.175763253408.issue12890@psf.upfronthosting.co.za> New submission from Jeff McNeil : If cgitb.enable is ran with a logdir set and a format='text' argument, then a trailing message is printed that includes

tags. This should only happen if the format requested is HTML. The following tiny script shows the problem: import cgitb cgitb.enable(format='text', logdir='/tmp') 1/0 Attaching a small patch which addresses. This is against tip on the default branch. mcjeff at macbook:~/cpython$ ./python.exe --version Python 3.3.0a0 ---------- components: Library (Lib) files: head-cgitb-display.patch keywords: patch messages: 143449 nosy: mcjeff priority: normal severity: normal status: open title: cgitb displays

tags when executed in text mode versions: Python 3.3 Added file: http://bugs.python.org/file23091/head-cgitb-display.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 3 17:07:47 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 03 Sep 2011 15:07:47 +0000 Subject: [New-bugs-announce] [issue12891] Clean up traces of manifest template in packaging Message-ID: <1315062467.17.0.194525671954.issue12891@psf.upfronthosting.co.za> New submission from ?ric Araujo : With distutils2/packaging, extra files to be included in sdists are defined in setup.cfg, no more in a manifest template. However, the Manifest class and the sdist command still have code to deal with manifest templates. I propose to remove it. ---------- assignee: tarek components: Distutils2 messages: 143462 nosy: alexis, eric.araujo, tarek priority: normal severity: normal stage: needs patch status: open title: Clean up traces of manifest template in packaging versions: 3rd party, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 4 12:49:30 2011 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 04 Sep 2011 10:49:30 +0000 Subject: [New-bugs-announce] [issue12892] UTF-16 and UTF-32 codecs should reject (lone) surrogates Message-ID: <1315133370.95.0.855318807974.issue12892@psf.upfronthosting.co.za> New submission from Ezio Melotti : >From Chapter 03 of the Unicode Standard 6[0], D91: """ ? UTF-16 encoding form: The Unicode encoding form that assigns each Unicode scalar value in the ranges U+0000..U+D7FF and U+E000..U+FFFF to a single unsigned 16-bit code unit with the same numeric value as the Unicode scalar value, and that assigns each Unicode scalar value in the range U+10000..U+10FFFF to a surrogate pair, according to Table 3-5. ? Because surrogate code points are not Unicode scalar values, isolated UTF-16 code units in the range 0xD800..0xDFFF are ill-formed. """ I.e. UTF-16 should be able to decode correctly a valid surrogate pair, and encode a non-BMP character using a valid surrogate pair, but it should reject lone surrogates both during encoding and decoding. On Python 3, the utf-16 codec can encode all the codepoints from U+0000 to U+10FFFF (including (lone) surrogates), but it's not able to decode lone surrogates (not sure if this is by design or if it just fails because it expects another (missing) surrogate). ---------------------------------------------- >From Chapter 03 of the Unicode Standard 6[0], D90: """ ? UTF-32 encoding form: The Unicode encoding form that assigns each Unicode scalar value to a single unsigned 32-bit code unit with the same numeric value as the Unicode scalar value. ? Because surrogate code points are not included in the set of Unicode scalar values, UTF-32 code units in the range 0x0000D800..0x0000DFFF are ill-formed. """ I.e. UTF-32 should reject both lone surrogates and valid surrogate pairs, both during encoding and during decoding. On Python 3, the utf-32 codec can encode and decode all the codepoints from U+0000 to U+10FFFF (including surrogates). ---------------------------------------------- I think that: * this should be fixed in 3.3; * it's a bug, so the fix /might/ be backported to 3.2. Hoverver it's also a fairly big change in behavior, so it might be better to leave it for 3.3 only; * it's better to leave 2.7 alone, even the utf-8 codec is broken there; * the surrogatepass error handler should work with the utf-16 and utf-32 codecs too. Note that this has been already reported in #3672, but eventually only the utf-8 codec was fixed. [0]: http://www.unicode.org/versions/Unicode6.0.0/ch03.pdf ---------- assignee: ezio.melotti components: Unicode messages: 143490 nosy: ezio.melotti, gvanrossum, haypo, lemburg, loewis, tchrist priority: high severity: normal stage: test needed status: open title: UTF-16 and UTF-32 codecs should reject (lone) surrogates type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 5 03:15:57 2011 From: report at bugs.python.org (Christian S. Perone) Date: Mon, 05 Sep 2011 01:15:57 +0000 Subject: [New-bugs-announce] [issue12894] pydoc help("modules keyword") is failing when a module throws an exception at the import time Message-ID: <1315185357.98.0.244247068278.issue12894@psf.upfronthosting.co.za> New submission from Christian S. Perone : Pydoc is failing when running the ModuleScanner().run() when you execute: help("modules keyword") ... if some module throws an exception at the import time. See this example: >>> help("modules convolve") Here is a list of matching modules. Enter any module name to get more help. numpy.numarray.convolve scipy.fftpack.convolve Traceback (most recent call last): File "", line 1, in File "C:\Python27\lib\site.py", line 467, in __call__ return pydoc.help(*args, **kwds) File "C:\Python27\lib\pydoc.py", line 1727, in __call__ self.help(request) File "C:\Python27\lib\pydoc.py", line 1768, in help self.listmodules(split(request)[1]) File "C:\Python27\lib\pydoc.py", line 1873, in listmodules apropos(key) File "C:\Python27\lib\pydoc.py", line 1975, in apropos ModuleScanner().run(callback, key) File "C:\Python27\lib\pydoc.py", line 1938, in run for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror): File "C:\Python27\lib\pkgutil.py", line 125, in walk_packages for item in walk_packages(path, name+'.', onerror): File "C:\Python27\lib\pkgutil.py", line 125, in walk_packages for item in walk_packages(path, name+'.', onerror): File "C:\Python27\lib\pkgutil.py", line 125, in walk_packages for item in walk_packages(path, name+'.', onerror): File "C:\Python27\lib\pkgutil.py", line 125, in walk_packages for item in walk_packages(path, name+'.', onerror): File "C:\Python27\lib\pkgutil.py", line 110, in walk_packages __import__(name) File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\lib\pubsub\core\arg1\__init__.py", line 16, in raise RuntimeError(msg) RuntimeError: Should not import this directly, used by pubsub.core if applicable After suppressing the exception by changing the "apropos()" method inside the pydoc.py: Line: ModuleScanner().run(callback, key) To: ModuleScanner().run(callback, key, onerror=lambda error: error) The problem is fixed, but I really don't know if this is the best way to suppress this and if we should suppress these exceptions, I think that as the intent of the help("modules keyword") is to find things with the keyword in the name, we shouldn't let the exception be propagated to the user. ---------- components: Library (Lib) messages: 143502 nosy: Christian.S..Perone priority: normal severity: normal status: open title: pydoc help("modules keyword") is failing when a module throws an exception at the import time type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 5 03:24:03 2011 From: report at bugs.python.org (Ram Rachum) Date: Mon, 05 Sep 2011 01:24:03 +0000 Subject: [New-bugs-announce] [issue12895] In MSI/EXE installer, allow installing Python modules in free path Message-ID: <1315185843.85.0.324851460345.issue12895@psf.upfronthosting.co.za> New submission from Ram Rachum : Currently, when you use an MSI installer (and possibly also EXE) for a Python module, it automatically detects the location of your various system's Python installations. This is very convenient. However, this can be a problem sometimes, if your Python installation doesn't conform to what's required by the installer. For example, if you want to install the module in a virtualenv: http://serverfault.com/questions/305008/installing-compiled-python-modules-on-windows-on-a-virtual-env The installer doesn't give you any option to manually enter a path of a Python installation, so you just can't install! The installer's automatic Python-finding mechanism should degrade gracefully; it should offer to automatically find your Python installation, but it should allow you to bypass it and type it in yourself. ---------- assignee: tarek components: Distutils2 messages: 143503 nosy: alexis, cool-RR, eric.araujo, tarek priority: normal severity: normal status: open title: In MSI/EXE installer, allow installing Python modules in free path versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 5 07:50:31 2011 From: report at bugs.python.org (Lennart Regebro) Date: Mon, 05 Sep 2011 05:50:31 +0000 Subject: [New-bugs-announce] [issue12896] Recommended location of the interpreter for Python 3 Message-ID: <1315201831.61.0.39811771821.issue12896@psf.upfronthosting.co.za> New submission from Lennart Regebro : The documentation on Using Python, 2.3. Python-related paths and files says that "exec_prefix/bin/python" is the recommended location for the interpreter, while for Python 3 it's "exec_prefix/bin/python3". http://docs.python.org/py3k/using/unix.html#python-related-paths-and-files ---------- assignee: docs at python components: Documentation messages: 143508 nosy: docs at python, lregebro priority: normal severity: normal status: open title: Recommended location of the interpreter for Python 3 versions: Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 5 14:01:45 2011 From: report at bugs.python.org (andrew cooke) Date: Mon, 05 Sep 2011 12:01:45 +0000 Subject: [New-bugs-announce] [issue12897] Support for iterators in multiprocessing map Message-ID: <1315224105.15.0.691135308397.issue12897@psf.upfronthosting.co.za> New submission from andrew cooke : http://stackoverflow.com/questions/7306522/combining-itertools-and-multiprocessing/7307078 suggests (and the idea itself seems reasonable) that it would sometimes be useful for multiprocessing to operate correctly (ie lazily) with lazy input (iterables). for example, if the input is large, or perhaps generated by some other process "on demand". obviously this complicates matters, given the asynchronous nature of a worker pool, and would mean re-allocating the results list as required. but in principle i suspect it would be possible and might be a useful extension. ---------- components: Library (Lib) messages: 143511 nosy: acooke priority: normal severity: normal status: open title: Support for iterators in multiprocessing map type: feature request versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 5 17:12:27 2011 From: report at bugs.python.org (Larry Hastings) Date: Mon, 05 Sep 2011 15:12:27 +0000 Subject: [New-bugs-announce] [issue12898] add opendir() for POSIX platforms Message-ID: <1315235547.8.0.461411196791.issue12898@psf.upfronthosting.co.za> New submission from Larry Hastings : With the recent spate of POSIX *at() functions added to os, we now have a bunch of places in the API that take directory fds. But afaict there's no way to get a directory fd in Python! The only calls to opendir() in the tree are internal, in os.listdir() and in the import machinery. (Though in practice most people will use AT_FDCWD anyway.) I propose adding a new function, os.opendir(), the implementation to be much the same as (aka a hacked-up copy and paste of) os.unlink() in Modules/posixmodule.c. I'd be happy to contribute the patch. ---------- components: Extension Modules messages: 143522 nosy: larry priority: normal severity: normal status: open title: add opendir() for POSIX platforms type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 5 17:40:40 2011 From: report at bugs.python.org (Larry Hastings) Date: Mon, 05 Sep 2011 15:40:40 +0000 Subject: [New-bugs-announce] [issue12899] Change os.utimensat() and os.futimens() to use float for atime & mtime Message-ID: <1315237240.05.0.971546244676.issue12899@psf.upfronthosting.co.za> New submission from Larry Hastings : The new functions os.futimens() and os.utimensat() update the timestamps of a file with nanosecond precision. However, both functions take atime and mtime as a tuple: (seconds since epoch, nanoseconds). Contrast this with os.utime(), which produces atime and mtime as a floating point number of seconds since epoch. Why the mismatch between the APIs? It simply forces the user to do the conversion themselves. You can see this in the regression tests for these two functions--there's a lot of multiplying by 1e9 going on. The only justification I can contrive is that the conversion of (secs+(1e-9*nsecs)) can be inaccurate; a double would need roughly one more byte of mantissa to be able to accurately preserve all possible nanosecond values. But that ship has sailed--os.utime() produces inaccurate results, and afaik there's no other way to do it in the Python library. os.futimens() and os.utimensat() should take atime and mtime in the floating-point format as produced by os.utime(). I'm happy to contribute the patch. ---------- components: Extension Modules messages: 143529 nosy: larry priority: normal severity: normal status: open title: Change os.utimensat() and os.futimens() to use float for atime & mtime type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 5 18:05:19 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 05 Sep 2011 16:05:19 +0000 Subject: [New-bugs-announce] [issue12900] Use universal newlines mode for setup.cfg Message-ID: <1315238719.19.0.16385104093.issue12900@psf.upfronthosting.co.za> New submission from ?ric Araujo : We need tests to make sure that setup.cfg files using CRLF or CR as newline character work. We could require that people use LF in the spec, but I don?t think it?s worth it, as it?s simple enough to support all newlines whereas Windows users can?t always use LF easily. For packaging in 3.3, opening the file in text mode gives us universal newlines for free, so the code is good but we need tests. For distutils2 in 2.x, we need to pass 'rU' as open flags. ---------- assignee: tarek components: Distutils2 keywords: easy messages: 143539 nosy: alexis, eric.araujo, tarek priority: normal severity: normal stage: needs patch status: open title: Use universal newlines mode for setup.cfg type: behavior versions: 3rd party, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 5 18:45:19 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 05 Sep 2011 16:45:19 +0000 Subject: [New-bugs-announce] [issue12901] Nest class/methods directives in documentation Message-ID: <1315241119.9.0.996780726209.issue12901@psf.upfronthosting.co.za> New submission from ?ric Araujo : I picked up a few files in Doc/library and updated their markup to use directives nesting. The attached patch is the result; it?s a lot of changes for small benefit. If we think it?s a good change anyway, I have two questions - Do you think it would be a good idea to have the -checkins emails ignore whitespace changes in some cases? (I?m thinking a magic string in the commit message) - A number of files have a class directive near the top of the file, in the list of all public names, and a later section ?XX objects? with the methods and attributes. When this is changed to nested class/methods directives, sometimes the first class directive gets a noindex flag, but I think it should jsut be removed: the index in the sidebar is enough to let people jump to the doc. Do you agree? ---------- assignee: docs at python components: Documentation messages: 143552 nosy: benjamin.peterson, docs at python, eric.araujo, georg.brandl priority: normal severity: normal status: open title: Nest class/methods directives in documentation versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 5 21:31:23 2011 From: report at bugs.python.org (dronus) Date: Mon, 05 Sep 2011 19:31:23 +0000 Subject: [New-bugs-announce] [issue12902] help("modules") executes module code Message-ID: <1315251083.43.0.259542197646.issue12902@psf.upfronthosting.co.za> New submission from dronus : When running help("modules"), some code of the modules seems to be run. For example, on my Gnome system KWallet configuration GUI pops up and stalls further opereation. I think no one expect help("modules") run abitrary code instead of just outputting a list of modules. ---------- components: None messages: 143556 nosy: dronus priority: normal severity: normal status: open title: help("modules") executes module code type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 5 21:51:54 2011 From: report at bugs.python.org (Remi Pointel) Date: Mon, 05 Sep 2011 19:51:54 +0000 Subject: [New-bugs-announce] [issue12903] test_io.test_interrupte[r]d* blocks on OpenBSD Message-ID: <1315252314.97.0.81854089556.issue12903@psf.upfronthosting.co.za> New submission from Remi Pointel : Hi, these tests block on OpenBSD: -test_interrupted_write_unbuffered() -test_interrupted_write_buffered() -test_interrupted_write_text() -test_interrupterd_read_retry_buffered() -test_interrupterd_read_retry_text() -test_interrupterd_write_retry_buffered() -test_interrupterd_write_retry_text() I have a patch which skip these tests, to have a full test_io.py regress tests but I think it's not the proper solution. Thanks for your help, Remi. ---------- files: patch-Lib_test_test_io_py messages: 143558 nosy: rpointel priority: normal severity: normal status: open title: test_io.test_interrupte[r]d* blocks on OpenBSD versions: Python 3.2 Added file: http://bugs.python.org/file23103/patch-Lib_test_test_io_py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 5 23:08:02 2011 From: report at bugs.python.org (Larry Hastings) Date: Mon, 05 Sep 2011 21:08:02 +0000 Subject: [New-bugs-announce] [issue12904] Change os.utime &c functions to use nanosecond precision where possible Message-ID: <1315256882.76.0.179568612134.issue12904@psf.upfronthosting.co.za> New submission from Larry Hastings : Since Linux 2.5 stat() has supported reading nanosecond resolution (1b/sec) for atime and mtime. However, the utime() family of functions could only write atime and mtime with microsecond resolution (1m/sec) until relatively recently. On POSIX platforms Python reads atime and mtime at nanosecond resolution but only writes them at microsecond resolution. This impedance mismatch can cause undesirable behavior. Consider the following code: import os import shutil import sys def mtime(path): return os.stat(path).st_mtime src = sys.argv[0] dest = src + ".new" shutil.copy2(src, dest) assert mtime(src) == mtime(dest) When run under Python on any modern Linux system, the assert fails. (I think any Python since 2.5 will do; I tested with 2.7.1 and a fresh 3.3 trunk.) The accompanying patch modifies Modules/posixmodule.c so all functions that write atime and mtime use nanosecond resolution when possible. With this patch applied, all the regression tests pass (except the ones for extension modules I didn't compile), and the above code runs to completion. Happy to hoist the patch up on Rietveld if there's interest. p.s. I have the commit bit set, so I'd like to be the one to check this in if we get that far. ---------- assignee: larry components: Extension Modules files: larry.utimensat.patch.r1 messages: 143563 nosy: larry priority: normal severity: normal status: open title: Change os.utime &c functions to use nanosecond precision where possible type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file23104/larry.utimensat.patch.r1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 5 23:33:33 2011 From: report at bugs.python.org (Remi Pointel) Date: Mon, 05 Sep 2011 21:33:33 +0000 Subject: [New-bugs-announce] [issue12905] multiple errors in test_socket on OpenBSD Message-ID: <1315258413.34.0.212082169153.issue12905@psf.upfronthosting.co.za> New submission from Remi Pointel : Hi, I have few problems in test_socket.py. 1) test_sendall_interrupted blocks on OpenBSD, I must Ctrl+c to interrupt the test. I added a skip to have full regress tests, but I think it's not the proper way. I have run it into gdb, and ctrl+c it: test_sendall_interrupted (__main__.GeneralModuleTests) ... [New process 20677] ^C Program received signal SIGINT, Interrupt. 0x0000000206d2378a in poll () from /usr/lib/libc.so.60.1 (gdb) bt #0 0x0000000206d2378a in poll () from /usr/lib/libc.so.60.1 #1 0x0000000205f4e4aa in _thread_kern_poll (wait_reqd=Variable "wait_reqd" is not available. ) at /usr/src/lib/libpthread/uthread/uthread_kern.c:780 #2 0x0000000205f4f3a8 in _thread_kern_sched (scp=0x0) at /usr/src/lib/libpthread/uthread/uthread_kern.c:382 #3 0x0000000205f43ade in sendto (fd=8, msg=0x2047bb040, len=1044480, flags=0, to=0x0, to_len=0) at /usr/src/lib/libpthread/uthread/uthread_sendto.c:63 #4 0x0000000210a5b243 in sock_sendall (s=0x20115c948, args=0x2011510d0) at /usr/ports/pobj/Python-3.2.2/Python-3.2.2/Modules/socketmodule.c:2699 #5 0x0000000000468992 in PyEval_EvalFrameEx (f=0x20a281c30, throwflag=Variable "throwflag" is not available. ) at Python/ceval.c:3921 #6 0x000000000046a95c in PyEval_EvalCodeEx (_co=0x20fc581b0, globals=Variable "globals" is not available. ) at Python/ceval.c:3350 #7 0x0000000000466df6 in PyEval_EvalFrameEx (f=0x20a9a3c30, throwflag=Variable "throwflag" is not available. ) at Python/ceval.c:4019 #8 0x0000000000468c1a in PyEval_EvalFrameEx (f=0x2033af030, throwflag=Variable "throwflag" is not available. ) at Python/ceval.c:4009 #9 0x000000000046a95c in PyEval_EvalCodeEx (_co=0x2028a9de8, globals=Variable "globals" is not available. ) at Python/ceval.c:3350 #10 0x0000000000466df6 in PyEval_EvalFrameEx (f=0x2052f1430, throwflag=Variable "throwflag" is not available. ) at Python/ceval.c:4019 #11 0x000000000046a95c in PyEval_EvalCodeEx (_co=0x2028a9f58, globals=Variable "globals" is not available. ) at Python/ceval.c:3350 #12 0x0000000000511ce3 in function_call (func=0x2050d5620, arg=0x20115d330, kw=0x2052f0030) at Objects/funcobject.c:629 #13 0x00000000004e4a7f in PyObject_Call (func=0x2050d5620, arg=0x20115d330, kw=0x2052f0030) at Objects/abstract.c:2149 #14 0x000000000046456d in PyEval_EvalFrameEx (f=0x2052f0e30, throwflag=Variable "throwflag" is not available. ) at Python/ceval.c:4236 #15 0x000000000046a95c in PyEval_EvalCodeEx (_co=0x2028ad268, globals=Variable "globals" is not available. ) at Python/ceval.c:3350 #16 0x0000000000511ce3 in function_call (func=0x2050d5790, arg=0x20115d240, kw=0x0) at Objects/funcobject.c:629 #17 0x00000000004e4a7f in PyObject_Call (func=0x2050d5790, arg=0x20115d240, kw=0x0) at Objects/abstract.c:2149 #18 0x00000000004ff349 in method_call (func=0x2050d5790, arg=0x20115a5a0, kw=0x0) at Objects/classobject.c:319 #19 0x00000000004e4a7f in PyObject_Call (func=0x20115d150, arg=0x20115a5a0, kw=0x0) at Objects/abstract.c:2149 #20 0x000000000042cb66 in slot_tp_call (self=Variable "self" is not available. ) at Objects/typeobject.c:5044 #21 0x00000000004e4a7f in PyObject_Call (func=0x20113b680, arg=0x20115a5a0, kw=0x0) at Objects/abstract.c:2149 #22 0x00000000004628fb in PyEval_EvalFrameEx (f=0x2071dc030, throwflag=Variable "throwflag" is not available. ) at Python/ceval.c:4141 #23 0x000000000046a95c in PyEval_EvalCodeEx (_co=0x2086db6b8, globals=Variable "globals" is not available. ) at Python/ceval.c:3350 #24 0x0000000000511ce3 in function_call (func=0x2086de1d0, arg=0x20115d1c8, kw=0x2071dd430) at Objects/funcobject.c:629 #25 0x00000000004e4a7f in PyObject_Call (func=0x2086de1d0, arg=0x20115d1c8, kw=0x2071dd430) at Objects/abstract.c:2149 #26 0x000000000046456d in PyEval_EvalFrameEx (f=0x2071dde30, throwflag=Variable "throwflag" is not available. ) at Python/ceval.c:4236 #27 0x000000000046a95c in PyEval_EvalCodeEx (_co=0x2086db490, globals=Variable "globals" is not available. ) at Python/ceval.c:3350 #28 0x0000000000511ce3 in function_call (func=0x2086de060, arg=0x20113f420, kw=0x0) at Objects/funcobject.c:629 #29 0x00000000004e4a7f in PyObject_Call (func=0x2086de060, arg=0x20113f420, kw=0x0) at Objects/abstract.c:2149 #30 0x00000000004ff349 in method_call (func=0x2086de060, arg=0x2011411b0, kw=0x0) at Objects/classobject.c:319 #31 0x00000000004e4a7f in PyObject_Call (func=0x20115d0d8, arg=0x2011411b0, kw=0x0) at Objects/abstract.c:2149 #32 0x000000000042cb66 in slot_tp_call (self=Variable "self" is not available. ) at Objects/typeobject.c:5044 #33 0x00000000004e4a7f in PyObject_Call (func=0x201138920, arg=0x2011411b0, kw=0x0) at Objects/abstract.c:2149 #34 0x00000000004628fb in PyEval_EvalFrameEx (f=0x2071dc430, throwflag=Variable "throwflag" is not available. ) at Python/ceval.c:4141 #35 0x000000000046a95c in PyEval_EvalCodeEx (_co=0x2086db6b8, globals=Variable "globals" is not available. ) at Python/ceval.c:3350 #36 0x0000000000511ce3 in function_call (func=0x2086de1d0, arg=0x20113c498, kw=0x2071dd830) at Objects/funcobject.c:629 #37 0x00000000004e4a7f in PyObject_Call (func=0x2086de1d0, arg=0x20113c498, kw=0x2071dd830) at Objects/abstract.c:2149 #38 0x000000000046456d in PyEval_EvalFrameEx (f=0x2071dda30, throwflag=Variable "throwflag" is not available. ) at Python/ceval.c:4236 #39 0x000000000046a95c in PyEval_EvalCodeEx (_co=0x2086db490, globals=Variable "globals" is not available. ) at Python/ceval.c:3350 #40 0x0000000000511ce3 in function_call (func=0x2086de060, arg=0x201127ee8, kw=0x0) at Objects/funcobject.c:629 #41 0x00000000004e4a7f in PyObject_Call (func=0x2086de060, arg=0x201127ee8, kw=0x0) at Objects/abstract.c:2149 #42 0x00000000004ff349 in method_call (func=0x2086de060, arg=0x20113e920, kw=0x0) at Objects/classobject.c:319 #43 0x00000000004e4a7f in PyObject_Call (func=0x208ba78d0, arg=0x20113e920, kw=0x0) at Objects/abstract.c:2149 #44 0x000000000042cb66 in slot_tp_call (self=Variable "self" is not available. ) at Objects/typeobject.c:5044 #45 0x00000000004e4a7f in PyObject_Call (func=0x201138370, arg=0x20113e920, kw=0x0) at Objects/abstract.c:2149 #46 0x00000000004628fb in PyEval_EvalFrameEx (f=0x20de7d830, throwflag=Variable "throwflag" is not available. ) at Python/ceval.c:4141 #47 0x0000000000468c1a in PyEval_EvalFrameEx (f=0x20de7f830, throwflag=Variable "throwflag" is not available. ) at Python/ceval.c:4009 #48 0x0000000000468c1a in PyEval_EvalFrameEx (f=0x20e626830, throwflag=Variable "throwflag" is not available. ) at Python/ceval.c:4009 #49 0x000000000046a95c in PyEval_EvalCodeEx (_co=0x20189b040, globals=Variable "globals" is not available. ) at Python/ceval.c:3350 #50 0x0000000000511ce3 in function_call (func=0x20449fb28, arg=0x2071d9a30, kw=0x0) at Objects/funcobject.c:629 #51 0x00000000004e4a7f in PyObject_Call (func=0x20449fb28, arg=0x2071d9a30, kw=0x0) at Objects/abstract.c:2149 #52 0x000000000046456d in PyEval_EvalFrameEx (f=0x200eb9830, throwflag=Variable "throwflag" is not available. ) at Python/ceval.c:4236 #53 0x0000000000468c1a in PyEval_EvalFrameEx (f=0x209c2d830, throwflag=Variable "throwflag" is not available. ) at Python/ceval.c:4009 #54 0x000000000046a95c in PyEval_EvalCodeEx (_co=0x20fc856b8, globals=Variable "globals" is not available. ) at Python/ceval.c:3350 #55 0x000000000046ab2b in PyEval_EvalCode (co=Variable "co" is not available. ) at Python/ceval.c:767 #56 0x000000000048ade7 in run_mod (mod=Variable "mod" is not available. ) at Python/pythonrun.c:1783 #57 0x000000000048aeee in PyRun_FileExFlags (fp=0x2071bb8e0, filename=0x205619690 "Lib/test/test_socket.py.orig", start=257, globals=0x205a01e30, locals=0x205a01e30, closeit=1, flags=0x7f7ffffbe5e0) at Python/pythonrun.c:1740 #58 0x000000000048da19 in PyRun_SimpleFileExFlags (fp=0x2071bb8e0, filename=0x205619690 "Lib/test/test_socket.py.orig", closeit=1, flags=0x7f7ffffbe5e0) at Python/pythonrun.c:1265 #59 0x000000000049fe00 in Py_Main (argc=Variable "argc" is not available. ) at Modules/main.c:297 #60 0x0000000000414eaa in main (argc=2, argv=0x7f7ffffbe6a0) at ./Modules/python.c:59 2) test_sendall_interrupted_with_timeout has an error: ====================================================================== ERROR: test_sendall_interrupted_with_timeout (__main__.GeneralModuleTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_socket.py", line 753, in test_sendall_interrupted_with_timeout self.check_sendall_interrupted(True) File "Lib/test/test_socket.py", line 742, in check_sendall_interrupted self.assertRaises(socket.timeout, c.sendall, b"x" * (1024**2)) File "/usr/ports/pobj/Python-3.2.2/Python-3.2.2/Lib/unittest/case.py", line 557, in assertRaises callableObj(*args, **kwargs) socket.error: [Errno 0] Error ====================================================================== 3) testInterruptedTimeout failed: ====================================================================== FAIL: testInterruptedTimeout (__main__.TCPTimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_socket.py", line 1707, in testInterruptedTimeout foo = self.serv.accept() socket.timeout: timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "Lib/test/test_socket.py", line 1707, in testInterruptedTimeout foo = self.serv.accept() Alarm During handling of the above exception, another exception occurred: Traceback (most recent call last): File "Lib/test/test_socket.py", line 1721, in testInterruptedTimeout self.fail("got Alarm in wrong place") AssertionError: got Alarm in wrong place ====================================================================== Thanks a lot, Remi. ---------- messages: 143564 nosy: rpointel priority: normal severity: normal status: open title: multiple errors in test_socket on OpenBSD versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 05:33:20 2011 From: report at bugs.python.org (Derrick Petzold) Date: Tue, 06 Sep 2011 03:33:20 +0000 Subject: [New-bugs-announce] [issue12906] Slight error in logging module's yaml config Message-ID: <1315280000.72.0.273608973729.issue12906@psf.upfronthosting.co.za> New submission from Derrick Petzold : Hello, format: format=%(asctime)s - %(name)s - %(levelname)s - %(message)s Should be: format: %(asctime)s - %(name)s - %(levelname)s - %(message)s Regards, btw I have to say the logging module is just excellent. What a truly great work. ty. ---------- assignee: docs at python components: Documentation messages: 143579 nosy: Derrick.Petzold, docs at python priority: normal severity: normal status: open title: Slight error in logging module's yaml config versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 06:46:53 2011 From: report at bugs.python.org (Brett Cannon) Date: Tue, 06 Sep 2011 04:46:53 +0000 Subject: [New-bugs-announce] [issue12907] Update test coverage devguide page Message-ID: <1315284413.51.0.757189280849.issue12907@psf.upfronthosting.co.za> New submission from Brett Cannon : The devguide needs to be updated with new coverage.py instructions. It seems that the script in issue11561 has been integrated into coverage.py's own repo, which means we now have a way to get much more complete coverage of the stdlib. But it also means that users need to build the tracer extension in coverage.py. That might require a little extra hand-holding as compiling from a checkout can mean needing to unset CPPFLAGS in order to not pick up the system Python's header files. ---------- assignee: brett.cannon components: Devguide keywords: easy messages: 143581 nosy: brett.cannon priority: high severity: normal stage: needs patch status: open title: Update test coverage devguide page versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 06:51:03 2011 From: report at bugs.python.org (Brett Cannon) Date: Tue, 06 Sep 2011 04:51:03 +0000 Subject: [New-bugs-announce] [issue12908] Update dev-in-a-box for new coverage steps Message-ID: <1315284663.33.0.542797190768.issue12908@psf.upfronthosting.co.za> New submission from Brett Cannon : Once the devguide has been updated, dev-in-a-box needs to be tweaked to follow the new instructions on how to generate a coverage report. ---------- assignee: brett.cannon components: None messages: 143583 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: Update dev-in-a-box for new coverage steps versions: 3rd party _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 09:40:18 2011 From: report at bugs.python.org (Nadeem Vawda) Date: Tue, 06 Sep 2011 07:40:18 +0000 Subject: [New-bugs-announce] [issue12909] Inconsistent exception usage in PyLong_As* C functions Message-ID: <1315294818.19.0.176172892985.issue12909@psf.upfronthosting.co.za> New submission from Nadeem Vawda : The C functions for converting a Python 'int' object to a C integer are inconsistent about what exception gets raised when the object passed to them is not an integer. Most of these functions raise a TypeError, but PyLong_AsUnsignedLongLong() and PyLong_AsDouble() raise a SystemError instead. Raising a SystemError here is quite unhelpful. My understanding is that it is intended to indicate internal programming errors, so an extension module should not raise one when (for example) a function is passed an argument of the incorrect type. In such a case, raising a TypeError is a reasonable default. Is there any reason not to change the behaviour of these two functions to be consistent with their siblings? ---------- components: Interpreter Core messages: 143588 nosy: nadeem.vawda, pitrou priority: normal severity: normal stage: needs patch status: open title: Inconsistent exception usage in PyLong_As* C functions type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 12:26:38 2011 From: report at bugs.python.org (=?utf-8?q?J=C3=B6rn_Hees?=) Date: Tue, 06 Sep 2011 10:26:38 +0000 Subject: [New-bugs-announce] [issue12910] urrlib.quote quotes too many chars, e.g., '()' Message-ID: <1315304798.98.0.174203108938.issue12910@psf.upfronthosting.co.za> New submission from J?rn Hees : urllib.quote('()') returns '%28%29' Looking into its code it tries to follow RFC 2396 (which is good even though it should follow rfc3986 nowadays), but it doesn't: http://tools.ietf.org/html/rfc2396 (see Appendix A, p.27): "(" and ")" are in mark and therefore unreserved, so why are they quoted? ---------- components: Library (Lib) messages: 143592 nosy: joern priority: normal severity: normal status: open title: urrlib.quote quotes too many chars, e.g., '()' type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 14:20:09 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 06 Sep 2011 12:20:09 +0000 Subject: [New-bugs-announce] [issue12911] Expose a private accumulator C API Message-ID: <1315311609.99.0.705451675521.issue12911@psf.upfronthosting.co.za> New submission from Antoine Pitrou : In 47176e8d7060, I fixed json to not blow memory when serializing a large container of small objects. It turns out that the repr() of tuple objects (and, very likely, list objects and possibly other containers) has the same problem. For example, Martin's 256GB machine can't serialize a two billion-element tuple: http://www.python.org/dev/buildbot/all/builders/AMD64%20debian%20parallel%20custom/builds/6/steps/test/logs/stdio So I propose to expose a private C API for the "accumulator" pattern introduced in 47176e8d7060 (with, e.g., the _PyAccumulator prefix), and to use that API from relevant code. ---------- components: Interpreter Core messages: 143598 nosy: mark.dickinson, pitrou, rhettinger priority: normal severity: normal status: open title: Expose a private accumulator C API type: resource usage versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 15:41:45 2011 From: report at bugs.python.org (Rob Crittenden) Date: Tue, 06 Sep 2011 13:41:45 +0000 Subject: [New-bugs-announce] [issue12912] xmlrpclib.__version__ not bumped with updates Message-ID: <1315316505.08.0.403062949645.issue12912@psf.upfronthosting.co.za> New submission from Rob Crittenden : xmlrpclib.__version__ reports 1.0.1 from Python 2.7 in Fedora 14 and Python 2.6 in Fedora 12. I discovered this while trying to find a way to identify the version of xmlrpclib. The 2.7 xmlrpclib is not completely backward compatible with that in 2.6 Version-Release number of selected component (if applicable): python-2.7-7.fc14.x86_64 Steps to Reproduce: $ rpm -q python python-2.6.2-8.fc12.x86_64 $ python Python 2.6.2 (r262:71600, Jun 4 2010, 18:28:58) [GCC 4.4.3 20100127 (Red Hat 4.4.3-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import xmlrpclib >>> xmlrpclib.__version__ '1.0.1' $ rpm -q python python-2.7-7.fc14.x86_64 $ python Python 2.7 (r27:82500, Jul 26 2010, 18:19:48) [GCC 4.5.0 20100716 (Red Hat 4.5.0-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import xmlrpclib >>> xmlrpclib.__version__ '1.0.1' ---------- components: Library (Lib) messages: 143604 nosy: rcritten priority: normal severity: normal status: open title: xmlrpclib.__version__ not bumped with updates versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 17:31:28 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 06 Sep 2011 15:31:28 +0000 Subject: [New-bugs-announce] [issue12913] Add a debugging howto Message-ID: <1315323088.65.0.459623812563.issue12913@psf.upfronthosting.co.za> New submission from ?ric Araujo : I found a few blogs posts that explained how to use pdb. It appears from the comments that such introductory material is very useful to a lot of users. Instead of just expanding the pdb module docs, I propose to add a debugging howto covering basic troubleshooting techniques and giving a pdb tutorial. I think a howto has more visibility, as people unaware of the existence of a thing named pdb may however look for ?debugging?. To educate myself on pdb, I have started writing a document. Before investing too much time, I?d like to know if people agree with the principle of adding such a howto. ---------- assignee: eric.araujo components: Documentation messages: 143615 nosy: eric.araujo priority: normal severity: normal status: open title: Add a debugging howto versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 18:28:08 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 06 Sep 2011 16:28:08 +0000 Subject: [New-bugs-announce] [issue12914] Add cram function to textwrap Message-ID: <1315326488.16.0.0777914338919.issue12914@psf.upfronthosting.co.za> New submission from ?ric Araujo : The pydoc module has a cram function that could be useful to Python authors, if we made it public (textwrap sounds like a great place). ---------- components: Library (Lib) messages: 143625 nosy: eric.araujo priority: normal severity: normal status: open title: Add cram function to textwrap type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 18:30:33 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 06 Sep 2011 16:30:33 +0000 Subject: [New-bugs-announce] [issue12915] Add inspect.locate and inspect.resolve Message-ID: <1315326633.9.0.910127000285.issue12915@psf.upfronthosting.co.za> New submission from ?ric Araujo : The need to resolve a dotted name to a Python object is spreading in the stdlib: pydoc has locate and resolve, packaging has util.resolve_name, unittest has something else, etc. For the benefit of stdlib maintainers as well as the community, I think such functionality should be exposed publicly by the inspect module. ---------- components: Library (Lib) messages: 143626 nosy: eric.araujo priority: normal severity: normal status: open title: Add inspect.locate and inspect.resolve type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 18:32:27 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 06 Sep 2011 16:32:27 +0000 Subject: [New-bugs-announce] [issue12916] Add inspect.splitdoc Message-ID: <1315326747.38.0.43030903994.issue12916@psf.upfronthosting.co.za> New submission from ?ric Araujo : splitdoc is a hidden gem in pydoc: it?s a little helper to implement docstring splitting as documented in the docstrings PEPs. It is not a one-liner, so I think there is value in making it public in the inspect module. ---------- components: Library (Lib) messages: 143627 nosy: eric.araujo priority: normal severity: normal status: open title: Add inspect.splitdoc type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 18:34:28 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 06 Sep 2011 16:34:28 +0000 Subject: [New-bugs-announce] [issue12917] Make visiblename and allmethods functions public Message-ID: <1315326868.85.0.0340726084847.issue12917@psf.upfronthosting.co.za> New submission from ?ric Araujo : pydoc contains these two functions that could be used by third-party code to implement a custom dir function, write a documentation tool or other uses: visiblename and allmethods. We could make them public, in pydoc or inspect. ---------- components: Library (Lib) messages: 143628 nosy: eric.araujo priority: normal severity: normal status: open title: Make visiblename and allmethods functions public type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 18:37:28 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 06 Sep 2011 16:37:28 +0000 Subject: [New-bugs-announce] [issue12918] New module for terminal utilities Message-ID: <1315327048.11.0.179720377155.issue12918@psf.upfronthosting.co.za> New submission from ?ric Araujo : It was suggested in #7798 to make the pager functions from pydoc public. I can?t find a good place to put them, so I think we could add a new module with terminal-related utilities. It could contain the pager functions, progress bars (there are many implementations to be compared), ANSI and Windows color codes (reimplemented over and over again), etc. This may require a run through python-ideas and/or -dev, but I?m opening a bug for the record. ---------- components: Library (Lib) messages: 143629 nosy: eric.araujo priority: normal severity: normal status: open title: New module for terminal utilities type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 19:53:36 2011 From: report at bugs.python.org (Brett Cannon) Date: Tue, 06 Sep 2011 17:53:36 +0000 Subject: [New-bugs-announce] [issue12919] Control what module is imported first Message-ID: <1315331616.23.0.265275073086.issue12919@psf.upfronthosting.co.za> New submission from Brett Cannon : Issue11561 had a use case for controlling what module is imported first (along with a patch to use a module other than 'os' to control finding the stdlib). There have been others who could use this feature as well. ---------- components: Interpreter Core messages: 143636 nosy: brett.cannon priority: low severity: normal stage: needs patch status: open title: Control what module is imported first type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 20:37:58 2011 From: report at bugs.python.org (Popa Claudiu) Date: Tue, 06 Sep 2011 18:37:58 +0000 Subject: [New-bugs-announce] [issue12920] Inspect.getsource fails to get source of local classes Message-ID: <1315334278.72.0.69534403863.issue12920@psf.upfronthosting.co.za> New submission from Popa Claudiu : inspect.getsource called with a class defined in the same file fails with TypeError: is a built-in class, although the documentation says that: "The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a single string." I think that should be specified in documentation that this function works only for objects living in a module. ---------- assignee: docs at python components: Documentation messages: 143645 nosy: Popa.Claudiu, docs at python priority: normal severity: normal status: open title: Inspect.getsource fails to get source of local classes type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 20:41:54 2011 From: report at bugs.python.org (Paul Upchurch) Date: Tue, 06 Sep 2011 18:41:54 +0000 Subject: [New-bugs-announce] [issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline Message-ID: <1315334514.02.0.137561826697.issue12921@psf.upfronthosting.co.za> New submission from Paul Upchurch : Calling http.server.BaseHTTPRequestHandler.send_error(code,message) with a message that contains a trailing newline does not display properly in Firefox, Chrome. Listing 1 #!/usr/bin/env python3.2 import http.server import traceback class httphandler(http.server.BaseHTTPRequestHandler): def do_GET(self): try: assert(False) except: self.send_error(500,traceback.format_exc()) if __name__=='__main__': addr=('',9000) http.server.HTTPServer(addr,httphandler).serve_forever() Consider Listing 1. A typical programming idiom would be to wrap do_GET with a try/except block that reports an HTTP error with an HTML formatted stack trace. However, when I view this with Firefox and Chrome the error message is unformatted, i.e. raw HTML is displayed. A simple workaround is to call strip() on the message. This could be suggested to the user in the docs, or added as an automatic preprocessing feature to the library. With strip(), the message is formatted. Adding or documenting strip() resolves the bug. The remainder of this report is a feature request. The default error_message_format is probably not what people want for a stack trace. It leaves formatting of whitespace to the HTML which removes the newlines. This is desirable for short, unformatted messages but undesirable for a preformatted traceback. In Listing 2 I give a working solution and suggest including it in the library if the community feels that preformatted messages are common enough to warrant extra attention. I feel it is since "try/except: print traceback" is almost mandatory for error prone internet operations. Listing 2 #!/usr/bin/env python3.2 import http.server import traceback class httphandler(http.server.BaseHTTPRequestHandler): def content_aware_error_message_format(self,m): oldfmt='

Message: %(message)s.\n' if oldfmt in self.error_message_format: # use

 if the message contains a newline internally
      # otherwise let the html control line breaks
      self.error_message_format=self.error_message_format.replace(oldfmt,'

%(message)s
\n') if '\n' in m else self.error_message_format.replace(oldfmt,'

%(message)s\n') def do_GET(self): try: assert(False) except: m=traceback.format_exc().strip() self.content_aware_error_message_format(m) self.send_error(500,m) if __name__=='__main__': addr=('',9000) http.server.HTTPServer(addr,httphandler).serve_forever() ---------- components: Library (Lib) messages: 143646 nosy: Paul.Upchurch priority: normal severity: normal status: open title: http.server.BaseHTTPRequestHandler.send_error and trailing newline type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 6 22:48:50 2011 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 06 Sep 2011 20:48:50 +0000 Subject: [New-bugs-announce] [issue12922] StringIO and seek() Message-ID: <1315342130.67.0.227650351498.issue12922@psf.upfronthosting.co.za> New submission from Terry J. Reedy : First, there is a minor documentation issue. 15.2.3.1. I/O Base Classes class io.IOBase seek(offset, whence=SEEK_SET) Change the stream position to the given byte offset Since StringIO seeks by code units that should perhaps say 'byte or code unit offset' or a separate note should be added to the doc entry for StringIO. >>> txt = StringIO('ab\U00010030') >>> txt.seek(3) 3 >>> txt.write('x') 1 >>> txt.getvalue() 'ab\ud800x' The behavior problem is that seeking for StringIO does not work relative to the current position or end. IOError: Can't do nonzero cur-relative seeks # Note: this message is wrong for end-relative seeks. I presume this is inherited from an undocumented restriction on seeking with text streams, because chars *might* be variably sized. However, I do not think it should be. StringIO does not inherit the same reason for the restriction (certainly not on wide builds, and on narrow builds, seeking from the beginning is just as problematical). For StringIO, there is no option of 'opening in binary (byte) mode instead' as there is for disk files. Since a StringIO object is a wrapped array of fixed-size units, seeking from any position is as trivial as it is from the beginning. And again, the current docs imply that it should work. Note that seeking from the beginning is not limited to the existing content. Instead, skipped areas are filled with nulls. from io import StringIO txt = StringIO('0123456789') txt.seek(15,0) # no problem with absolute seek txt.write('xxx') s = txt.getvalue() print(ord(s[12])) # 0 So that is not a reason to limit seeking from other positions either. ---------- components: Library (Lib) messages: 143649 nosy: terry.reedy priority: normal severity: normal stage: test needed status: open title: StringIO and seek() type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 7 01:40:58 2011 From: report at bugs.python.org (Stefan Krah) Date: Tue, 06 Sep 2011 23:40:58 +0000 Subject: [New-bugs-announce] [issue12923] test_urllib fails in refleak mode Message-ID: <1315352458.41.0.979039254957.issue12923@psf.upfronthosting.co.za> New submission from Stefan Krah : Hi, test_urllib fails in refleak mode: ./python -m test -uall -v -R : test_urllib ====================================================================== FAIL: test_invalid_redirect (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/stefan/hg/cpython/Lib/test/test_urllib.py", line 235, in test_invalid_redirect "http://python.org/") AssertionError: HTTPError not raised by urlopen ---------------------------------------------------------------------- Ran 58 tests in 0.075s FAILED (failures=1, skipped=1) test test_urllib failed 1 test failed: test_urllib [133995 refs] ---------- components: Tests messages: 143656 nosy: orsenthil, skrah priority: normal severity: normal status: open title: test_urllib fails in refleak mode type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 7 07:58:33 2011 From: report at bugs.python.org (Jon Parise) Date: Wed, 07 Sep 2011 05:58:33 +0000 Subject: [New-bugs-announce] [issue12924] Missing call to quote_plus() in test_urllib.test_default_quoting() Message-ID: <1315375113.16.0.494762103225.issue12924@psf.upfronthosting.co.za> New submission from Jon Parise : test_default_quoting() runs a number of identical tests on both quote() and quote_plus() (which is most cases have equivalent behavior). However, at the end of the method, there appears to be a missing complementary call to quote_plus() despite there being an assertion call for the quote_plus() case. ---------- components: Tests files: test_urllib.default_quoting.patch keywords: patch messages: 143663 nosy: jon priority: normal severity: normal status: open title: Missing call to quote_plus() in test_urllib.test_default_quoting() type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file23112/test_urllib.default_quoting.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 7 10:41:04 2011 From: report at bugs.python.org (Sergei Stolyarov) Date: Wed, 07 Sep 2011 08:41:04 +0000 Subject: [New-bugs-announce] [issue12925] python setup.py upload_docs doesn't ask for login and password Message-ID: <1315384864.35.0.23347114707.issue12925@psf.upfronthosting.co.za> New submission from Sergei Stolyarov : python setup.py upload_docs doesn't ask for login and password instead it prints Upload failed (401): You must be identified to edit package information Works only with valid ~/.pypirc ---------- assignee: tarek components: Distutils messages: 143666 nosy: cancel, eric.araujo, tarek priority: normal severity: normal status: open title: python setup.py upload_docs doesn't ask for login and password type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 7 12:04:11 2011 From: report at bugs.python.org (Fabio Erculiani) Date: Wed, 07 Sep 2011 10:04:11 +0000 Subject: [New-bugs-announce] [issue12926] tarfile tarinfo.extract*() broken with symlinks Message-ID: <1315389851.08.0.471880114138.issue12926@psf.upfronthosting.co.za> New submission from Fabio Erculiani : TarFile.makelink() is plain broken. Test file: http://git.sabayon.org/entropy.git/tree/libraries/tests/packages/amarok-2.2.2.90.tbz2 _extract_member calls makelink which does os.symlink() and then falls to the else branch and calls back _extract_member(), which calls makelink() which calls os.symlink() and causes errno 17. ERROR: test_db_insert_compare_match_mime (__main__.EntropyRepositoryTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "db.py", line 490, in test_db_insert_compare_match_mime data = self.Spm.extract_package_metadata(test_pkg) File "../entropy/spm/plugins/interfaces/portage_plugin/__init__.py", line 1038, in extract_package_metadata extract_path = pkg_dir, catch_empty = False) File "../entropy/tools.py", line 2088, in uncompress_tarball tar.extract(tarinfo, encoded_path) File "/usr/lib64/python3.2/tarfile.py", line 2174, in extract set_attrs=set_attrs) File "/usr/lib64/python3.2/tarfile.py", line 2258, in _extract_member self.makelink(tarinfo, targetpath) File "/usr/lib64/python3.2/tarfile.py", line 2358, in makelink targetpath) File "/usr/lib64/python3.2/tarfile.py", line 2258, in _extract_member self.makelink(tarinfo, targetpath) File "/usr/lib64/python3.2/tarfile.py", line 2341, in makelink os.symlink(tarinfo.linkname, targetpath) OSError: [Errno 17] File exists ---------- components: Library (Lib) messages: 143667 nosy: Fabio.Erculiani priority: normal severity: normal status: open title: tarfile tarinfo.extract*() broken with symlinks type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 7 14:45:14 2011 From: report at bugs.python.org (Stefan Krah) Date: Wed, 07 Sep 2011 12:45:14 +0000 Subject: [New-bugs-announce] [issue12927] test_ctypes: segfault with suncc Message-ID: <1315399514.93.0.967789977585.issue12927@psf.upfronthosting.co.za> New submission from Stefan Krah : stefan at opensolaris:~/hg/cpython$ ./python -m test -uall -v test_ctypes == CPython 3.3.0a0 (default:5c8b6e03ebfe, Sep 7 2011, 13:41:08) [C] == Solaris-2.11-i86pc-i386-32bit little-endian == /export/home/stefan/hg/cpython/build/test_python_28849 Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0) [1/1] test_ctypes test_cast (ctypes.test.test_memfunctions.MemFunctionsTest) ... ok test_memmove (ctypes.test.test_memfunctions.MemFunctionsTest) ... ok test_memset (ctypes.test.test_memfunctions.MemFunctionsTest) ... ok test_string_at (ctypes.test.test_memfunctions.MemFunctionsTest) ... ok test_wstring_at (ctypes.test.test_memfunctions.MemFunctionsTest) ... ok test_chararray (ctypes.test.test_delattr.TestCase) ... ok test_simple (ctypes.test.test_delattr.TestCase) ... ok test_struct (ctypes.test.test_delattr.TestCase) ... ok test_struct_by_value (ctypes.test.test_win32.Structures) ... ok test_buffers (ctypes.test.test_unicode.StringTestCase) ... ok test_func (ctypes.test.test_unicode.StringTestCase) ... ok test_wcslen (ctypes.test.test_unicode.StringTestCase) ... ok test_buffers (ctypes.test.test_unicode.UnicodeTestCase) ... ok test_wcslen (ctypes.test.test_unicode.UnicodeTestCase) ... ok test_compare (ctypes.test.test_simplesubclasses.Test) ... ok test_ignore_retval (ctypes.test.test_simplesubclasses.Test) ... Fatal Python error: Segmentation fault Current thread 0x00000001: File "/export/home/stefan/hg/cpython/Lib/ctypes/test/test_simplesubclasses.py", line 24 in test_ignore_retval File "/export/home/stefan/hg/cpython/Lib/unittest/case.py", line 386 in _executeTestPart File "/export/home/stefan/hg/cpython/Lib/unittest/case.py", line 441 in run File "/export/home/stefan/hg/cpython/Lib/unittest/case.py", line 493 in __call__ File "/export/home/stefan/hg/cpython/Lib/unittest/suite.py", line 105 in run File "/export/home/stefan/hg/cpython/Lib/unittest/suite.py", line 67 in __call__ File "/export/home/stefan/hg/cpython/Lib/unittest/suite.py", line 105 in run File "/export/home/stefan/hg/cpython/Lib/unittest/suite.py", line 67 in __call__ File "/export/home/stefan/hg/cpython/Lib/unittest/suite.py", line 105 in run File "/export/home/stefan/hg/cpython/Lib/unittest/suite.py", line 67 in __call__ File "/export/home/stefan/hg/cpython/Lib/unittest/runner.py", line 168 in run File "/export/home/stefan/hg/cpython/Lib/test/support.py", line 1293 in _run_suite File "/export/home/stefan/hg/cpython/Lib/test/support.py", line 1327 in run_unittest File "/export/home/stefan/hg/cpython/Lib/test/test_ctypes.py", line 13 in test_main File "/export/home/stefan/hg/cpython/Lib/test/regrtest.py", line 1140 in runtest_inner File "/export/home/stefan/hg/cpython/Lib/test/regrtest.py", line 916 in runtest File "/export/home/stefan/hg/cpython/Lib/test/regrtest.py", line 708 in main File "/export/home/stefan/hg/cpython/Lib/test/__main__.py", line 13 in File "/export/home/stefan/hg/cpython/Lib/runpy.py", line 73 in _run_code File "/export/home/stefan/hg/cpython/Lib/runpy.py", line 160 in _run_module_as_main Segmentation Fault (core dumped) ---------- components: ctypes messages: 143670 nosy: skrah priority: normal severity: normal status: open title: test_ctypes: segfault with suncc type: crash versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 7 15:16:26 2011 From: report at bugs.python.org (simon) Date: Wed, 07 Sep 2011 13:16:26 +0000 Subject: [New-bugs-announce] [issue12928] exec not woking in unittest Message-ID: <1315401386.62.0.247993467146.issue12928@psf.upfronthosting.co.za> New submission from simon : works in 2.6, fails in 3.2.2 import unittest class MyTest(unittest.TestCase): def test_a(self): exec(compile("a = 1", '', 'single')) assert a == 1 if __name__ == '__main__': unittest.main() ---------- components: Library (Lib) messages: 143672 nosy: simonsteiner priority: normal severity: normal status: open title: exec not woking in unittest type: compile error versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 7 16:10:46 2011 From: report at bugs.python.org (Stefan Krah) Date: Wed, 07 Sep 2011 14:10:46 +0000 Subject: [New-bugs-announce] [issue12929] faulthandler: void pointer used in arithmetic Message-ID: <1315404646.94.0.313585190069.issue12929@psf.upfronthosting.co.za> New submission from Stefan Krah : Hi, suncc detected pointer arithmetic with a pointer to void: "./Modules/faulthandler.c", line 910: warning: pointer to void or function used in arithmetic "./Modules/faulthandler.c", line 911: warning: pointer to void or function used in arithmetic "./Modules/faulthandler.c", line 914: warning: pointer to void or function used in arithmetic "./Modules/faulthandler.c", line 916: warning: pointer to void or function used in arithmetic ---------- components: Extension Modules messages: 143675 nosy: haypo, skrah priority: normal severity: normal status: open title: faulthandler: void pointer used in arithmetic type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 7 16:29:37 2011 From: report at bugs.python.org (Dima Tisnek) Date: Wed, 07 Sep 2011 14:29:37 +0000 Subject: [New-bugs-announce] [issue12930] reindent.py inserts spaces in multiline literals Message-ID: <1315405777.71.0.767109553281.issue12930@psf.upfronthosting.co.za> New submission from Dima Tisnek : Given this as input: #!/usr/bin/python def x(): s = """line one line two line three""" return s reindent.py changes it to: #!/usr/bin/python def x(): s = """line one line two line three""" return s Which means that I cannot use reindent.py on any source that includes multiline literals that are not docs. Btw, it is generally weird that reindented file ends up with 2 spaces before "line two". ---------- components: Demos and Tools messages: 143679 nosy: Dima.Tisnek priority: normal severity: normal status: open title: reindent.py inserts spaces in multiline literals type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 7 16:30:07 2011 From: report at bugs.python.org (Wolfgang Schnerring) Date: Wed, 07 Sep 2011 14:30:07 +0000 Subject: [New-bugs-announce] [issue12931] xmlrpclib confuses unicode and string Message-ID: <1315405807.49.0.456740277996.issue12931@psf.upfronthosting.co.za> New submission from Wolfgang Schnerring : This is a similar issue to http://bugs.python.org/issue7093, but more insiduous: This works: xmlrpclib.ServerProxy(u'http://localhost:8080').foo(dict(baz=u'b?r')) While this fails with a UnicodeDecodeError (note the trailing slash in the URI): xmlrpclib.ServerProxy(u'http://localhost:8080/').foo(dict(baz=u'b?r')) File "/usr/local/python2.7/lib/python2.7/httplib.py", line 937, in endheaders self._send_output(message_body) File "/usr/local/python2.7/lib/python2.7/httplib.py", line 795, in _send_output msg += message_body UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 139: ordinal not in range(128) So, somewhere in xmlrpclib, confusion happens, since even though the URI is passed in as unicode both times, it is stored as string in the first case (thus compatible with the serialized, utf-8 encoded string of the message body), but in the second case it remains unicode (thus failing, as #7093 tells, which I personally wouldn't have closed wontfix). ---------- components: Library (Lib) messages: 143680 nosy: wosc priority: normal severity: normal status: open title: xmlrpclib confuses unicode and string type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 7 18:01:36 2011 From: report at bugs.python.org (Kevin Smith) Date: Wed, 07 Sep 2011 16:01:36 +0000 Subject: [New-bugs-announce] [issue12932] dircmp does not allow non-shallow comparisons Message-ID: <1315411296.33.0.213336425163.issue12932@psf.upfronthosting.co.za> New submission from Kevin Smith : While filecmp.cmp and filecmp.cmpfiles allow a shallow option to be specified to invoke a more involved comparison of files, filecmp.dircmp does not. It is limited to shallow-only comparisons. This could be solved quite easily by adding a shallow keyword option to dircmp then changing the phase3 method to the following. def phase3(self): # Find out differences between common files xx = cmpfiles(self.left, self.right, self.common_files, self.shallow) self.same_files, self.diff_files, self.funny_files = xx ---------- components: Library (Lib) messages: 143692 nosy: kesmit priority: normal severity: normal status: open title: dircmp does not allow non-shallow comparisons type: feature request versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 7 18:06:54 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Sep 2011 16:06:54 +0000 Subject: [New-bugs-announce] [issue12933] Update or remove claims that distutils requires external programs Message-ID: <1315411614.16.0.0292960363033.issue12933@psf.upfronthosting.co.za> New submission from ?ric Araujo : In the past, distutils could use either the zipfile/tarfile modules or the external programs tar, zip and friends. This is told in the documentation and checked in the tests. I suspect that the docs and tests are now outdated. For example, some tests will be skipped if the tar program is not found, even if the code would have used the tarfile module and run successfully. I?ll look into this for packaging, but I don?t have the time right now to go over the distutils test and docs for 2.7 and 3.2. ---------- assignee: eric.araujo components: Distutils, Documentation, Tests keywords: easy messages: 143694 nosy: eric.araujo priority: normal severity: normal stage: needs patch status: open title: Update or remove claims that distutils requires external programs versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 7 18:12:48 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Sep 2011 16:12:48 +0000 Subject: [New-bugs-announce] =?utf-8?q?=5Bissue12934=5D_pysetup_doesn?= =?utf-8?q?=E2=80=99t_work_for_the_docutils_project?= Message-ID: <1315411968.07.0.253348749085.issue12934@psf.upfronthosting.co.za> New submission from ?ric Araujo : I tried to run ?pysetup metadata? in a docutils source directory but the program failed, because packaging tries to import docutils and it picks up the 2.x version in the local directory. The import chain is: pysetup ? packaging.run ? packaging.metadata ? docutils I could edit sys.path in pysetup, but that would mean that people calling ?python3.y -m packaging.run? would not get the fix. Another idea would be to catch both ImportError and SyntaxError when packaging.metadata tries to import docutils, but it would be better to find the 3.x version of docutils in site-packages if it exists. What do you import experts think? ---------- assignee: tarek components: Distutils2 messages: 143695 nosy: alexis, brett.cannon, eric.araujo, ncoghlan, tarek priority: normal severity: normal status: open title: pysetup doesn?t work for the docutils project versions: 3rd party, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 8 11:32:24 2011 From: report at bugs.python.org (Karsten Wolf) Date: Thu, 08 Sep 2011 09:32:24 +0000 Subject: [New-bugs-announce] [issue12935] Typo in findertools.py Message-ID: <1315474344.82.0.220434823255.issue12935@psf.upfronthosting.co.za> New submission from Karsten Wolf : In the current Python-2.7.2.tar.bz2 archive ./Lib/plat-mac/findertools.py in function comment on line 131 the call to FSNewAliasMinimal is misstyped. current version: object_alias = object.FSNewAliasMonimal() corrected version object_alias = object.FSNewAliasMinimal() ---------- assignee: ronaldoussoren components: Macintosh messages: 143722 nosy: karstenw, ronaldoussoren priority: normal severity: normal status: open title: Typo in findertools.py versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 8 11:54:47 2011 From: report at bugs.python.org (Stefan Krah) Date: Thu, 08 Sep 2011 09:54:47 +0000 Subject: [New-bugs-announce] [issue12936] armv5tejl: random segfaults in getaddrinfo() Message-ID: <1315475687.6.0.367377293571.issue12936@psf.upfronthosting.co.za> New submission from Stefan Krah : I'm getting random segfaults in `make buildbottest` on qemu-debian-arm: Linux-2.6.26-2-versatile-armv5tejl-with-debian-5.0.8 little-endian The segfaults occurred in test_robotparser and test_nntplib and couldn't be reproduced when running the tests separately. qemu-debian-arm is horrendously slow, so I don't think I'll have time to debug this. I'm submitting the report in case someone has access to fast ARM hardware. [ 81/359/3] test_nntplib Fatal Python error: Segmentation fault Current thread 0x400225f0: File "/home/user/cpython-e91ad9669c08/Lib/socket.py", line 389 in create_connection File "/home/user/cpython-e91ad9669c08/Lib/nntplib.py", line 1024 in __init__ File "/home/user/cpython-e91ad9669c08/Lib/test/test_nntplib.py", line 291 in setUpClass File "/home/user/cpython-e91ad9669c08/Lib/unittest/suite.py", line 143 in _handleClassSetUp File "/home/user/cpython-e91ad9669c08/Lib/unittest/suite.py", line 97 in run File "/home/user/cpython-e91ad9669c08/Lib/unittest/suite.py", line 67 in __call__ File "/home/user/cpython-e91ad9669c08/Lib/unittest/suite.py", line 105 in run File "/home/user/cpython-e91ad9669c08/Lib/unittest/suite.py", line 67 in __call__ File "/home/user/cpython-e91ad9669c08/Lib/unittest/runner.py", line 168 in run File "/home/user/cpython-e91ad9669c08/Lib/test/support.py", line 1293 in _run_suite File "/home/user/cpython-e91ad9669c08/Lib/test/support.py", line 1327 in run_unittest File "/home/user/cpython-e91ad9669c08/Lib/test/test_nntplib.py", line 1260 in test_main File "/home/user/cpython-e91ad9669c08/Lib/test/regrtest.py", line 1140 in runtest_inner File "/home/user/cpython-e91ad9669c08/Lib/test/regrtest.py", line 905 in runtest File "/home/user/cpython-e91ad9669c08/Lib/test/regrtest.py", line 708 in main File "/home/user/cpython-e91ad9669c08/Lib/test/__main__.py", line 13 in File "/home/user/cpython-e91ad9669c08/Lib/runpy.py", line 73 in _run_code File "/home/user/cpython-e91ad9669c08/Lib/runpy.py", line 160 in _run_module_as_main Segmentation fault ---------- components: Extension Modules messages: 143723 nosy: skrah priority: normal severity: normal stage: test needed status: open title: armv5tejl: random segfaults in getaddrinfo() type: crash versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 8 19:49:47 2011 From: report at bugs.python.org (Brett Cannon) Date: Thu, 08 Sep 2011 17:49:47 +0000 Subject: [New-bugs-announce] [issue12937] Support install options as found in distutils Message-ID: <1315504187.52.0.368275649699.issue12937@psf.upfronthosting.co.za> New submission from Brett Cannon : Distutils2/packaging does not support all the flags provided in distutils (e.g., --user, --prefix, etc.). It would be good to provide the same level of install control (or at least support the --user flag). ---------- assignee: tarek components: Distutils2 messages: 143734 nosy: alexis, brett.cannon, eric.araujo, tarek priority: normal severity: normal status: open title: Support install options as found in distutils type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 8 21:00:48 2011 From: report at bugs.python.org (zvin) Date: Thu, 08 Sep 2011 19:00:48 +0000 Subject: [New-bugs-announce] [issue12938] html.escape does not mention single quotes (') Message-ID: <1315508448.5.0.992592094222.issue12938@psf.upfronthosting.co.za> New submission from zvin : The html.escape docstring says: """ Replace special characters "&", "<" and ">" to HTML-safe sequences. If the optional flag quote is true (the default), the quotation mark character (") is also translated. """ But if you set the optional flag quote to True, this function also escapes single quotes ('). You can see it by comparing _escape_map and _escape_map_full. [http://hg.python.org/cpython/file/cf811943046b/Lib/html/__init__.py] The docstring needs to be updated. ---------- components: Library (Lib) messages: 143736 nosy: zvin priority: normal severity: normal status: open title: html.escape does not mention single quotes (') type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 9 01:19:01 2011 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Sep 2011 23:19:01 +0000 Subject: [New-bugs-announce] [issue12939] Add new io.FileIO using the native Windows API Message-ID: <1315523941.29.0.146575875409.issue12939@psf.upfronthosting.co.za> New submission from STINNER Victor : On Windows, Python uses the POSIX API (file descriptors), instead of the native API (file handles). Some features cannot be used using the POSIX API, like setting security attributes. It would be nice to have a io.FileIO using Windows file handlers to get access to all Windows features. It would help feature #12105 to implement "O_CLOEXEC" flag using the lpSecurityAttributes argument. We can maybe try with a prototype written in Python. Using _pyio.RawIOBase, only readinto(), write(), seek() and truncate() have to be implemented. But it is better to implement also close() :-) ---------- components: IO, Unicode messages: 143741 nosy: amaury.forgeotdarc, haypo, mmarkk priority: normal severity: normal status: open title: Add new io.FileIO using the native Windows API versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 9 02:04:52 2011 From: report at bugs.python.org (Tim Chase) Date: Fri, 09 Sep 2011 00:04:52 +0000 Subject: [New-bugs-announce] [issue12940] Cmd example using turtle left vs. right doc-bug Message-ID: <1315526692.9.0.379869372006.issue12940@psf.upfronthosting.co.za> New submission from Tim Chase : The Turtle example for the cmd module as documented at http://docs.python.org/py3k/library/cmd.html#cmd-example In the left() method, it calls turtle.right() instead of turtle.left(). Easy fix: /def left/+2s/left/right/ Likely exists in most 3.x documentation. ---------- assignee: docs at python components: Documentation messages: 143746 nosy: Gumnos, docs at python priority: normal severity: normal status: open title: Cmd example using turtle left vs. right doc-bug type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 9 02:11:01 2011 From: report at bugs.python.org (John Feuerstein) Date: Fri, 09 Sep 2011 00:11:01 +0000 Subject: [New-bugs-announce] [issue12941] add random.pop() Message-ID: <1315527061.03.0.145475351113.issue12941@psf.upfronthosting.co.za> New submission from John Feuerstein : This patch against current hg tip (72314:92842e347d98) adds random.pop(): pop(self, seq) method of Random instance Remove and return a random element from a non-empty sequence. Includes test case. ---------- components: Library (Lib) files: random_pop.diff keywords: patch messages: 143748 nosy: jfeuerstein priority: normal severity: normal status: open title: add random.pop() type: feature request versions: Python 3.4 Added file: http://bugs.python.org/file23120/random_pop.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 9 03:28:04 2011 From: report at bugs.python.org (Aaron Meurer) Date: Fri, 09 Sep 2011 01:28:04 +0000 Subject: [New-bugs-announce] [issue12942] Shebang line fixer for 2to3 Message-ID: <1315531684.56.0.727993232351.issue12942@psf.upfronthosting.co.za> New submission from Aaron Meurer : As suggested in this thread in the Python porting list (http://mail.python.org/pipermail/python-porting/2011-September/000231.html), it would be nice if 2to3 had a fixer that translated shebang lines from #! /usr/bin/env python to #! /usr/bin/env python3 Also relevant here is the draft PEP 394 (http://www.python.org/dev/peps/pep-0394/), which apparently is likely to be accepted. ---------- components: 2to3 (2.x to 3.0 conversion tool) messages: 143749 nosy: Aaron.Meurer priority: normal severity: normal status: open title: Shebang line fixer for 2to3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 9 05:11:07 2011 From: report at bugs.python.org (Meador Inge) Date: Fri, 09 Sep 2011 03:11:07 +0000 Subject: [New-bugs-announce] [issue12943] tokenize: add python -m tokenize support back Message-ID: <1315537867.15.0.614423357455.issue12943@psf.upfronthosting.co.za> New submission from Meador Inge : In 2.x, 'python -m tokenize' worked great: [meadori at motherbrain cpython]$ python2.7 -m tokenize test.py 1,0-1,5: NAME 'print' 1,6-1,21: STRING '"Hello, World!"' 1,21-1,22: NEWLINE '\n' 2,0-2,0: ENDMARKER '' In 3.x, however, the functionality has been removed and replaced with some hard-wired test code: [meadori at motherbrain cpython]$ python3 -m tokenize test.py TokenInfo(type=57 (ENCODING), string='utf-8', start=(0, 0), end=(0, 0), line='') TokenInfo(type=1 (NAME), string='def', start=(1, 0), end=(1, 3), line='def parseline(self, line):') TokenInfo(type=1 (NAME), string='parseline', start=(1, 4), end=(1, 13), line='def parseline(self, line):') TokenInfo(type=53 (OP), string='(', start=(1, 13), end=(1, 14), line='def parseline(self, line):') ... The functionality was removed here [1], but with no explanation. Let's add it back and document the functionality this time around. [1] http://hg.python.org/cpython/rev/51e24512e305/ ---------- components: Library (Lib) messages: 143752 nosy: meadori priority: normal severity: normal stage: needs patch status: open title: tokenize: add python -m tokenize support back type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 9 08:32:49 2011 From: report at bugs.python.org (Rene Dudfield) Date: Fri, 09 Sep 2011 06:32:49 +0000 Subject: [New-bugs-announce] [issue12944] setup.py upload to pypi needs to work with specified files Message-ID: <1315549969.41.0.856641810932.issue12944@psf.upfronthosting.co.za> New submission from Rene Dudfield : We need to specify files to upload to pypi. Otherwise we have to use the web interface. 'Regarding the "setup.py upload" command, this isn't very helpful because it will not upload a package that was already built - for example, a Windows package built on another host while I am trying to release from a Linux desktop. Since automatic package building across a build farm is the only way I can actually build packages for most platforms, this rules out use of the "upload" command.' See this post for more details: http://as.ynchrono.us/2011/09/releasing-python-software-is-tedious.html ---------- assignee: tarek components: Distutils messages: 143754 nosy: eric.araujo, illume, tarek priority: normal severity: normal status: open title: setup.py upload to pypi needs to work with specified files type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 9 15:54:49 2011 From: report at bugs.python.org (Pavel Boldin) Date: Fri, 09 Sep 2011 13:54:49 +0000 Subject: [New-bugs-announce] [issue12945] ctypes works incorrectly with _swappedbytes_ = 1 Message-ID: <1315576489.44.0.807779711581.issue12945@psf.upfronthosting.co.za> New submission from Pavel Boldin : ctypes seems to work incorrectly with _swappedbytes_ specified. I.e. it misses some values from buffer: class X(ctypes.Structure): _swappedbytes_ = 1 _pack_ = 1 _fields_ = [ ('a', ctypes.c_ubyte, 4), ('b', ctypes.c_ubyte, 4), ('c', ctypes.c_ushort, 8), ('d', ctypes.c_ushort, 8), ] buf = '\x12\x34\x56\x78' x = X.from_buffer_copy(buf) print x.a == 1 print x.b == 2 print x.c == 3 print x.d == 4 This prints True True False False Where as four 'True' are expected. ---------- components: ctypes files: test_ctypes.py messages: 143761 nosy: Pavel.Boldin priority: normal severity: normal status: open title: ctypes works incorrectly with _swappedbytes_ = 1 versions: Python 2.7, Python 3.1 Added file: http://bugs.python.org/file23122/test_ctypes.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 9 18:19:52 2011 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 09 Sep 2011 16:19:52 +0000 Subject: [New-bugs-announce] [issue12946] PyModule_GetDict() claims it can never fail, but it can Message-ID: <1315585192.34.0.742122652176.issue12946@psf.upfronthosting.co.za> New submission from Stefan Behnel : As is obvious from the code, PyModule_GetDict() can fail if being passed a non-module object, and when the (unlikely) dict creation at the end fails. The documentation of the C-API function should be fixed to reflect that, i.e. it should state that NULL is returned in the case of an error. PyObject * PyModule_GetDict(PyObject *m) { PyObject *d; if (!PyModule_Check(m)) { PyErr_BadInternalCall(); return NULL; } d = ((PyModuleObject *)m) -> md_dict; if (d == NULL) ((PyModuleObject *)m) -> md_dict = d = PyDict_New(); return d; } ---------- assignee: docs at python components: Documentation messages: 143764 nosy: docs at python, scoder priority: normal severity: normal status: open title: PyModule_GetDict() claims it can never fail, but it can 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 Sep 9 19:22:34 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 09 Sep 2011 17:22:34 +0000 Subject: [New-bugs-announce] [issue12947] Examples in library/doctest.html lack the flags Message-ID: <1315588954.16.0.979263107509.issue12947@psf.upfronthosting.co.za> New submission from ?ric Araujo : The docs for the doctest module contains examples that use doctest flags to control behavior, but the HTML version does not contain the flags, making the examples useless. I don?t know if this is a bug with the HTML builder or something we can fix in markup. ---------- assignee: docs at python components: Documentation messages: 143775 nosy: docs at python, eric.araujo, georg.brandl priority: normal severity: normal status: open title: Examples in library/doctest.html lack the flags versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 9 20:25:35 2011 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Fri, 09 Sep 2011 18:25:35 +0000 Subject: [New-bugs-announce] [issue12948] multiprocessing test failures can hang the buildbots Message-ID: <1315592735.18.0.0641673256441.issue12948@psf.upfronthosting.co.za> New submission from Jes?s Cea Avi?n : Some failures in the multiprocessing testsuite can leave processes around, hanging the buildbots (until the timeout). I take care of this myself. ---------- assignee: jcea messages: 143783 nosy: jcea priority: normal severity: normal status: open title: multiprocessing test failures can hang the buildbots versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 9 20:26:29 2011 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 09 Sep 2011 18:26:29 +0000 Subject: [New-bugs-announce] [issue12949] Documentation of PyCode_New() lacks kwonlyargcount argument Message-ID: <1315592789.75.0.632556595518.issue12949@psf.upfronthosting.co.za> New submission from Stefan Behnel : In Py3, PyCode_New() takes a new argument "kwonlyargcount". The signature change is not currently in the Py3 C-API documentation. http://docs.python.org/dev/c-api/code.html PyCodeObject * PyCode_New(int argcount, int kwonlyargcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names, PyObject *varnames, PyObject *freevars, PyObject *cellvars, PyObject *filename, PyObject *name, int firstlineno, PyObject *lnotab) ---------- assignee: docs at python components: Documentation messages: 143784 nosy: docs at python, scoder priority: normal severity: normal status: open title: Documentation of PyCode_New() lacks kwonlyargcount argument type: behavior versions: Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 9 20:55:59 2011 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Fri, 09 Sep 2011 18:55:59 +0000 Subject: [New-bugs-announce] [issue12950] multiprocessing "test_fd_transfer" fails under OpenIndiana Message-ID: <1315594559.68.0.697746063648.issue12950@psf.upfronthosting.co.za> New submission from Jes?s Cea Avi?n : Buildbots running OpenIndiana 147 show failures in multiprocessing "test_fd_transfer": """ ====================================================================== ERROR: test_fd_transfer (test.test_multiprocessing.WithProcessesTestConnection) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.2.cea-indiana-x86/build/Lib/test/test_multiprocessing.py", line 1597, in test_fd_transfer reduction.send_handle(conn, fd, p.pid) File "/export/home/buildbot/32bits/3.2.cea-indiana-x86/build/Lib/multiprocessing/reduction.py", line 80, in send_handle _multiprocessing.sendfd(conn.fileno(), handle) OSError: [Errno 9] Bad file number ====================================================================== ERROR: test_large_fd_transfer (test.test_multiprocessing.WithProcessesTestConnection) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/32bits/3.2.cea-indiana-x86/build/Lib/test/test_multiprocessing.py", line 1626, in test_large_fd_transfer reduction.send_handle(conn, newfd, p.pid) File "/export/home/buildbot/32bits/3.2.cea-indiana-x86/build/Lib/multiprocessing/reduction.py", line 80, in send_handle _multiprocessing.sendfd(conn.fileno(), handle) OSError: [Errno 9] Bad file number ---------------------------------------------------------------------- """ Buildbots are running OpenIndiana 147 (this is not the last OI version, could be a OI bug). This test seem to work correctly under Solaris 10 Update 9. ---------- messages: 143787 nosy: jcea priority: normal severity: normal stage: needs patch status: open title: multiprocessing "test_fd_transfer" fails under OpenIndiana versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 9 21:29:04 2011 From: report at bugs.python.org (=?utf-8?b?4KS24KSC4KSk4KSo4KWC?=) Date: Fri, 09 Sep 2011 19:29:04 +0000 Subject: [New-bugs-announce] [issue12951] List behavior is different Message-ID: <1315596544.14.0.783397700321.issue12951@psf.upfronthosting.co.za> New submission from ????? : URL: http://docs.python.org/library/stdtypes.html Following example is given. >>> lists = [[]] * 3 >>> lists [[], [], []] >>> lists[0].append(3) >>> lists [[3], [3], [3]] Behavior is as follows. >>> a = [[]] * 3 >>> a [[], [], []] >>> a[0] = 1 >>> a [1, [], []] >>> Python interpreter details: $ python Python 2.7.2 (default, Aug 22 2011, 13:53:27) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. ---------- assignee: docs at python components: Documentation messages: 143793 nosy: docs at python, ????? priority: normal severity: normal status: open title: List behavior is different type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 9 23:47:01 2011 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Fri, 09 Sep 2011 21:47:01 +0000 Subject: [New-bugs-announce] [issue12952] Solaris/Illumos (OpenIndiana) Scheduling policies Message-ID: <1315604821.27.0.391952177257.issue12952@psf.upfronthosting.co.za> New submission from Jes?s Cea Avi?n : Solaris/Illumos (OpenIndiana) have several more Scheduling Policies, specially if the program is running under a Solaris Zone. OpenIndiana buildbots are running under Zones, and the test is failing because current (under Zones) scheduling policy is not recognized. I take care of this myself. ---------- assignee: jcea messages: 143806 nosy: jcea priority: normal severity: normal status: open title: Solaris/Illumos (OpenIndiana) Scheduling policies type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 10 00:37:22 2011 From: report at bugs.python.org (=?utf-8?q?Hagen_F=C3=BCrstenau?=) Date: Fri, 09 Sep 2011 22:37:22 +0000 Subject: [New-bugs-announce] [issue12953] Function calls missing from profiler output Message-ID: <1315607842.02.0.28762981022.issue12953@psf.upfronthosting.co.za> New submission from Hagen F?rstenau : I noticed that some function calls don't get reported by profile/cProfile. For example, 'len' works fine, but calls to 'range' or functions in 'itertools' don't show up. Is this a known limitation? I remember that there was a bug in profiling C-functions with keyword arguments (issue5330, fixed), but I don't have the time right now to investigate whether this is related. ---------- components: Library (Lib) messages: 143813 nosy: hagen priority: normal severity: normal status: open title: Function calls missing from profiler output type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 10 01:26:49 2011 From: report at bugs.python.org (paul j3) Date: Fri, 09 Sep 2011 23:26:49 +0000 Subject: [New-bugs-announce] [issue12954] Multiprocessing logging under Windows Message-ID: <1315610809.5.0.0888786272542.issue12954@psf.upfronthosting.co.za> New submission from paul j3 : The Windows programming guidelines for the multiprocessing module documentation should include a warning that any logging initialization should be protected by the 'if __name__' block. Otherwise you will get duplicate logging entries for the child processes. This is because the multiprocessing.forking.prepare() function explicitly calls log_to_stderr(), and may implicitly do so again when it imports the parent module, resulting in duplicate logging handlers. ---------- assignee: docs at python components: Documentation messages: 143815 nosy: docs at python, paul.j3 priority: normal severity: normal status: open title: Multiprocessing logging under Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 10 12:30:28 2011 From: report at bugs.python.org (Valery Khamenya) Date: Sat, 10 Sep 2011 10:30:28 +0000 Subject: [New-bugs-announce] [issue12955] urllib2.build_opener().open() is not friendly to "with ... as:" Message-ID: <1315650628.73.0.673162910121.issue12955@psf.upfronthosting.co.za> New submission from Valery Khamenya : The following intuitive construction with urllib2.build_opener().open() as: ... leads to AttributeError: addinfourl instance has no attribute '__exit__' http://docs.python.org/library/urllib2.html says almost nothing about concept of closing. Could it be possible to add a canonical "with ... as:" example for urllib2.build_opener() ? Thanks, Valery ---------- assignee: docs at python components: Documentation, IO, Library (Lib) messages: 143836 nosy: Valery.Khamenya, docs at python priority: normal severity: normal status: open title: urllib2.build_opener().open() is not friendly to "with ... as:" type: resource usage 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 Sat Sep 10 17:55:14 2011 From: report at bugs.python.org (LMO) Date: Sat, 10 Sep 2011 15:55:14 +0000 Subject: [New-bugs-announce] [issue12956] 2.7.2 build fails with --enable-framework and space in pathname on OS X 10.7.1 Message-ID: <1315670114.35.0.572946657302.issue12956@psf.upfronthosting.co.za> Changes by LMO : ---------- components: Build nosy: rzn8tr priority: normal severity: normal status: open title: 2.7.2 build fails with --enable-framework and space in pathname on OS X 10.7.1 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 10 22:24:19 2011 From: report at bugs.python.org (Michael Schurter) Date: Sat, 10 Sep 2011 20:24:19 +0000 Subject: [New-bugs-announce] [issue12957] mmap.resize changes memory address of mmap'd region Message-ID: <1315686259.57.0.0304440203891.issue12957@psf.upfronthosting.co.za> New submission from Michael Schurter : Since mmap.resize uses MREMAP_MAYMOVE on Linux, it would be nice to warn users that pointers into their memory mapped regions will be invalid after resizes. Linux's manpage offers the following explanation: "If the mapping is relocated, then absolute pointers into the old mapping location become invalid (offsets relative to the starting address of the mapping should be employed)." Since the only way I know of to use pointers into mmaps from pure Python is to use ctypes..from_buffer(), perhaps clarification would be better in the ctypes docs. ---------- assignee: docs at python components: Documentation files: killctypes.py messages: 143845 nosy: docs at python, schmichael priority: normal severity: normal status: open title: mmap.resize changes memory address of mmap'd region type: feature request versions: Python 2.7 Added file: http://bugs.python.org/file23126/killctypes.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 11 07:40:43 2011 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 11 Sep 2011 05:40:43 +0000 Subject: [New-bugs-announce] [issue12958] test_socket failures on Mac OS X Message-ID: <1315719643.71.0.858357749479.issue12958@psf.upfronthosting.co.za> New submission from Nick Coghlan : Several of the new socket tests introduced in #6560 are failing on the Mac OS X buildbots. These appear to be due to platform problems rather than anything in the test suite or the new sendmsg/recvmsg code, but it would be good if a developer on Mac OS X could take a closer look at them. To avoid polluting the buildbot results, the affected tests will be flagged as expected failures when run on Mac OS X (this isn't in the repo yet, but once it is, the tests will be marked with "anticipate_failure" in the test_socket code). ---------- components: Library (Lib) messages: 143854 nosy: ncoghlan priority: normal severity: normal status: open title: test_socket failures on Mac OS X type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 11 14:34:46 2011 From: report at bugs.python.org (July Tikhonov) Date: Sun, 11 Sep 2011 12:34:46 +0000 Subject: [New-bugs-announce] [issue12959] Add 'ChainMap' to collections.__all__ Message-ID: <1315744486.33.0.835466042574.issue12959@psf.upfronthosting.co.za> New submission from July Tikhonov : ChainMap is the only item from collections module, that is described in docs, but is not included in collections.__all__ ---------- components: Library (Lib) files: chainmap_in___all__.diff keywords: patch messages: 143862 nosy: july priority: normal severity: normal status: open title: Add 'ChainMap' to collections.__all__ type: feature request versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file23128/chainmap_in___all__.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 11 15:37:19 2011 From: report at bugs.python.org (Nikolaus Rath) Date: Sun, 11 Sep 2011 13:37:19 +0000 Subject: [New-bugs-announce] [issue12960] threading.Condition is not a class Message-ID: <1315748239.01.0.928739848932.issue12960@psf.upfronthosting.co.za> New submission from Nikolaus Rath : According to http://docs.python.org/library/threading.html#condition-objects, threading.Condition is a class. However, in fact it turns out to be function that constructs a _Condition instance. I don't know the reason for that, but it seems to me that either Condition should be a class, or the reason for it being a function should be documented so that people who I would like to inherit from Conditionknow if that is not supported, or if they can safely inherit from _Condition instead. ---------- assignee: docs at python components: Documentation messages: 143864 nosy: Nikratio, docs at python priority: normal severity: normal status: open title: threading.Condition is not a class 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 Sun Sep 11 22:01:51 2011 From: report at bugs.python.org (Phillip Feldman) Date: Sun, 11 Sep 2011 20:01:51 +0000 Subject: [New-bugs-announce] [issue12961] unlabelled balls in boxes Message-ID: <1315771311.11.0.00644993310332.issue12961@psf.upfronthosting.co.za> New submission from Phillip Feldman : The current set of combinatorial functions in `itertools` does not include unlabelled balls in labeled boxes and unlabelled balls in unlabelled boxes. If the boxes have no capacity limits (i.e., can store an unlimited number of balls), then the unlabelled balls in labelled boxes can be handled with existing tools. But, this is a special case. Various people have developed working Python implementations for the "unlabelled balls in labelled boxes with capacity limits" problem. I believe that "unlabelled balls in unlabelled boxes with capacity limits" can be handled with a minor variation on the same algorithm. It would be a great benefit to have this capability in `itertools`. ---------- messages: 143874 nosy: Phillip.M.Feldman, rhettinger priority: normal severity: normal status: open title: unlabelled balls in boxes type: feature request versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 12 09:27:10 2011 From: report at bugs.python.org (anatoly techtonik) Date: Mon, 12 Sep 2011 07:27:10 +0000 Subject: [New-bugs-announce] [issue12962] TitledHelpFormatter and IndentedHelpFormatter are not documented Message-ID: <1315812430.81.0.82881222836.issue12962@psf.upfronthosting.co.za> New submission from anatoly techtonik : In optparse module doc this two classes are referenced, but not documented: http://docs.python.org/library/optparse.html ---------- components: Library (Lib) messages: 143888 nosy: techtonik priority: normal severity: normal status: open title: TitledHelpFormatter and IndentedHelpFormatter are not documented versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 12 14:13:46 2011 From: report at bugs.python.org (Stefan Krah) Date: Mon, 12 Sep 2011 12:13:46 +0000 Subject: [New-bugs-announce] [issue12963] PyLong_AsSize_t returns (unsigned long)-1 Message-ID: <1315829626.88.0.38210073004.issue12963@psf.upfronthosting.co.za> New submission from Stefan Krah : In one of the error branches PyLong_AsSize_t() returns (unsigned long)-1 instead of (size_t)-1. ---------- components: Interpreter Core files: pylong_as_size_t.diff keywords: patch messages: 143896 nosy: mark.dickinson, skrah priority: normal severity: normal stage: patch review status: open title: PyLong_AsSize_t returns (unsigned long)-1 type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file23130/pylong_as_size_t.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 12 14:41:27 2011 From: report at bugs.python.org (Sinisa Segvic) Date: Mon, 12 Sep 2011 12:41:27 +0000 Subject: [New-bugs-announce] [issue12964] Two improvements for the locale aliasing engine Message-ID: <1315831287.41.0.402878841254.issue12964@psf.upfronthosting.co.za> New submission from Sinisa Segvic : Hi, There appears to be some space for improvement regarding the stable implementation of the Python locale aliasing engine. Sometimes, one wishes to be able to override the default system locale. For instance, it would be nice that a program supposed to sort people according to national rules would be able to run correctly even when the system does not default to the national locale. Judging from the Python manuals and provided the desired national locale is installed, this should be doable in at least the following two ways: import locale ianaLanguageSubtag='en' # the desired national locale locale.setlocale(locale.LC_ALL, (ianaLanguageSubtag, locale.getpreferredencoding())) #(1) locale.setlocale(locale.LC_ALL, locale.normalize(ianaLanguageSubtag)) #(2) For a quicker reference, this is the relevant part of the manual: http://docs.python.org/release/3.2/library/locale.html ''' locale.setlocale(category, locale=None) ... If (the locale) is a tuple, it is converted to a string using the locale aliasing engine. ... ''' The locale aliasing engine binds the IANA language subtags to POSIX locales. Its effects can be directly observed through locale.normalize: >>> import locale >>> locale.normalize('hr') 'hr_HR.ISO8859-2' >>> locale.normalize('en') 'en_US.ISO8859-1' My first objection concerns the Windows behaviour of the calls (1) and (2) above. Both of the two calls *do not work* since Windows does not recognize strings such as 'en_US.ISO8859-1'. Instead, Windows provides their own locale nomenclature: http://msdn.microsoft.com/en-us/library/x99tb11d%28VS.80%29.aspx Consequently, the following *works*: locale.setlocale(locale.LC_ALL, 'English_United States.1252') IMHO this issue should be fixed, perhaps by providing an alternate definition of the locale alias dictionary (locale.locale_alias). My second objection concerns the behaviour on Linux, where the call (1) above always works, while (2) in some cases might not work. It happens that the call (2) requests an outdated 8-bit encoding although UTF8 has obtained a world-wide acceptance. The call shall result in a locale error whenever the desired national locale is present only in the UTF8 variant. This might be fixed by changing the encodings in the locale.locale_alias from 8-bit variants to UTF8. Note however that the problem could be circumvented by issuing the call (1), so this would be less important than the Windows fix proposed above. Source code references: .../Python-3.2.2/Lib/locale.py locale.locale_alias locale.normalize locale.setlocale comp.lang.python discussion: http://groups.google.com/group/comp.lang.python/browse_thread/thread/3591d496cf108ad2# Cheers, Sinisa ---------- components: Library (Lib), Windows messages: 143902 nosy: ssegvic priority: normal severity: normal status: open title: Two improvements for the locale aliasing engine type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 12 18:57:50 2011 From: report at bugs.python.org (Stefan Krah) Date: Mon, 12 Sep 2011 16:57:50 +0000 Subject: [New-bugs-announce] [issue12965] longobject: documentation improvements Message-ID: <1315846670.45.0.93309834122.issue12965@psf.upfronthosting.co.za> New submission from Stefan Krah : I think the integer objects documentation could be clearer on a couple of points: - Despite being listed under "Concrete Objects Layer", some functions implicitly accept anything with an __int__() method. Currently only the PyLong_AsLong() documentation states this explicitly. The patch clearly distinguishes between functions that duck type and functions that don't. - The patch replaces "is greater than *_MAX" instances with "out of bounds" to include the other error condition "is less than *_MIN". Additionally, the patch fixes comments in longobject.c that don't state the duck typing behavior. ---------- assignee: docs at python components: Documentation files: longobject-doc.diff keywords: patch messages: 143922 nosy: docs at python, mark.dickinson, skrah priority: normal severity: normal stage: patch review status: open title: longobject: documentation improvements type: feature request versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file23133/longobject-doc.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 12 21:14:40 2011 From: report at bugs.python.org (Paulie Pena) Date: Mon, 12 Sep 2011 19:14:40 +0000 Subject: [New-bugs-announce] [issue12966] cookielib.LWPCookieJar breaks on cookie values with a newline Message-ID: <1315854880.61.0.95908383563.issue12966@psf.upfronthosting.co.za> New submission from Paulie Pena : Even though RFC 6265's cookie-value's cookie-octet definition says that whitespace characters are not allowed (see http://tools.ietf.org/html/rfc6265), there are non-compliant web sites that send cookie values with newlines. cookielib.LWPCookieJar will save the bad value in a cookie file, but when it tries to load it, it probably is only splitting by newlines, so it crashes on the invalid line. The easiest thing would probably be to just ignore cookies that have values with a newline. (Note: I'm using Python 2.5, so this might have been fixed in a later version.) ---------- components: Library (Lib) messages: 143928 nosy: paulie4 priority: normal severity: normal status: open title: cookielib.LWPCookieJar breaks on cookie values with a newline type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 13 06:38:10 2011 From: report at bugs.python.org (ben) Date: Tue, 13 Sep 2011 04:38:10 +0000 Subject: [New-bugs-announce] [issue12967] AttributeError distutils\log.py Message-ID: <1315888690.96.0.966369051182.issue12967@psf.upfronthosting.co.za> New submission from ben : AttributeErrors on log.py in the distutils directory import sys stream = sys.stdout if stream.errors == 'strict': pass'=> this will raise an AttributeError' ---------- assignee: tarek components: Distutils files: log.py messages: 143949 nosy: Ben.thelen, eric.araujo, tarek priority: normal severity: normal status: open title: AttributeError distutils\log.py type: compile error versions: Python 3.2 Added file: http://bugs.python.org/file23136/log.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 13 08:51:35 2011 From: report at bugs.python.org (=?utf-8?b?SmnFmcOtIEt1xI1lcmE=?=) Date: Tue, 13 Sep 2011 06:51:35 +0000 Subject: [New-bugs-announce] [issue12969] Command 'open(0, "wb").close()' cause crash of Python interpreter [interactive mode] Message-ID: <1315896695.55.0.887775413024.issue12969@psf.upfronthosting.co.za> New submission from Ji?? Ku?era : Invoking the `close' method of `_io.BufferedWriter' instance created by `open(0,"wb")' command cause the Python interpreter crash. Python interpreter info: mode: interactive version info: Python 3.2.1 (default, Jul 10 2011, 21:51:15) [MSC v.1500 32 bit (Intel)] on win32 Operanting system info: Microsoft Windows XP Home Edition Version 2002 Service Pack 3 Commands: >>> fd = open(0,"wb") >>> fd.close() ---------- components: Interpreter Core messages: 143951 nosy: i386x priority: normal severity: normal status: open title: Command 'open(0,"wb").close()' cause crash of Python interpreter [interactive mode] type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 13 15:02:12 2011 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Tue, 13 Sep 2011 13:02:12 +0000 Subject: [New-bugs-announce] [issue12970] os.wlak() consider some symlinks as dirs instead of non-dirs Message-ID: <1315918932.02.0.810529185276.issue12970@psf.upfronthosting.co.za> New submission from ???? ????????? : Consider code: for (root, dirs, nondirs) in os.walk(path, followlinks=False): print (nondirs) This code will not print symlinks that refer to some dir. I think it is the bug. In other words: If followlinks is True, we should consider some symlinks as dirs. If not, any symlink is the non-dir. Patch included. Also, please fix documentation about this nuance. ---------- assignee: docs at python components: Documentation, Library (Lib) files: z.patch keywords: patch messages: 143965 nosy: docs at python, mmarkk priority: normal severity: normal status: open title: os.wlak() consider some symlinks as dirs instead of non-dirs type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file23140/z.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 13 15:23:58 2011 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Tue, 13 Sep 2011 13:23:58 +0000 Subject: [New-bugs-announce] [issue12971] os.isdir() should contain skiplinks=False in arguments Message-ID: <1315920238.53.0.290032380593.issue12971@psf.upfronthosting.co.za> New submission from ???? ????????? : When skiplinks is False (by default), it should as in current implementation, i.e. using stat(). if skiplinks is True, isidr() should use lstat() and same logick. If one will be implemented, os.walk() should be patched (see issue12970) to use this new isdir() with this new parameter instead of own logick in os.walk(). ---------- components: Library (Lib) messages: 143968 nosy: mmarkk priority: normal severity: normal status: open title: os.isdir() should contain skiplinks=False in arguments type: feature request versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 13 17:29:32 2011 From: report at bugs.python.org (Damian) Date: Tue, 13 Sep 2011 15:29:32 +0000 Subject: [New-bugs-announce] [issue12972] Color prompt + readline Message-ID: <1315927772.69.0.871921956001.issue12972@psf.upfronthosting.co.za> New submission from Damian : Hi, when using terminal coloring codes (for instance '\x1b[32mhello world\x1b[0m' for a green 'hello world') the raw_input function and readline module behave well except under a very specific use case... ======================================== import readline # provides history via up/down prompt = '\x1b[32m>>> \x1b[0m' # green '>>> ' prompt while True: raw_input(prompt) ======================================== This provides a green prompt and up/down cycles through prior input. This works well as long as the input is shorter than the prompt string length (in this case 13 characters). However, if the input is longer than the prompt then up/down thinks that the first thirteen rendered characters now belong to the prompt. For instance... atagar at fenrir:~/Desktop/arm$ python tmp.py >>> http://docs.python.org/library/readline Press up, then down to get back to a blank prompt. You'll have... >>> http://do This is probably due to a len() check on the raw_input argument... >>> len('>>> http://do') 13 >>> len('\x1b[32m>>> \x1b[0m') 13 I'm at a bit of a loss for investigating this further - help would be appreciated! -Damian ---------- messages: 143977 nosy: atagar1 priority: normal severity: normal status: open title: Color prompt + readline type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 13 21:46:50 2011 From: report at bugs.python.org (Adam) Date: Tue, 13 Sep 2011 19:46:50 +0000 Subject: [New-bugs-announce] [issue12973] int_pow() implementation is incorrect Message-ID: <1315943210.06.0.258464290509.issue12973@psf.upfronthosting.co.za> New submission from Adam : int_pow() (from Objects/intobject.c) shows incorrect results when Python is compiled with Clang (llvm.org); long story short: int_pow() function should use 'unsigned long' type instead of 'long' or some code gets optimised out. Please, refer to this bug report to find out the details: http://llvm.org/bugs/show_bug.cgi?id=10923 ---------- messages: 143985 nosy: adam at NetBSD.org priority: normal severity: normal status: open title: int_pow() implementation is incorrect type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 14 02:48:15 2011 From: report at bugs.python.org (Meador Inge) Date: Wed, 14 Sep 2011 00:48:15 +0000 Subject: [New-bugs-announce] [issue12974] array module: deprecate '__int__' conversion support for array elements Message-ID: <1315961295.78.0.425877150438.issue12974@psf.upfronthosting.co.za> New submission from Meador Inge : When reviewing the fix for issue1172711 it was discovered that the 'array' module allows for '__int__' conversions: >>> import array, struct >>> a = array.array('L', [1,2,3]) >>> class T(object): ... def __init__(self, value): ... self.value = value ... def __int__(self): ... return self.value ... >>> a = array.array('L', [1,2,3]) >>> struct.pack_into('L', a, 0, 9) >>> a array('L', [9, 2, 3]) >>> a[0] = T(100) >>> a array('L', [100, 2, 3]) As discussed in issue1172711, this behavior may not be desirable. We should look at deprecating '__int__' and adding '__index__' as was done for the struct module in issue1530559. ---------- components: Library (Lib) messages: 144000 nosy: mark.dickinson, meadori, skrah priority: normal severity: normal stage: needs patch status: open title: array module: deprecate '__int__' conversion support for array elements type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 14 13:57:19 2011 From: report at bugs.python.org (Benny Siegert) Date: Wed, 14 Sep 2011 11:57:19 +0000 Subject: [New-bugs-announce] [issue12976] select module: only use EVFILT_TIMER if available (kqueue backend) Message-ID: <1316001439.23.0.212484245122.issue12976@psf.upfronthosting.co.za> New submission from Benny Siegert : When building python-2.6 on MirBSD, building the select module (which uses the kqueue backend on this platform) fails. This is because EVFILT_TIMER is not available on the platform. The proposed patch is for python-2.6 but should apply to tip too. This was discovered when building the python package from NetBSD pkgsrc, so the patch is taken from there. ---------- components: Extension Modules files: patch-az messages: 144022 nosy: bsiegert priority: normal severity: normal status: open title: select module: only use EVFILT_TIMER if available (kqueue backend) type: compile error versions: Python 2.6 Added file: http://bugs.python.org/file23153/patch-az _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 14 15:41:59 2011 From: report at bugs.python.org (Florian Ludwig) Date: Wed, 14 Sep 2011 13:41:59 +0000 Subject: [New-bugs-announce] [issue12977] socket.socket.setblocking does not raise exception if no data available Message-ID: <1316007719.98.0.0164178020562.issue12977@psf.upfronthosting.co.za> New submission from Florian Ludwig : The documentation states: > In non-blocking mode, if a recv() call doesn?t find any data, [...], a error exception is raised; [0] Which is wrong. If no data is available recv() does not raise an exception but returns an empty string. [0] http://docs.python.org/library/socket.html#socket.socket.setblocking ---------- assignee: docs at python components: Documentation messages: 144024 nosy: Florian.Ludwig, docs at python priority: normal severity: normal status: open title: socket.socket.setblocking does not raise exception if no data available versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 14 17:35:26 2011 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 14 Sep 2011 15:35:26 +0000 Subject: [New-bugs-announce] [issue12978] Figure out extended attributes on BSDs Message-ID: <1316014526.21.0.982877507813.issue12978@psf.upfronthosting.co.za> New submission from Benjamin Peterson : Extended attribute support currently exists in the os module for Linux. BSD's (including OSX) have a similar (but of course incompatible) interface. They should be exposed through the same functions. For example, os.getxattr("myfile", "user.whatever") should call on the C level getxattr("myfile", "user.whatever", value, sizeof(value), 0, 0); ---------- messages: 144028 nosy: benjamin.peterson priority: normal severity: normal status: open title: Figure out extended attributes on BSDs versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 14 20:39:32 2011 From: report at bugs.python.org (ilikepython) Date: Wed, 14 Sep 2011 18:39:32 +0000 Subject: [New-bugs-announce] [issue12979] tkinter.font.Font object not usable as font option Message-ID: <1316025572.88.0.893423233334.issue12979@psf.upfronthosting.co.za> New submission from ilikepython : If a Font object is passed as a font option to a Tk widget e. g.: import tkinter import tkinter.font f = tkinter.font.Font(family='Arial', size=30) root = Tk() label = tkinter.Label(root, text="Hello", font=f) label.pack() the font does not get respected at runtime. ---------- messages: 144036 nosy: ilikepython priority: normal severity: normal status: open title: tkinter.font.Font object not usable as font option type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 14 21:36:33 2011 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Sep 2011 19:36:33 +0000 Subject: [New-bugs-announce] [issue12980] segfault in test_json on AMD64 FreeBSD 8.2 2.7 Message-ID: <1316028993.76.0.263196651772.issue12980@psf.upfronthosting.co.za> New submission from STINNER Victor : http://www.python.org/dev/buildbot/all/builders/AMD64%20FreeBSD%208.2%202.7/builds/301 --------------------------------------------- [ 44/359] test_json Fatal Python error: Segmentation fault Current thread 0x00000008010041c0: File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 420 in _iterencode File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 309 in _iterencode_list File "/usr/home/buildbot/buildarea/2.7.krah-freebsd/build/Lib/json/encoder.py", line 408 in _iterencode ... *** Signal 11 --------------------------------------------- Can it be an unlimited loop (recursive loop)? It looks like a stack overflow. ---------- components: Library (Lib) messages: 144045 nosy: ezio.melotti, haypo priority: normal severity: normal status: open title: segfault in test_json on AMD64 FreeBSD 8.2 2.7 type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 14 21:51:24 2011 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Wed, 14 Sep 2011 19:51:24 +0000 Subject: [New-bugs-announce] [issue12981] rewrite multiprocessing (senfd|recvfd) in Python Message-ID: <1316029884.26.0.0837911327487.issue12981@psf.upfronthosting.co.za> New submission from Charles-Fran?ois Natali : Now that sendmsg()/recvmsg() are exposed in socketmodule, we could use them to replace the ad-hoc FD-passing routines used by multiprocessing.reduction. Antoine suggested adding sendfd()/recvfd() methods to socket objects, but I'm not sure about this, since those only make sense for Unix domain sockets. Two remarks on the patch attached: - this removes sendfd()/recvfd() from _multiprocessing (but AFAICT those were never documented as part of the public API) - EOF/invalid data received result in a RuntimeError ---------- components: Library (Lib) files: multiprocessing_fd.diff keywords: patch messages: 144047 nosy: haypo, neologix priority: normal severity: normal status: open title: rewrite multiprocessing (senfd|recvfd) in Python type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file23156/multiprocessing_fd.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 14 22:32:43 2011 From: report at bugs.python.org (Eric O. LEBIGOT) Date: Wed, 14 Sep 2011 20:32:43 +0000 Subject: [New-bugs-announce] [issue12982] .pyo file cannot be imported Message-ID: <1316032363.3.0.192750692303.issue12982@psf.upfronthosting.co.za> New submission from Eric O. LEBIGOT : When creating a .pyo file (either with -O or -OO) and removing any .pyc or .py original file, import complains with "No module called ". The import does work with .pyc files. I'm not sure that this is the correct behavior, as the documentation does not seem to make any difference between .pyc and .pyo files on this point: "It is possible to have a file called spam.pyc (or spam.pyo when -O is used) without a file spam.py for the same module. This can be used to distribute a library of Python code in a form that is moderately hard to reverse engineer." ---------- components: Interpreter Core messages: 144049 nosy: lebigot priority: normal severity: normal status: open title: .pyo file cannot be imported type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 15 00:51:36 2011 From: report at bugs.python.org (Ned Deily) Date: Wed, 14 Sep 2011 22:51:36 +0000 Subject: [New-bugs-announce] [issue12983] byte string literals with invalid hex escape codes raise ValueError instead of SyntaxError Message-ID: <1316040696.89.0.548775164505.issue12983@psf.upfronthosting.co.za> New submission from Ned Deily : In behavior carried over from Python 2 string literals, Python 3 byte string literals raise a less helpful ValueError exception when an invalid hex escape code is given: >>> x = b'\x0' ValueError: invalid \x escape A string literal raises a SyntaxError and a full traceback including line number: >>> x = '\x0' File "", line 1 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-2: end of string in escape sequence ---------- components: Interpreter Core messages: 144059 nosy: ned.deily priority: normal severity: normal status: open title: byte string literals with invalid hex escape codes raise ValueError instead of SyntaxError type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 15 01:11:48 2011 From: report at bugs.python.org (Matthew Newcomb) Date: Wed, 14 Sep 2011 23:11:48 +0000 Subject: [New-bugs-announce] [issue12984] XML NamedNodeMap ( attribName in NamedNodeMap fails ) Message-ID: <1316041908.49.0.966708119681.issue12984@psf.upfronthosting.co.za> New submission from Matthew Newcomb : I was cleaning up some old code to make it pep8 compliant and came across this bug. Switching from 'has_key' to 'in' does not work with a xml.dom.minidom.NamedNodeMap. An easy solution appears to be to add a '__contains__' method to NamedNodeMap. This is with: Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) [GCC 4.5.2] on linux2 I've tried it with 2.4.3 as well ( on some older machines ). import xml.dom.minidom def show_bug(): document = 'foobar_attributes' dom = xml.dom.minidom.parseString(document) attribs = dom.getElementsByTagName('dom')[0].attributes if attribs.has_key('mbid'): print "This works.. found 'mbid' attribute" if 'mbid' in attribs: print "Will never get here, the above will throw an exception" >>> show_bug() This works.. found 'mbid' attribute Traceback (most recent call last): File "", line 1, in File "show_bug.py", line 11, in show_bug if 'mbid' in attribs: File "/usr/lib/python2.7/xml/dom/minidom.py", line 524, in __getitem__ return self._attrs[attname_or_tuple] KeyError: 0 ---------- components: XML files: show_bug.py messages: 144060 nosy: spolematt priority: normal severity: normal status: open title: XML NamedNodeMap ( attribName in NamedNodeMap fails ) type: crash versions: Python 2.7 Added file: http://bugs.python.org/file23157/show_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 15 11:34:37 2011 From: report at bugs.python.org (Stefan Krah) Date: Thu, 15 Sep 2011 09:34:37 +0000 Subject: [New-bugs-announce] [issue12985] Check signed arithmetic overflow in ./configure Message-ID: <1316079277.71.0.960663177072.issue12985@psf.upfronthosting.co.za> New submission from Stefan Krah : I'm not sure if this is a good idea: I wonder if it would be an option to check for overflow behavior at the bottom of ./configure and print a warning. The patch appears to work for gcc, clang and suncc. It would have caught the problem in #12973. The Intel compiler is the odd one here. Even with -O0 this particular overflow is undefined, but I can't remember seeing the specific test failures from #12973. So the drawback is that the patch might give false positives. $ cat overflow_is_defined.c #include int overflow_is_defined(int x) { if (x + 1000 < x) return 0; return 1; } int main() { return overflow_is_defined(INT_MAX); } gcc-4.4.3 ========= $ gcc -Wall -W -O0 -o overflow_is_defined overflow_is_defined.c $ ./overflow_is_defined || echo "undefined" $ gcc -Wall -W -O2 -o overflow_is_defined overflow_is_defined.c overflow_is_defined.c: In function ?overflow_is_defined?: overflow_is_defined.c:3: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false $ ./overflow_is_defined || echo "undefined" undefined $ gcc -Wall -W -O2 -fwrapv -o overflow_is_defined overflow_is_defined.c $ ./overflow_is_defined || echo "undefined" $ clang-3.0 ========= $ clang -Wall -W -O0 -o overflow_is_defined overflow_is_defined.c $ ./overflow_is_defined || echo "undefined" $ clang -Wall -W -O2 -o overflow_is_defined overflow_is_defined.c $ ./overflow_is_defined || echo "undefined" undefined $ clang -Wall -W -fwrapv -O2 -o overflow_is_defined overflow_is_defined.c $ ./overflow_is_defined || echo "undefined" $ suncc-12.2 ========== $ suncc -o overflow_is_defined overflow_is_defined.c $ ./overflow_is_defined || echo "undefined" $ suncc -O2 -o overflow_is_defined overflow_is_defined.c $ ./overflow_is_defined || echo "undefined" $ icc-12.0.0 ========== $ icc -Wall -O0 -o overflow_is_defined overflow_is_defined.c $ ./overflow_is_defined || echo "undefined" undefined $ icc -Wall -O2 -o overflow_is_defined overflow_is_defined.c $ ./overflow_is_defined || echo "undefined" undefined $ ---------- files: configure_catch_overflow.diff keywords: patch messages: 144071 nosy: skrah priority: normal severity: normal stage: patch review status: open title: Check signed arithmetic overflow in ./configure type: feature request Added file: http://bugs.python.org/file23160/configure_catch_overflow.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 15 18:30:17 2011 From: report at bugs.python.org (Matt Chaput) Date: Thu, 15 Sep 2011 16:30:17 +0000 Subject: [New-bugs-announce] [issue12986] Using getrandbits() in uuid.uuid4() is faster and more readable Message-ID: <1316104217.68.0.381815581788.issue12986@psf.upfronthosting.co.za> New submission from Matt Chaput : Currently the 'uuid' module uses os.urandom (in the absence of a system UUID generation function) to generate random UUIDs in the uuid.uudi4() function. This patch changes the implementation of uuid4() to use random.getrandbits() as the source of randomness instead, for the following reasons: * In my quick tests, using getrandbits() is much faster on Windows and Linux. Some applications do need to generate UUIDs quickly. >>> setup = "import uuid, os, random" >>> ur = "uuid.UUID(bytes=os.urandom(16), version=4)" >>> grb = "uuid.UUID(int=random.getrandbits(128), version=4)" >>> # Windows -------- >>> timeit.Timer(ur, setup).timeit() 22.861042160383903 >>> timeit.Timer(grb, setup).timeit() 3.8689128309085135 >>> # Linux -------- >>> timeit.Timer(ur, setup).timeit() 29.32686185836792 >> timeit.Timer(grb, setup).timeit() 3.7429409027099609 * The patched code is cleaner. It avoids the try...finally required by the possibly unavailable os.urandom function, and the fallback to generating random bytes. ---------- components: Library (Lib) files: fastuuid4.patch keywords: patch messages: 144087 nosy: mattchaput priority: normal severity: normal status: open title: Using getrandbits() in uuid.uuid4() is faster and more readable type: performance Added file: http://bugs.python.org/file23163/fastuuid4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 15 19:06:16 2011 From: report at bugs.python.org (jan matejek) Date: Thu, 15 Sep 2011 17:06:16 +0000 Subject: [New-bugs-announce] [issue12987] Demo/scripts/newslist.py has non-commercial license clause Message-ID: <1316106376.14.0.821549088904.issue12987@psf.upfronthosting.co.za> New submission from jan matejek : from Demo/scripts/newslist.py : # Feel free to copy, distribute and modify this code for # non-commercial use. If you make any useful modifications, let me # know! # # (c) Quentin Stafford-Fraser 1994 # fraser at europarc.xerox.com qs101 at cl.cam.ac.uk this is not very nice for commercial distros - we have to drop the file (for now anyway) i'm not sure what the "right" solution for upstream is - you might want to remove the file, ask Quentin to relicense it, or just acknowledge its existence and keep it ---------- components: Demos and Tools messages: 144088 nosy: matejcik priority: normal severity: normal status: open title: Demo/scripts/newslist.py has non-commercial license clause versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 15 23:45:06 2011 From: report at bugs.python.org (Brian Gernhardt) Date: Thu, 15 Sep 2011 21:45:06 +0000 Subject: [New-bugs-announce] [issue12988] IDLE on Win7 crashes when saving to Documents Library Message-ID: <1316123106.02.0.189929579788.issue12988@psf.upfronthosting.co.za> New submission from Brian Gernhardt : Python 3.2.1 (default, Jul 10 2011, 20:02:51) [MSC v.1500 64 bit (AMD64)] on win32 Steps: 1) Start IDLE 2) Open Save dialog (File > Save or Ctrl-S) 3) Select Libraries from the buttons on the left or the dropdown on top. 4) Double-click on Documents 5) Enter any file name (test.txt) 6) Hit enter or click save 7) See "pythonw.exe has stopped working dialog" I tried running it from the command line (via c:\python32\python -m idlelib.idle) and it produced no useful error messages. ---------- components: IDLE messages: 144106 nosy: Brian.Gernhardt priority: normal severity: normal status: open title: IDLE on Win7 crashes when saving to Documents Library versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 16 02:08:16 2011 From: report at bugs.python.org (Nam Nguyen) Date: Fri, 16 Sep 2011 00:08:16 +0000 Subject: [New-bugs-announce] [issue12989] Consistently handle path separator in Py_GetPath on Windows Message-ID: <1316131696.55.0.834479609561.issue12989@psf.upfronthosting.co.za> New submission from Nam Nguyen : The module search path is constructed from PYTHONPATH env-var, then zip path, then HKCU PythonPath, then HKLM PythonPath, then PYTHONPATH define (in pyconfig.h), and finally argv[0]. If PYTHONHOME is available, the PYTHONPATH define is expanded. These paths are separated by semicolon. Without PYTHONHOME, PYTHONPATH define is appended to module_search_path as-is, and a semicolon comes **after** that. With PYTHONHOME, PYTHONPATH define is expanded, and there is no semicolon after it. Then, finally, when argv[0] is added to module_search_path, a semicolon is **prepended** before it. This inconsistency in handling path delimiter leads to a case where two semicolons are next to each other (;;), which is translated to the current directory. It happens when PYTHONHOME is not found. The current directory is put in front of the application directory (argv[0]) causing a security issue whereby external modules might be imported inadvertently. This patch makes semicolon handling consistent. A semicolon is appended at the end of every path component, except argv[0]. ---------- components: Interpreter Core, Windows files: getpath.consistent.delim.patch keywords: patch messages: 144111 nosy: Nam.Nguyen priority: normal severity: normal status: open title: Consistently handle path separator in Py_GetPath on Windows 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/file23169/getpath.consistent.delim.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 16 12:19:49 2011 From: report at bugs.python.org (Ricky Teng) Date: Fri, 16 Sep 2011 10:19:49 +0000 Subject: [New-bugs-announce] [issue12990] launcher can't work on path including tradition chinese char Message-ID: <1316168389.55.0.517137945943.issue12990@psf.upfronthosting.co.za> Changes by Ricky Teng : ---------- assignee: ronaldoussoren components: Macintosh nosy: Ricky.Teng, ronaldoussoren priority: normal severity: normal status: open title: launcher can't work on path including tradition chinese char versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 16 13:43:00 2011 From: report at bugs.python.org (Wong Wah Meng) Date: Fri, 16 Sep 2011 11:43:00 +0000 Subject: [New-bugs-announce] [issue12991] Python 64-bit build on HP Itanium - Executable built successfully but modules failed with HP Compiler Message-ID: <1316173380.25.0.744886006815.issue12991@psf.upfronthosting.co.za> New submission from Wong Wah Meng : Server Info: HP-UX B.11.31 Itanium ia64. Evaluation copy is used however the license is being purchased, hopefully this are not these errors are not caused by evaluation copy. # swlist -l product | grep Compiler ACXX C.06.26.EVAL HP C/aC++ Compiler C-ANSI-C C.06.26.EVAL HP C/aC++ Compiler COMPLIBS B.11.31 Compiler Support Libraries I encountered more failures in module build with my HP-UX ANSI C Compiler versus gcc. I wonder why. I need a Oracle plug-in later, i.e. cx_Oracle and the reason I do not want to ignore these errors now because I thought cx_Oracle will have to (or, better) be built using HP compiler, not gcc for support from Oracle. I read through the README file, I followed the instruction to set the required environment variables before the configure is run, and unset them before make is run, also edited Makefile to remove Optimization and the -Olimit 1500. However, it gives me a lot more modules that are failed to be built versus 2 when gcc is used. At the bottom of the mail we can see what failed to be built. I have summarized my inquiry as follow:- 1.) Despite following the instruction to edit the Makefile before make is run, I am surprise to see that the Makefile content is changed again when the executable is generated. The changed I edited is restored. Is this expected and did the compiler make use of the content that I edited when it did the build and link? $ diff Makefile Makefile_Original 61,62c61,62 < OPT= -DNDEBUG -O < BASECFLAGS= +DD64 -Olimit 1500 --- > OPT= -DNDEBUG > BASECFLAGS= +DD64 2.) A lot of failed module and I suspected it is due +DD64 nopt recognized by the compiler. Why the HP-UX compiler did not recognize the option? ld -b +DD64 -lxnet build/temp.hp-ux-B.11.31-ia64-2.7/home/r32813/Build/2.7.1/Python-2.7.1/Modules/mathmodule.o build/temp.hp-ux-B.11.31-ia64-2.7/home/r32813/Build/2.7.1/Python-2.7.1/Modules/_math.o -L/usr/local/lib -lm -o build/lib.hp-ux-B.11.31-ia64-2.7/math.so ld: Unrecognized argument: +DD64 Fatal error. 3.) This is a general question, in the README file there isn't specific instruction on how to enable gcc for 64-bit build. Does gcc support 64-bit build and how to? 4.) These are warning message. I have seen a lot of them. Am I right I can ignore them? I don't see them when I use gcc though. cc -Ae -c +DD64 -g -DNDEBUG -I. -IInclude -I./Include -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c "Include/pyfpe.h", line 8: warning #3750-D: "\" followed by white space is not a line splice Thanks in advance for your input. Here is the output of my make using HP C compiler. Python build finished, but the necessary bits to build these modules were not found: _bsddb _curses _curses_panel _sqlite3 _ssl _tkinter bsddb185 bz2 dl gdbm imageop linuxaudiodev ossaudiodev readline spwd sunaudiodev zlib To find the necessary bits, look in setup.py in detect_modules() for the module's name. Failed to build these modules: _bisect _codecs_cn _codecs_hk _codecs_iso2022 _codecs_jp _codecs_kr _codecs_tw _collections _csv _ctypes _ctypes_test _elementtree _functools _heapq _hotshot _io _json _locale _lsprof _md5 _multibytecodec _multiprocessing _random _sha _socket _struct _testcapi array audioop binascii cmath cPickle crypt cStringIO datetime dbm fcntl future_builtins grp itertools math mmap nis operator parser pyexpat resource select strop syslog termios time unicodedata running build_scripts ---------- components: Build messages: 144123 nosy: wah meng priority: normal severity: normal status: open title: Python 64-bit build on HP Itanium - Executable built successfully but modules failed with HP Compiler type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 16 14:23:22 2011 From: report at bugs.python.org (Wong Wah Meng) Date: Fri, 16 Sep 2011 12:23:22 +0000 Subject: [New-bugs-announce] [issue12992] Python build finished, but the necessary bits to build these modules were not found: _tkinter Message-ID: <1316175802.51.0.740552144626.issue12992@psf.upfronthosting.co.za> New submission from Wong Wah Meng : Hello there, I am building python on HP-UX 11.31 (Itanium ia64). I would like to utilize the _tkinter module in my application however I failed to build it. I think this module requires additional tcl + tk source code placed into certain directory and the configure will do the build accordingly. Can someone let me know what files are needed and where should I place them in terms of directory structure, so that I can build python with that built-in module successfully? Thanks! (PS: I am able to build tcl tk 8.5.9 successfully on the same box however I am not sure how to link that piece of work into python build) ---------- components: Tkinter messages: 144128 nosy: wah meng priority: normal severity: normal status: open title: Python build finished, but the necessary bits to build these modules were not found: _tkinter versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 16 14:34:19 2011 From: report at bugs.python.org (Mayur & Angela Patel-Lam) Date: Fri, 16 Sep 2011 12:34:19 +0000 Subject: [New-bugs-announce] [issue12993] prepared statements in sqlite3 module Message-ID: <1316176459.71.0.201980894918.issue12993@psf.upfronthosting.co.za> New submission from Mayur & Angela Patel-Lam : The sqlite3 module is wonderful, but the one advantage that C/C++ coders have using that system is the ability to use precompiled/prepared SQL statements. Some SQL databases like Postgresql allow you to precompile statements using special SQL statements (e.g. PREPARE), so there is no need to change the python DBI for those database systems. But unfortunately, sqlite3 only offers a C/C++ function, which returns a handle to the prepared statement. I have sought a way to call this from the python DBI, but I simply don't think it's exposed. Since my application interleaves several SQL commands, depending on the results of the last iteration, I can't immediately use executemany() to obtain maximum performance on my code. Precompiled statements offer me the best opportunity to optimize. I can prepare the 2 or 3 most expensive queries in my loop and call them in whatever order I need. There are some estimates that prepared statements can accelerate complex queries by an order of magnitude, as the parser and optimizers don't need to come into play for every call. Would you consider an extension to the sqlite3 DBI to expose prepared statements? Thanks. ---------- components: Library (Lib) messages: 144129 nosy: Mayur.&.Angela.Patel-Lam priority: normal severity: normal status: open title: prepared statements in sqlite3 module type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 16 14:36:38 2011 From: report at bugs.python.org (Wong Wah Meng) Date: Fri, 16 Sep 2011 12:36:38 +0000 Subject: [New-bugs-announce] [issue12994] cx_Oracle failed to load in newly build python 2.7.1 Message-ID: <1316176598.1.0.658499058413.issue12994@psf.upfronthosting.co.za> New submission from Wong Wah Meng : Platform : HP-UX 11.31 on Itanium ia64. HP Compiler: # swlist -l product | grep Compiler ACXX C.06.26.EVAL HP C/aC++ Compiler C-ANSI-C C.06.26.EVAL HP C/aC++ Compiler COMPLIBS B.11.31 Compiler Support Libraries I downloaded cx_Oracle5.1 source code and run python setup.py build and able to build the module. However, when I import the module it just cannot load without giving any explicit indication what goes wrong. Does anyone knows why? $ python setup.py build running build running build_ext building 'cx_Oracle' extension creating build creating build/temp.hp-ux-B.11.31-ia64-2.7-11g cc -Ae -Olimit 1500 -g -DNDEBUG -O +z -I/opt/oracle/product/11.1.0/rdbms/demo -I/opt/oracle/product/11.1.0/rdbms/public -I/home/r32813/Build/2.7.1/Python-2.7.1/Include -I/home/r32813/Build/2.7.1/Python-2.7.1/Lib/.. -c cx_Oracle.c -o build/temp.hp-ux-B.11.31-ia64-2.7-11g/cx_Oracle.o -DBUILD_VERSION=5.0 cc: warning 1913: `1500' does not exist or cannot be read "/home/r32813/Build/2.7.1/Python-2.7.1/Include/pyfpe.h", line 8: warning #3750-D: "\" followed by white space is not a line splice / Copyright (c) 1996. \ ^ "NumberVar.c", line 306: warning #4232-D: conversion from "PyObject *" to a more strictly aligned type "PyFloatObject *" may cause misaligned access doubleValue = PyFloat_AS_DOUBLE(value); ^ "NumberVar.c", line 579: warning #4232-D: conversion from "PyObject *" to a more strictly aligned type "PyFloatObject *" may cause misaligned access var->data[pos] = PyFloat_AS_DOUBLE(value); ^ creating build/lib.hp-ux-B.11.31-ia64-2.7-11g ld -b build/temp.hp-ux-B.11.31-ia64-2.7-11g/cx_Oracle.o -L/opt/oracle/product/11.1.0/lib32 -L/opt/oracle/product/11.1.0 -lclntsh -o build/lib.hp-ux-B.11.31-ia64-2.7-11g/cx_Oracle.so $ ls -lrt build total 0 drwx------ 2 r32813 users 96 Sep 16 20:33 temp.hp-ux-B.11.31-ia64-2.7-11g drwx------ 2 r32813 users 96 Sep 16 20:33 lib.hp-ux-B.11.31-ia64-2.7-11g $ cp build/lib.hp-ux-B.11.31-ia64-2.7-11g/cx_Oracle.so $PYTHONPATH $ python iPython 2.7.1 (r271:86832, Sep 15 2011, 14:46:37) [C] on hp-ux11 Type "help", "copyright", "credits" or "license" for more information. >>> >>> import cx_Oracle Traceback (most recent call last): File "", line 1, in ImportError: Failed to load /home/r32813/Build/2.7.1/Python-2.7.1/Lib/cx_Oracle.so >>> $ env | grep PYTHON PYTHONPATH=/home/r32813/Build/2.7.1/Python-2.7.1/Lib $ ---------- components: Extension Modules messages: 144130 nosy: wah meng priority: normal severity: normal status: open title: cx_Oracle failed to load in newly build python 2.7.1 type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 16 19:50:14 2011 From: report at bugs.python.org (Vincent Vande Vyvre) Date: Fri, 16 Sep 2011 17:50:14 +0000 Subject: [New-bugs-announce] [issue12995] Different behaviours with between v3.1.2 and v3.2.2 Message-ID: <1316195414.51.0.601610361957.issue12995@psf.upfronthosting.co.za> New submission from Vincent Vande Vyvre : Hi, Trying this code: ------------------------------ # -*- coding: utf-8 -*- import os import sys import platform print('\nPython version: ', sys.version.split()[0]) print(platform.platform()) paths = ['/home/vincent/image.jpg', '/home/vincent/?????.jpg'] for path in paths: print('\n', type(path)) try: print(path) except UnicodeEncodeError as why: print('print > {0}'.format(why)) try: if not os.path.exists(path): print('File not found!') else: print('File exists') except UnicodeEncodeError as why: print('os.path.exist > {0}'.format(why)) try: stats = os.stat(path) print(stats.st_atime) except UnicodeEncodeError as why: print('os.stat > {0}'.format(why)) try: f = open(path, 'b') f.close() except Exception as why: print('open > {0}'.format(why)) ------------------------------------ on python 3.1.2: ------------------------------------ vincent at tiemoko:~/Python/oqapy/devel$ python3 test_string.py Python version: 3.1.2 Linux-2.6.32-33-generic-i686-with-Ubuntu-10.04-lucid /home/vincent/image.jpg File exists 1316179838.94 open > Must have exactly one of read/write/append mode /home/vincent/?????.jpg File exists 1316179838.81 open > Must have exactly one of read/write/append mode vincent at tiemoko:~/Python/oqapy/devel$ ------------------------------------------------ on python 3.2.2: ------------------------------------------------ [vincent at myhost ~]$ python test_string.py Python version: 3.2.2 Linux-3.0-ARCH-x86_64-Pentium-R-_Dual-Core_CPU_T4500_ at _2.30GHz-with-glibc2.2.5 /home/vincent/image.jpg File exists 1316187109.6772401 open > Must have exactly one of read/write/append mode and at most one plus print > 'ascii' codec can't encode characters in position 14-18: ordinal not in range(128) os.path.exist > 'ascii' codec can't encode characters in position 14-18: ordinal not in range(128) os.stat > 'ascii' codec can't encode characters in position 14-18: ordinal not in range(128) open > 'ascii' codec can't encode characters in position 14-18: ordinal not in range(128) [vincent at myhost ~]$ ------------------------------------------------------------------- Any 'path = path.decode('utf-8')', 'encode(bhla)', 'sys.getfilesystemencoding()', 'magic_transform(abracadabra)' don't change anythings. Thanks for yours advice. vince ---------- components: Unicode messages: 144143 nosy: VinsS priority: normal severity: normal status: open title: Different behaviours with between v3.1.2 and v3.2.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 16 20:40:55 2011 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Fri, 16 Sep 2011 18:40:55 +0000 Subject: [New-bugs-announce] [issue12996] multiprocessing.Connection endianness issue Message-ID: <1316198455.11.0.87432837805.issue12996@psf.upfronthosting.co.za> New submission from Charles-Fran?ois Natali : Since the rewrite in pure Python of multiprocessing.Connection (issue #11743), multiprocessing.Connection sends and receives the length of the data (used as header) in host byte order. This will break if the connection's endpoints are on machine with different endianness. Patch attached (it also removes an unnecessary computation of the length of the data being sent). ---------- components: Library (Lib) files: multiprocessing_conn_endianness.diff keywords: needs review, patch messages: 144148 nosy: haypo, neologix priority: normal severity: normal stage: patch review status: open title: multiprocessing.Connection endianness issue type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file23171/multiprocessing_conn_endianness.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 17 00:54:19 2011 From: report at bugs.python.org (Mark Bucciarelli) Date: Fri, 16 Sep 2011 22:54:19 +0000 Subject: [New-bugs-announce] [issue12997] sqlite3: PRAGMA foreign_keys = ON doesn't work Message-ID: <1316213659.17.0.858548174329.issue12997@psf.upfronthosting.co.za> New submission from Mark Bucciarelli : If I read http://bugs.python.org/issue10740#msg132470 correctly, the foreign_keys PRAGMA is a no-op b/c "The python sqlite module automatically commits open transactions when it encounters a DDL statement." Entering as a separate issue as I'm not sure solving 10740 is required to solve this one. ---------- components: None files: t.py messages: 144166 nosy: Mark.Bucciarelli priority: normal severity: normal status: open title: sqlite3: PRAGMA foreign_keys = ON doesn't work type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file23177/t.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 17 08:29:26 2011 From: report at bugs.python.org (M) Date: Sat, 17 Sep 2011 06:29:26 +0000 Subject: [New-bugs-announce] [issue12998] Memory leak with CTypes Structure Message-ID: <1316240966.68.0.395492985431.issue12998@psf.upfronthosting.co.za> New submission from M : When using Python 2.5.4 on Windows (and potentially other versions and platforms), usage of CTypes like the following cause a memory leak. The memory leak can be verified with ProcessExplorer, as the memory Python takes up keeps increasing until eventually Python will get a MemoryError. ---- import ctypes def hi(): class c1(ctypes.Structure): _fields_=[('f1',ctypes.c_uint8)] class c2(ctypes.Structure): _fields_=[('g1',c1*2)] while True: test=hi() ---- This is true even if the garbage collector is called explicitly: ---- import gc import ctypes def hi(): class c1(ctypes.Structure): _fields_=[('f1',ctypes.c_uint8)] class c2(ctypes.Structure): _fields_=[('g1',c1*2)] while True: test=hi() test2=gc.collect() ---- It is also true if "del" is called on the return value of the function. In order to get the memory leak, it appears to be necessary to have two Structure classes, with one of them containing a "multiple" of the other one as a field. In a code project where functions returning Structure classes similarly to this example are being used, MemoryError has been encountered. See: http://stackoverflow.com/users/553702/user553702 ---------- components: ctypes messages: 144170 nosy: a01 priority: normal severity: normal status: open title: Memory leak with CTypes Structure type: resource usage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 17 09:17:25 2011 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sat, 17 Sep 2011 07:17:25 +0000 Subject: [New-bugs-announce] [issue12999] _XOPEN_SOURCE usage on Solaris Message-ID: <1316243845.31.0.573111003636.issue12999@psf.upfronthosting.co.za> Changes by Charles-Fran?ois Natali : ---------- nosy: haypo, neologix priority: normal severity: normal stage: needs patch status: open title: _XOPEN_SOURCE usage on Solaris type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 17 14:06:15 2011 From: report at bugs.python.org (jorge.seifert) Date: Sat, 17 Sep 2011 12:06:15 +0000 Subject: [New-bugs-announce] [issue13000] unhandled exception at install Message-ID: <1316261175.24.0.481643908897.issue13000@psf.upfronthosting.co.za> New submission from jorge.seifert : Unhandled exception just at when start to install on windows 2003 ---------- components: Installation messages: 144182 nosy: jorge.seifert priority: normal severity: normal status: open title: unhandled exception at install type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 17 16:34:31 2011 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sat, 17 Sep 2011 14:34:31 +0000 Subject: [New-bugs-announce] [issue13001] test_socket.testRecvmsgTrunc failure on FreeBSD 7.2 buildbot Message-ID: <1316270071.04.0.179563462632.issue13001@psf.upfronthosting.co.za> New submission from Charles-Fran?ois Natali : http://www.python.org/dev/buildbot/all/builders/x86 FreeBSD 7.2 3.x/builds/2129/steps/test/logs/stdio """ ====================================================================== FAIL: testRecvmsgTrunc (test.test_socket.RecvmsgUDPTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_socket.py", line 1666, in testRecvmsgTrunc self.checkFlags(flags, eor=False) File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_socket.py", line 1354, in checkFlags self.assertEqual(flags & mask, checkset & mask) AssertionError: 0 != 16 ====================================================================== FAIL: testRecvmsgTrunc (test.test_socket.RecvmsgIntoUDPTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_socket.py", line 1666, in testRecvmsgTrunc self.checkFlags(flags, eor=False) File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_socket.py", line 1354, in checkFlags self.assertEqual(flags & mask, checkset & mask) AssertionError: 0 != 16 """ This fails because MSG_TRUNC isn't always set in msg_flags when receiving a truncated datagram with recvmsg(). It's a known kernel bug (http://svnweb.freebsd.org/base?view=revision&revision=211030), fixed in FreeBSD 8 (and the test indeed passes on the FreeBSD 8 buildbot). The patch attached skips the test on FreeBSD < 8 (and introduces @support.requires_freebsd_version). ---------- components: Tests files: freebsd_msgtrunc.diff keywords: needs review, patch messages: 144188 nosy: haypo, neologix priority: normal severity: normal stage: patch review status: open title: test_socket.testRecvmsgTrunc failure on FreeBSD 7.2 buildbot type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file23182/freebsd_msgtrunc.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 17 16:43:55 2011 From: report at bugs.python.org (Stefan Krah) Date: Sat, 17 Sep 2011 14:43:55 +0000 Subject: [New-bugs-announce] [issue13002] peephole.c: unused parameter Message-ID: <1316270635.94.0.378241205596.issue13002@psf.upfronthosting.co.za> New submission from Stefan Krah : peephole.c: CONST_STACK_TOP(x) has an unused parameter. ---------- components: Interpreter Core files: peephole_unused_parameter.diff keywords: patch messages: 144189 nosy: skrah priority: normal severity: normal stage: patch review status: open title: peephole.c: unused parameter type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file23183/peephole_unused_parameter.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 18 06:55:23 2011 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 18 Sep 2011 04:55:23 +0000 Subject: [New-bugs-announce] [issue13003] Bug in equivalent code for itertools.izip_longest Message-ID: <1316321723.69.0.619993124857.issue13003@psf.upfronthosting.co.za> New submission from Eli Bendersky : Regarding the sample code in: http://docs.python.org/library/itertools#itertools.izip_longest If an IndexError is raised inside an iterator in the "equivalent" code from the docs, the generator stops and the error is swallowed. If an IndexError is raised inside an iterator in the "izip_longest_next" code in CPython's "Modules/itertoolsmodule.c", the generator stops and the error propagates. --- Reported by Adam Forsyth on the docs mailing list. More details in this SO discussion: http://stackoverflow.com/questions/7392902/izip-longest-in-itertools-how-does-rasing-indexerror-inside-the-iterator-work ---------- assignee: docs at python components: Documentation messages: 144228 nosy: docs at python, eli.bendersky priority: normal severity: normal status: open title: Bug in equivalent code for itertools.izip_longest versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 18 19:41:13 2011 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 18 Sep 2011 17:41:13 +0000 Subject: [New-bugs-announce] [issue13004] pprint: add option to truncate seqeunces Message-ID: <1316367673.59.0.101028933355.issue13004@psf.upfronthosting.co.za> New submission from Terry J. Reedy : >From python-ideas thread "truncate sequences in pretty-print ?" On Sat, Sep 17, 2011 at 9:59 PM, Steven Samuel Cole > i use pprint quite a bit during development to give me quick insight > into what is going on inside my application. > however, when there's any sequences involved, the output becomes less > useful the longer these sequences are - i often find myself scrolling > around (or even searching) in the terminal window, trying to find the > bit of output i am interested in. > > imo, it would be great if pprint had a parameter 'max_len' or so that > reduces output of every sequence to a maximum and inserts something > like '...' to indicate truncation, e.g. > {'my key': ['my list item 01', > 'my list item 02', > 'my list item 03', > 'my list item 04', > 'my list item 05', > 'my list item 06', > 'my list item 07', > 'my list item 08', > '...', > 'my list item 10',]} > > somewhat comparable to the '...' already printed when a structure is > more deeply nested than you want to know right now. On 9/18/2011 10:59 AM, Guido van Rossum wrote: Agreed, this would be a useful feature. I've reimplemented something like pprint a few times and always had to implement this truncation feature. If you or someone can contribute a patch that would be much appreciated! ---------- components: Library (Lib) messages: 144247 nosy: terry.reedy priority: normal severity: normal stage: test needed status: open title: pprint: add option to truncate seqeunces type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 18 21:24:54 2011 From: report at bugs.python.org (Luciano Ramalho) Date: Sun, 18 Sep 2011 19:24:54 +0000 Subject: [New-bugs-announce] [issue13005] operator module docs include repeat Message-ID: <1316373895.0.0.0510419466495.issue13005@psf.upfronthosting.co.za> New submission from Luciano Ramalho : The operator module documentation for versions 3.2 and 3.3 includes the repeat function in a table "9.3.1. Mapping Operators to Functions" [1], but fails to mention that the repeat function is deprecated and mul should be used instead, as described in the 2.7 version of the operator module docs [2]. The main entry for the repeat function was removed in the 3.2 and 3.3 docs, only the mention in the table remains [1]. [1] http://docs.python.org/py3k/library/operator#mapping-operators-to-functions [2] http://docs.python.org/library/operator#operator.__repeat__ ---------- assignee: docs at python components: Documentation messages: 144251 nosy: docs at python, luciano priority: normal severity: normal status: open title: operator module docs include repeat versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 19 06:32:46 2011 From: report at bugs.python.org (Stephen Vavasis) Date: Mon, 19 Sep 2011 04:32:46 +0000 Subject: [New-bugs-announce] [issue13006] bug in core python variable binding Message-ID: <1316406766.78.0.388912606851.issue13006@psf.upfronthosting.co.za> New submission from Stephen Vavasis : There seems to be a serious bug in how python 2.7.2 binds variables to values. In the attached function buildfunclist, you see that there is a variable called 'funclist' that is initialized to [], and then is modified only with 'append' calls. This means that once append is called 46 times, one expects that funclist[45] is defined and will not change? And yet funclist[45] changes several times as more data items are appended. The same bug is present in 3.2.2. My operating system is Windows 7 64-bit on a Lenovo Thinkpad T410. I'm guessing that there is a problem with python's lazy copying-- it is a bit too lazy and failing to make copies when lists are changed. To exhibit this bug, proceed as follows: import pickle h = open('combined_oplists_pickle','r') combined_oplists = pickle.Unpickler(h).load() import pybugreport funclist,funcdist = pybugreport.buildfunclist(combined_oplists) and then you will see funclist[45] printed out on two successive iterations. It has changed as a result of an append operation, which should not happen. (It's 6th entry is longer.) Here is the output: funclist[45] = [0, 22973, '$FUNC', 'splitBoxInterior', [['InArg', [[['', 'ActiveBoxVectorI', '::', 'iterator', ''], ['thisboxdata_p', '']], [['', 'FaceIndex', ''], ['faceind', '']]]], ['InOutArg', [[['', 'ActiveBoxVectorI', ''], ['interiorOrbitNextLev', '']]]], ['RefGlobal', [[['', 'MIndex', ''], ['guiActiveBoxCount', '']]]], ['Workspace', [[['', 'QMGVector', '<', '', 'BoxCreationData', '', '> ', ''], ['boxCreationVec', '']]]]], [], [[0, 23017], [0, 23048], [0, 23068], [0, 23069]], [[0, 23001]]] funclist[45] = [0, 22973, '$FUNC', 'splitBoxInterior', [['InArg', [[['', 'ActiveBoxVectorI', '::', 'iterator', ''], ['thisboxdata_p', '']], [['', 'FaceIndex', ''], ['faceind', '']]]], ['InOutArg', [[['', 'ActiveBoxVectorI', ''], ['interiorOrbitNextLev', '']]]], ['RefGlobal', [[['', 'MIndex', ''], ['guiActiveBoxCount', '']]]], ['Workspace', [[['', 'QMGVector', '<', '', 'BoxCreationData', '', '> ', ''], ['boxCreationVec', '']]]]], [[0, 23115], [0, 23116], [0, 23117], [0, 23118], [0, 23119], [0, 23120], [0, 23121], [0, 23122], [0, 23123], [0, 23124], [0, 23125], [0, 23126], [0, 23127], [0, 23128], [0, 23129], [0, 23130], [0, 23131], [0, 23132], [0, 23133], [0, 23134], [0, 23135], [0, 23136], [0, 23139], [0, 23140], [0, 23141], [0, 23142], [0, 23143], [0, 23144], [0, 23145], [0, 23146]], [[0, 23017], [0, 23048], [0, 23068], [0, 23069], [0, 23137], [0, 23138], [0, 23147], [0, 23148], [0, 23149], [0, 23161]], [[0, 23001]]] ---------- components: Interpreter Core files: pybugreport.zip messages: 144261 nosy: vavasis priority: normal severity: normal status: open title: bug in core python variable binding type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file23190/pybugreport.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 19 16:18:09 2011 From: report at bugs.python.org (Marien Zwart) Date: Mon, 19 Sep 2011 14:18:09 +0000 Subject: [New-bugs-announce] [issue13007] gdbm 1.9 has new magic that whichdb does not recognize Message-ID: <1316441889.97.0.558871663517.issue13007@psf.upfronthosting.co.za> New submission from Marien Zwart : dbm.whichdb (python 3) and whichdb.whichdb (python 2) only check for "magic == 0x13579ace" to recognize gdbm databases. The recently released gdbm 1.9 series adds 0x13579acd (for "32bit") and 0x13579acf (for "64bit") magics (see src/gdbmconst.h in the gdbm-1.9 or gdbm-1.9.1 source tree). Python's gdbm linked to gdbm 1.9 creates databases with the new magic, which causes the whichdb tests to fail. To reproduce this just build python against the new libgdbm and run test/test_dbm.py. whichdb should probably just check for the two new magic numbers too. This will cause it to recognize the new gdbm databases even if python's gdbm extension is linked to an older version of gdbm that cannot open them, but that is probably less likely to cause problems than the current behavior, where a database created by python's gdbm is not recognized as such. (I've left the "Versions" field untouched as I do not know which versions of python this should be backported to, but it affects all of them.) ---------- components: Library (Lib) messages: 144277 nosy: marienz priority: normal severity: normal status: open title: gdbm 1.9 has new magic that whichdb does not recognize type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 19 16:21:24 2011 From: report at bugs.python.org (anatoly techtonik) Date: Mon, 19 Sep 2011 14:21:24 +0000 Subject: [New-bugs-announce] [issue13008] syntax error when pasting valid snippet into console without empty string after the function def Message-ID: <1316442084.93.0.49113454288.issue13008@psf.upfronthosting.co.za> New submission from anatoly techtonik : This is self-explanative. Function definitions are identical. Syntax error caused by the absence of empty line after the function definition. Python 2.7.1 (r271:86832, Apr 12 2011, 16:16:18) [GCC 4.6.0 20110331 (Red Hat 4.6.0-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> def get_size(start_path = '.'): ... total_size = 0 ... for dirpath, dirnames, filenames in os.walk(start_path): ... for f in filenames: ... fp = os.path.join(dirpath, f) ... total_size += os.path.getsize(fp) ... return total_size ... >>> print get_size() 1595969238 >>> def get_size(start_path = '.'): ... total_size = 0 ... for dirpath, dirnames, filenames in os.walk(start_path): ... for f in filenames: ... fp = os.path.join(dirpath, f) ... total_size += os.path.getsize(fp) ... return total_size ... print get_size() File "", line 8 print get_size() ^ SyntaxError: invalid syntax ---------- messages: 144278 nosy: techtonik priority: normal severity: normal status: open title: syntax error when pasting valid snippet into console without empty string after the function def versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 19 17:08:13 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 19 Sep 2011 15:08:13 +0000 Subject: [New-bugs-announce] [issue13009] Remove documentation in distutils2 repo Message-ID: <1316444893.0.0.327846688186.issue13009@psf.upfronthosting.co.za> New submission from ?ric Araujo : The docs for packaging now live at docs.python.org. Maintaining separate documentation for the distutils2 backport would take much time for little benefit. Tarek agreed that we could just delete them, so I will remove them, add a file to mention their new location and update the PyPI and packages.python.org pages. I?m opening this report to let people know, I don?t need a patch. ---------- assignee: eric.araujo components: Distutils2 messages: 144285 nosy: alexis, eric.araujo priority: normal severity: normal status: open title: Remove documentation in distutils2 repo versions: 3rd party _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 19 18:38:18 2011 From: report at bugs.python.org (Steven Samuel Cole) Date: Mon, 19 Sep 2011 16:38:18 +0000 Subject: [New-bugs-announce] [issue13010] devguide doc: ./python.exe on OS X Message-ID: <1316450298.9.0.0678816170988.issue13010@psf.upfronthosting.co.za> New submission from Steven Samuel Cole : it says in the last paragraph of the chapter at http://docs.python.org/devguide/setup.html#unix: [...] ./python.exe on OS X [...] .exe seems to indicate that should probably be './python.exe on Windows' ---------- assignee: docs at python components: Documentation messages: 144298 nosy: docs at python, ssc priority: normal severity: normal status: open title: devguide doc: ./python.exe on OS X _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 20 03:44:51 2011 From: report at bugs.python.org (Malcolm Purvis) Date: Tue, 20 Sep 2011 01:44:51 +0000 Subject: [New-bugs-announce] [issue13011] Frozen programs require the original build directory in order to run. Message-ID: <1316483091.36.0.96391936283.issue13011@psf.upfronthosting.co.za> New submission from Malcolm Purvis : In Python 2.7.2, Linux executables built with freeze.py will only run on the machine that contains the original build directory. This defeats the purpose of having frozen programs. This problem did not exist in Python 2.5. The following steps reproduce the problem: 1) Build a copy of python: $ tar -xf Python-2.7.2.tar.bz2 $ cd Python-2.7.2 $ ./configure --prefix=`pwd`/install $ make $ make install 2) In another directory, build a frozen program: $ echo 'print "Hello World"' >hello.py $ ~/src/Python-2.7.2/python ~/src/Python-2.7.2/Tools/freeze/freeze.py hello.py $ make $ ./hello Hello World Copy the binary to another machine: $ $ ./hello Traceback (most recent call last): File "/home/malcolmp/src/Python-2.7.2/Lib/site.py", line 563, in File "/home/malcolmp/src/Python-2.7.2/Lib/site.py", line 545, in main File "/home/malcolmp/src/Python-2.7.2/Lib/site.py", line 278, in addusersitepackages File "/home/malcolmp/src/Python-2.7.2/Lib/site.py", line 253, in getusersitepackages File "/home/malcolmp/src/Python-2.7.2/Lib/site.py", line 243, in getuserbase File "/home/malcolmp/src/Python-2.7.2/Lib/sysconfig.py", line 520, in get_config_var File "/home/malcolmp/src/Python-2.7.2/Lib/sysconfig.py", line 419, in get_config_vars File "/home/malcolmp/src/Python-2.7.2/Lib/sysconfig.py", line 287, in _init_posix IOError: invalid Python installation: unable to open /home/malcolmp/src/Python-2.7.2/install/lib/python2.7/config/Makefile (No such file or directory) ---------- components: Demos and Tools messages: 144315 nosy: malcolmp priority: normal severity: normal status: open title: Frozen programs require the original build directory in order to run. type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 20 15:44:07 2011 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 20 Sep 2011 13:44:07 +0000 Subject: [New-bugs-announce] [issue13012] Allow keyword argument in str.splitlines() Message-ID: <1316526247.48.0.14583848283.issue13012@psf.upfronthosting.co.za> New submission from Mark Dickinson : The docstring of str.splitlines says: splitlines(...) S.splitlines([keepends]) -> list of strings Return a list of the lines in S, breaking at line boundaries. Line breaks are not included in the resulting list unless keepends is given and true. Currently the optional argument can only be specified positionally. What do people think about also allowing this argument to be specified by keyword? (And applying the same change to bytes.splitlines.) The main motivation here is readability: in long_string.splitlines(keepends=True) it's fairly clear what the boolean argument is doing. But in long_string.splitlines(True) it's much less clear. (This came up during a Python training class that I was running recently.) I'm not advocating making the argument keyword-only; just allowing those who want to specify it by keyword to do so. There are many other str methods that don't accept keyword arguments, but it's only this one where I think readability would really benefit. ---------- components: Interpreter Core messages: 144326 nosy: mark.dickinson priority: normal severity: normal stage: needs patch status: open title: Allow keyword argument in str.splitlines() type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 20 16:48:11 2011 From: report at bugs.python.org (Suman Saha) Date: Tue, 20 Sep 2011 14:48:11 +0000 Subject: [New-bugs-announce] [issue13013] Resource is not released before returning from the functiion Message-ID: <1316530091.14.0.467899274194.issue13013@psf.upfronthosting.co.za> New submission from Suman Saha : Something that is allocated using PyTuple_Pack is not freed on one error path. ---------- files: python_patch1 messages: 144330 nosy: Suman.Saha priority: normal severity: normal status: open title: Resource is not released before returning from the functiion type: resource usage Added file: http://bugs.python.org/file23198/python_patch1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 20 16:51:15 2011 From: report at bugs.python.org (Suman Saha) Date: Tue, 20 Sep 2011 14:51:15 +0000 Subject: [New-bugs-announce] [issue13014] Resource is not released before returning from the functiion Message-ID: <1316530275.76.0.31607583855.issue13014@psf.upfronthosting.co.za> New submission from Suman Saha : Something that is allocated using PyList_New is not freed on one error path. ---------- files: python_patch2 messages: 144331 nosy: Suman.Saha priority: normal severity: normal status: open title: Resource is not released before returning from the functiion type: resource usage Added file: http://bugs.python.org/file23199/python_patch2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 20 16:53:26 2011 From: report at bugs.python.org (Suman Saha) Date: Tue, 20 Sep 2011 14:53:26 +0000 Subject: [New-bugs-announce] [issue13015] Resource is not released before returning from the functiion Message-ID: <1316530406.22.0.00922720094034.issue13015@psf.upfronthosting.co.za> New submission from Suman Saha : Something that is allocated using PyDict_Type.tp_repr is not freed on one error path. ---------- files: python_patch3 messages: 144332 nosy: Suman.Saha priority: normal severity: normal status: open title: Resource is not released before returning from the functiion type: resource usage Added file: http://bugs.python.org/file23200/python_patch3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 20 16:54:34 2011 From: report at bugs.python.org (Suman Saha) Date: Tue, 20 Sep 2011 14:54:34 +0000 Subject: [New-bugs-announce] [issue13016] Resource is not released before returning from the functiion Message-ID: <1316530474.09.0.885561459136.issue13016@psf.upfronthosting.co.za> New submission from Suman Saha : Something that is allocated using PySequence_Fast is not freed on one error path. ---------- files: python_patch4 messages: 144333 nosy: Suman.Saha priority: normal severity: normal status: open title: Resource is not released before returning from the functiion type: resource usage Added file: http://bugs.python.org/file23201/python_patch4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 20 16:55:20 2011 From: report at bugs.python.org (Suman Saha) Date: Tue, 20 Sep 2011 14:55:20 +0000 Subject: [New-bugs-announce] [issue13017] Resource is not released before returning from the functiion Message-ID: <1316530520.98.0.265221985232.issue13017@psf.upfronthosting.co.za> New submission from Suman Saha : Something that is allocated using conv_content_model is not freed on one error path. ---------- files: python_patch5 messages: 144334 nosy: Suman.Saha priority: normal severity: normal status: open title: Resource is not released before returning from the functiion type: resource usage Added file: http://bugs.python.org/file23202/python_patch5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 20 16:56:04 2011 From: report at bugs.python.org (Suman Saha) Date: Tue, 20 Sep 2011 14:56:04 +0000 Subject: [New-bugs-announce] [issue13018] Resource is not released before returning from the functiion Message-ID: <1316530564.57.0.408350668852.issue13018@psf.upfronthosting.co.za> New submission from Suman Saha : Something that is allocated using PyObject_CallObjec is not freed on one or more error paths. ---------- files: python_patch6 messages: 144335 nosy: Suman.Saha priority: normal severity: normal status: open title: Resource is not released before returning from the functiion type: resource usage Added file: http://bugs.python.org/file23203/python_patch6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 20 16:56:51 2011 From: report at bugs.python.org (Suman Saha) Date: Tue, 20 Sep 2011 14:56:51 +0000 Subject: [New-bugs-announce] [issue13019] Resource is not released before returning from the functiion Message-ID: <1316530611.41.0.519397979389.issue13019@psf.upfronthosting.co.za> New submission from Suman Saha : 1. Something that is allocated using PyObject_GetIter is not freed on one error path. 2. Something that is allocated using PyByteArray_FromStringAndSize is not freed on one error path ---------- files: python_patch7 messages: 144336 nosy: Suman.Saha priority: normal severity: normal status: open title: Resource is not released before returning from the functiion type: resource usage Added file: http://bugs.python.org/file23204/python_patch7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 20 16:57:35 2011 From: report at bugs.python.org (Suman Saha) Date: Tue, 20 Sep 2011 14:57:35 +0000 Subject: [New-bugs-announce] [issue13020] Resource is not released before returning from the functiion Message-ID: <1316530655.8.0.189777030615.issue13020@psf.upfronthosting.co.za> New submission from Suman Saha : Something that is allocated using PySequence_Fast is not freed on one error path. ---------- files: python_patch8 messages: 144337 nosy: Suman.Saha priority: normal severity: normal status: open title: Resource is not released before returning from the functiion type: resource usage Added file: http://bugs.python.org/file23205/python_patch8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 20 16:58:13 2011 From: report at bugs.python.org (Suman Saha) Date: Tue, 20 Sep 2011 14:58:13 +0000 Subject: [New-bugs-announce] [issue13021] Resource is not released before returning from the functiion Message-ID: <1316530693.5.0.703564325805.issue13021@psf.upfronthosting.co.za> New submission from Suman Saha : Something that is allocated using PyUnicode_DecodeFSDefault is not freed on one error path. ---------- files: python_patch9 messages: 144338 nosy: Suman.Saha priority: normal severity: normal status: open title: Resource is not released before returning from the functiion type: resource usage Added file: http://bugs.python.org/file23206/python_patch9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 20 23:00:49 2011 From: report at bugs.python.org (David Watson) Date: Tue, 20 Sep 2011 21:00:49 +0000 Subject: [New-bugs-announce] [issue13022] _multiprocessing.recvfd() doesn't check that file descriptor was actually received Message-ID: <1316552449.49.0.318949569142.issue13022@psf.upfronthosting.co.za> New submission from David Watson : The function _multiprocessing.recvfd() calls recvmsg() and expects to receive a file descriptor in an SCM_RIGHTS control message, but doesn't check that such a control message is actually present. So if the sender sends data without an accompanying file descriptor, recvfd() will the return the integer value of the uninitialized CMSG_DATA() buffer. The attached recvfd-check.diff checks for a complete control message of the correct type, and raises RuntimeError if it isn't there. This matches the behaviour of the proposed pure-Python implementation at issue #12981. The patch includes a test case, but like the other recently-added tests for the function, it isn't guarded against multiprocessing.reduction being unavailable. Issue #12981 has a patch "skip_reduction.diff" (already in 3.3) to fix this, and I'm attaching recvfd-skip-reduction-fix.diff to apply on top of it and guard the new test case as well. ---------- components: Extension Modules files: recvfd-check.diff keywords: patch messages: 144351 nosy: baikie priority: normal severity: normal status: open title: _multiprocessing.recvfd() doesn't check that file descriptor was actually received type: behavior versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file23214/recvfd-check.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 21 00:28:27 2011 From: report at bugs.python.org (=?utf-8?q?Denilson_Figueiredo_de_S=C3=A1?=) Date: Tue, 20 Sep 2011 22:28:27 +0000 Subject: [New-bugs-announce] [issue13023] argparse should allow displaying argument default values in addition to setting a formatter class Message-ID: <1316557707.22.0.0719652961871.issue13023@psf.upfronthosting.co.za> New submission from Denilson Figueiredo de S? : In my script, I wanted two things at the same time: 1. Setting a formatter class so that the epilog would have the line breaks preserved. 2. Telling argparse to automatically display default values for all arguments. Currently, both things are handled by the same configuration parameter: formatter_class This means we can either pass argparse.RawDescriptionHelpFormatter or argparse.ArgumentDefaultsHelpFormatter, but not both. I did a hackish workaround by subclassing both formatters, and passing my (empty) subclass to ArgumentParser. It works for now, but it might break on future versions. The ideal solution, however, would have a native support for both features, or at least explicitly allowing subclassing. Maybe ArgumentDefaultsHelpFormatter could be transformed into a simple boolean parameter passed to ArgumentParser object (and maybe also passed to add_argument() method), instead of being a formatter class. ---------- components: Library (Lib) messages: 144354 nosy: denilsonsa priority: normal severity: normal status: open title: argparse should allow displaying argument default values in addition to setting a formatter class type: feature request versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 21 01:02:09 2011 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Sep 2011 23:02:09 +0000 Subject: [New-bugs-announce] [issue13024] cgitb uses stdout encoding Message-ID: <1316559729.08.0.724028142076.issue13024@psf.upfronthosting.co.za> New submission from STINNER Victor : cgitb module writes its output to sys.stdout by default and so encode its HTML document into stdout encoding, whereas it doesn't specify the HTML encoding. Moreover it uses stdout error handler. If the locale encoding is ASCII whereas a filename in the traceback contains a non-ASCII character, it fails to encode the non-ASCII characters. Another error handler should be used, xmlcharrefreplace is a good candidate. To reproduce this issue, use the following script with ASCII locale encoding and a non-ASCII character in name of the current directory: --- import cgitb cgitb.enable() raise ValueError("Hello World") --- Attached patch uses a workaround similar to the one used in Log._log() from distutils.logging. ---------- components: Library (Lib) files: cgitb.patch keywords: patch messages: 144356 nosy: haypo priority: normal severity: normal status: open title: cgitb uses stdout encoding versions: Python 3.3 Added file: http://bugs.python.org/file23218/cgitb.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 21 01:07:07 2011 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Sep 2011 23:07:07 +0000 Subject: [New-bugs-announce] [issue13025] mimetypes should read the rule file using UTF-8, not the locale encoding Message-ID: <1316560027.85.0.800562759244.issue13025@psf.upfronthosting.co.za> New submission from STINNER Victor : On Debian and Ubuntu, /etc/mime.types file is pure ASCII, but on Fedora 15 it contains a non-ASCII character, ? (U+00B3), in the line: "application/vnd.geocube+xml g3 g?" And the file is encoded in UTF-8. That's why Python should read this file from UTF-8 instead of the locale encoding, because the locale encoding can be ASCII. Attached patch implements this idead. I think that it is a bug and so it should also be fixed in Python 3.2. (Python 2.7 reads the file in binary mode, it doesn't care of the encoding.) ---------- files: mimetypes_encoding.patch keywords: patch messages: 144357 nosy: haypo, sandro.tosi, terry.reedy priority: normal severity: normal status: open title: mimetypes should read the rule file using UTF-8, not the locale encoding versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file23219/mimetypes_encoding.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 22 00:02:38 2011 From: report at bugs.python.org (Arnaud Delobelle) Date: Wed, 21 Sep 2011 22:02:38 +0000 Subject: [New-bugs-announce] [issue13026] Dis module - documentation of MAKE_FUNCTION Message-ID: <1316642558.64.0.601129278503.issue13026@psf.upfronthosting.co.za> New submission from Arnaud Delobelle : The description of the opcode MAKE_FUNCTION in the dis module document is out of date. It still describes the 2.X version of the opcode: """ MAKE_FUNCTION(argc) Pushes a new function object on the stack. TOS is the code associated with the function. The function object is defined to have argc default parameters, which are found below TOS. """ According to http://hg.python.org/cpython/file/default/Python/ceval.c#l2684: 2684 int posdefaults = oparg & 0xff; 2685 int kwdefaults = (oparg>>8) & 0xff; 2686 int num_annotations = (oparg >> 16) & 0x7fff; So the documentation should read something like """ MAKE_FUNCTION(argc) Pushes a new function object on the stack. TOS is the code associated with the function. The function object is defined to have argc & 0xFF positional default parameters, (argc >> 8) & 0xFF keyword only default parameters, and (argc >> 16) & 0x7FFF parameter annotations which are push below TOS in this order. For each keyword only default, the name of the parameter is pushed just below its default value. On top of all the annotations, a tuple is pushed listing the parameter names for these annotations. """ ---------- assignee: docs at python components: Documentation messages: 144393 nosy: arno, docs at python, terry.reedy priority: normal severity: normal status: open title: Dis module - documentation of MAKE_FUNCTION versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 22 15:56:26 2011 From: report at bugs.python.org (Balachandran Sivakumar) Date: Thu, 22 Sep 2011 13:56:26 +0000 Subject: [New-bugs-announce] [issue13027] python 2.6.6 interpreter core dumps on modules command from help prompt Message-ID: <1316699786.14.0.395194212825.issue13027@psf.upfronthosting.co.za> New submission from Balachandran Sivakumar : >From the python 2.6.6 interpreter on Debian Lenny(Debian 5.0), on invoking help(), and issuing the modules command, the interpreter seg faults, and dumps core. Also, it throws a few Deprecated warnings for modules like md5. The gdb backtrace on the core had 1 frame. attaching the bt in a separate file. Core was generated by `python'. Program terminated with signal 11, Segmentation fault. #0 0xb5d72e47 in XQueryExtension () from /usr/lib/libX11.so.6 (gdb) ---------- components: Interpreter Core files: python_bt.log messages: 144408 nosy: Balachandran.Sivakumar priority: normal severity: normal status: open title: python 2.6.6 interpreter core dumps on modules command from help prompt type: crash versions: Python 2.6 Added file: http://bugs.python.org/file23224/python_bt.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 22 20:56:47 2011 From: report at bugs.python.org (Roger) Date: Thu, 22 Sep 2011 18:56:47 +0000 Subject: [New-bugs-announce] [issue13028] python wastes linux users time by checking for dylib on each dynamic library load Message-ID: <1316717807.43.0.635056141333.issue13028@psf.upfronthosting.co.za> New submission from Roger : instead it should check for linux once, store that linux is used and not even once check for dylib strace extract [pid 23025] stat64("//lib/libreadline.dylib", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("//lib/libreadline.so", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("//lib/libreadline.a", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/lib64/libreadline.dylib", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/lib64/libreadline.so", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/lib64/libreadline.a", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/usr/lib64/libreadline.dylib", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/usr/lib64/libreadline.so", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/usr/lib64/libreadline.a", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/lib/libreadline.dylib", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/lib/libreadline.so", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/lib/libreadline.a", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/usr/lib/libreadline.dylib", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/usr/lib/libreadline.so", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/usr/lib/libreadline.a", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("//lib/libncursesw.dylib", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("//lib/libncursesw.so", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("//lib/libncursesw.a", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/lib64/libncursesw.dylib", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/lib64/libncursesw.so", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/lib64/libncursesw.a", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/usr/lib64/libncursesw.dylib", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/usr/lib64/libncursesw.so", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/usr/lib64/libncursesw.a", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/lib/libncursesw.dylib", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/lib/libncursesw.so", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/lib/libncursesw.a", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/usr/lib/libncursesw.dylib", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/usr/lib/libncursesw.so", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/usr/lib/libncursesw.a", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("//lib/libncurses.dylib", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("//lib/libncurses.so", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("//lib/libncurses.a", {st_mode=S_IFREG|0644, st_size=431218, ...}) = 0 [pid 23025] stat64("//lib/libcrypt.dylib", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("//lib/libcrypt.so", 0xbfd27c1c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("//lib/libcrypt.a", {st_mode=S_IFREG|0644, st_size=8, ...}) = 0 [pid 23025] stat64("//include/openssl/ssl.h", {st_mode=S_IFREG|0644, st_size=93660, ...}) = 0 [pid 23025] stat64("//include/krb5.h", 0xbfd27cac) = -1 ENOENT (No such file or directory) [pid 23025] stat64("./krb5.h", 0xbfd27cac) = -1 ENOENT (No such file or directory) [pid 23025] stat64("Include/krb5.h", 0xbfd27cac) = -1 ENOENT (No such file or directory) [pid 23025] stat64("./Include/krb5.h", 0xbfd27cac) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/src/Python-2.7.2/Include/krb5.h", 0xbfd27cac) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/src/Python-2.7.2/krb5.h", 0xbfd27cac) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/usr/include/krb5.h", 0xbfd27cac) = -1 ENOENT (No such file or directory) [pid 23025] stat64("/usr/kerberos/include/krb5.h", 0xbfd27cac) = -1 ENOENT (No such file or directory) [pid 23025] stat64("//lib/libssl.dylib", 0xbfd27b3c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("//lib/libssl.so", 0xbfd27b3c) = -1 ENOENT (No such file or directory) [pid 23025] stat64("//lib/libssl.a", {st_mode=S_IFREG|0644, st_size=448496, ...}) = 0 ---------- messages: 144413 nosy: fzvqedi priority: normal severity: normal status: open title: python wastes linux users time by checking for dylib on each dynamic library load versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 22 23:09:04 2011 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Sep 2011 21:09:04 +0000 Subject: [New-bugs-announce] [issue13029] test_strptime fails on Windows 7 french Message-ID: <1316725744.77.0.0655730808912.issue13029@psf.upfronthosting.co.za> New submission from STINNER Victor : Python 3 uses wcsftime() to format a timestamp and decodes tzname[0] and tzname[1] from UTF-8. The problem is that both methods format the quote differently: U+0092 for wcsftime("%Z") and U+2019 in tzname[1]. >>> time.strftime("%Z") 'Paris, Madrid (heure d\x92?t?)' >>> time.tzname ('Paris, Madrid', 'Paris, Madrid (heure d\u2019?t?)') ====================================================================== ERROR: test_timezone (test.test_strptime.StrptimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\victor\cpython\lib\test\test_strptime.py", line 303, in test_timezone strp_output = _strptime._strptime_time(strf_output, "%Z") File "C:\victor\cpython\lib\_strptime.py", line 482, in _strptime_time tt = _strptime(data_string, format)[0] File "C:\victor\cpython\lib\_strptime.py", line 340, in _strptime data_string[found.end():]) ValueError: unconverted data remains: (heure d\x92?t?) ====================================================================== FAIL: test_timezone (test.test_strptime.LocaleTime_Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\victor\cpython\lib\test\test_strptime.py", line 78, in test_timezone (timezone, self.LT_ins.timezone)) AssertionError: False is not true : timezone paris, madrid (heure d\x92?t?) not found in (frozenset({'utc', 'paris, madrid', 'gmt'}), frozenset({'paris, madrid (heure d\u2019?t?)'})) ---------------------------------------------------------------------- ---------- components: Unicode, Windows messages: 144417 nosy: haypo priority: normal severity: normal status: open title: test_strptime fails on Windows 7 french versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 22 23:31:51 2011 From: report at bugs.python.org (Sandro Tosi) Date: Thu, 22 Sep 2011 21:31:51 +0000 Subject: [New-bugs-announce] [issue13030] Be more generic when identifying the Windows main dir in installation doc Message-ID: <1316727111.41.0.373563358156.issue13030@psf.upfronthosting.co.za> New submission from Sandro Tosi : Given I have no knowledge of the windows system, I'm just proxying http://mail.python.org/pipermail/docs/2011-September/005793.html : >>> Under: http://docs.python.org/install/index.html#inst-how-install-works It notes "Windows prefix\Lib\site-packages C:\PythonXY\Lib\site-packages" for default values on Windows. In the paragraph following the table is the text: "prefix and exec-prefix stand for the directories that Python is installed to, and where it finds its libraries at run-time. They are always the same under Windows, and very often the same under Unix and Mac OS X. " I don't know if it's hardcoded into Python distributions to use C, but it's not correct. The correct way to identify what most people think of as C is via the %SYSTEMROOT% environment variable, so the path described would be "%SYSTEMROOT%\PythonXY\Lib\site-packages" (This is still not the correct way to do things on Windows, but it at least shouldn't break on systems with a %SYSTEMROOT% other than C. I've seen configurations like that on systems which boot multiple versions of Windows.) <<< ---------- assignee: docs at python components: Documentation messages: 144422 nosy: brian.curtin, docs at python, sandro.tosi, tim.golden priority: normal severity: normal stage: needs patch status: open title: Be more generic when identifying the Windows main dir in installation doc type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 23 06:48:55 2011 From: report at bugs.python.org (Justin Peel) Date: Fri, 23 Sep 2011 04:48:55 +0000 Subject: [New-bugs-announce] [issue13031] [PATCH] small speed-up for tarfile.py when unzipping tarballs Message-ID: <1316753335.88.0.48389267066.issue13031@psf.upfronthosting.co.za> New submission from Justin Peel : Attached small diff speeds up extracting a gzipped tarball on my machine using python 3.2 by 3-5%. It will probably be a larger percentage on machines that have faster hard drives (mine is 5400rpm). Basically, the changes speed up calculating the checksums by only doing one slice rather than four and call struct.unpack twice rather than four times. We are able to use less unpack calls because 'x' means to skip a byte. ---------- components: Library (Lib) files: cpython_tarfile.diff keywords: patch messages: 144436 nosy: jpeel priority: normal severity: normal status: open title: [PATCH] small speed-up for tarfile.py when unzipping tarballs versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file23229/cpython_tarfile.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 23 10:37:41 2011 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Fri, 23 Sep 2011 08:37:41 +0000 Subject: [New-bugs-announce] [issue13032] h2py.py can fail with UnicodeDecodeError Message-ID: <1316767061.34.0.367682305149.issue13032@psf.upfronthosting.co.za> New submission from Arfrever Frehtes Taifersar Arahesis : Tools/scripts/h2py.py fails with UnicodeDecodeError when a header file contains characters undecodable in current locale. I suggest to use binary mode. I'm attaching a patch. ---------- components: Demos and Tools files: h2py.py.patch keywords: needs review, patch messages: 144438 nosy: Arfrever, georg.brandl, haypo priority: normal severity: normal status: open title: h2py.py can fail with UnicodeDecodeError versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file23230/h2py.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 23 11:24:09 2011 From: report at bugs.python.org (Low Kian Seong) Date: Fri, 23 Sep 2011 09:24:09 +0000 Subject: [New-bugs-announce] [issue13033] recursive chown for shutils Message-ID: <1316769849.87.0.0298236424523.issue13033@psf.upfronthosting.co.za> New submission from Low Kian Seong : Currently shutils chown still can't do a recursive chown. It would be nice to have this instead of having to do the looping dance we put our selves through each time we need recursion. Ruby's FileUtils already have this. ---------- components: Library (Lib) messages: 144439 nosy: Low.Kian.Seong priority: normal severity: normal status: open title: recursive chown for shutils versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 23 13:53:13 2011 From: report at bugs.python.org (Andrea Trasatti) Date: Fri, 23 Sep 2011 11:53:13 +0000 Subject: [New-bugs-announce] [issue13034] Python does not read Alternative Subject Names from SSL certificates larger than 1024 bits Message-ID: <1316778793.21.0.229691764484.issue13034@psf.upfronthosting.co.za> New submission from Andrea Trasatti : We found a problem with SSL certificates, when they are larger than 1024 bits and you need to check Alternative Subject Names. In our case we have a 2048 bit certificate, issued by Verisign for the domain developer.nokia.com. The certificate also covers other sub-domains, once of which is projects.developer.nokia.com. We found the issue using the mercurial client, but we dug down to SSLSocket.getpeercert. It looks like when the openSSL library reads the certificate it does not return any Alternative Subject Name, even though they are there. Using the standard openssl binary we could read the certificate with no problems and the alternative domain names are all there, including the one we need. See below two examples, the first is our 2048 bit certificate and what Python returns. Then there is Google's code.google.com SSL certificate, 1024 bits and as you can see Python returns the other names correctly. This was tested with Python 2.7.2. Binary for projects.developer.nokia.com '0\x82\x06\xb10\x82\x05\x99\xa0\x03\x02\x01\x02\x02\x10\x0e\xf6_f@\xe4\xd1gtU\x9e39Rn80\r\x06\t*\x86H\x86\xf7\r\x01\x01\x05\x05\x000\x81\xbc1\x0b0\t\x06\x03U\x04\x06\x13\x02US1\x170\x15\x06\x03U\x04\n\x13\x0eVeriSign, Inc.1\x1f0\x1d\x06\x03U\x04\x0b\x13\x16VeriSign Trust Network1;09\x06\x03U\x04\x0b\x132Terms of use at https://www.verisign.com/rpa (c)101604\x06\x03U\x04\x03\x13-VeriSign Class 3 International Server CA - G30\x1e\x17\r110608000000Z\x17\r120607235959Z0h1\x0b0\t\x06\x03U\x04\x06\x13\x02FI1\x0e0\x0c\x06\x03U\x04\x08\x13\x05Espoo1\x0e0\x0c\x06\x03U\x04\x07\x14\x05Espoo1\x0e0\x0c\x06\x03U\x04\n\x14\x05Nokia1\x0b0\t\x06\x03U\x04\x0b\x14\x02IT1\x1c0\x1a\x06\x03U\x04\x03\x14\x13developer.nokia.com0\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0f\x000\x82\x01\n\x02\x82\x01\x01\x00\xf8\xdeL"\x8az\xbb\xa6\xddj\x14\x89X\xeeh\x87\x07\xbd\xb3\xc5=! \xb9\x80\xe8\xe6v"*\xec6w\x82\r\xb6b\x10\xb8\xe5\x06\x88w\xfd\x03\xa9\x82\x9d\xdf\xdb\xbft\xdb\x06\xc5\'\xdd\x83\x0e\ xf1GdM\x9a\x14\xefyO\x8e\x9dO, \x92\xf8\xcf\xd3\xb3\xa8m\xc3@^\xa5\x0e\xfb$ddn\xc0\x1cV\xe4\xeaE\xce\x1eoG\xca\xf3\x01\xab\x08V\xd2<\x91\x7f7\xbc\x90\x16\xd6b\xdb\x83(ySA\xccH\x1b\x80"7)^\xe9\x1c\xcaZ&r-\xc6\xf0\xe0\xb6\xde\x16c W\x0b\xf4\xd24ei[E\xbaY\xc9[; \xbbs\nQ\xfc\x1b_TiM\x8e\xb6\x9c9\x7f}\xa3\xfe\x96\xab\xa9\xb4\x8dn\\S\xfc\x08\xd5\x1a71 \xd3\x14\xaaF\xd0\xe4\xcf\x0f-\xf9\x10\xa7U\xf6\x92\xafQa\x8b\x02x\xc7V; \xe2F\xf5 L\xe4\xc1\r\x1f\xec| \x02\xee\xda\x9ej\xb3\xda\xda\x9b\xf8\xaf\xb5\xa2=\x1e\n\x14qf\xe7\xef\xbd\x8av\xe7l\x9d7\x93\xea\x11\x02\x03\x01\x00\x01\xa3\x82\x03\x000\x82\x02\xfc0\x82\x01I\x06\x03U\x1d\x11\x04\x82\x01 at 0\x82\x01<\x82\x13developer.nokia.com\x82\x17www.developer.nokia.com\x82\x17aux.developer.nokia.com\x82\x16cc.developer.nokia.com\x82\x1cprojects.developer.nokia.com\x82\x17sso.developer.nokia.com\x82\x19stage.developer.nokia.com\x82\x17ejb.developer.nokia.com\x82\x16cm.developer.nokia.com\x82\x17dav.developer.nokia.com\x82\x1fdav.sandbox.developer.nokia.com\x 82\x1ect.sandbox.developer.nokia.com0\t\x06\x03U\x1d\x13\x04\x020\x000\x0b\x06\x03U\x1d\x0f\x04\x04\x03\x02\x05\xa00A\x06\x03U\x1d\x1f\x04:0806\xa04\xa02\x860http://SVRIntl- G3-crl.verisign.com/SVRIntlG3.crl0D\x06\x03U\x1d \x04=0;09\x06\x0b`\x86H\x01\x86\xf8E\x01\x07\x17\x030*0(\x06\x08+\x06\x01\x05\x05\x07\x02\x01\x16\x1chttps://www.verisign.com/rpa0(\x06\x03U\x1d%\x04! 0\x1f\x06\t`\x86H\x01\x86\xf8B\x04\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x020r\x06\x08+\x06\x01\x05\x05\x07\x01\x01\x04f0d0$\x06\x08+\x06\x01\x05\x05\x070\x01\x86\x18http://ocsp.verisign.com0<\x06\x08+\x06\x01\x05\x05\x070\x02\x860http://SVRIntl- G3- aia.verisign.com/SVRIntlG3.cer0n\x06\x08+\x06\x01\x05\x05\x07\x01\x0c\x04b0`\xa1^\xa0\\0Z0X0V\x16\timage/gif0! 0\x1f0\x07\x06\x05+\x0e\x03\x02\x1a\x04\x14Kk\xb9(\x96\x06\x0c\xbb\xd0R8\x9b)\xacK\x07\x8b! \x05\x180&\x16$http://logo.verisign.com/vslogo1.gif0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x05\x05\x00\x03\x82\x01\x01\x006N\x97\x1e\xba\x85\xcb\x1e \xddO6\xf9\xf3\x16-\xb6\x05\x13"\xec*\x00\x0f\xde\x89\xc1\xb7\xc1^\xf0\x8b0=C\x87\xf3| zI\xe4\r\xedmD1\xc1\x06[GqMuV\xd9\x03\xdd\xa6\xbd2Z! \x0c\xdf\x93\x9c\xc6\xba\x12\xd1\xaa\xd08\x1c\x82\x02\xd1\xb3\xeeK\xca\xcaEK\x07\xffR\xcfW\xae\xa0\x85\xeb\xc1h\xeb\r\xad\xd5\x92d\x82\xac\x03(\x07\xa1F\x82\x93\xdep\xe9\x9a\xf8O\xb1\xfc\xe0&\xfat\xf4d\xa3q&`\x05J\xb9\xdb\x9a\xb5o; \xb7O\xaa/\xac\xba\xab\xc9\xd9)m\xf2c\xe8=\xc4\x95\xef\xe9\x92\xee\tlx\xe2\xfc>\x87\xab\xbe\xde\xd4[\xc3\x85>X\x8f\xf3\xe3\x89\xc9, \\\xb2:\x9f\xf3\xe2\xf3\x81; \xdbk\x9f\x1e\xbc\x00\xc7\x87@\xb3\xac\xdf\xe09\xfe: \xef\n\xcf\xdaCZ\xc7\x07X\xd0\x0f\xf2nBKe\x1f\xd8\xcc\xb4\xa2%\x01<\x0eE\nt{G\r\x9a\xfd\xaf\x97\xaf\xba\xb8\x983\xc5~\xd2\x1d\xdd\x04\x13*\xd3\xf3VK:' Python dictionary extracted {'notAfter': 'Jun 7 23:59:59 2012 GMT', 'subject': ((('countryName', u'FI'),), (('stateOrProvinceName', u'Espoo'),), (('localityName', u'Espoo'),), (('organizationName', u'Nokia'),), (('organizationalUnitName', u'IT'),), (('commonName', u'developer.nokia.com'),))} Binary for code.google.com '0\x82\x05\x080\x82\x04q\xa0\x03\x02\x01\x02\x02\nk\xf3\xf0+\x00\x03\x00\x00/\xf60\r\x06\t*\x86H\x86\xf7\r\x01\x01\x05\x05\x000F1\x0b0\t\x06\x03U\x04\x06\x13\x02US1\x130\x11\x06\x03U\x04\n\x13\nGoogle Inc1"0 \x06\x03U\x04\x03\x13\x19Google Internet Authority0\x1e\x17\r110905060549Z\x17\r120905061549Z0f1\x0b0\t\x06\x03U\x04\x06\x13\x02US1\x130\x11\x06\x03U\x04\x08\x13\nCalifornia1\x160\x14\x06\x03U\x04\x07\x13\rMountain View1\x130\x11\x06\x03U\x04\n\x13\nGoogle Inc1\x150\x13\x06\x03U\x04\x03\x14\x0c*.google.com0\x81\x9f0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x81\x8d\x000\x81\x89\x02\x81\x81\x00\xbd\x7f49\x0c\xbdg\x962\xd4\x18\x8d#\x16\x91[\xbcH\x8f\xac+\x8a=\xd0\x1cW\x8bRVIh\x89\xf4\x85\xe0\x12\xe1\xfaG\x1a\xf9\x0bQ\xc2\\b; \x0f$)c\xb9\xc7\xc45\xb90dK1\xf9\xcd\x111\x15]\xac\xb4\xfd\xa7>\x85\x16a\x15\xd3\x870\x82\xf4\xee^\x86\xbb\xd1\xf6\x81\x9a\x06\x07\xbe\xb7\xebx*\x9a\tX\x03; \x9bE\xad\x02\xeb`(:\xa3k| \xca"\xca&\xd4\x98\x03I\\\x81\xc1\xb3\xf7\xf2\x95\xc9;\x02\x03\x01\x00\x01\x a3\x82\x02\xdb0\x82\x02\xd70\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x140\xf5l\xa9\xb8\xd6\xe2\xc7\xcdy\x7fF\xf5)t%\xe4\x9f\x16U0\x1f\x06\x03U\x1d#\x04\x180\x16\x80\x14\xbf\xc00\xeb\xf5C\x11>g\xba\x9e\x91\xfb\xfcj\xda\xe3k\x12$0[\x06\x03U\x1d\x1f\x04T0R0P\xa0N\xa0L\x86Jhttp://www.gstatic.com/GoogleInternetAuthority/GoogleInternetAuthority.crl0f\x06\x08+\x06\x01\x05\x05\x07\x01\x01\x04Z0X0V\x06\x08+\x06\x01\x05\x05\x070\x02\x86Jhttp://www.gstatic.com/GoogleInternetAuthority/GoogleInternetAuthority.crt0! \x06\t+\x06\x01\x04\x01\x827\x14\x02\x04\x14\x1e\x12\x00W\x00e\x00b\x00S\x00e\x00r\x00v\x00e\x00r0\x82\x01\xab\x06\x03U\x1d\x11\x04\x82\x01\xa20\x82\x01\x9e\x82\x0c*.google.com\x82\ngoogle.com\x82\x0b*.atggl.com\x82\r*.youtube.com\x82\x0byoutube.com\x82\x0b*.ytimg.com\x82\x0f*.google.com.br\x82\x0e*.google.co.in\x82\x0b*.google.es\x82\x0e*.google.co.uk\x82\x0b*.google.ca\x82\x0b*.google.fr\x82\x0b*.google.pt\x82\x0b*.google.it\x82\x0b*.google.de\x82\x0b*.google.cl\x82\x0b*.google.pl\x82\x0b*.goo gle.nl\x82\x0f*.google.com.au\x82\x0e*.google.co.jp\x82\x0b*.google.hu\x82\x0f*.google.com.mx\x82\x0f*.google.com.ar\x82\x0f*.google.com.co\x82\x0f*.google.com.vn\x82\x0f*.google.com.tr\x82\r*.android.com\x82\x14*.googlecommerce.com0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x05\x05\x00\x03\x81\x81\x00Mfgo\xae\xd5}\xcb\xf7\xca\x82\xed\xcerGvl`\'F0\x0e? \x8c0\xbc\x7f\xc6\x0c:\x98\xe0\x02\xe4 J\x10\x9d\xe3\xe5p\xd6\xfam\xe0\x91wY\xdb\xf0-\xefV\xfc\xaeVJ!\x0eL_\xf4| \xff\xb3q\xf4h%\xcc\xf1\xfe \xfe\xe4\xa57\xb5\x8d\xeeT\xf3-\x04\x01\xfdB`P\xfb\x82\xf3w\xce\x93\x8e+q\x9b\x03\xc9\xcf[Y\xc0\x0f\xf5,V\xb0$\xe6\x1f9qi\xef\xf1\xb3\xda\xba\xc9\xc0\xbb\x84\x1a\x9f\x89' Python dictionary {'notAfter': 'Sep 5 06:15:49 2012 GMT', 'subjectAltName': (('DNS', '*.google.com'), ('DNS', 'google.com'), ('DNS', '*.atggl.com'), ('DNS', '*.youtube.com'), ('DNS', 'youtube.com'), ('DNS', '*.ytimg.com'), ('DNS', '*.google.com.br'), ('DNS', '*.google.co.in'), ('DNS', '*.google.es'), ('DNS', '*.google.co.uk'), ('DNS', '*.google.ca'), ('DNS', '*.google.fr'), ('DNS', '*.google.pt'), ('DNS', '*.google.it'), ('DNS', '*.google.de'), ('DNS', '*.google.cl'), ('DNS', '*.google.pl'), ('DNS', '*.google.nl'), ('DNS', '*.google.com.au'), ('DNS', '*.google.co.jp'), ('DNS', '*.google.hu'), ('DNS', '*.google.com.mx'), ('DNS', '*.google.com.ar'), ('DNS', '*.google.com.co'), ('DNS', '*.google.com.vn'), ('DNS', '*.google.com.tr'), ('DNS', '*.android.com'), ('DNS', '*.googlecommerce.com')), 'subject': ((('countryName', u'US'),), (('stateOrProvinceName', u'California'),), (('localityName', u'Mountain View'),), (('organizationName', u'Google Inc'),), (('commonName', u'*.google.com'),))} >>> ---------- messages: 144441 nosy: atrasatti priority: normal severity: normal status: open title: Python does not read Alternative Subject Names from SSL certificates larger than 1024 bits type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 23 15:57:25 2011 From: report at bugs.python.org (Joshua Bronson) Date: Fri, 23 Sep 2011 13:57:25 +0000 Subject: [New-bugs-announce] [issue13035] "maintainer" value clear the "author" value when registering Message-ID: <1316786245.72.0.911460125553.issue13035@psf.upfronthosting.co.za> New submission from Joshua Bronson : This issue was originally opened in the PyPI tracker but was dismissed on the theory that it's a bug in Python: https://sourceforge.net/tracker/index.php?func=detail&aid=3396924&group_id=66150&atid=513503 """ If in one package's setup.py I provide maintainer (with email) and author (whith email) after the "python setup.py register ... upload" I create a new package where I see the maintainer as a creator. If I manually fix it through the pypi user interface it works, so seems that this is only a bug in the register procedure. """ ---------- messages: 144444 nosy: jab priority: normal severity: normal status: open title: "maintainer" value clear the "author" value when registering _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 23 17:21:37 2011 From: report at bugs.python.org (Yves Dorfsman) Date: Fri, 23 Sep 2011 15:21:37 +0000 Subject: [New-bugs-announce] [issue13036] time format in logging is wrong Message-ID: <1316791297.78.0.299394793338.issue13036@psf.upfronthosting.co.za> New submission from Yves Dorfsman : The basic time format in the logging module uses a comma instead of a dot to separate the seconds from the tenth of seconds: import logging logging.basicConfig(format='%(asctime)s %(message)s') logging.warning('hello') 2011-09-23 09:08:53,739 hello Using a dot seems to be more accepted, see: ls -l --full-time Java's default dates python's datetime.datetime.isoformat( datetime.datetime.now() ) ---------- components: Library (Lib) messages: 144447 nosy: yves at zioup.com priority: normal severity: normal status: open title: time format in logging is wrong type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 23 20:50:42 2011 From: report at bugs.python.org (Christopher Egner) Date: Fri, 23 Sep 2011 18:50:42 +0000 Subject: [New-bugs-announce] [issue13037] [Regression] socket.error does not inherit from IOError as documented Message-ID: <1316803842.26.0.835338049921.issue13037@psf.upfronthosting.co.za> New submission from Christopher Egner : http://docs.python.org/library/socket.html#socket.error "Changed in version 2.6: socket.error is now a child class of IOError." However, this is not the case. $ python Python 2.7.2 (default, Aug 18 2011, 18:26:35) [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> isinstance( socket.error, IOError ) False Catching IOError in except blocks does not catch socket.error, as one might expect according to the documentation. ---------- components: IO messages: 144467 nosy: Christopher.Egner priority: normal severity: normal status: open title: [Regression] socket.error does not inherit from IOError as documented type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 24 00:14:32 2011 From: report at bugs.python.org (Mitch Frazier) Date: Fri, 23 Sep 2011 22:14:32 +0000 Subject: [New-bugs-announce] [issue13038] distutils windows installer STATUS_INVALID_CRUNTIME_PARAMETER (C0000417) exception when python dir is read only Message-ID: <1316816072.59.0.865990615621.issue13038@psf.upfronthosting.co.za> New submission from Mitch Frazier : Distutils built installers will fail on Windows with a run-time exception of STATUS_INVALID_CRUNTIME_PARAMETER, error-code: C0000417 if the python installation directory (e.g. C:\Python27) is read-only for the user running the installer. I've experienced this with the pyside and pywin32 installers on Windows XP. Using procmon I discovered that the installer fails when it tries to create the installation log file in the python install directory. That led me to look at the directory which is when I discovered that it was read only for my user account. It's read-only because the Python installer was run as Administrator and the other installers are being run from my user account. Changing the directory to read-only for my account allows the installer to run without problem. Perhaps the installer could check for this and provide a friendlier response. ---------- assignee: tarek components: Distutils messages: 144477 nosy: eric.araujo, mitchfrazier, tarek priority: normal severity: normal status: open title: distutils windows installer STATUS_INVALID_CRUNTIME_PARAMETER (C0000417) exception when python dir is read only type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 24 00:26:59 2011 From: report at bugs.python.org (etuardu) Date: Fri, 23 Sep 2011 22:26:59 +0000 Subject: [New-bugs-announce] [issue13039] IDLE3 editor: shell-like behaviour on line starting with ">>>" Message-ID: <1316816819.73.0.347712729805.issue13039@psf.upfronthosting.co.za> New submission from etuardu : In the editor window, if a line starts with the shell prompt string ">>>", backspacing is inhibited when reaching the first space, just like in the shell window. OS: Linux 2.6.38-11-generic-pae #50-Ubuntu i386 GNU/Linux Python version: 3.2 IDLE version: 3.2 Tk version: 8.5 ---------- components: IDLE messages: 144478 nosy: etuardu priority: normal severity: normal status: open title: IDLE3 editor: shell-like behaviour on line starting with ">>>" type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Sep 24 12:44:06 2011 From: report at bugs.python.org (Richard86) Date: Sat, 24 Sep 2011 10:44:06 +0000 Subject: [New-bugs-announce] [issue13040] call to tkinter.messagebox.showinfo hangs the script Message-ID: <1316861046.74.0.26633284396.issue13040@psf.upfronthosting.co.za> New submission from Richard86 : Call to tkinter.messagebox.showinfo("Test", "test") makes the script hang in Windows 7 with Python 3.2.2 with Timer(2, methodname, ()).start(). ---------- components: Tkinter, Windows files: test1.py messages: 144496 nosy: Richard86 priority: normal severity: normal status: open title: call to tkinter.messagebox.showinfo hangs the script type: crash versions: Python 3.2 Added file: http://bugs.python.org/file23236/test1.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 25 00:07:19 2011 From: report at bugs.python.org (Zbyszek Szmek) Date: Sat, 24 Sep 2011 22:07:19 +0000 Subject: [New-bugs-announce] [issue13041] argparse: terminal width is not detected properly Message-ID: <1316902039.33.0.744560309521.issue13041@psf.upfronthosting.co.za> New submission from Zbyszek Szmek : COLUMNS is a shell variable (updated whenever the window size changes), that usually isn't exported to programs. Therefore checking for COLUMNS in sys.environ will not work in the majority of cases. The proper check is to use the TIOCGWINSZ ioctl on stdout. Why COLUMNS is not exported? Because it can change during the lifetime of a program. Therefore it is better to use the dynamic ioctl. ---------- components: Library (Lib) files: patch1.diff keywords: patch messages: 144507 nosy: zbysz priority: normal severity: normal status: open title: argparse: terminal width is not detected properly type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file23238/patch1.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 25 00:07:20 2011 From: report at bugs.python.org (Zbyszek Szmek) Date: Sat, 24 Sep 2011 22:07:20 +0000 Subject: [New-bugs-announce] [issue13042] argparse: terminal width is not detected properly Message-ID: <1316902040.77.0.692202253798.issue13042@psf.upfronthosting.co.za> New submission from Zbyszek Szmek : COLUMNS is a shell variable (updated whenever the window size changes), that usually isn't exported to programs. Therefore checking for COLUMNS in sys.environ will not work in the majority of cases. The proper check is to use the TIOCGWINSZ ioctl on stdout. Why COLUMNS is not exported? Because it can change during the lifetime of a program. Therefore it is better to use the dynamic ioctl. ---------- components: Library (Lib) files: patch1.diff keywords: patch messages: 144508 nosy: zbysz priority: normal severity: normal status: open title: argparse: terminal width is not detected properly type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file23239/patch1.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 25 09:08:28 2011 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sun, 25 Sep 2011 07:08:28 +0000 Subject: [New-bugs-announce] [issue13043] Unexpected behavior of imp.find_module(".") with a package present in sys.path and also referenced in a .pth file Message-ID: <1316934508.79.0.173574445416.issue13043@psf.upfronthosting.co.za> New submission from Arfrever Frehtes Taifersar Arahesis : # python3.3 -c 'import imp; print(imp.find_module("."))' Traceback (most recent call last): File "", line 1, in ImportError: No module named '.' # mkdir /usr/lib64/python3.3/site-packages/something # touch /usr/lib64/python3.3/site-packages/something/__init__.py # echo something > /usr/lib64/python3.3/site-packages/something.pth # python3.3 -c 'import imp; print(imp.find_module("."))' (None, '/usr/lib64/python3.3/site-packages/something/.', ('', '', 5)) ---------- messages: 144519 nosy: Arfrever priority: normal severity: normal status: open title: Unexpected behavior of imp.find_module(".") with a package present in sys.path and also referenced in a .pth file versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 25 18:36:22 2011 From: report at bugs.python.org (akl) Date: Sun, 25 Sep 2011 16:36:22 +0000 Subject: [New-bugs-announce] [issue13044] pdb throws AttributeError at end of debugging session Message-ID: <1316968582.76.0.94343164649.issue13044@psf.upfronthosting.co.za> New submission from akl : Using Python 2.7.1 on OpenBSD-current and 2.7.2 on Arch Linux, pdb throws a (harmless, it appears) exception at the end of a debugging session. This does not happen for me using Python 2.5 or 2.6 or 3.2. Console Session (on linux): $ python2 --version Python 2.7.2 $ python2 debug.py > /tmp/debug.py(4)() -> a = 1 (Pdb) n > /tmp/debug.py(5)() -> b = 2 (Pdb) n > /tmp/debug.py(6)() -> sum = a + b (Pdb) n --Return-- > /tmp/debug.py(6)()->None -> sum = a + b (Pdb) n Exception AttributeError: "'NoneType' object has no attribute 'path'" in ignore ---------- components: Library (Lib) files: debug.py messages: 144525 nosy: akl priority: normal severity: normal status: open title: pdb throws AttributeError at end of debugging session type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file23242/debug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 25 19:12:20 2011 From: report at bugs.python.org (Artyom Gavrichenkov) Date: Sun, 25 Sep 2011 17:12:20 +0000 Subject: [New-bugs-announce] [issue13045] [PATCH] socket.getsockopt may require custom buffer contents Message-ID: <1316970740.88.0.976956666008.issue13045@psf.upfronthosting.co.za> New submission from Artyom Gavrichenkov : Currently the Python implementation of socket.getsockopt allows only option name, level name and buffer size as its arguments. However, IEEE Standard 1003.1-2008 allows one further argument -- an actual buffer to modify at the kernel level. POSIX does not prohibit the kernel from reading this buffer before modification, and the contents of the buffer may be used together with option and level names to specify an exact socket option to return. In fact, this is how some applications already work, ipset (http://ipset.netfilter.org/) being a noticeable example. The patch, written against Python 3.2 and aiming at providing this functionality, is attached. It may also apply to previous Python versions, though it's not tested against anything except Python 3.2. ---------- components: Extension Modules files: getsockopt_buffer_input.patch keywords: patch messages: 144526 nosy: Artyom.Gavrichenkov priority: normal severity: normal status: open title: [PATCH] socket.getsockopt may require custom buffer contents type: feature request versions: Python 3.2 Added file: http://bugs.python.org/file23243/getsockopt_buffer_input.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 25 21:03:51 2011 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sun, 25 Sep 2011 19:03:51 +0000 Subject: [New-bugs-announce] [issue13046] imp.find_module() should not find unimportable modules Message-ID: <1316977431.22.0.335405032353.issue13046@psf.upfronthosting.co.za> New submission from Arfrever Frehtes Taifersar Arahesis : imp.find_module() can find files, which cannot be imported. I suggest that imp.find_module() raise an exception in such cases. $ cd /tmp $ touch .something.py $ python3.3 Python 3.3.0a0 (default:5e456e1a9e8c+, Sep 25 2011, 18:57:23) [GCC 4.5.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import .something File "", line 1 import .something ^ SyntaxError: invalid syntax >>> module = __import__(".something") Traceback (most recent call last): File "", line 1, in ValueError: Empty module name >>> import imp >>> file, pathname, description = imp.find_module(".something") >>> file, pathname, description (<_io.TextIOWrapper name=4 mode='U' encoding='utf-8'>, '.something.py', ('.py', 'U', 1)) ---------- components: Interpreter Core messages: 144527 nosy: Arfrever priority: normal severity: normal status: open title: imp.find_module() should not find unimportable modules versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 25 22:49:58 2011 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sun, 25 Sep 2011 20:49:58 +0000 Subject: [New-bugs-announce] [issue13047] imp.find_module("") and imp.find_module(".") Message-ID: <1316983798.48.0.694425302693.issue13047@psf.upfronthosting.co.za> New submission from Arfrever Frehtes Taifersar Arahesis : It's undocumented that imp.find_module("") and imp.find_module(".") try to find __init__.py. There is also a small difference in behavior between them. sys.path by default contains "" as the first element, which is sufficient for imp.find_module("."), but not for imp.find_module(""): $ mkdir /tmp/imp_tests $ cd /tmp/imp_tests $ touch __init__.py $ python3.3 -c 'import imp, sys; print(repr(sys.path[0])); print(imp.find_module("."))' '' (None, '.', ('', '', 5)) $ python3.3 -c 'import imp, sys; print(repr(sys.path[0])); print(imp.find_module(""))' '' Traceback (most recent call last): File "", line 1, in ImportError: No module named '' If sys.path contains path (e.g. "." or absolute path) to directory with __init__.py file, then imp.find_module("") will succeed: $ PYTHONPATH="." python3.3 -c 'import imp, sys; print(repr(sys.path[0:2])); print(imp.find_module("."))' ['', '/tmp/imp_tests'] (None, '.', ('', '', 5)) $ PYTHONPATH="." python3.3 -c 'import imp, sys; print(repr(sys.path[0:2])); print(imp.find_module(""))' ['', '/tmp/imp_tests'] (None, '/tmp/imp_tests/', ('', '', 5)) $ python3.3 -c 'import imp, sys; sys.path.insert(1, "."); print(repr(sys.path[0:2])); print(imp.find_module("."))' ['', '.'] (None, '.', ('', '', 5)) $ python3.3 -c 'import imp, sys; sys.path.insert(1, "."); print(repr(sys.path[0:2])); print(imp.find_module(""))' ['', '.'] (None, './', ('', '', 5)) I think that imp.find_module(".") and imp.find_module("") should have the same behavior, and this behavior should be documented. ---------- assignee: docs at python components: Documentation, Interpreter Core messages: 144531 nosy: Arfrever, docs at python priority: normal severity: normal status: open title: imp.find_module("") and imp.find_module(".") versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Sep 25 23:05:33 2011 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sun, 25 Sep 2011 21:05:33 +0000 Subject: [New-bugs-announce] [issue13048] Handling of paths in first argument of imp.find_module() Message-ID: <1316984733.77.0.135974751185.issue13048@psf.upfronthosting.co.za> New submission from Arfrever Frehtes Taifersar Arahesis : It's undocumented that imp.find_module() supports paths with "/" as the first argument: $ mkdir /tmp/imp_tests $ cd /tmp/imp_tests $ mkdir a $ touch a/b.py $ python3.3 -c 'import imp; print(imp.find_module("a/b"))' (<_io.TextIOWrapper name=4 mode='U' encoding='utf-8'>, 'a/b.py', ('.py', 'U', 1)) ---------- assignee: docs at python components: Documentation, Interpreter Core messages: 144532 nosy: Arfrever, brett.cannon, docs at python, ezio.melotti, ncoghlan priority: normal severity: normal status: open title: Handling of paths in first argument of imp.find_module() versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Sep 26 19:40:33 2011 From: report at bugs.python.org (Carl Meyer) Date: Mon, 26 Sep 2011 17:40:33 +0000 Subject: [New-bugs-announce] [issue13049] distutils2 should not allow packages Message-ID: <1317058833.63.0.231790801143.issue13049@psf.upfronthosting.co.za> New submission from Carl Meyer : As discussed at http://groups.google.com/group/the-fellowship-of-the-packaging/browse_frm/thread/3b7a8ddd307d1020 , distutils2 should not allow a distribution to install files into a top-level package that is already installed from a different distribution. ---------- assignee: tarek components: Distutils2 messages: 144542 nosy: alexis, carljm, eric.araujo, tarek priority: normal severity: normal status: open title: distutils2 should not allow packages type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Sep 27 21:02:06 2011 From: report at bugs.python.org (R. David Murray) Date: Tue, 27 Sep 2011 19:02:06 +0000 Subject: [New-bugs-announce] [issue13050] RLock support the context manager protocol but this is not documented Message-ID: <1317150126.74.0.206470385317.issue13050@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- assignee: docs at python components: Documentation nosy: docs at python, r.david.murray priority: normal severity: normal status: open title: RLock support the context manager protocol but this is not documented _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 28 02:47:11 2011 From: report at bugs.python.org (Tycho Andersen) Date: Wed, 28 Sep 2011 00:47:11 +0000 Subject: [New-bugs-announce] [issue13051] Infinite recursion in curses.textpad.Textbox Message-ID: <1317170831.29.0.145546521568.issue13051@psf.upfronthosting.co.za> New submission from Tycho Andersen : The attached patch fixes two bugs which manifest as infinite recursion in _insert_printable_char() of Textbox. First, the previous implementation of _insert_printable_char() used recursion to move characters when inserting a character. Thus, any Textpad which had an area greater than the interpreter's maximum recursion limit would crash. A minimal test case is the following: #!/usr/bin/python import curses from curses.textpad import Textbox def main(stdscr): box = Textbox(stdscr, insert_mode=True) box.stripspaces = True while 1: cmd = box.edit() if cmd == 'q': break curses.wrapper(main) Run that script in a terminal with area (i.e. $LINES * $COLUMNS) > 1000 (the default max recursion limit), press any key and be greeted by a stack trace. The patch changes the implementation of _insert_printable_char() to be iterative, thus avoiding the infinite recursion. Second, when the underlying curses window was resized to be smaller than it was when the Textpad was created, pressing any key would result in infinite recursion (or with the new method, an infinite loop). The patch also changes Textpad so that instead of keeping the underlying window's size as instance attributes of this Textpad, Textpad asks the underlying window its size every time Textpad needs to know, allowing the underlying window to be resized at will. I've verified this bug is in 2.7.1 and 3.2. Let me know if you need anything else. ---------- components: Library (Lib) files: textpad_resize.patch keywords: patch messages: 144559 nosy: tycho priority: normal severity: normal status: open title: Infinite recursion in curses.textpad.Textbox type: crash versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file23249/textpad_resize.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 28 04:44:03 2011 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 28 Sep 2011 02:44:03 +0000 Subject: [New-bugs-announce] [issue13052] IDLE: replace ending with '\' causes crash Message-ID: <1317177843.04.0.691154940707.issue13052@psf.upfronthosting.co.za> New submission from Terry J. Reedy : As reported by R.S.Kachanovsky on the IDLE-sig list, and comfirmed by me with 3.2.2 on Win 7, entering a replace term ending with '\', like 'test\', in the find/replace dialog box causes IDLE to crash, as in do nothing for a couple of seconds and then close all windows. A find term in either a find or find/replace box with a \ anywhere causes a beep. This means that one cannot search for test containing such, but that is better than crashing (which has the same effect). ---------- components: IDLE messages: 144562 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE: replace ending with '\' causes crash type: crash versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 28 17:37:28 2011 From: report at bugs.python.org (Larry Hastings) Date: Wed, 28 Sep 2011 15:37:28 +0000 Subject: [New-bugs-announce] [issue13053] Add Capsule migration documentation to "cporting" Message-ID: <1317224248.53.0.263122473581.issue13053@psf.upfronthosting.co.za> New submission from Larry Hastings : After the great Capsule flame wars of 2011, it became clear that we need documentation on migrating from CObject to Capsules, as CObject is gone as of 3.2. Nick made me promise to write the documentation, and Raymond steered me in the direction of "cporting.rst" (Porting Extension Modules To Python 3.0). I already have a patch in reasonable shape. However, I understand we're doing "forward-porting" (what Monotone calls "daggy fixes"). I think this would be valuable information for 2.7 users. It includes no code changes (though it does include some sample code). Would checking it in to the 2.7 head be appropriate? Once we decide where the checkin should go, I'll produce a patch against that head that will hopefully garner your approval. ---------- assignee: larry components: Documentation messages: 144567 nosy: larry, ncoghlan, rhettinger priority: normal severity: normal stage: needs patch status: open title: Add Capsule migration documentation to "cporting" type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 28 17:47:35 2011 From: report at bugs.python.org (Ezio Melotti) Date: Wed, 28 Sep 2011 15:47:35 +0000 Subject: [New-bugs-announce] [issue13054] sys.maxunicode value after PEP-393 Message-ID: <1317224855.38.0.863349241023.issue13054@psf.upfronthosting.co.za> New submission from Ezio Melotti : Now that PEP 393 is in and the distinction between narrow and wide doesn't exist anymore, the value of sys.maxunicode should always be 0x10FFFF. sys.maxunicode currently uses PyUnicode_GetMax (Objects/unicodeobject.c:196) and still returns either 0x10FFFF if Py_UNICODE_WIDE is defined or 0xFFFF if it's not (and that should now mean that it's defined on Linux where wchar_t is 4 bytes, but not on Windows where it's 2 bytes (isn't this backward incompatible? if so it probably deserves another issue)). IIUC the difference between narrow and wide is gone for Python users, but it's still there for C users that use the old API, so changing PyUnicode_GetMax will most likely break their code. I therefore suggest to set sys.maxunicode to 0x10FFFF and to leave PyUnicode_GetMax as is. C users that switch to the new API should stop using PyUnicode_GetMax and it should be added along with the other deprecated functions in PEP 393. If sys.maxunicode becomes a constant, it won't be useful to determine if the build is narrow or wide anymore (that won't actually matter anymore, but this was the main use of sys.maxunicode), but it might still be useful to know the value of the highest codepoint. Therefore I think that sys.maxunicode can still stay around without being deprecated (its documentation should be fixed though). ---------- assignee: ezio.melotti components: Interpreter Core, Unicode messages: 144568 nosy: ezio.melotti, haypo, lemburg, loewis priority: high severity: normal stage: test needed status: open title: sys.maxunicode value after PEP-393 type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Sep 28 21:32:02 2011 From: report at bugs.python.org (Ben Gamari) Date: Wed, 28 Sep 2011 19:32:02 +0000 Subject: [New-bugs-announce] [issue13055] Distutils tries to handle null versions but fails Message-ID: <1317238322.67.0.925527851228.issue13055@psf.upfronthosting.co.za> New submission from Ben Gamari : The distutils.LooseVersion constructor currently only calls parse if vstring has a value. Unfortunately, this means that a user passing in vstring="" or vstring=None gets a version object with self.vstring and self.version unset. This wreaks havoc later when the user tries to do anything with their object. I've attached two possible solutions. The first attempts to fix the issue by raising an exception when an invalid vstring is given. This seems like the most reasonable treatment of this case as there is no reasonable way to fully initialize the object. The second works around the issue, initializing the uninitialized fields with "" in the event of an invalid vstring. ---------- files: distutils-fix.patch keywords: patch messages: 144575 nosy: bgamari priority: normal severity: normal status: open title: Distutils tries to handle null versions but fails Added file: http://bugs.python.org/file23252/distutils-fix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 29 03:38:20 2011 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 29 Sep 2011 01:38:20 +0000 Subject: [New-bugs-announce] [issue13056] test_multibytecodec.py:TestStreamWriter is skipped after PEP393 Message-ID: <1317260300.62.0.299015504355.issue13056@psf.upfronthosting.co.za> New submission from Ezio Melotti : The test at Lib/test/test_multibytecodec.py:178 checks for len('\U00012345') == 2, and with PEP393 this is always False. I tried to run the tests with a few changes and they seem to work, but the code doesn't raise any exception on c.reset(): ---->8-------->8-------->8-------->8---- import io, codecs s = io.BytesIO() c = codecs.getwriter('gb18030')(s) c.write('123'); s.getvalue() c.write('\U00012345'); s.getvalue() c.write('\U00012345' + '\uac00\u00ac'); s.getvalue() c.write('\uac00'); s.getvalue() c.reset() s.getvalue() ---->8-------->8-------->8-------->8---- Result: >>> import io, codecs >>> s = io.BytesIO() >>> c = codecs.getwriter('gb18030')(s) >>> c.write('123'); s.getvalue() b'123' >>> c.write('\U00012345'); s.getvalue() b'123\x907\x959' >>> # '\U00012345'[0] is the same of '\U00012345' now >>> c.write('\U00012345' + '\uac00\u00ac'); s.getvalue() b'123\x907\x959\x907\x959\x827\xcf5\x810\x851' >>> c.write('\uac00'); s.getvalue() b'123\x907\x959\x907\x959\x827\xcf5\x810\x851\x827\xcf5' >>> c.reset() # is this supposed to raise an error? >>> s.getvalue() b'123\x907\x959\x907\x959\x827\xcf5\x810\x851\x827\xcf5' Victor suggested to wait until multibytecodec gets ported to the new API before fixing this. ---------- components: Tests messages: 144583 nosy: ezio.melotti, haypo, loewis priority: normal severity: normal stage: needs patch status: open title: test_multibytecodec.py:TestStreamWriter is skipped after PEP393 type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 29 04:38:37 2011 From: report at bugs.python.org (Wong Wah Meng) Date: Thu, 29 Sep 2011 02:38:37 +0000 Subject: [New-bugs-announce] [issue13057] Thread not working for python 2.7.1 built with HP Compiler on HP-UX 11.31 ia64 Message-ID: <02EA6D704E30CE499C5071776509A925F59F04@039-SN1MPN1-003.039d.mgd.msft.net> New submission from Wong Wah Meng : Resending as my old alternative email ID wasn't registered under my account. =========================================================================== Hello there, I included --with-threads option into the configure script calling, which it failed to add the -D_REENTRANT into Makefile. So I manually added this into OPT of the Makefile. I ran make again and generated a new python binary. However, the new binary is still not able to start a new thread from the thread module. I reviewed the config.log file, I think this failure has caused the build with threads failed. Cthreads.h header file is missing. Should this be included in my HP UX Compiler or it comes from python source? In python source I only found pythread.h. Anyway, I am only guessing what is wrong. Hope to hear some feedback here, whether this is something missing or a bug. configure:8407: checking for --with-threads configure:8427: result: yes configure:8484: checking for _POSIX_THREADS in unistd.h configure:8503: result: yes configure:8508: checking cthreads.h usability configure:8508: cc +DD64 -I/home/r32813/local/include -c -g conftest.c >&5 "conftest.c", line 128: error #3696-D: cannot open source file "cthreads.h" #include ^ 1 error detected in the compilation of "conftest.c". configure:8508: result: no configure:8508: checking for cthreads.h configure:8508: result: no configure:8521: checking mach/cthreads.h usability configure:8521: cc +DD64 -I/home/r32813/local/include -c -g conftest.c >&5 "conftest.c", line 128: error #3696-D: cannot open source file "mach/cthreads.h" #include ^ 1 error detected in the compilation of "conftest.c". configure:8521: $? = 2 configure: failed program was: | /* confdefs.h */ | #define _GNU_SOURCE 1 configure:8521: result: no configure:8521: checking for mach/cthreads.h configure:8521: result: no configure:8533: checking for --with-pth configure:8548: result: no configure:8556: checking for pthread_create in -lpthread configure:8572: cc +DD64 -I/home/r32813/local/include -o conftest -g -L/home/r32813/local/lib -L/home/r32813/Build/2.7.1/Python-2.7.1 conftest.c -l nsl -lrt -ldld -ldl -lpthread >&5 Regards, Wah Meng Genesis Wafermap Support Ticket: To report a problem: http://dyno.freescale.net/Question/QuestionMain3.asp?location=zmy02&category=&tickettype=6820 To request a service: http://dyno.freescale.net/Question/Questionmain3.asp?location=74&category=2&tickettype=6819 Or if it is related to EWM or DSA: http://dyno.freescale.net/Question/Questionmain3.asp?location=ZMY02&tickettype=6539 ---------- messages: 144584 nosy: wah meng priority: normal severity: normal status: open title: Thread not working for python 2.7.1 built with HP Compiler on HP-UX 11.31 ia64 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 29 13:29:43 2011 From: report at bugs.python.org (Thomas Jarosch) Date: Thu, 29 Sep 2011 11:29:43 +0000 Subject: [New-bugs-announce] [issue13058] Fix file descriptor leak on error Message-ID: <1317295783.94.0.921063756825.issue13058@psf.upfronthosting.co.za> New submission from Thomas Jarosch : Hi, attached patch fixes a file descriptor leak on error. Best regards, Thomas Jarosch ---------- components: Extension Modules files: cpython-fix-file-descriptor-leak.patch keywords: patch messages: 144588 nosy: thomas.jarosch priority: normal severity: normal status: open title: Fix file descriptor leak on error type: resource usage versions: Python 3.4 Added file: http://bugs.python.org/file23256/cpython-fix-file-descriptor-leak.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 29 14:48:05 2011 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Sep 2011 12:48:05 +0000 Subject: [New-bugs-announce] [issue13059] Sporadic test_multiprocessing failure: IOError("bad message length") in recv_bytes() Message-ID: <1317300485.05.0.349182962077.issue13059@psf.upfronthosting.co.za> New submission from STINNER Victor : [ 62/359] test_multiprocessing Warning -- threading._dangling was modified by test_multiprocessing Warning -- multiprocessing.process._dangling was modified by test_multiprocessing test test_multiprocessing crashed -- Traceback (most recent call last): File "/var/lib/buildslave/3.x.murray-gentoo/build/Lib/test/regrtest.py", line 1163, in runtest_inner indirect_test() File "/var/lib/buildslave/3.x.murray-gentoo/build/Lib/test/test_multiprocessing.py", line 2349, in test_main ManagerMixin.pool = ManagerMixin.manager.Pool(4) File "/var/lib/buildslave/3.x.murray-gentoo/build/Lib/multiprocessing/managers.py", line 670, in temp token, exp = self._create(typeid, *args, **kwds) File "/var/lib/buildslave/3.x.murray-gentoo/build/Lib/multiprocessing/managers.py", line 568, in _create conn = self._Client(self._address, authkey=self._authkey) File "/var/lib/buildslave/3.x.murray-gentoo/build/Lib/multiprocessing/connection.py", line 507, in Client answer_challenge(c, authkey) File "/var/lib/buildslave/3.x.murray-gentoo/build/Lib/multiprocessing/connection.py", line 734, in answer_challenge message = connection.recv_bytes(256) # reject large message File "/var/lib/buildslave/3.x.murray-gentoo/build/Lib/multiprocessing/connection.py", line 243, in recv_bytes self._bad_message_length() File "/var/lib/buildslave/3.x.murray-gentoo/build/Lib/multiprocessing/connection.py", line 175, in _bad_message_length raise IOError("bad message length") IOError: bad message length http://www.python.org/dev/buildbot/all/builders/x86%20Gentoo%203.x/builds/828/steps/test/logs/stdio ---------- components: Library (Lib) messages: 144589 nosy: haypo, neologix, pitrou priority: normal severity: normal status: open title: Sporadic test_multiprocessing failure: IOError("bad message length") in recv_bytes() versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 29 17:16:50 2011 From: report at bugs.python.org (Arne Babenhauserheide) Date: Thu, 29 Sep 2011 15:16:50 +0000 Subject: [New-bugs-announce] [issue13060] make round() floating-point errors less hurtful Message-ID: <1317309410.46.0.106397423857.issue13060@psf.upfronthosting.co.za> New submission from Arne Babenhauserheide : Hi, I just stumbled over round() errors. I read the FAQ?, and even though the FAQ states that this is no bug, its implementation is less than ideal. To illustrate: >>> round(0.5, 1) 0.0 and >>> round(5, -1) 0 This is mathematically wrong and hits for comparisions which humans put in. As alternate I use the following hack myself where ever I have to round numbers: def roundexact(a, *args): ... return round(a+0.000000000000001*max(1.0, (2*a)//10), *args) This has correct behavior for *5 on my hardware: >>> roundexact(0.5, 0) 1.0 Its errors only appear in corner cases: >>> roundexact(0.4999999999999999, 0) 0.0 >>> roundexact(0.49999999999999998, 0) 1.0 This implementation shields me from implementation details of my hardware in all but very few extreme cases, while the current implementation of round() exhibits the hardware-imposed bugs in cases which actually matter to humans. Maybe round could get a keyword argument roundup5 or such, which exhibits the behavior that any *5 number is rounded up. Note: The decimal module is no alternative, because it is more than factor 100 slower than floats (at least for simple computations): >>> from timeit import timeit >>> timeit("float(1.0)+float(0.1)") 0.30365920066833496 >>> timeit("Decimal(1.0)+Decimal(0.1)", setup="from decimal import Decimal, getcontext; getcontext().prec=17") 49.96972298622131 ?: http://docs.python.org/library/functions.html?highlight=round#round ---------- components: Interpreter Core messages: 144590 nosy: ArneBab priority: normal severity: normal status: open title: make round() floating-point errors less hurtful versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 29 19:27:44 2011 From: report at bugs.python.org (Joshua Bleecher Snyder) Date: Thu, 29 Sep 2011 17:27:44 +0000 Subject: [New-bugs-announce] [issue13061] Decimal module yields incorrect results when Python compiled with llvm Message-ID: <1317317264.78.0.478675633552.issue13061@psf.upfronthosting.co.za> New submission from Joshua Bleecher Snyder : When Python is compiled on OS X with llvm, the decimal module behaves erratically (simple calculations are wrong, most doctests fail). This was originally reported here: http://stackoverflow.com/questions/7590137/dividing-decimals-yields-invalid-results-in-python-2-5-to-2-7 and the compiler dependency was tracked down here: https://trac.macports.org/ticket/31444 Although it looks like MacPorts is going to force use of gcc, it'd still be better for Python to behave correctly when compiled with llvm. Possibly related to http://bugs.python.org/issue11149? ---------- assignee: ronaldoussoren components: Build, Installation, Library (Lib), Macintosh messages: 144604 nosy: josharian, ronaldoussoren priority: normal severity: normal status: open title: Decimal module yields incorrect results when Python compiled with llvm type: behavior versions: 3rd party, Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 29 19:43:10 2011 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 29 Sep 2011 17:43:10 +0000 Subject: [New-bugs-announce] [issue13062] Introspection generator and function closure state Message-ID: <1317318190.56.0.437971601638.issue13062@psf.upfronthosting.co.za> New submission from Nick Coghlan : Based on the python-ideas thread about closures, I realised there are two features the inspect module could offer to greatly simplify some aspects of testing closure and generator behaviour: inspect.getclosure(func) Returns a dictionary mapping closure references from the supplied function to their current values. inspect.getgeneratorlocals(generator) Returns the same result as would be reported by calling locals() in the generator's frame of execution The former would just involve syncing up the names on the code object with the cell references on the function object, while the latter would be equivalent to doing generator.gi_frame.f_locals with some nice error checking for when the generator's frame is already gone (or the supplied object isn't a generator iterator). ---------- messages: 144606 nosy: ncoghlan priority: normal severity: normal status: open title: Introspection generator and function closure state type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 29 21:07:14 2011 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Sep 2011 19:07:14 +0000 Subject: [New-bugs-announce] [issue13063] test_concurrent_futures failures on Windows: IOError('[Errno 232] The pipe is being closed') on _send_bytes() Message-ID: <1317323234.29.0.73593324718.issue13063@psf.upfronthosting.co.za> New submission from STINNER Victor : Re-running test 'test_concurrent_futures' in verbose mode test_killed_child (test.test_concurrent_futures.ProcessPoolExecutorTest) ... 5.79s ok test_map (test.test_concurrent_futures.ProcessPoolExecutorTest) ... 3.63s ok test_map_exception (test.test_concurrent_futures.ProcessPoolExecutorTest) ... 4.05s ok test_map_timeout (test.test_concurrent_futures.ProcessPoolExecutorTest) ... 9.64s ok test_shutdown_race_issue12456 (test.test_concurrent_futures.ProcessPoolExecutorTest) ... 3.60s ok test_submit (test.test_concurrent_futures.ProcessPoolExecutorTest) ... 3.63s ok test_submit_keyword (test.test_concurrent_futures.ProcessPoolExecutorTest) ... 4.09s ok test_map (test.test_concurrent_futures.ThreadPoolExecutorTest) ... 0.13s ok test_map_exception (test.test_concurrent_futures.ThreadPoolExecutorTest) ... 0.12s ok test_map_submits_without_iteration (test.test_concurrent_futures.ThreadPoolExecutorTest) Tests verifying issue 11777. ... 0.14s ok test_map_timeout (test.test_concurrent_futures.ThreadPoolExecutorTest) ... 6.11s ok test_shutdown_race_issue12456 (test.test_concurrent_futures.ThreadPoolExecutorTest) ... 0.11s ok test_submit (test.test_concurrent_futures.ThreadPoolExecutorTest) ... 0.11s ok test_submit_keyword (test.test_concurrent_futures.ThreadPoolExecutorTest) ... 0.11s ok test_all_completed (test.test_concurrent_futures.ProcessPoolWaitTests) ... 3.74s ok test_first_completed (test.test_concurrent_futures.ProcessPoolWaitTests) ... 5.18s ok test_first_completed_some_already_completed (test.test_concurrent_futures.ProcessPoolWaitTests) ... 5.02s ok test_first_exception (test.test_concurrent_futures.ProcessPoolWaitTests) ... 6.57s ok test_first_exception_one_already_failed (test.test_concurrent_futures.ProcessPoolWaitTests) ... 6.37s ok test_first_exception_some_already_complete (test.test_concurrent_futures.ProcessPoolWaitTests) ... 5.15s ok test_timeout (test.test_concurrent_futures.ProcessPoolWaitTests) ... 10.94s ok test_all_completed (test.test_concurrent_futures.ThreadPoolWaitTests) ... 0.12s ok test_first_completed (test.test_concurrent_futures.ThreadPoolWaitTests) ... 1.62s ok test_first_completed_some_already_completed (test.test_concurrent_futures.ThreadPoolWaitTests) ... 1.61s ok test_first_exception (test.test_concurrent_futures.ThreadPoolWaitTests) ... 3.12s ok test_first_exception_one_already_failed (test.test_concurrent_futures.ThreadPoolWaitTests) ... 2.10s ok test_first_exception_some_already_complete (test.test_concurrent_futures.ThreadPoolWaitTests) ... 1.60s ok test_timeout (test.test_concurrent_futures.ThreadPoolWaitTests) ... 6.12s ok test_no_timeout (test.test_concurrent_futures.ProcessPoolAsCompletedTests) ... 3.62s ok test_zero_timeout (test.test_concurrent_futures.ProcessPoolAsCompletedTests) ... 5.65s ok test_no_timeout (test.test_concurrent_futures.ThreadPoolAsCompletedTests) ... 0.12s ok test_zero_timeout (test.test_concurrent_futures.ThreadPoolAsCompletedTests) ... 2.11s ok test_cancel (test.test_concurrent_futures.FutureTests) ... ok test_cancelled (test.test_concurrent_futures.FutureTests) ... ok test_done (test.test_concurrent_futures.FutureTests) ... ok test_done_callback_already_cancelled (test.test_concurrent_futures.FutureTests) ... ok test_done_callback_already_failed (test.test_concurrent_futures.FutureTests) ... ok test_done_callback_already_successful (test.test_concurrent_futures.FutureTests) ... ok test_done_callback_raises (test.test_concurrent_futures.FutureTests) ... ok test_done_callback_with_cancel (test.test_concurrent_futures.FutureTests) ... ok test_done_callback_with_exception (test.test_concurrent_futures.FutureTests) ... ok test_done_callback_with_result (test.test_concurrent_futures.FutureTests) ... ok test_exception_with_success (test.test_concurrent_futures.FutureTests) ... ok test_exception_with_timeout (test.test_concurrent_futures.FutureTests) ... ok test_repr (test.test_concurrent_futures.FutureTests) ... ok test_result_with_cancel (test.test_concurrent_futures.FutureTests) ... ok test_result_with_success (test.test_concurrent_futures.FutureTests) ... ok test_result_with_timeout (test.test_concurrent_futures.FutureTests) ... ok test_running (test.test_concurrent_futures.FutureTests) ... ok test_context_manager_shutdown (test.test_concurrent_futures.ProcessPoolShutdownTest) ... 3.58s ok test_del_shutdown (test.test_concurrent_futures.ProcessPoolShutdownTest) ... 3.92s ok test_interpreter_shutdown (test.test_concurrent_futures.ProcessPoolShutdownTest) ... 5.60s FAIL test_processes_terminate (test.test_concurrent_futures.ProcessPoolShutdownTest) ... 3.67s ok test_run_after_shutdown (test.test_concurrent_futures.ProcessPoolShutdownTest) ... 0.01s ok test_context_manager_shutdown (test.test_concurrent_futures.ThreadPoolShutdownTest) ... 0.02s ok test_del_shutdown (test.test_concurrent_futures.ThreadPoolShutdownTest) ... 0.03s ok test_interpreter_shutdown (test.test_concurrent_futures.ThreadPoolShutdownTest) ... 1.68s ok test_run_after_shutdown (test.test_concurrent_futures.ThreadPoolShutdownTest) ... 0.00s ok test_threads_terminate (test.test_concurrent_futures.ThreadPoolShutdownTest) ... Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\queues.py", line 267, in _feed send(obj) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\connection.py", line 231, in send self._send_bytes(memoryview(buf)) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\connection.py", line 299, in _send_bytes overlapped = win32.WriteFile(self._handle, buf, overlapped=True) IOError: [Errno 232] The pipe is being closed Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\queues.py", line 267, in _feed send(obj) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\connection.py", line 231, in send self._send_bytes(memoryview(buf)) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\connection.py", line 299, in _send_bytes overlapped = win32.WriteFile(self._handle, buf, overlapped=True) IOError: [Errno 232] The pipe is being closed Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\queues.py", line 267, in _feed send(obj) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\connection.py", line 231, in send self._send_bytes(memoryview(buf)) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\connection.py", line 299, in _send_bytes overlapped = win32.WriteFile(self._handle, buf, overlapped=True) IOError: [Errno 232] The pipe is being closed Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\queues.py", line 267, in _feed send(obj) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\connection.py", line 231, in send self._send_bytes(memoryview(buf)) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\connection.py", line 299, in _send_bytes overlapped = win32.WriteFile(self._handle, buf, overlapped=True) IOError: [Errno 232] The pipe is being closed Warning -- threading._dangling was modified by test_concurrent_futures test test_concurrent_futures failed 0.01s ok ====================================================================== FAIL: test_interpreter_shutdown (test.test_concurrent_futures.ProcessPoolShutdownTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_concurrent_futures.py", line 109, in test_interpreter_shutdown self.assertFalse(err) AssertionError: b'Traceback (most recent call last):\n File "D:\\cygwin\\home\\db3l\\buildarea\\3.x.bolen-windows\\build\\lib\\multiprocessing\\queues.py", line 267, in _feed\n send(obj)\n File "D:\\cygwin\\home\\db3l\\buildarea\\3.x.bolen-windows\\build\\lib\\multiprocessing\\connection.py", line 231, in send' is not false ---------------------------------------------------------------------- Ran 59 tests in 133.632s http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.x/builds/5243/steps/test/logs/stdio ---------- components: Library (Lib) messages: 144612 nosy: haypo, neologix, pitrou priority: normal severity: normal status: open title: test_concurrent_futures failures on Windows: IOError('[Errno 232] The pipe is being closed') on _send_bytes() versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Sep 29 23:09:08 2011 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Sep 2011 21:09:08 +0000 Subject: [New-bugs-announce] [issue13064] Port codecs and error handlers to the new Unicode API Message-ID: <1317330548.17.0.268887391547.issue13064@psf.upfronthosting.co.za> New submission from STINNER Victor : We really need a new API for error handlers, using Python objects instead of Py_UNICODE* strings, and using code point indexes instead of UTF-16 unit indexes (index in the Py_UNICODE* object). It's also inefficient to encode to Py_UNICODE at the first encode/decode error. I added private APIs, we may make them public: * _PyUnicode_AsASCIIString() * _PyUnicode_AsLatin1String() * _PyUnicode_AsUTF8String() -- Martin answered me by mail: Would you like to work on this? Some thoughts: - encoding error handlers are easier than decoding, since the encoding error API uses Py_UNICODE* for almost no good reason (except to pass substrings into the exception object, which is better done with PyUnicode_Substring). Decoding has the issue that the error handler may produce a replacement string which then needs to be inserted into the output. - for decoding, I suggest to duplicate the error handling utility function, into one that operates on Unicode objects only. Then port one codec at a time, and ultimately remove the then-unused Py_UNICODE function. - adding an error handler result into a string may cause widening of the string. I can see two approaches: a) write decoders in Py_UCS4. This is perhaps best for the rarely-used codecs, such as UTF-7. b) write the codecs so that they do incremental widening. Start off with a Py_UCS1 buffer, and check each decoded character whether it is out of range. When you get an error handler result, check maxchar and widen the result accordingly. c) in principle, there is a third approach: run over the string once, collect all error handler results. Then allocate the output string, decode again, pasting the replacement strings into the output interleaved with regular decoded chars. This seems too complicated to implement. ---------- components: Unicode messages: 144639 nosy: haypo priority: normal severity: normal status: open title: Port codecs and error handlers to the new Unicode API versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 30 00:25:52 2011 From: report at bugs.python.org (Victor Semionov) Date: Thu, 29 Sep 2011 22:25:52 +0000 Subject: [New-bugs-announce] [issue13065] test Message-ID: <1317335152.37.0.143552991068.issue13065@psf.upfronthosting.co.za> New submission from Victor Semionov : ignore me ---------- messages: 144647 nosy: vsemionov priority: normal severity: normal status: open title: test _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 30 00:27:34 2011 From: report at bugs.python.org (Victor Semionov) Date: Thu, 29 Sep 2011 22:27:34 +0000 Subject: [New-bugs-announce] [issue13066] test Message-ID: <1317335254.91.0.776015122181.issue13066@psf.upfronthosting.co.za> New submission from Victor Semionov : ignore me ---------- components: IO, Interpreter Core messages: 144648 nosy: vsemionov priority: normal severity: normal status: open title: test type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 30 00:30:05 2011 From: report at bugs.python.org (Victor Semionov) Date: Thu, 29 Sep 2011 22:30:05 +0000 Subject: [New-bugs-announce] [issue13067] test Message-ID: <1317335405.74.0.519394753326.issue13067@psf.upfronthosting.co.za> New submission from Victor Semionov : ignore me ---------- components: IO, Interpreter Core files: backtrace messages: 144651 nosy: vsemionov priority: normal severity: normal status: open title: test type: crash versions: Python 3.2 Added file: http://bugs.python.org/file23269/backtrace _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 30 00:31:24 2011 From: report at bugs.python.org (Victor Semionov) Date: Thu, 29 Sep 2011 22:31:24 +0000 Subject: [New-bugs-announce] [issue13068] test Message-ID: <1317335484.04.0.337799871347.issue13068@psf.upfronthosting.co.za> New submission from Victor Semionov : ignore me ---------- messages: 144654 nosy: vsemionov priority: normal severity: normal status: open title: test type: crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 30 00:39:24 2011 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 29 Sep 2011 22:39:24 +0000 Subject: [New-bugs-announce] [issue13069] test Message-ID: <1317335964.94.0.450772671281.issue13069@psf.upfronthosting.co.za> New submission from Ezio Melotti : Testing issue creation ---------- hgrepos: 83 messages: 144655 nosy: ezio.melotti priority: normal severity: normal status: open title: test _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 30 00:42:45 2011 From: report at bugs.python.org (Victor Semionov) Date: Thu, 29 Sep 2011 22:42:45 +0000 Subject: [New-bugs-announce] [issue13070] segmentation fault in pure-python multi-threaded server Message-ID: <1317336165.27.0.207190934922.issue13070@psf.upfronthosting.co.za> New submission from Victor Semionov : Hello, I'm developing a multi-threaded TCP server and have been seeing segmentation faults on 3.2 on Linux and 3.2.2 on Windows. This happens when using only pure-Python libraries, so I believe the problem is in the interpreter. The issue is very easy to reproduce with my code, but I think it is obscure, because I have not been able to reproduce it with a smaller program. Here's what happens. The server accepts TCP connections, and creates a thread for every new connection. When the client sends a request, the server initiates its own TCP connection to a database. If any socket IO operation fails by raising a socket error (e.g. the database is down), those errors are caught by the calling code, and it gracefully terminates the thread. However, when the next client connects and sends a request, even if the server-initiated connections are successfully established, the interpreter crashes a bit later during the processing of the client's request (I think during IO operations). Strangely, this does not occur if the thread recovers and does not terminate after catching an exception (as the case with failed redis connections). Also, I was able to port my program to python 2.7, and it did not crash. To reproduce, you will need pg8000, which is a pure-python dbapi driver. You will need to get my program, wordbase, from the mercurial repository at https://bitbucket.org/vsemionov/wordbase (changeset 31c6554e67ee) and edit src/wordbase/db/pgsql.py. Change "import psycopg2 as dbapi" to "import pg8000.dbapi as dbapi". This is just to ensure that no C-based library is used. Steps to reproduce: 0. Ensure postgres is not running 1. Start wordbase with src/wordbase/wordbase.py -f . Use the path to the provided sample conf file at src/wordbase/wordbase.conf. By default you'll need to be root, in order to be able to create a log file. 2. Connect a client with "telnet localhost 2628" and enter "d hello". This should fail with status 420. Reconnect and repeat the same step a couple of times. The interpreter usually crashes after repeating this step. I'm providing the interpreter's backtrace, which is obtained from Python 3.2 on Linux. It is attached in a separate file. If you need any other information, please let me know. Best regards, Victor Semionov ---------- components: IO, Interpreter Core files: backtrace messages: 144656 nosy: vsemionov priority: normal severity: normal status: open title: segmentation fault in pure-python multi-threaded server type: crash versions: Python 3.2 Added file: http://bugs.python.org/file23270/backtrace _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 30 02:05:22 2011 From: report at bugs.python.org (jfalskfjdsl;akfdjsa;l laksfj;aslkfdj;sal) Date: Fri, 30 Sep 2011 00:05:22 +0000 Subject: [New-bugs-announce] [issue13071] IDLE refuses to open on windows 7 Message-ID: <1317341122.37.0.866117748717.issue13071@psf.upfronthosting.co.za> New submission from jfalskfjdsl;akfdjsa;l laksfj;aslkfdj;sal : I have tried all ways of opening IDLE and have uninstalled and reinstalled Python, but when I try to open it it crashes before anything happens ---------- components: IDLE messages: 144657 nosy: jfalskfjdsl;akfdjsa;l.laksfj;aslkfdj;sal priority: normal severity: normal status: open title: IDLE refuses to open on windows 7 type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 30 02:09:50 2011 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Sep 2011 00:09:50 +0000 Subject: [New-bugs-announce] [issue13072] Getting a buffer from a Unicode array uses invalid format Message-ID: <1317341390.65.0.255779328054.issue13072@psf.upfronthosting.co.za> New submission from STINNER Victor : In Python 3.2, when you get a buffer from array.array('u'), "u" is used as buffer format. The format is supposed to be a format from the struct module, and "u" is an invalid struct format. "w" is used on wide mode. I just upgraded the array module to use the new Unicode API (PEP 393). The array now uses a Py_UCS4 buffer. I used "I" or "L" format depending on the size of int and long C types. It would be better to use a format for a Py_UCS4 string, but struct doesn't support such type. For Python 2.7 and 3.2, I don't know if it is really a bug or not. ---------- components: Library (Lib) messages: 144658 nosy: haypo, pitrou priority: normal severity: normal status: open title: Getting a buffer from a Unicode array uses invalid format versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 30 10:09:03 2011 From: report at bugs.python.org (Petri Lehtinen) Date: Fri, 30 Sep 2011 08:09:03 +0000 Subject: [New-bugs-announce] [issue13073] message_body argument of HTTPConnection.endheaders is undocumented Message-ID: <1317370143.22.0.297306447289.issue13073@psf.upfronthosting.co.za> New submission from Petri Lehtinen : The argument is essential to avoid slowdown with delayed ACKs and the Nagle algorithm, so it should be documented. It was added when fixing issue 4336. I believe that it's new in Python 2.7. ---------- assignee: docs at python components: Documentation messages: 144676 nosy: docs at python, petri.lehtinen priority: normal severity: normal stage: needs patch status: open title: message_body argument of HTTPConnection.endheaders is undocumented type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 30 10:15:34 2011 From: report at bugs.python.org (Geoffrey Bache) Date: Fri, 30 Sep 2011 08:15:34 +0000 Subject: [New-bugs-announce] [issue13074] Improve documentation of locale encoding functions Message-ID: <1317370534.21.0.426762958064.issue13074@psf.upfronthosting.co.za> New submission from Geoffrey Bache : The locale module provides locale.getdefaultlocale and locale.getpreferredencoding. The encodings returned by each are generally subtly different ('ISO8859-1' vs 'ISO-8859-1'), but the difference between these methods is not explained. A comment by Martin von L?wis from 2003 in http://bugs.python.org/issue813449 indicates that "getdefaultlocale should not be used in new code", if this is really the case then this should be in the docs. Anyone reading the docs from the top will currently encounter getdefaultlocale first and believe that this is the way to get the encoding. ---------- assignee: docs at python components: Documentation messages: 144677 nosy: docs at python, gjb1002 priority: normal severity: normal status: open title: Improve documentation of locale encoding functions 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 Sep 30 11:21:25 2011 From: report at bugs.python.org (Elmar Zander) Date: Fri, 30 Sep 2011 09:21:25 +0000 Subject: [New-bugs-announce] [issue13075] PEP-0001 contains dead links Message-ID: <1317374485.54.0.239839552518.issue13075@psf.upfronthosting.co.za> New submission from Elmar Zander : The links in section "Resources" of PEP-0001 are all dead. They point to www.python.org/dev/ and all return a 404. Most of them can still be found via google archive.org, but that's not really how it should be. Maybe some of them are already superseded, but even then I think they have at least historical value and should be kept on python.org. ---------- assignee: docs at python components: Documentation messages: 144680 nosy: docs at python, ezander priority: normal severity: normal status: open title: PEP-0001 contains dead links _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 30 15:45:08 2011 From: report at bugs.python.org (Geoffrey Bache) Date: Fri, 30 Sep 2011 13:45:08 +0000 Subject: [New-bugs-announce] [issue13076] Bad links to 'time' in datetime documentation Message-ID: <1317390308.93.0.874341309843.issue13076@psf.upfronthosting.co.za> New submission from Geoffrey Bache : Reading through the datetime module documentation, various places that refer to "datetime.time" objects are in fact links to the "time" module. They should refer to the appropriate section on the same page. ---------- messages: 144689 nosy: gjb1002 priority: normal severity: normal status: open title: Bad links to 'time' in datetime documentation 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 Sep 30 17:30:42 2011 From: report at bugs.python.org (etuardu) Date: Fri, 30 Sep 2011 15:30:42 +0000 Subject: [New-bugs-announce] [issue13077] Unclear behavior of daemon threads on main thread exit Message-ID: <1317396642.03.0.535538271179.issue13077@psf.upfronthosting.co.za> New submission from etuardu : The definition of daemon thread in the current documentation reads: ?A thread can be flagged as a "daemon thread". The significance of this flag is that the entire Python program exits when only daemon threads are left. [...]? (http://docs.python.org/library/threading.html#thread-objects) I think it's not very clear from this that daemon threads themselves terminate when the program (main thread plus other non-daemon threads) terminates. I think this have to be said more explicitly. I'd propose a change with something like: ?A thread can be flagged as a "daemon thread", which means it will get shut down when the overall program terminates. The entire Python program exits when only daemon threads are left.? ---------- assignee: docs at python components: Documentation messages: 144691 nosy: docs at python, etuardu priority: normal severity: normal status: open title: Unclear behavior of daemon threads on main thread exit 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 Sep 30 19:41:55 2011 From: report at bugs.python.org (Ash Sparks) Date: Fri, 30 Sep 2011 17:41:55 +0000 Subject: [New-bugs-announce] [issue13078] Python Crashes When Saving Or Opening Message-ID: <1317404515.12.0.258020695982.issue13078@psf.upfronthosting.co.za> New submission from Ash Sparks : Hi there, Python v3.2 crashes every time I attempt to save or open .py files. I have attached a text file that shows the error I receive. In advance, your help is much appreciated Regards Ash ---------- components: Windows files: Python_Issue.txt messages: 144697 nosy: Ash.Sparks priority: normal severity: normal status: open title: Python Crashes When Saving Or Opening type: crash versions: Python 3.2 Added file: http://bugs.python.org/file23276/Python_Issue.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 30 19:51:59 2011 From: report at bugs.python.org (ojab) Date: Fri, 30 Sep 2011 17:51:59 +0000 Subject: [New-bugs-announce] [issue13079] Wrong datetime format in PEP3101 Message-ID: <1317405119.65.0.993211188436.issue13079@psf.upfronthosting.co.za> New submission from ojab : Example in pep3101 is "Today is: {0:a b d H:M:S Y}".format(datetime.now()) but it should be "Today is: {0:%a %b %d %H:%M:%S %Y}".format(datetime.now()) ---------- assignee: docs at python components: Documentation messages: 144698 nosy: docs at python, ojab priority: normal severity: normal status: open title: Wrong datetime format in PEP3101 type: behavior versions: 3rd party _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 30 21:31:37 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 30 Sep 2011 19:31:37 +0000 Subject: [New-bugs-announce] [issue13080] test_email fails in refleak mode Message-ID: <1317411097.99.0.612727168161.issue13080@psf.upfronthosting.co.za> New submission from Antoine Pitrou : $ ./python -m test -R 3:2 -uall test_email [1/1] test_email beginning 5 repetitions 12345 Warning -- sys.path was modified by test_email test test_email failed -- Traceback (most recent call last): File "/home/antoine/cpython/default/Lib/test/test_email/test_policy.py", line 136, in test_overriden_register_defect_works self.assertEqual(my_policy.defects, [defect1]) AssertionError: Lists differ: [MyDefect('one',), MyDefect('t... != [MyDefect('one',)] First differing element 0: one one First list contains 2 additional elements. First extra element 1: two - [MyDefect('one',), MyDefect('two',), MyDefect('one',)] + [MyDefect('one',)] 1 test failed: test_email ---------- components: Library (Lib), Tests messages: 144700 nosy: barry, pitrou, r.david.murray priority: normal severity: normal status: open title: test_email fails in refleak mode type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Sep 30 23:21:05 2011 From: report at bugs.python.org (Roger Libiez) Date: Fri, 30 Sep 2011 21:21:05 +0000 Subject: [New-bugs-announce] [issue13081] Crash in Windows with unknown cause Message-ID: <1317417665.11.0.474916583341.issue13081@psf.upfronthosting.co.za> New submission from Roger Libiez : While using the application found at: https://sourceforge.net/tracker/?group_id=199269 The following Windows error dump generates itself while processing a batch of 3D mesh files with it. I do not know the specifics about what process was underway or have any Python trace data to supply, but it can be reproduced reliably using the beta6 version of the application. The developer directed me here after I filed this bug: https://sourceforge.net/tracker/?func=detail&aid=3415495&group_id=199269&atid=968813 The only known method I have to reproduce this is to run a batch process against a large number of mesh files. Windows memory usage is not anywhere close to the 2GB process limit. Windows 7 Home Premium 64 bit, using 32 bit Python 2.7.2. Problem signature: Problem Event Name: APPCRASH Application Name: python.exe Application Version: 0.0.0.0 Application Timestamp: 4df4ba7c Fault Module Name: python27.dll Fault Module Version: 2.7.2150.1013 Fault Module Timestamp: 4df4ba7c Exception Code: c0000005 Exception Offset: 0002a33f OS Version: 6.1.7601.2.1.0.768.3 Locale ID: 1033 Additional Information 1: 0a9e Additional Information 2: 0a9e372d3b4ad19135b953a78882e789 Additional Information 3: 0a9e Additional Information 4: 0a9e372d3b4ad19135b953a78882e789 ---------- components: Windows messages: 144707 nosy: rlibiez priority: normal severity: normal status: open title: Crash in Windows with unknown cause versions: Python 2.7 _______________________________________ Python tracker _______________________________________