From report at bugs.python.org Thu Mar 1 01:00:48 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 01 Mar 2012 00:00:48 +0000 Subject: [New-bugs-announce] [issue14163] tkinter: problems with hello doc example Message-ID: <1330560048.21.0.5556738264.issue14163@psf.upfronthosting.co.za> New submission from Terry J. Reedy : After an intro, the tkinter docs start with a traditional 'Hello World'. http://docs.python.org/py3k/library/tkinter.html#a-simple-hello-world-program Problem 1. The example ends with root.destroy John Salerno, today, on python-list thread "Is it necessary to call Tk() when writing a GUI app with Tkinter?", reported the following, which I verified. On Windows, at least, closing the unlabelled Tk window by clicking the normal [X} close button on the frame causes _tkinter.TclError: can't invoke "destroy" command: application has been destroyed This does not happen if one instead clicks the QUIT button inside the frame (as that does not destroy the app). Question 1a. Does the example work the same with current tcl/tk on *nix and mac? I assume it should, but I do not know if the example was buggy from the beginning or if something changes. In any case, I do not want to commit a solution that is not tested on more than my Win7. Question 1b. How do we most simply fix this part of the example? In '''self.QUIT["command"] = self.quit''', I changed 'quit' to 'destroy' and the result is to destroy the widgets but leave the outer frame and continue the mainloop. I tried another solution based on adding self.protocol("WM_DELETE_WINDOW", self.onDestroyWindow) to __init__(), but while this worked for Rick Johnson's class App(tk.Tk) example in his response to Salerno, it does not work for this class Application(Frame) example as the latter has no .protocol attribute. --- Problem 2. A 'Hello World' example should say 'Hello World' instead of just 'hello'. So I make the trivial edit and tk add braces and displays '{Hello World}'. What??? Adding '\n' does not trigger brace addition, so "Hello_World\n(click_me)" works as expected. Queston 2. How does one put a space in a button label with triggering addition of braces, or is this impossible? --- Problem and Solution 3. The example currently puts a loud capital red QUIT button first, and the quiet lowercase blass hello button second. This is backwards in both placement and emphasis. Putting the expanded hello buttom on top and QUIT under looks better to me. --- Problem 4 (in the intro, before the example): There is a lot that could be changed or added to the doc, but I think revising to use Tkinter all you need is a simple import statement: import tkinter Or, more often: from tkinter import * (3.x version) to add what I think is the best option, 'import tkinter as tk', as at least equal to the '*' option, should be done soon. I am thinking of something like to use Tkinter, use one of these import statements: import tkinter import tkinter as tk from tkinter import * ---------- assignee: docs at python components: Documentation, Tkinter messages: 154669 nosy: docs at python, ned.deily, serwy, terry.reedy priority: normal severity: normal status: open title: tkinter: problems with hello doc example type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 13:25:25 2012 From: report at bugs.python.org (John Napster) Date: Thu, 01 Mar 2012 12:25:25 +0000 Subject: [New-bugs-announce] [issue14164] my little contribution to the docs Message-ID: <1330604725.79.0.785320238353.issue14164@psf.upfronthosting.co.za> New submission from John Napster : This patch fixes some small grammar things in the docs. Hope you like my contribution. ---------- assignee: docs at python components: Documentation files: patch.diff keywords: patch messages: 154688 nosy: docs at python, joenapnap priority: normal severity: normal status: open title: my little contribution to the docs type: enhancement versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file24695/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 14:52:36 2012 From: report at bugs.python.org (Sven Marnach) Date: Thu, 01 Mar 2012 13:52:36 +0000 Subject: [New-bugs-announce] [issue14165] The new shlex.quote() function should be marked "New in version 3.3" Message-ID: <1330609956.34.0.635238408021.issue14165@psf.upfronthosting.co.za> New submission from Sven Marnach : The function shlex.quotes() [1] does not yet exist in Python 3.2 [2], so it should be marked "New in version 3.3." in the docs. I double-checked that it really does not yet exist in 3.2 and is not only missing from the 3.2 documentation. [1]: http://docs.python.org/dev/library/shlex.html#shlex.quote [2]: http://docs.python.org/py3k/library/shlex.html ---------- assignee: docs at python components: Documentation messages: 154693 nosy: docs at python, smarnach priority: normal severity: normal status: open title: The new shlex.quote() function should be marked "New in version 3.3" versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 15:34:10 2012 From: report at bugs.python.org (sbt) Date: Thu, 01 Mar 2012 14:34:10 +0000 Subject: [New-bugs-announce] [issue14166] private dispatch table for picklers Message-ID: <1330612450.14.0.527502526549.issue14166@psf.upfronthosting.co.za> New submission from sbt : Currently the only documented way to have customised pickling for a type is to register a reduction function with the global dispatch table managed by the copyreg module. But such global changes are liable to disrupt other code which uses pickling. Multiprocessing deals with this by defining a ForkingPickler class which subclasses the pure python _Pickler class (using undocumented features), and supports registering reduction functions specifically for that class. I would like to see some documented alternative which works with both C and Python implementations. At least then multiprocessing can avoid using slow pure python pickling. The attached patch allows a pickler object to have a private dispatch table which it uses *instead* of the global one. It lets one write code like p = pickle.Pickler(...) p.dispatch_table = copyreg.dispatch_table.copy() p.dispatch_table[SomeClass] = reduce_SomeClass or class MyPickler(pickle.Pickler): dispatch_table = copyreg.dispatch_table.copy() MyPickler.dispatch_table[SomeClass] = reduce_SomeClass p = MyPickler(...) The equivalent using copyreg would be copyreg.pickle(SomeClass, reduce_SomeClass) p = pickle.Pickler(...) ---------- files: pickle_dispatch.patch keywords: patch messages: 154695 nosy: sbt priority: normal severity: normal status: open title: private dispatch table for picklers type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24697/pickle_dispatch.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 16:07:09 2012 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 01 Mar 2012 15:07:09 +0000 Subject: [New-bugs-announce] [issue14167] document return statement in finally blocks Message-ID: <1330614429.57.0.59180427723.issue14167@psf.upfronthosting.co.za> New submission from Yury Selivanov : I think that the documentation should put more emphasis on the `return` statement in a `finally` block. Example: def test(): try: 1/0 finally: return 10 >>> test() 10 I think we need to add a warning, or at least a note, that 'return' masks exceptions, if any occurred. ---------- assignee: docs at python components: Documentation messages: 154697 nosy: Yury.Selivanov, docs at python, georg.brandl, rhettinger priority: normal severity: normal status: open title: document return statement in finally blocks type: enhancement versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 18:21:39 2012 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 01 Mar 2012 17:21:39 +0000 Subject: [New-bugs-announce] [issue14168] minidom behaves differently in 3.3 compared to 3.2 Message-ID: <1330622499.39.0.488658908154.issue14168@psf.upfronthosting.co.za> New submission from Vinay Sajip : The following script, minidom_test.py, from xml.dom import minidom data = b''' https://example.com/blog/ https://example.com/blog/1/ ''' doc = minidom.parseString(data) for link in doc.getElementsByTagName('link'): print(link._attrs) produces different results in Python 3.2 and 3.3: vinay at eta-oneiric64:~/projects/scratch$ python3.2 minidom_test.py {} {} vinay at eta-oneiric64:~/projects/scratch$ python3.3 minidom_test.py None None ---------- components: Library (Lib), XML keywords: 3.2regression messages: 154705 nosy: loewis, r.david.murray, vinay.sajip priority: normal severity: normal status: open title: minidom behaves differently in 3.3 compared to 3.2 type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 19:03:05 2012 From: report at bugs.python.org (Fabio Menegazzo) Date: Thu, 01 Mar 2012 18:03:05 +0000 Subject: [New-bugs-announce] [issue14169] compiler.compile fails on "if" statement in attached file Message-ID: <1330624985.96.0.952704814324.issue14169@psf.upfronthosting.co.za> New submission from Fabio Menegazzo : compiler.compile fails on "if" statement in attached file. When executing the code compiler.compile(contents, '', 'exec') passing the attached file contents, the following error is raised: ValueError: chr() arg not in range(256) This won't fail when using the builtin "compile". Also removing the "if" statement or any line before it, the contents are compiled successfully. ---------- files: small_with_error.py messages: 154707 nosy: menegazzobr priority: normal severity: normal status: open title: compiler.compile fails on "if" statement in attached file type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file24699/small_with_error.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 04:43:31 2012 From: report at bugs.python.org (nkxyz) Date: Fri, 02 Mar 2012 03:43:31 +0000 Subject: [New-bugs-announce] [issue14170] print unicode string error in cmd console Message-ID: <1330659811.63.0.966664432837.issue14170@psf.upfronthosting.co.za> New submission from nkxyz : print u'????' ?raceback (most recent call last): File "C:\Users\__test.py", line 96, in sys.exit(main()) File "C:\Users\__test.py", line 84, in main print u'??????' IOError: [Errno 28] No space left on device the unicode must start with a ascii char, then print can works like this: "print u' ????'" ---------- components: IO messages: 154724 nosy: nkxyz priority: normal severity: normal status: open title: print unicode string error in cmd console type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 07:48:20 2012 From: report at bugs.python.org (Zooko O'Whielacronx) Date: Fri, 02 Mar 2012 06:48:20 +0000 Subject: [New-bugs-announce] [issue14171] warnings from valgrind about openssl as used by CPython Message-ID: <1330670900.9.0.919434132567.issue14171@psf.upfronthosting.co.za> New submission from Zooko O'Whielacronx : The buildbot for the Tahoe-LAFS and pycryptopp projects runs CPython under valgrind on Fedora, and valgrind emits warnings like this: ==30127== Conditional jump or move depends on uninitialised value(s) ==30127== at 0x4C2AD01: bcmp (mc_replace_strmem.c:889) ==30127== by 0xC1D1646: fips_get_entropy (fips_drbg_lib.c:166) ==30127== by 0xC1D1D6E: FIPS_drbg_instantiate (fips_drbg_lib.c:234) ==30127== by 0xC15F590: RAND_init_fips (rand_lib.c:286) ==30127== by 0xC0F54D3: OPENSSL_init_library (o_init.c:106) ==30127== by 0xBE76AF8: SSL_library_init (ssl_algs.c:68) ==30127== by 0xBC2B39D: init_hashlib (in /usr/lib64/python2.7/lib-dynload/_hashlib.so) ==30127== by 0x4F1DB00: _PyImport_LoadDynamicModule (in /usr/lib64/libpython2.7.so.1.0) You can see the full output from such a buildbot run here: https://tahoe-lafs.org/buildbot-pycryptopp/builders/Ruben%20Fedora%20syslib/builds/58/steps/test%20valgrind/logs/valgrind Here is information about the versions of software involved: https://tahoe-lafs.org/buildbot-pycryptopp/builders/Ruben%20Fedora%20syslib/builds/58/steps/show-tool-versions/logs/stdio The owner of the buildslave machine says that the openssl package was "openssl-1.0.1-0.1.beta2.fc17.x86_64". Not having looked closer, I assume this is just a case of openssl using uninitialized memory as part of the initialization of the PRNG. Accordingly, I wrote suppressions stanzas for our valgrind suppressions file, which made the warnings go away. Here are the suppression expressions: # generated on buildbot.rubenkerkhof.com, which had, according to Ruben # Fedora's package "openssl-1.0.1-0.1.beta2.fc17.x86_64" { buildbot.rubenkerkhof.com cond fips openssl 1 Memcheck:Cond fun:bcmp fun:fips_get_entropy fun:FIPS_drbg_instantiate fun:RAND_init_fips fun:OPENSSL_init_library fun:SSL_library_init fun:init_hashlib } { buildbot.rubenkerkhof.com cond fips openssl 2 Memcheck:Cond fun:fips_get_entropy fun:FIPS_drbg_instantiate fun:RAND_init_fips fun:OPENSSL_init_library fun:SSL_library_init fun:init_hashlib } { buildbot.rubenkerkhof.com val _x86_64_AES_encrypt_compact Memcheck:Value8 fun:_x86_64_AES_encrypt_compact fun:AES_encrypt } I opened this ticket on launchpad.net to track the handling of this issue in various projects such as openssl, pycryptopp, CPython, valgrind, and Fedora: https://bugs.launchpad.net/pycryptopp/+bug/944585 ---------- components: Library (Lib) files: cpython-openssl101.supp messages: 154742 nosy: zooko priority: normal severity: normal status: open title: warnings from valgrind about openssl as used by CPython versions: Python 2.7 Added file: http://bugs.python.org/file24701/cpython-openssl101.supp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 10:42:59 2012 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 02 Mar 2012 09:42:59 +0000 Subject: [New-bugs-announce] [issue14172] ref-counting leak in buffer usage in Python/marshal.c Message-ID: <1330681379.13.0.854959913583.issue14172@psf.upfronthosting.co.za> New submission from Stefan Behnel : Line 428 in Python/marshal.c calls pb->bf_releasebuffer() without dec-refing the view.obj field afterwards. I don't think this is really so truly performance critical that it can't accept the couple of nanoseconds that it takes to go through PyBuffer_Release() instead. ---------- components: Interpreter Core messages: 154755 nosy: scoder priority: normal severity: normal status: open title: ref-counting leak in buffer usage in Python/marshal.c type: behavior versions: Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 11:41:33 2012 From: report at bugs.python.org (Ferringb) Date: Fri, 02 Mar 2012 10:41:33 +0000 Subject: [New-bugs-announce] [issue14173] PyOS_FiniInterupts leaves signal.getsignal segfaulty Message-ID: <1330684893.81.0.620988158976.issue14173@psf.upfronthosting.co.za> New submission from Ferringb : During Py_Finalize (pythonrun.c), it does the following: 1) suppress signal handling PyOs_FiniInterupts 2) clear caches 3) force gc collection; first for objects, then via wiping modules. The problem is that for unix OSs, Modules/signal.c's PyOs_FiniInterrupts leaves itself in a state where its internal Handlers are effectively reset to NULL, except the various functions don't properly handle that scenario. Attached is a test case demonstrating it; it segfaults on every python version I've tested (2.4->3.2; haven't tried 3.3). Since this *only* occurs during the final gc sweep when modules are destroyed, its a bit of a pain in the ass to detect that we're in that scenario, and that we must not touch signal.getsignal lest it segfault the interp. That said, def _SignalModuleUsable(): try: signal.signal(signal.SIGUSR1, signal.signal(signal.SIGUSR1, some_handler)) return True except (TypeError, AttributeError, SystemError): # we were invoked in a module cleanup context. return False does manage to poke the api just right so that it can be detected w/out segfaulting the interp. Finally, note that while folks could point at __del__... its not really at fault. Doing a proper weakref.ref finalizer can trigger the same- the fault is signal.c's PyOs_FiniInterrupts leaving the signal module in a bad state. For the testcase, I used __del__ just because it was quicker/less code to do so. ---------- components: Interpreter Core files: test.py messages: 154758 nosy: ferringb priority: normal severity: normal status: open title: PyOS_FiniInterupts leaves signal.getsignal segfaulty type: crash versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file24703/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 13:08:10 2012 From: report at bugs.python.org (Arnout van Meer) Date: Fri, 02 Mar 2012 12:08:10 +0000 Subject: [New-bugs-announce] [issue14174] argparse.REMAINDER fails to parse remainder correctly Message-ID: <1330690090.15.0.511487898244.issue14174@psf.upfronthosting.co.za> New submission from Arnout van Meer : Reproduction case is attached and should speak for itself, but the short brief is that the argparse.REMAINDER behaviour is very inconsistent based on what (potentially) defined argument handlers come before it. Tested this on Python 2.7 on OS X, but also grabbed the latest argparse.py from hg to verify against this. ---------- components: Library (Lib) files: worker.py messages: 154761 nosy: rr2do2 priority: normal severity: normal status: open title: argparse.REMAINDER fails to parse remainder correctly type: behavior versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file24704/worker.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 13:31:29 2012 From: report at bugs.python.org (Florent Xicluna) Date: Fri, 02 Mar 2012 12:31:29 +0000 Subject: [New-bugs-announce] [issue14175] broken links on /download/ page Message-ID: <1330691489.97.0.756489125199.issue14175@psf.upfronthosting.co.za> New submission from Florent Xicluna : The links for the latest RC are broken on the official page. http://www.python.org/download/ And the "release" page only list 3.2.3 rc1 and forget the other 3: http://www.python.org/download/releases/ ---------- messages: 154762 nosy: flox priority: normal severity: normal status: open title: broken links on /download/ page type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 13:36:56 2012 From: report at bugs.python.org (Jean-Michel Fauth) Date: Fri, 02 Mar 2012 12:36:56 +0000 Subject: [New-bugs-announce] [issue14176] Fix unicode literals (for PEP 414) Message-ID: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> New submission from Jean-Michel Fauth : Now, that the PEP 414 has been accepted, I can only strongly recommend to fix the problem of unicode literals as a partial workaround. >>> print u'abc???' abc? >>> If these six characters are not rendered correctly, you shoud read: LATIN SMALL LETTER A LATIN SMALL LETTER B LATIN SMALL LETTER C LATIN SMALL LIGATURE OE LATIN SMALL LETTER E WITH ACUTE EURO SIGN It is not necessary to give here the list of the numerous libs that do not understand u'unicode literals' as shown above. (I wrote all my Py2 code in a u'unicode mode', and I know how hard it is to have to select between the u'' or unicode() variants. Face it. Python has never worked [*], Python does not work, Python will never work. More important, it is more than clear to me, there is no willingness to solve this issue. (The holy compatibilty with not working code). [*] Except the pure ASCII serie (Py 1.5) and the Python 3[0,1,2] serie. No offense. I'm pretty sure the creator of this PEP is not even able to type on his machine the list of the 42 characters supposed to be available it the typographies (plural) used by the different countries speaking French. The whole free/open source software disaster in all its splendor. Regards. jmf ---------- components: None messages: 154763 nosy: Jean-Michel.Fauth priority: normal severity: normal status: open title: Fix unicode literals (for PEP 414) versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 17:25:12 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 02 Mar 2012 16:25:12 +0000 Subject: [New-bugs-announce] [issue14177] marshal.loads accepts unicode strings Message-ID: <1330705512.68.0.880632816673.issue14177@psf.upfronthosting.co.za> New submission from Antoine Pitrou : >>> marshal.loads('T') True >>> marshal.loads(b'T') True Contrast with: >>> marshal.load(io.BytesIO(b'T')) True >>> marshal.load(io.StringIO('T')) Traceback (most recent call last): File "", line 1, in TypeError: f.read() returned not bytes but str ---------- components: Extension Modules keywords: easy messages: 154778 nosy: pitrou priority: normal severity: normal stage: needs patch status: open title: marshal.loads accepts unicode strings type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 17:36:23 2012 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 02 Mar 2012 16:36:23 +0000 Subject: [New-bugs-announce] [issue14178] Failing tests for ElementTree Message-ID: <1330706183.38.0.536130831322.issue14178@psf.upfronthosting.co.za> New submission from Stefan Behnel : These are tests from lxml's ET compatibility test suite that now fail in ElementTree: def test_delslice_step(self): Element = self.etree.Element SubElement = self.etree.SubElement a = Element('a') b = SubElement(a, 'b') c = SubElement(a, 'c') d = SubElement(a, 'd') e = SubElement(a, 'e') del a[1::2] self.assertEquals( [b, d], list(a)) def test_delslice_step_negative(self): Element = self.etree.Element SubElement = self.etree.SubElement a = Element('a') b = SubElement(a, 'b') c = SubElement(a, 'c') d = SubElement(a, 'd') e = SubElement(a, 'e') del a[::-1] self.assertEquals( [], list(a)) def test_delslice_step_negative2(self): Element = self.etree.Element SubElement = self.etree.SubElement a = Element('a') b = SubElement(a, 'b') c = SubElement(a, 'c') d = SubElement(a, 'd') e = SubElement(a, 'e') del a[::-2] self.assertEquals( [b, d], list(a)) The error messages go like this: del a[1::2] ValueError: attempt to assign sequence of size 0 to extended slice of size 2 del a[::-1] ValueError: attempt to assign sequence of size 0 to extended slice of size 4 del a[::-2] ValueError: attempt to assign sequence of size 0 to extended slice of size 2 Additionally, I get this error: self.assertNotEquals(None, e.code) AttributeError: 'ParseError' object has no attribute 'code' for this test: required_versions_ET['test_feed_parser_error_position'] = (1,3) def test_feed_parser_error_position(self): ParseError = self.etree.ParseError parser = self.etree.XMLParser() try: parser.close() except ParseError: e = sys.exc_info()[1] self.assertNotEquals(None, e.code) self.assertNotEquals(0, e.code) self.assert_(isinstance(e.position, tuple)) self.assert_(e.position >= (0, 0)) The complete test suite is here: https://github.com/lxml/lxml/blob/master/src/lxml/tests/test_elementtree.py ---------- components: Library (Lib), XML messages: 154780 nosy: scoder priority: normal severity: normal status: open title: Failing tests for ElementTree type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 19:07:14 2012 From: report at bugs.python.org (Florian M) Date: Fri, 02 Mar 2012 18:07:14 +0000 Subject: [New-bugs-announce] [issue14179] Test coverage for lib/re.py Message-ID: <1330711634.92.0.5841595214.issue14179@psf.upfronthosting.co.za> New submission from Florian M : I added one small test in lib/test/test_re.py for complete coverage of 're._compile' method. ---------- components: Tests files: re_coverage.patch keywords: patch messages: 154785 nosy: flomm priority: normal severity: normal status: open title: Test coverage for lib/re.py versions: Python 3.3 Added file: http://bugs.python.org/file24710/re_coverage.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 01:10:22 2012 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Mar 2012 00:10:22 +0000 Subject: [New-bugs-announce] [issue14180] Factorize code to convert int/float to time_t, timeval or timespec Message-ID: <1330733422.24.0.352066771242.issue14180@psf.upfronthosting.co.za> New submission from STINNER Victor : There are various ways to convert a Python int/float to a C time_t, timeval or timespec structure. Attached patch factorize code by adding functions to convert a Python object to a C type (time_t, timeval or timespec). My patch changes how datetime rounds microsecond: round towards zero instead of rounding to nearest with ties going away from zero. I chose this rounding method because it is the method used by int(float) and int(time.time()) is a common in programs (more than round(time.time()). Rounding towards zero avoids also producing timestamps in the future. On overflow, an OverflowError is now raises instead of a ValueError. I prefer OverflowError over ValueError because it is an implementation detail. For example, time_t is 32 bits on Linux 32 bits, 64 bits on Linux 64 bits or on Windows (32 or 64 bits). PyTime_ObjectToXXX() functions are part of Python and so can be used by the posix, time, datetime and select modules. The patch removes _time.c, _time.h and timefunc.h because these files were only used for one function (_PyTime_DoubleToTime_t) which is no more used and it required to link a module to _time.c to get this function. -- If it is a problem to replace ValueError with OverflowError for backward compatibility, it is easy to adapt the patch to raise ValueError instead. timedelta*float and timedelta/float rounding method may also be changed. ---------- components: Library (Lib) files: pytime.patch keywords: patch messages: 154811 nosy: belopolsky, georg.brandl, gregory.p.smith, haypo priority: normal severity: normal status: open title: Factorize code to convert int/float to time_t, timeval or timespec versions: Python 3.3 Added file: http://bugs.python.org/file24716/pytime.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 09:29:22 2012 From: report at bugs.python.org (Stefan Krah) Date: Sat, 03 Mar 2012 08:29:22 +0000 Subject: [New-bugs-announce] [issue14181] Support getbuffer redirection scheme in memoryview Message-ID: <1330763362.99.0.43231376241.issue14181@psf.upfronthosting.co.za> New submission from Stefan Krah : Supporting chained objects that redirect getbuffer requests to a single exporter rather than re-exporting the buffer is a matter of removing an assert, but it needs tests and documentation updates. ---------- assignee: skrah messages: 154826 nosy: ncoghlan, pitrou, scoder, skrah priority: normal severity: normal stage: test needed status: open title: Support getbuffer redirection scheme in memoryview type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 11:10:04 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 03 Mar 2012 10:10:04 +0000 Subject: [New-bugs-announce] [issue14182] collections.Counter equality test thrown-off by zero counts Message-ID: <1330769404.28.0.817906963132.issue14182@psf.upfronthosting.co.za> New submission from Raymond Hettinger : >>> from collections import Counter >>> x=Counter(a=10,b=0,c=3) >>> y=Counter(a=10,c=3) >>> x == y False >>> all(x[k]==y[k] for k in set(x) | set(y)) True ---------- assignee: rhettinger components: Library (Lib) messages: 154827 nosy: rhettinger priority: normal severity: normal status: open title: collections.Counter equality test thrown-off by zero counts type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 14:55:35 2012 From: report at bugs.python.org (=?utf-8?q?Francisco_Mart=C3=ADn_Brugu=C3=A9?=) Date: Sat, 03 Mar 2012 13:55:35 +0000 Subject: [New-bugs-announce] [issue14183] Test coverage for lib/packaging.install and lib/packaging/pypi/wrapper Message-ID: <1330782935.14.0.67461963587.issue14183@psf.upfronthosting.co.za> New submission from Francisco Mart?n Brugu? : I've added a test to Lib/packaging/tests/test_install.py to increase the line test coverage of lib/packaging.install (and lib/packaging/pypi/wrapper indirectly from 14% to 80%). ---------- components: Tests files: packaging_get_infos_coverage_e67b3a9bd2dc.patch keywords: patch messages: 154839 nosy: francismb priority: normal severity: normal status: open title: Test coverage for lib/packaging.install and lib/packaging/pypi/wrapper versions: Python 3.3 Added file: http://bugs.python.org/file24720/packaging_get_infos_coverage_e67b3a9bd2dc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 19:24:10 2012 From: report at bugs.python.org (Dionysios Kalofonos) Date: Sat, 03 Mar 2012 18:24:10 +0000 Subject: [New-bugs-announce] [issue14184] test_recursion_limit Message-ID: <1330799050.76.0.964372531449.issue14184@psf.upfronthosting.co.za> Changes by Dionysios Kalofonos : ---------- nosy: dk priority: normal severity: normal status: open title: test_recursion_limit _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 20:00:55 2012 From: report at bugs.python.org (=?utf-8?q?Westley_Mart=C3=ADnez?=) Date: Sat, 03 Mar 2012 19:00:55 +0000 Subject: [New-bugs-announce] [issue14185] Failure to build _dbm with ndbm on Arch Linux Message-ID: <1330801255.84.0.367469513946.issue14185@psf.upfronthosting.co.za> New submission from Westley Mart?nez : When building Python I get this: "building dbm using ndbm *** WARNING: renaming "_dbm" since importing it failed: build/lib.linux-i686-3.3-pydebug/_dbm.cpython-33dm.so: undefined symbol: dbm_nextkey Failed to build these modules: _dbm " I'm running Arch and I have gdbm installed so shouldn't it be building dbm with gdbm? ---------- messages: 154845 nosy: anikom15 priority: normal severity: normal status: open title: Failure to build _dbm with ndbm on Arch Linux type: compile error versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 21:15:11 2012 From: report at bugs.python.org (Chris Rebert) Date: Sat, 03 Mar 2012 20:15:11 +0000 Subject: [New-bugs-announce] [issue14186] Link to PEP 3107 in "def" part of Language Reference Message-ID: <1330805711.99.0.463703521532.issue14186@psf.upfronthosting.co.za> New submission from Chris Rebert : The part of the Language Reference concerning the `def` statement (http://docs.python.org/dev/reference/compound_stmts.htm#function-definitions ) should include a See Also link to PEP 3107 "Function Annotations". ---------- assignee: docs at python components: Documentation messages: 154851 nosy: cvrebert, docs at python priority: normal severity: normal status: open title: Link to PEP 3107 in "def" part of Language Reference versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 21:19:17 2012 From: report at bugs.python.org (Chris Rebert) Date: Sat, 03 Mar 2012 20:19:17 +0000 Subject: [New-bugs-announce] [issue14187] add "annotation" entry to Glossary Message-ID: <1330805957.18.0.748865462478.issue14187@psf.upfronthosting.co.za> New submission from Chris Rebert : The Glossary should include an entry for "annotation" and/or "function annotation" regarding the language feature introduced by PEP 3107. ---------- assignee: docs at python components: Documentation messages: 154852 nosy: cvrebert, docs at python priority: normal severity: normal status: open title: add "annotation" entry to Glossary versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 00:56:18 2012 From: report at bugs.python.org (Barry Alan Scott) Date: Sat, 03 Mar 2012 23:56:18 +0000 Subject: [New-bugs-announce] [issue14188] Sharing site-packages between Apply and python.org builds breaks extensions Message-ID: <1330818978.97.0.545598673172.issue14188@psf.upfronthosting.co.za> New submission from Barry Alan Scott : I'm testing on Mac OS X 10.7.3 http://bugs.python.org/issue4865 added /Library/Python/2.7/site-packages to the path for python.org built 2.7. This will work for .py files but .so cannot be shared. pysvn will SEGV python.org 2.7 when it is built against apple 2.7. Because /Library/Python/2.7/site-packages is before /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages it is not possible to work around by install two binary kits. To reproduce: Install pysvn 1.7.6 for python.org Then run python.org 2.7 and import pysvn. This will work. Install pysvn 1.7.6 for Apple python. python.org 2.7 import pysvn is now broken. $ /usr/bin/python Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import pysvn >>> pysvn >>> ^D $ /usr/local/bin/python2.7 Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import pysvn Segmentation fault: 11 ---------- components: None messages: 154859 nosy: barry-scott priority: normal severity: normal status: open title: Sharing site-packages between Apply and python.org builds breaks extensions type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 05:18:59 2012 From: report at bugs.python.org (Baruch Sterin) Date: Sun, 04 Mar 2012 04:18:59 +0000 Subject: [New-bugs-announce] [issue14189] Documentation for some C APIs is missing clear specification of the type of reference they return Message-ID: <1330834739.26.0.103894619612.issue14189@psf.upfronthosting.co.za> New submission from Baruch Sterin : In addition to the description text, most C API functions have a one-line, emphasized specification whether they return a new or a borrowed reference. (e.g. 'Return value: New reference.'). The following API functions are missing that. Some of them, like PyMemoryView_FromBuffer(), have descriptions that are clear, but it would still be nice to have an unambiguous statement like most other API functions have. The list has been generated automatically, so it might contain some errors. Doc/c-api/arg.rst: Py_VaBuildValue Doc/c-api/buffer.rst: PyMemoryView_FromBuffer Doc/c-api/buffer.rst: PyMemoryView_FromObject Doc/c-api/buffer.rst: PyMemoryView_GetContiguous Doc/c-api/bytearray.rst: PyByteArray_Concat Doc/c-api/bytearray.rst: PyByteArray_FromObject Doc/c-api/bytearray.rst: PyByteArray_FromStringAndSize Doc/c-api/code.rst: PyCode_New Doc/c-api/codec.rst: PyCodec_BackslashReplaceErrors Doc/c-api/codec.rst: PyCodec_Decode Doc/c-api/codec.rst: PyCodec_Decoder Doc/c-api/codec.rst: PyCodec_Encode Doc/c-api/codec.rst: PyCodec_Encoder Doc/c-api/codec.rst: PyCodec_IgnoreErrors Doc/c-api/codec.rst: PyCodec_IncrementalDecoder Doc/c-api/codec.rst: PyCodec_IncrementalEncoder Doc/c-api/codec.rst: PyCodec_LookupError Doc/c-api/codec.rst: PyCodec_ReplaceErrors Doc/c-api/codec.rst: PyCodec_StreamReader Doc/c-api/codec.rst: PyCodec_StreamWriter Doc/c-api/codec.rst: PyCodec_StrictErrors Doc/c-api/codec.rst: PyCodec_XMLCharRefReplaceErrors Doc/c-api/exceptions.rst: PyUnicodeDecodeError_Create Doc/c-api/exceptions.rst: PyUnicodeDecodeError_GetEncoding Doc/c-api/exceptions.rst: PyUnicodeDecodeError_GetObject Doc/c-api/exceptions.rst: PyUnicodeDecodeError_GetReason Doc/c-api/exceptions.rst: PyUnicodeEncodeError_Create Doc/c-api/exceptions.rst: PyUnicodeTranslateError_Create Doc/c-api/float.rst: PyFloat_GetInfo Doc/c-api/import.rst: PyImport_GetImporter Doc/c-api/import.rst: PyImport_ImportModuleNoBlock Doc/c-api/import.rst: _PyImport_FindExtension Doc/c-api/import.rst: _PyImport_FixupExtension Doc/c-api/init.rst: PyEval_GetCallStats Doc/c-api/int.rst: PyInt_FromSize_t Doc/c-api/long.rst: PyLong_FromSize_t Doc/c-api/long.rst: PyLong_FromSsize_t Doc/c-api/number.rst: PyNumber_Index Doc/c-api/number.rst: PyNumber_ToBase Doc/c-api/object.rst: PyObject_Bytes Doc/c-api/object.rst: PyObject_GenericGetAttr Doc/c-api/unicode.rst: PyUnicode_AsUTF32String Doc/c-api/unicode.rst: PyUnicode_DecodeMBCSStateful Doc/c-api/unicode.rst: PyUnicode_DecodeUTF32 Doc/c-api/unicode.rst: PyUnicode_DecodeUTF32Stateful Doc/c-api/unicode.rst: PyUnicode_DecodeUTF7 Doc/c-api/unicode.rst: PyUnicode_DecodeUTF7Stateful Doc/c-api/unicode.rst: PyUnicode_EncodeUTF32 Doc/c-api/unicode.rst: PyUnicode_EncodeUTF7 Doc/c-api/veryhigh.rst: PyEval_EvalCodeEx Doc/c-api/veryhigh.rst: PyEval_EvalFrame Doc/c-api/veryhigh.rst: PyEval_EvalFrameEx ---------- assignee: docs at python components: Documentation messages: 154877 nosy: baruch.sterin, docs at python priority: normal severity: normal status: open title: Documentation for some C APIs is missing clear specification of the type of reference they return type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 07:07:08 2012 From: report at bugs.python.org (Baruch Sterin) Date: Sun, 04 Mar 2012 06:07:08 +0000 Subject: [New-bugs-announce] [issue14190] Minor C API documentation bugs Message-ID: <1330841228.13.0.736937779561.issue14190@psf.upfronthosting.co.za> New submission from Baruch Sterin : The following functions are documented, but do not exist in the code: * PyCodec_KnownEncoding * PyRun_SimpleFileFlags The following function is documented and exists in the code, but is not exposed through any of the header files: PyParser_SimpleParseStringFlagsFilename The prototype in the documentation is incorrect: * PyOS_stricmp returns int, not char* * PyOS_strnicmp returns int, not char* * PyCode_GetNumFree accepts a PyCodeObject* not PyObject* * PyCode_NewEmpty returns a PyCodeObject* not PyObject* * PyFile_SetBufSize accepts a PyObject*, not PyCodeObject * PyGILState_GetThisThreadState returns PyThreadState* not PyThreadState * PyUnicode_EncodeRawUnicodeEscape accepts 2, not 3 arguments * PyUnicode_RichCompare returns PyObject*, not int * PyType_IS_GC needs a PyTypeObject*, not PyObject* * PyType_HasFeature needs a PyTypeObject*, not PyObject* In addition, PyLong_FromSsize_t and PyLong_FromSsize_t are documented twice in long.html. ---------- assignee: docs at python components: Documentation messages: 154879 nosy: baruch.sterin, docs at python priority: normal severity: normal status: open title: Minor C API documentation bugs type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 07:37:33 2012 From: report at bugs.python.org (Glenn Linderman) Date: Sun, 04 Mar 2012 06:37:33 +0000 Subject: [New-bugs-announce] [issue14191] argparse: nargs='*' doesn't parse all positional parameters Message-ID: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> New submission from Glenn Linderman : To me, "all positional parameters" mean whether they are in the front, back or middle, as long as they are not diriectly preceded by an option that can accept an unlimited number of parameters. from argparse import ArgumentParser, SUPPRESS, REMAINDER import sys print( sys.version ) parser = ArgumentParser() parser.add_argument('--foo', dest='foo') parser.add_argument('--bar', dest='bar') parser.add_argument('baz', nargs='*') print( parser.parse_args('a b --foo x --bar 1 c d'.split())) # expected: Namespace(bar='1', baz=['a', 'b', 'c', 'd'], foo='x') # actual: error: unrecognized arguments: c d Above also supplied as a test file, t12.py ---------- components: Library (Lib) files: t12.py messages: 154880 nosy: v+python priority: normal severity: normal status: open title: argparse: nargs='*' doesn't parse all positional parameters type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file24726/t12.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 10:42:34 2012 From: report at bugs.python.org (Redoute) Date: Sun, 04 Mar 2012 09:42:34 +0000 Subject: [New-bugs-announce] [issue14192] stdout.encoding not set when redirecting windows command line output Message-ID: <1330854154.2.0.961318278787.issue14192@psf.upfronthosting.co.za> New submission from Redoute : When running a python script from windows command line (cmd.exe) and redirecting its output, stdout.encoding is set to None and printing non-ascii chars fails. Encoding should be the same as without redirecting. Example: [Code unictest.py] # -*- coding: utf-8 -*- from sys import stdout, stderr print >> stderr, 'stdout.encoding: ', stdout.encoding print u'????' [/Code] [windows command prompt] C:\Daten>testunic.py stdout.encoding: cp850 ???? C:\Daten>testunic.py > testunic.txt stdout.encoding: None Traceback (most recent call last): File "C:\Daten\Cmd\testunic.py", line 5, in print u'????????' UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordin al not in range(128) [/windows command prompt] ---------- components: Windows messages: 154885 nosy: Redoute priority: normal severity: normal status: open title: stdout.encoding not set when redirecting windows command line output type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 13:53:57 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 04 Mar 2012 12:53:57 +0000 Subject: [New-bugs-announce] [issue14193] broken link on PEP 385 Message-ID: <1330865637.77.0.994112450027.issue14193@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : The pymigr link on pep385 is broken. ---------- assignee: docs at python components: Documentation messages: 154890 nosy: docs at python, tshepang priority: normal severity: normal status: open title: broken link on PEP 385 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 15:47:24 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 04 Mar 2012 14:47:24 +0000 Subject: [New-bugs-announce] [issue14194] typo in pep414 Message-ID: <1330872444.33.0.601967914335.issue14194@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : in pep414: "in additional to" --> "in addition to" ---------- messages: 154895 nosy: tshepang priority: normal severity: normal status: open title: typo in pep414 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 21:28:40 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 04 Mar 2012 20:28:40 +0000 Subject: [New-bugs-announce] [issue14195] WeakSet has ordering relations wrong Message-ID: <1330892920.08.0.914795848044.issue14195@psf.upfronthosting.co.za> New submission from Antoine Pitrou : >>> a = weakref.WeakSet() >>> a < a True >>> a > a True ---------- components: Library (Lib) messages: 154910 nosy: pitrou priority: normal severity: normal stage: needs patch status: open title: WeakSet has ordering relations wrong type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 01:15:16 2012 From: report at bugs.python.org (Simon Chopin) Date: Mon, 05 Mar 2012 00:15:16 +0000 Subject: [New-bugs-announce] [issue14196] Unhandled exceptions in pdb return value display Message-ID: <1330906516.74.0.432612109172.issue14196@psf.upfronthosting.co.za> New submission from Simon Chopin : This issue occurred at least in Python 2.7, I haven't checked in other versions. When stepping on a return statement, pdb calls the return value __str__() method to display it at the end of the line. Only, it doesn't handle the potential exceptions raised within those functions. An exemple would be: import pdb class A(object): def __new__(cls): pdb.set_trace() return super(A, cls).__new__() def __init__(self): self.value = "Foo" def __str__(self): return self.value pdb.run("A()") When using the step by step, pdb will be interrupted by an unhandled AttributeError. ---------- components: Library (Lib) messages: 154916 nosy: Simon.Chopin priority: normal severity: normal status: open title: Unhandled exceptions in pdb return value display versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 05:57:08 2012 From: report at bugs.python.org (shibingli) Date: Mon, 05 Mar 2012 04:57:08 +0000 Subject: [New-bugs-announce] [issue14197] MacOS10.7 compiled uWSGI the issue. Message-ID: <1330923428.91.0.0488366772742.issue14197@psf.upfronthosting.co.za> New submission from shibingli : Artificial libpython3.2.a soft links to libpython3.2m.a ---------- components: None messages: 154921 nosy: shibingli priority: normal severity: normal status: open title: MacOS10.7 compiled uWSGI the issue. type: compile error versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 10:30:16 2012 From: report at bugs.python.org (Stefan Krah) Date: Mon, 05 Mar 2012 09:30:16 +0000 Subject: [New-bugs-announce] [issue14198] Backport parts of the new memoryview documentation Message-ID: <1330939816.35.0.731110214123.issue14198@psf.upfronthosting.co.za> New submission from Stefan Krah : Nick's comment from #10181: "It occurs to me that one thing that *could* be backported to early versions are some of the documentation improvements on how to correctly handle the lifecycle of fields in Py_buffer. That gets messy though because memoryview doesn't behave nicely in those versions, so we'd be violating our own guidelines. Perhaps the relevant sections should be updated with a reference saying that the semantics have been cleaned up in 3.3, and if in doubt, try to follow the 3.3 documentation?" ---------- assignee: skrah components: Documentation messages: 154934 nosy: ncoghlan, pitrou, skrah priority: normal severity: normal status: open title: Backport parts of the new memoryview documentation type: enhancement versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 13:33:28 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Mar 2012 12:33:28 +0000 Subject: [New-bugs-announce] [issue14199] Keep a refence to mro in _PyType_Lookup() and super_getattro() Message-ID: <1330950808.29.0.801414525121.issue14199@psf.upfronthosting.co.za> New submission from STINNER Victor : Lib/test/crashers/losing_mro_ref.py does crash Python: _PyType_Lookup() borrows a reference to the type MRO, but the type MRO is replaced during the lookup. Python crashs because it reads an item from a tuple that was destroyed (in the specific test, it reads an item from a newly created tuple which is not the type MRO). Attached patch keeps a strong reference to the type MRO during the lookup to workaround this crasher. It fixes Lib/test/crashers/losing_mro_ref.py. If changing temporary has an impact on performances, a guard can be used to check that the type MRO has not been changed during the lookup. ---------- components: Interpreter Core files: type_lookup_mro.patch keywords: patch messages: 154943 nosy: haypo priority: normal severity: normal status: open title: Keep a refence to mro in _PyType_Lookup() and super_getattro() type: crash versions: Python 3.3 Added file: http://bugs.python.org/file24736/type_lookup_mro.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 13:39:36 2012 From: report at bugs.python.org (Vlastimil Brom) Date: Mon, 05 Mar 2012 12:39:36 +0000 Subject: [New-bugs-announce] [issue14200] Idle shell crash on printing non-BMP unicode character Message-ID: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> New submission from Vlastimil Brom : Hi, while testing python 3.3a1 a bit, especially the new string handling of non-BMP characters, I noticed a problem in Idle in this regard: Python 3.3.0a1 (default, Mar 4 2012, 17:27:59) [MSC v.1500 32 bit (Intel)] on win32 ... [using win XPp SP3 Czech] >>> got_ahsa = "\N{GOTHIC LETTER AHSA}" >>> len(got_ahsa) 1 >>> got_ahsa.encode("unicode-escape") b'\\U00010330' >>> got_ahsa [crash - idle shell window closes immediately without any visible error message or traceback] I realised later, that tkinter probably won't be able to print wide-unicode characters anyway (according to http://bugs.python.org/issue12342 ), but Idle should probably just print the exception introduced there, e.g. ValueError: character U+10330 is above the range (U+0000-U+FFFF) allowed by Tcl Regards vbr ---------- components: IDLE, Tkinter, Unicode messages: 154944 nosy: ezio.melotti, vbr priority: normal severity: normal status: open title: Idle shell crash on printing non-BMP unicode character versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 15:23:41 2012 From: report at bugs.python.org (Erik Johansson) Date: Mon, 05 Mar 2012 14:23:41 +0000 Subject: [New-bugs-announce] [issue14201] libc.time != libc['time'] Message-ID: <1330957421.08.0.5889949548.issue14201@psf.upfronthosting.co.za> New submission from Erik Johansson : I would expect that the following code would give True as result: >>> from ctypes import * >>> libc = CDLL("libc.so.6") >>> libc.time == libc['time'] False Is it by design that libc['time'] always returns a different _FuncPtr object? It is a bit confusing when doing things like: libc['time'].restype = ... libc['time'].argtypes = [...] # python --version Python 2.7.2+ Ubunutu version 2.7.2-5ubuntu1. ---------- components: ctypes messages: 154949 nosy: erijo priority: normal severity: normal status: open title: libc.time != libc['time'] type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 17:25:19 2012 From: report at bugs.python.org (Eli Bendersky) Date: Mon, 05 Mar 2012 16:25:19 +0000 Subject: [New-bugs-announce] [issue14202] The docs of xml.dom.pulldom are almost nonexistent Message-ID: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> New submission from Eli Bendersky : http://docs.python.org/dev/library/xml.dom.pulldom.html "embarrassing" is the word I wanted to use, but it's too strong for the title ;-) Seriously, this module is part of the stdlib, it should at least have *some* documentation. ---------- assignee: docs at python components: Documentation keywords: easy messages: 154959 nosy: docs at python, eli.bendersky, eric.araujo, flox priority: normal severity: normal stage: needs patch status: open title: The docs of xml.dom.pulldom are almost nonexistent type: behavior versions: Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 19:32:49 2012 From: report at bugs.python.org (Stefan Krah) Date: Mon, 05 Mar 2012 18:32:49 +0000 Subject: [New-bugs-announce] [issue14203] bytearray_getbuffer: unnecessary code Message-ID: <1330972369.17.0.543217676638.issue14203@psf.upfronthosting.co.za> New submission from Stefan Krah : bytearray_getbuffer() checks for view==NULL. But this has never been allowed: PEP: "The second argument is the address to a bufferinfo structure. Both arguments must never be NULL." DOCS (3.2): "view must point to an existing Py_buffer structure allocated by the caller". A quick grep through the source tree shows no instances where the middle argument of either PyObject_GetBuffer of bf_getbuffer is NULL or 0. Patch attached, all tests pass. I wouldn't be comfortable to commit it without review though (it's just too strange). BTW, the next conditional in bytearray_getbuffer ... if (ret >= 0) { obj->ob_exports++; } is also superfluous, since PyBuffer_FillInfo() cannot fail if readonly==0. ---------- components: Interpreter Core files: bytearray_getbuffer.diff keywords: needs review, patch messages: 154969 nosy: ncoghlan, pitrou, skrah priority: normal severity: normal stage: patch review status: open title: bytearray_getbuffer: unnecessary code type: resource usage versions: Python 3.3 Added file: http://bugs.python.org/file24738/bytearray_getbuffer.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 21:21:01 2012 From: report at bugs.python.org (Colin Marc) Date: Mon, 05 Mar 2012 20:21:01 +0000 Subject: [New-bugs-announce] [issue14204] Support for the NPN extension to TLS/SSL Message-ID: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> New submission from Colin Marc : Recent versions of OpenSSL (1.0.1 and greater) support a new extension to SSL/TLS called Next Protocol Negotiation, defined here: http://tools.ietf.org/html/draft-agl-tls-nextprotoneg-02. The extension allows servers and clients to advertise which protocols they support (for example, both HTTP and SPDY) and then agree on one during the handshake according to a simple algorithm. This patch to 2.7 adds support for the NPN extension via another parameter to ssl.wrap_socket, called 'npn_protocols', and by using the OpenSSL API. It should fail gracefully if the linked version of OpenSSL has no support for NPN, using a macro guard. Once the handshake is completed, SSLSocket.selected_protocol() returns whatever was agreed upon. Although I included client/server tests with the patch, testing this functionality in real-life situations proved difficult. Google chrome has SPDY and NPN functionality baked in, so I wrote a simple socket server that advertises SPDY/2 in addition to HTTP/1.1. Chrome, pointed at this server, correctly completed the handshake and started merrily sending SPDY control frames. ---------- files: npn_patch.diff keywords: patch messages: 154973 nosy: colinmarc priority: normal severity: normal status: open title: Support for the NPN extension to TLS/SSL type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file24739/npn_patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 22:19:55 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Mar 2012 21:19:55 +0000 Subject: [New-bugs-announce] [issue14205] Raise an error if a dict is modified during a lookup Message-ID: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> New submission from STINNER Victor : Lib/test/crashers/nasty_eq_vs_dict.py does crash Python because of an infinite loop in the dictionary lookup. The script modifies the dictionary at each lookup, whereas Python tries a new lookup each time that the dictionary is modified. I proposed to make the lookup fail with a RuntimeError if the dictionary has been modified during a lookup. It should not occur if you are not doing something evil. ---------- components: Interpreter Core files: dict_lookup.patch keywords: patch messages: 154976 nosy: haypo priority: normal severity: normal status: open title: Raise an error if a dict is modified during a lookup versions: Python 3.3 Added file: http://bugs.python.org/file24740/dict_lookup.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 01:32:42 2012 From: report at bugs.python.org (Garrett Moore) Date: Tue, 06 Mar 2012 00:32:42 +0000 Subject: [New-bugs-announce] [issue14206] multiprocessing.Queue documentation is lacking important details Message-ID: <1330993962.13.0.893864771053.issue14206@psf.upfronthosting.co.za> New submission from Garrett Moore : 1) If cancel_join_thread() is called, data may be lost. This is not explicitly stated. I had multiple writers put() data in a Queue, and wanted to have the workers finish before I began consuming the data. This caused a deadlock because my Queue was not empty, and it seemed like the a way to force my workers finish was to use cancel_join_thread(). This caused data loss. 2) multiprocessing.Queue states "The Queue class is a near clone of Queue.Queue." Queue.Queue states "If maxsize is less than or equal to zero, the queue size is infinite." mp.Queue provides no information on queue size. It is reasonable to assume then that it inherits the property of Queue.Queue. After discussion on IRC, it seems that mp.Queue maximum size is implementation-dependent and likely relies on how much data Pipes can hold on your platform. If this is the case there should be some mention of the fact that mp.Queue does NOT function like Queue.Queue does for maximum size. ---------- assignee: docs at python components: Documentation messages: 154995 nosy: Garrett.Moore, docs at python priority: normal severity: normal status: open title: multiprocessing.Queue documentation is lacking important details versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 06:05:33 2012 From: report at bugs.python.org (Eli Bendersky) Date: Tue, 06 Mar 2012 05:05:33 +0000 Subject: [New-bugs-announce] [issue14207] ElementTree.ParseError - needs documentation and consistent C&Py implementations Message-ID: <1331010333.9.0.736082311251.issue14207@psf.upfronthosting.co.za> New submission from Eli Bendersky : Following issue #14178: The ElementTree.ParseError is not documented and its behavior seems to differ between the C and Python implementations. In particular, the C module doesn't assign the 'code' attribute when raising a ParseError. ---------- components: Extension Modules, Library (Lib) messages: 154999 nosy: effbot, eli.bendersky, flox, scoder priority: normal severity: normal stage: needs patch status: open title: ElementTree.ParseError - needs documentation and consistent C&Py implementations versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 07:53:23 2012 From: report at bugs.python.org (Ben Darnell) Date: Tue, 06 Mar 2012 06:53:23 +0000 Subject: [New-bugs-announce] [issue14208] No way to recover original argv with python -m Message-ID: <1331016803.5.0.715499259579.issue14208@psf.upfronthosting.co.za> New submission from Ben Darnell : I have a script which attempts to re-invoke itself using sys.argv, but it fails when run with "python -m package.module". The problem is that the handling of -m (via the runpy module) rewrites sys.argv as if it were run as "python package/module.py", but the two command lines are not equivalent: With -m the current directory is inserted at the head of sys.path, but without -m it's the directory containing module.py. The net effect is that the initial run of "python -m package.module" works as expected, but when it re-runs itself as "python package/module.py" the imports from module.py are effectively relative instead of absolute. One possible solution would be to provide an immutable sys.__argv__ (by analogy with sys.__stdout__ and friends). ---------- messages: 155002 nosy: Ben.Darnell priority: normal severity: normal status: open title: No way to recover original argv with python -m type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 16:02:24 2012 From: report at bugs.python.org (James Pickering) Date: Tue, 06 Mar 2012 15:02:24 +0000 Subject: [New-bugs-announce] [issue14209] pkgutil.iter_zipimport_modules ignores the prefix parameter for packages Message-ID: <1331046144.89.0.833633660995.issue14209@psf.upfronthosting.co.za> New submission from James Pickering : If you run pkgutil.iter_zipimport_modules with a prefix parameter, and the module in question is a package, then the prefix parameter is ignored. The most visible symptom of this is when running pkgutil.walk_packages for a zipfile. Imagine we have a module structure like this (or create one): a/ a/__init__.py a/b/ a/b/__init.__py If we put this structure in a directory, add the directory to sys.path, and run pkgutil.walk_packages(), it will find modules "a" and "a.b". If we put this structure in a zipfile, however, we add this file to sys.path, and run pkgutil.walk_packages(), it will find modules "a" and "b". This is because pkgutil.iter_zipimport_modules ignores the prefix parameter "a.". This is incorrect. This can be fixed by changing line ~344 of Lib/pkgutil.py from: yield fn[0], True to yield prefix + fn[0], True Thanks, James P.s, This is my first Python bug report. I apologise in advance for any poor etiquette. ---------- components: Library (Lib) messages: 155018 nosy: James.Pickering priority: normal severity: normal status: open title: pkgutil.iter_zipimport_modules ignores the prefix parameter for packages type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 16:36:47 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Tue, 06 Mar 2012 15:36:47 +0000 Subject: [New-bugs-announce] [issue14210] add filename completion to pdb Message-ID: <1331048207.84.0.206422925925.issue14210@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : This would be extra nice because I would not have to fill in the entire path manually when I'm setting a b(reak). ---------- components: Library (Lib) messages: 155020 nosy: tshepang priority: normal severity: normal status: open title: add filename completion to pdb type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 18:19:05 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Mar 2012 17:19:05 +0000 Subject: [New-bugs-announce] [issue14211] Don't rely on borrowed _PyType_Lookup() reference in PyObject_GenericSetAttr() Message-ID: <1331054345.96.0.65871889242.issue14211@psf.upfronthosting.co.za> New submission from STINNER Victor : PyObject_GenericSetAttr() doesn't keep a reference to the descriptor: Python does crash if the descriptor is destroyed while the attribute is set. Attached patch keeps a reference to the desriptor to avoid the crash. A smililar was done in PyObject_GenericGetAttr() 8 years with the changelog "fix obscure crash in descriptor handling", see the changeset 941d49a65f06. The patch fixes Lib/test/crashers/borrowed_ref_2.py and so removes it. ---------- files: type_lookup_ref.patch keywords: patch messages: 155025 nosy: haypo priority: normal severity: normal status: open title: Don't rely on borrowed _PyType_Lookup() reference in PyObject_GenericSetAttr() Added file: http://bugs.python.org/file24746/type_lookup_ref.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 19:00:16 2012 From: report at bugs.python.org (Maciej Fijalkowski) Date: Tue, 06 Mar 2012 18:00:16 +0000 Subject: [New-bugs-announce] [issue14212] Segfault when using re.finditer over mmap Message-ID: <1331056816.2.0.964506318301.issue14212@psf.upfronthosting.co.za> New submission from Maciej Fijalkowski : Example to get a segfault attached. Crashes under python3 as well. ---------- files: x.py messages: 155028 nosy: fijall priority: normal severity: normal status: open title: Segfault when using re.finditer over mmap type: crash versions: Python 2.7 Added file: http://bugs.python.org/file24747/x.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 19:18:36 2012 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 06 Mar 2012 18:18:36 +0000 Subject: [New-bugs-announce] [issue14213] python33.dll not removed on uninstallation Message-ID: <1331057916.51.0.575841714998.issue14213@psf.upfronthosting.co.za> New submission from Vinay Sajip : I built an MSI for Python 3.3 on Windows 7 and installed from it - the resulting installation seems to work OK in that it passes all tests except test_tcl (intermittent failure). However, when I uninstall, python33.dll is left behind in System32. If I rebuild Python and the MSI after some changes and reinstall, the old python33.dll is not overwritten with the new one. ---------- components: Installation, Windows messages: 155030 nosy: loewis, vinay.sajip priority: normal severity: normal status: open title: python33.dll not removed on uninstallation type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 02:30:50 2012 From: report at bugs.python.org (Miki Tebeka) Date: Wed, 07 Mar 2012 01:30:50 +0000 Subject: [New-bugs-announce] [issue14214] test_concurrent_futures hangs Message-ID: <1331083850.64.0.939496340029.issue14214@psf.upfronthosting.co.za> New submission from Miki Tebeka : Running "make test" on 3.3a source tree on Ubuntu 11.10 (64bit) hangs at test_concurrent_futures ---------- components: Tests messages: 155043 nosy: tebeka priority: normal severity: normal status: open title: test_concurrent_futures hangs versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 07:43:20 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Wed, 07 Mar 2012 06:43:20 +0000 Subject: [New-bugs-announce] [issue14215] http://www.python.org/dev/peps/ title is python.org Message-ID: <1331102600.96.0.801989456091.issue14215@psf.upfronthosting.co.za> New submission from Ramchandra Apte : The http://www.python.org/dev/peps browser title is python.org I suggest it should be changed to "PEP Index". ---------- messages: 155051 nosy: ramchandra.apte priority: normal severity: normal status: open title: http://www.python.org/dev/peps/ title is python.org type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 08:47:18 2012 From: report at bugs.python.org (Qian Liu) Date: Wed, 07 Mar 2012 07:47:18 +0000 Subject: [New-bugs-announce] [issue14216] ImportError: No module named binascii Message-ID: <1331106438.0.0.366139924133.issue14216@psf.upfronthosting.co.za> New submission from Qian Liu : File "~/PythonInstall/lib/python2.7/multiprocessing/process.py", line 129, in start from .forking import Popen File "~/PythonInstall/lib/python2.7/multiprocessing/forking.py", line 58, in from pickle import Pickler File "~/PythonInstall/lib/python2.7/pickle.py", line 1266, in import binascii as _binascii ImportError: No module named binascii The used OS is: [GCC 3.4.6 20060404 (Red Hat 3.4.6-9)] on linux2 NOTED: There is no error when I import "binascii" in Python 2.7.2 on Window XP. How to solve it? Many thanks. ---------- components: Library (Lib) messages: 155055 nosy: liuqianhn priority: normal severity: normal status: open title: ImportError: No module named binascii type: crash versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 09:19:11 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 07 Mar 2012 08:19:11 +0000 Subject: [New-bugs-announce] [issue14217] text output pretends to be code Message-ID: <1331108351.7.0.269278733631.issue14217@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : The attached patch removes the highlighting. I hope there's a better way to do this, instead of this hack. I searched the Sphinx and docutils docs and failed to find something better. ---------- assignee: docs at python components: Documentation files: tis-not-code.patch keywords: patch messages: 155056 nosy: docs at python, tshepang priority: normal severity: normal status: open title: text output pretends to be code versions: Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24751/tis-not-code.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 10:06:34 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 07 Mar 2012 09:06:34 +0000 Subject: [New-bugs-announce] [issue14218] include rendered output in addition to markup Message-ID: <1331111194.08.0.943407781198.issue14218@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : For devguide/documenting, If you show me markup, also show me what output it gives me. It's kinda tedious to keep building the markup just to verify how it's rendered. ---------- components: Devguide messages: 155061 nosy: ezio.melotti, tshepang priority: normal severity: normal status: open title: include rendered output in addition to markup type: enhancement versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 10:13:39 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 07 Mar 2012 09:13:39 +0000 Subject: [New-bugs-announce] [issue14219] start the Class tutorial in a more gentle manner Message-ID: <1331111619.2.0.272575522063.issue14219@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : Looking at Doc/tutorial/classes, the section "Python Scopes and Namespaces" is full of heavy/deep information. I expect that people who would be able to properly digest that info are people who are already advanced at Python, and therefore maybe it should be moved to some cookbook (or language reference). I would prefer something gentler, since the tutorial is for Python newbies who aren't necessarily conversant with OO concepts. There can of course be links to heavier material for deeper understanding. ---------- assignee: docs at python components: Documentation messages: 155065 nosy: docs at python, tshepang priority: normal severity: normal status: open title: start the Class tutorial in a more gentle manner type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 12:09:03 2012 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 07 Mar 2012 11:09:03 +0000 Subject: [New-bugs-announce] [issue14220] "yield from" kills generator on re-entry Message-ID: <1331118543.05.0.972821091665.issue14220@psf.upfronthosting.co.za> New submission from Stefan Behnel : Based on the existing "test_attempted_yield_from_loop" in Lib/test/test_pep380.py, I wrote this test and I wonder why it does not work: """ def test_attempted_reentry(): """ >>> for line in test_attempted_reentry(): print(line) g1: starting Yielded: y1 g1: about to yield from g2 g2: starting Yielded: y2 g2: about to yield from g1 g2: caught ValueError Yielded: y3 g1: after delegating to g2 Yielded: y4 """ trace = [] def g1(): trace.append("g1: starting") yield "y1" trace.append("g1: about to yield from g2") yield from g2() trace.append("g1: after delegating to g2") yield "y4" def g2(): trace.append("g2: starting") yield "y2" trace.append("g2: about to yield from g1") try: yield from gi except ValueError: trace.append("g2: caught ValueError") else: trace.append("g1 did not raise ValueError on reentry") yield "y3" gi = g1() for y in gi: trace.append("Yielded: %s" % (y,)) return trace """ In current CPython, I get this: """ Failed example: for line in test_attempted_reentry(): print(line) Expected: g1: starting Yielded: y1 g1: about to yield from g2 g2: starting Yielded: y2 g2: about to yield from g1 g2: caught ValueError Yielded: y3 g1: after delegating to g2 Yielded: y4 Got: g1: starting Yielded: y1 g1: about to yield from g2 g2: starting Yielded: y2 g2: about to yield from g1 g2: caught ValueError Yielded: y3 """ Even though I catch the ValueError (raised on generator reentry) at the position where I run the "yield from", the outer generator (g1) does not continue to run after the termination of g2. It shouldn't normally have an impact on the running g1 that someone attempts to jump back into it, but it clearly does here. I noticed this while trying to adapt the implementation for Cython, because the original test was one of the few failing cases and it made the code jump through the generator support code quite wildly. ---------- components: Interpreter Core messages: 155072 nosy: scoder priority: normal severity: normal status: open title: "yield from" kills generator on re-entry type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 18:28:34 2012 From: report at bugs.python.org (Phillip Feldman) Date: Wed, 07 Mar 2012 17:28:34 +0000 Subject: [New-bugs-announce] [issue14221] re.sub backreferences to numbered groups produce garbage Message-ID: <1331141314.19.0.206090274406.issue14221@psf.upfronthosting.co.za> New submission from Phillip Feldman : The first example below works; the second one produces output containing garbage characters. (This came up while I was creating a set of examples for a tutorial on regular expressions). import re text= "The cat ate the rat." print("before: %s" % text) m= re.search("The (\w+) ate the (\w+)", text) text= "The %s ate the %s." % (m.group(2), m.group(1)) print("after : %s" % text) text= "The cat ate the rat." print("before: %s" % text) text= re.sub("(\w+) ate the (\w+)", "\2 ate the \1", text) print("after : %s" % text) ---------- components: Regular Expressions messages: 155100 nosy: Phillip.M.Feldman, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: re.sub backreferences to numbered groups produce garbage type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 20:38:40 2012 From: report at bugs.python.org (Tasslehoff Kjappfot) Date: Wed, 07 Mar 2012 19:38:40 +0000 Subject: [New-bugs-announce] [issue14222] Using time.time() in Queue.get breaks when system time is changed Message-ID: <1331149120.51.0.79082225225.issue14222@psf.upfronthosting.co.za> New submission from Tasslehoff Kjappfot : Queue.get([block[, timeout]]) uses time.time() for calculations of the timeout. If someone changes the system time this breaks. If a timeout of 1 second is set and someone (on a unix system) uses date to set the time 1 hour back, Queue.get will use 1 hour and 1 second to time out. I'm guessing the fix is just to use another library function to measure time, but I don't know if one exists that works on all platforms. ---------- components: Library (Lib) messages: 155106 nosy: tasslehoff priority: normal severity: normal status: open title: Using time.time() in Queue.get breaks when system time is changed type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:44:54 2012 From: report at bugs.python.org (Nicholas Cole) Date: Wed, 07 Mar 2012 20:44:54 +0000 Subject: [New-bugs-announce] [issue14223] curses addch broken on Python3.3a1 Message-ID: <1331153094.15.0.871612927682.issue14223@psf.upfronthosting.co.za> New submission from Nicholas Cole : The following code works on Python versions prior to 3.3a1: import curses def test_screen(screen): screen.addch(5,5, curses.ACS_HLINE) screen.refresh() curses.wrapper(test_screen) On python3.3, the program produces the following traceback: Traceback (most recent call last): File "/tmp/p.py", line 7, in curses.wrapper(test_screen) File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/curses/__init__.py", line 94, in wrapper return func(stdscr, *args, **kwds) File "/tmp/p.py", line 4, in test_screen screen.addch(5,5, curses.ACS_HLINE) OverflowError: byte doesn't fit in chtype ---------- components: Library (Lib) messages: 155118 nosy: Nicholas.Cole priority: normal severity: normal status: open title: curses addch broken on Python3.3a1 versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 22:53:54 2012 From: report at bugs.python.org (Johannes Kolb) Date: Wed, 07 Mar 2012 21:53:54 +0000 Subject: [New-bugs-announce] [issue14224] packaging: path description of resources is mixed up Message-ID: <1331157234.71.0.528832694178.issue14224@psf.upfronthosting.co.za> New submission from Johannes Kolb : The documentation for "files" section of the setup.cfg file causes confusion: The examples don't match the description. Obviously the order of "destination" and "source" part in the generated filenames was mixed up in some places. ---------- assignee: docs at python components: Documentation files: packaging-docfixes.diff keywords: patch messages: 155123 nosy: docs at python, jokoala priority: normal severity: normal status: open title: packaging: path description of resources is mixed up type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file24754/packaging-docfixes.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 23:59:45 2012 From: report at bugs.python.org (Ned Deily) Date: Wed, 07 Mar 2012 22:59:45 +0000 Subject: [New-bugs-announce] [issue14225] _cursesmodule compile error in OS X 32-bit-only installer build Message-ID: <1331161185.98.0.75427514561.issue14225@psf.upfronthosting.co.za> New submission from Ned Deily : ./Modules/_cursesmodule.c:279: error: syntax error before 'cchar_t' /Users/sysadmin/build/v3.3.0a1/Modules/_cursesmodule.c: In function 'PyCurses_ConvertToCchar_t': ./Modules/_cursesmodule.c:289: error: 'obj' undeclared (first use in this function)/Users/sysadmin/build/v3.3.0a1/Modules/_cursesmodule.c:279: error: syntax error before 'cchar_t' Note to self, this installer build builds its own version of ncurses. It may need adjusting for 3.3. ---------- assignee: ned.deily components: Build, Macintosh messages: 155130 nosy: ned.deily priority: release blocker severity: normal status: open title: _cursesmodule compile error in OS X 32-bit-only installer build type: compile error versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 00:35:40 2012 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9_Malo?=) Date: Wed, 07 Mar 2012 23:35:40 +0000 Subject: [New-bugs-announce] [issue14226] Expose dict_proxy type from descrobject.c Message-ID: <1331163340.11.0.494916770875.issue14226@psf.upfronthosting.co.za> New submission from Andr? Malo : As discussed in the dev-thread about frozendicts, it would be helpful for providing advisory read-only-dicts, to just expose the dict_proxy type. I suppose, the collections module would be a good place (it just needs to provide the interface to the type, not the whole implementation). ---------- components: Extension Modules, Interpreter Core messages: 155131 nosy: ndparker priority: normal severity: normal status: open title: Expose dict_proxy type from descrobject.c type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 05:35:33 2012 From: report at bugs.python.org (Mark Tolonen) Date: Thu, 08 Mar 2012 04:35:33 +0000 Subject: [New-bugs-announce] [issue14227] console w/ cp65001 displays extra characters for non-ascii strings. Message-ID: <1331181333.28.0.535514339767.issue14227@psf.upfronthosting.co.za> New submission from Mark Tolonen : This is on Windows 7 SP1. Run 'chcp 65001' then Python from a console. Note the extra characters when non-ASCII characters are in the string. At a guess it appears to be using the UTF-8 byte length of the internal representation instead of the character count. Python 3.3.0a1 (default, Mar 4 2012, 17:27:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> print('hello') hello >>> print('p\u012bny\u012bn') p?ny?n n >>> print('\u012b'*10) ?????????? ????? ?? ---------- components: IO, Unicode, Windows messages: 155149 nosy: ezio.melotti, metolone priority: normal severity: normal status: open title: console w/ cp65001 displays extra characters for non-ascii strings. type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 10:05:36 2012 From: report at bugs.python.org (telmich) Date: Thu, 08 Mar 2012 09:05:36 +0000 Subject: [New-bugs-announce] [issue14228] SIGINT (Ctrl-C) not caught at startup Message-ID: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> New submission from telmich : Hello, pressing ctrl-c or having sigint delivered to the python process in its startup phase results in random tracebacks displayed. This is related to issue3137, but actually happening in Python 3.2.2 on archlinux. We noticed this during development of the cdist project (http://www.nico.schottelius.org/software/cdist/), where we call a shell via subprocess.check_call() which calls us again (under a different name and thus different behaviour. So the call chain is like this: cdist => /bin/sh -e script => cdist_as_different_name (i.e. __file) A simple test case to reproduce the problem needs the two files caller.py and shellpart.sh in a directory: % ln -s caller.py __testpython % chmod a+x * % ./caller.py Indirect child being called Indirect child being called Indirect child being called Indirect child being called ^Ccaught signint in parent Traceback (most recent call last): File "/usr/lib/python3.2/site.py", line 58, in import traceback File "/usr/lib/python3.2/traceback.py", line 3, in import linecache File "/usr/lib/python3.2/linecache.py", line 10, in import tokenize File "/usr/lib/python3.2/tokenize.py", line 28, in import re File "/usr/lib/python3.2/re.py", line 121, in [10:02] brief:python-traceback-test% import functools File "/usr/lib/python3.2/functools.py", line 2, in """ KeyboardInterrupt Pressing Ctrl-C results in various different tracebacks and I don't see any way to catch the SIGINT reliably currently, as the code executed seems to be *before* my code is being executed. There is another related bug at debian that references the same problem: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652926 ---------- files: shellpart.sh messages: 155152 nosy: telmich priority: normal severity: normal status: open title: SIGINT (Ctrl-C) not caught at startup type: crash versions: Python 3.2 Added file: http://bugs.python.org/file24755/shellpart.sh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 21:21:25 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 08 Mar 2012 20:21:25 +0000 Subject: [New-bugs-announce] [issue14229] On KeyboardInterrupt, the exit code should mirror the signal number Message-ID: <1331238085.62.0.936420173713.issue14229@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Compare: $ ./python -c "import subprocess, signal, time; p = subprocess.Popen(['cat']); time.sleep(1); p.send_signal(signal.SIGINT); print(p.wait())" -2 with: $ ./python -c "import subprocess, signal, time; p = subprocess.Popen(['python', '-c', 'input()']); time.sleep(1); p.send_signal(signal.SIGINT); print(p.wait())" Traceback (most recent call last): File "", line 1, in KeyboardInterrupt 1 Python's behaviour apparently breaks a common assumption towards Unix processes (see bug reported at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652926). A solution would be to add a signal number attribute to KeyboardInterrupt, and use that value when computing the process exit code. ---------- components: Interpreter Core messages: 155174 nosy: loewis, neologix, pitrou priority: normal severity: normal status: open title: On KeyboardInterrupt, the exit code should mirror the signal number type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 22:11:50 2012 From: report at bugs.python.org (Mark Shannon) Date: Thu, 08 Mar 2012 21:11:50 +0000 Subject: [New-bugs-announce] [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb Message-ID: <1331241110.78.0.993419519739.issue14230@psf.upfronthosting.co.za> New submission from Mark Shannon : Delegating generators do not show always up in stack traces, such as inspect.stack(). The show up during the first delegation, but not thereafter. I have attached a patch. It alters the way the YIELD_FROM bytecode works; it loops back on itself. This ensures the delegator's frame is always in the trace. Unfortunately I started working on it before Benjamin fixed issue 14220 (rev 3357eac1ba62). By the nature of it, this patch necessarily fixes most of issue 14220, so I have just included the tests for issue 14220 in this patch as well. So in order to apply this, 3357eac1ba62 will have to be backed out. Sorry for the overlap. ---------- components: Interpreter Core files: yieldfrom.patch keywords: patch messages: 155182 nosy: Mark.Shannon priority: normal severity: normal status: open title: Delegating generator is not always visible to debugging tools such as inspect & pdb type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file24759/yieldfrom.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 01:05:37 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Mar 2012 00:05:37 +0000 Subject: [New-bugs-announce] [issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py Message-ID: <1331251537.37.0.172100522309.issue14231@psf.upfronthosting.co.za> New submission from STINNER Victor : Lib/test/crashers/borrowed_ref_1.py contains the docstring: "_PyType_Lookup() returns a borrowed reference. This attacks the call in dictobject.c." The file was added by Armin in 2006 by the changeset 4dd1a9383e47. I just fixed #14211 which was a similar bug (Lib/test/crashers/borrowed_ref_2.py), but I'm unable to reproduce this one. Extract of dict_subscript(): missing = _PyObject_LookupSpecial((PyObject *)mp, &PyId___missing__); if (missing != NULL) { res = PyObject_CallFunctionObjArgs(missing, key, NULL); Py_DECREF(missing); return res; } I fail to see how missing can be destroyed before being used. Is it a problem that missing is destroyed while we are calling it? How can I trigger the crash in gdb? ---------- components: Interpreter Core messages: 155190 nosy: arigo, haypo priority: normal severity: normal status: open title: Fix or drop Lib/test/crashers/borrowed_ref_1.py type: crash versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 01:18:00 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Mar 2012 00:18:00 +0000 Subject: [New-bugs-announce] [issue14232] obmalloc: mmap() returns MAP_FAILED on error, not 0 Message-ID: <1331252280.16.0.132612334338.issue14232@psf.upfronthosting.co.za> New submission from STINNER Victor : Python fails to catch memory allocation error in its memory allocator when mmap() is used. Attached patch fixes the issue. ---------- components: Interpreter Core files: obmalloc_map_failed.patch keywords: patch messages: 155192 nosy: haypo, neologix, pitrou priority: normal severity: normal status: open title: obmalloc: mmap() returns MAP_FAILED on error, not 0 versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24760/obmalloc_map_failed.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 01:48:34 2012 From: report at bugs.python.org (guilherme-pg) Date: Fri, 09 Mar 2012 00:48:34 +0000 Subject: [New-bugs-announce] [issue14233] argparse: "append" action fails to override default values Message-ID: <1331254114.08.0.807459942746.issue14233@psf.upfronthosting.co.za> New submission from guilherme-pg : Trying to set a default value to arguments whose action is "append" causes argparse to raise AttributeError when such arguments are provided in the command line (see attached test case t1.py). This happens because _AppendAction doesn't expect the presence of a default value for the argument: when the command line is parsed and the argument is found, _AppendAction attempts to append the new value to the list of old values, if any, or the old list. In case there is already a non-list default value, it attempts to append the new value to it, which raises the exception. Is this intended behavior? If so, shouldn't ArgumentError be raised instead? It should also be easy to fix this issue otherwise, making _StoreAction ensure the old values are stored in a list before appending. ---------- components: Library (Lib) files: t1.py messages: 155195 nosy: bethard, guilherme-pg priority: normal severity: normal status: open title: argparse: "append" action fails to override default values type: crash versions: Python 3.3 Added file: http://bugs.python.org/file24761/t1.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 01:56:31 2012 From: report at bugs.python.org (Dave Malcolm) Date: Fri, 09 Mar 2012 00:56:31 +0000 Subject: [New-bugs-announce] [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat Message-ID: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> New submission from Dave Malcolm : Expat 2.1.0 Beta was recently announced: http://mail.libexpat.org/pipermail/expat-discuss/2012-March/002768.html which contains (among other things) a fix for a hash-collision denial-of-service attack (CVE-2012-0876) I'm attaching a patch which minimally backports the hash-collision fix part of expat 2.1.0 to the embedded copy of expat in the CPython source tree, and which adds a call to XML_SetHashSalt() to pyexpat when creating parsers. It reuses part of the hash secret from Py_HashSecret. ---------- components: XML files: expat-hash-randomization.patch keywords: patch messages: 155198 nosy: dmalcolm priority: normal severity: normal status: open title: CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat 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/file24762/expat-hash-randomization.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 02:12:50 2012 From: report at bugs.python.org (Josh Watson) Date: Fri, 09 Mar 2012 01:12:50 +0000 Subject: [New-bugs-announce] [issue14235] test_cmd.py does not correctly call reload() Message-ID: <1331255570.35.0.441826601517.issue14235@psf.upfronthosting.co.za> New submission from Josh Watson : The test_coverage function in test_cmd.py calls reload(cmd) ---------- components: Tests messages: 155200 nosy: Josh.Watson priority: normal severity: normal status: open title: test_cmd.py does not correctly call reload() type: crash versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 07:06:57 2012 From: report at bugs.python.org (py.user) Date: Fri, 09 Mar 2012 06:06:57 +0000 Subject: [New-bugs-announce] [issue14236] In help(re) are insufficient details Message-ID: <1331273217.26.0.527770128505.issue14236@psf.upfronthosting.co.za> New submission from py.user : 1) help(re) " \s Matches any whitespace character; equivalent to [ \t\n\r\f\v]. \S Matches any non-whitespace character; equiv. to [^ \t\n\r\f\v]." no info about unicode spaces 2) help(re.split) "split(pattern, string, maxsplit=0, flags=0) Split the source string by the occurrences of the pattern, returning a list containing the resulting substrings." no info about behaviour with groups in pattern ---------- assignee: docs at python components: Documentation, Regular Expressions messages: 155207 nosy: docs at python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: In help(re) are insufficient details versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 07:11:14 2012 From: report at bugs.python.org (py.user) Date: Fri, 09 Mar 2012 06:11:14 +0000 Subject: [New-bugs-announce] [issue14237] Special sequences \A and \Z don't work in character set [] Message-ID: <1331273474.34.0.161446399383.issue14237@psf.upfronthosting.co.za> New submission from py.user : >>> import re >>> re.search(r'\Ac\Z', 'c') <_sre.SRE_Match object at 0xb74cff38> >>> re.search(r'[\A]c[\Z]', 'c') >>> re.purge() >>> re.search(r'[\A]c[\Z]', 'c', re.DEBUG) in at at_beginning_string literal 99 in at at_end_string >>> ---------- components: Regular Expressions messages: 155208 nosy: ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: Special sequences \A and \Z don't work in character set [] type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 10:22:00 2012 From: report at bugs.python.org (Arkadiusz Miskiewicz Arkadiusz Miskiewicz) Date: Fri, 09 Mar 2012 09:22:00 +0000 Subject: [New-bugs-announce] [issue14238] python shouldn't need username in passwd database Message-ID: <1331284920.1.0.720164223022.issue14238@psf.upfronthosting.co.za> New submission from Arkadiusz Miskiewicz Arkadiusz Miskiewicz : I'm trying to run python from UID which doesn't have entry in passwd database. This fails with: Traceback (most recent call last): File "/usr/share/python2.7/site.py", line 567, in File "/usr/share/python2.7/site.py", line 549, in main File "/usr/share/python2.7/site.py", line 278, in addusersitepackages File "/usr/share/python2.7/site.py", line 253, in getusersitepackages File "/usr/share/python2.7/site.py", line 243, in getuserbase File "/usr/share/python2.7/sysconfig.py", line 522, in get_config_var File "/usr/share/python2.7/sysconfig.py", line 426, in get_config_vars File "/usr/share/python2.7/sysconfig.py", line 184, in _getuserbase File "/usr/share/python2.7/sysconfig.py", line 171, in joinuser File "/usr/share/python2.7/posixpath.py", line 260, in expanduser KeyError: 'getpwuid(): uid not found: 51' ---------- components: Interpreter Core messages: 155215 nosy: arekm priority: normal severity: normal status: open title: python shouldn't need username in passwd database versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 11:04:22 2012 From: report at bugs.python.org (Mark Shannon) Date: Fri, 09 Mar 2012 10:04:22 +0000 Subject: [New-bugs-announce] [issue14239] Uninitialised variable in _PyObject_GenericSetAttrWithDict Message-ID: <1331287462.62.0.137638108542.issue14239@psf.upfronthosting.co.za> New submission from Mark Shannon : I get the following compiler warning (rev 2a142141e5fd) Its not strictly an error, but an unitialised variable in such an important function is dangerous. Objects/object.c: In function ?_PyObject_GenericSetAttrWithDict?: Objects/object.c:1144: warning: ?descr? may be used uninitialised in this function Patch attached ---------- components: Installation files: uninitialised_descr.patch keywords: patch messages: 155221 nosy: Mark.Shannon priority: normal severity: normal status: open title: Uninitialised variable in _PyObject_GenericSetAttrWithDict type: compile error Added file: http://bugs.python.org/file24765/uninitialised_descr.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 12:51:35 2012 From: report at bugs.python.org (Thomas Turner) Date: Fri, 09 Mar 2012 11:51:35 +0000 Subject: [New-bugs-announce] [issue14240] lstrip problem Message-ID: <1331293895.45.0.678808480935.issue14240@psf.upfronthosting.co.za> New submission from Thomas Turner : Problem with lstrip >>> s = 'msgid "supplier code"' >>> >>> s.lstrip('msgid "') 'upplier code"' >>> It should come back with supplier code" To get round the bug I did >>> s.lstrip('msgid ').lstrip('"') 'supplier code"' >>> ---------- components: None messages: 155225 nosy: Thomas.Turner priority: normal severity: normal status: open title: lstrip problem type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 13:39:16 2012 From: report at bugs.python.org (Mark Shannon) Date: Fri, 09 Mar 2012 12:39:16 +0000 Subject: [New-bugs-announce] [issue14241] io.UnsupportedOperation.__new__(io.UnsupportedOperation) fails Message-ID: <1331296756.01.0.329340447456.issue14241@psf.upfronthosting.co.za> New submission from Mark Shannon : >>> io.UnsupportedOperation.__new__(io.UnsupportedOperation) Traceback (most recent call last): File "", line 1, in TypeError: ValueError.__new__(UnsupportedOperation) is not safe, use OSError.__new__() Looking at the mro of io.UnsupportedOperation (io.UnsupportedOperation, ValueError, OSError, Exception, BaseException, object'>) Shows that ValueError.__new__ is getting called, but will not construct an instance of a subtype of OSError Switching the order of ValueError and OSError fixes this error (patch attached), but doesn't fix the underlying problem. Why doesn't io.UnsupportedOperation() fail, when UnsupportedOperation.__new__ does? io.UnsupportedOperation() actually calls OSError.__new__ via the internal tp_new slot. In other words UnsupportedOperation->tp_new != UnsupportedOperation.__new__ This should not happen, it looks like the logic in inherit_special() in typeobject.c may be faulty. ---------- components: Interpreter Core files: io_new.patch keywords: patch messages: 155227 nosy: Mark.Shannon priority: normal severity: normal status: open title: io.UnsupportedOperation.__new__(io.UnsupportedOperation) fails type: behavior Added file: http://bugs.python.org/file24768/io_new.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 01:23:04 2012 From: report at bugs.python.org (Dan Colish) Date: Sat, 10 Mar 2012 00:23:04 +0000 Subject: [New-bugs-announce] [issue14242] Make subprocess.Popen aware of $SHELL Message-ID: <1331338984.42.0.434201711387.issue14242@psf.upfronthosting.co.za> New submission from Dan Colish : The hardcoding of /bin/sh in the Popen _execute_child method can be a point of frustration when so many users are used to their chosen environment shell. The module can easily support the re-use of the defined $SHELL variable. I've attached a patch which gives one way of doing this. Before I get into writing tests for this, I wanted to float the idea of adding this feature. ---------- components: Library (Lib) files: popen_shell.diff keywords: patch messages: 155274 nosy: dcolish priority: normal severity: normal status: open title: Make subprocess.Popen aware of $SHELL type: enhancement versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file24772/popen_shell.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 03:14:08 2012 From: report at bugs.python.org (Dave Abrahams) Date: Sat, 10 Mar 2012 02:14:08 +0000 Subject: [New-bugs-announce] [issue14243] NamedTemporaryFile usability request Message-ID: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> New submission from Dave Abrahams : NamedTemporaryFile is too hard to use portably when you need to open the file by name after writing it. To do that, you need to close the file first (on Windows), which means you have to pass delete=False, which in turn means that you get no help in cleaning up the actual file resource, which as you can see from the code in tempfile.py is devilishly hard to do correctly. The fact that it's different on posix (you can open the file for reading by name without closing it first) makes this problem worse. What we really need for this use-case is a way to say, "delete on __del__ but not on close()." ---------- components: Library (Lib) messages: 155278 nosy: dabrahams priority: normal severity: normal status: open title: NamedTemporaryFile usability request versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 04:08:22 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Sat, 10 Mar 2012 03:08:22 +0000 Subject: [New-bugs-announce] [issue14244] No information about behaviour with groups in pattern in the docstring for re.split Message-ID: <1331348902.51.0.968875082813.issue14244@psf.upfronthosting.co.za> New submission from Ramchandra Apte : help(re.split) "split(pattern, string, maxsplit=0, flags=0) Split the source string by the occurrences of the pattern, returning a list containing the resulting substrings." No info is given about behaviour with groups in pattern. Created because of http://bugs.python.org/issue14236#msg155283. ---------- assignee: docs at python components: Documentation messages: 155286 nosy: docs at python, ramchandra.apte priority: normal severity: normal status: open title: No information about behaviour with groups in pattern in the docstring for re.split _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 10:35:12 2012 From: report at bugs.python.org (Zbyszek Szmek) Date: Sat, 10 Mar 2012 09:35:12 +0000 Subject: [New-bugs-announce] [issue14245] float rounding examples in FAQ are outdated Message-ID: <1331372112.92.0.532785259032.issue14245@psf.upfronthosting.co.za> New submission from Zbyszek Szmek : http://docs.python.org/dev/faq/design.html#why-are-floating-point-calculations-so-inaccurate This whole paragraph is wrong since #9337 (Make float.__str__ behave identically to float.__repr__). """ The str() function prints fewer digits and this often results in the more sensible number that was probably intended: >>> 1.1 - 0.9 0.20000000000000007 >>> print(1.1 - 0.9) 0.2 """ Applies from 3.2 onwards. ---------- assignee: docs at python components: Documentation messages: 155300 nosy: docs at python, zbysz priority: normal severity: normal status: open title: float rounding examples in FAQ are outdated versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 12:04:02 2012 From: report at bugs.python.org (Phil Thompson) Date: Sat, 10 Mar 2012 11:04:02 +0000 Subject: [New-bugs-announce] [issue14246] Accelerated ETree XMLParser cannot handle io.StringIO Message-ID: <1331377442.17.0.542633134085.issue14246@psf.upfronthosting.co.za> New submission from Phil Thompson : The old unaccelerated ETree XMLParser accepts input from a io.StringIO, but the accelerated version does not. Any code that relies on this is broken by Python v3.3. ---------- components: XML messages: 155301 nosy: philthompson10 priority: normal severity: normal status: open title: Accelerated ETree XMLParser cannot handle io.StringIO type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:01:02 2012 From: report at bugs.python.org (=?utf-8?q?Damjan_Ko=C5=A1ir?=) Date: Sat, 10 Mar 2012 18:01:02 +0000 Subject: [New-bugs-announce] [issue14247] "in" operator doesn't return boolean Message-ID: <1331402462.68.0.808379005089.issue14247@psf.upfronthosting.co.za> New submission from Damjan Ko?ir : In operator acts like it doesn't return a boolean value >>> 3 in [1,2,3] == True False and even >>> 3 in [1,2,3] == 3 in [1,2,3] False but somehow if you add ( ) it starts working >>> (3 in [1,2,3]) == True True Tested on OSX 10.7 Python 2.7.1 ---------- components: None messages: 155329 nosy: Damjan.Ko?ir priority: normal severity: normal status: open title: "in" operator doesn't return boolean versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 20:43:19 2012 From: report at bugs.python.org (Jakub Wilk) Date: Sat, 10 Mar 2012 19:43:19 +0000 Subject: [New-bugs-announce] =?utf-8?q?=5Bissue14248=5D_Typo_in_=22What?= =?utf-8?b?4oCZcyBOZXcgSW4gUHl0aG9uIDMuMyI6ICJjb21wYXJhaXNvbiI=?= Message-ID: <1331408599.07.0.132199218541.issue14248@psf.upfronthosting.co.za> New submission from Jakub Wilk : Typo in Doc/whatsnew/3.3.rst: "comparaison" -> "comparison". ---------- assignee: docs at python components: Documentation messages: 155347 nosy: docs at python, jwilk priority: normal severity: normal status: open title: Typo in "What?s New In Python 3.3": "comparaison" versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 23:19:53 2012 From: report at bugs.python.org (Stefan Krah) Date: Sat, 10 Mar 2012 22:19:53 +0000 Subject: [New-bugs-announce] [issue14249] unicodeobject.c: aliasing warnings Message-ID: <1331417993.32.0.291164156337.issue14249@psf.upfronthosting.co.za> New submission from Stefan Krah : There are a couple of aliasing warnings in non-debug mode. For example: http://www.python.org/dev/buildbot/all/builders/x86%20Gentoo%20Non-Debug%203.x/builds/1741 Objects/object.c:293: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result Objects/object.c:302: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result Objects/unicodeobject.c:5533: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5533: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5533: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5523: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5523: warning: dereferencing pointer 'pblock' does break strict-aliasing rules cc1: warning: dereferencing pointer 'pblock' does break strict-aliasing rules cc1: warning: dereferencing pointer 'pblock' does break strict-aliasing rules cc1: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5523: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5523: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5533: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5533: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5533: warning: dereferencing pointer 'pblock' does break strict-aliasing rules cc1: warning: dereferencing pointer 'pblock' does break strict-aliasing rules cc1: warning: dereferencing pointer 'pblock' does break strict-aliasing rules cc1: warning: dereferencing pointer 'pblock' does break strict-aliasing rules ---------- components: Build keywords: buildbot messages: 155357 nosy: haypo, skrah priority: normal severity: normal status: open title: unicodeobject.c: aliasing warnings type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 01:46:32 2012 From: report at bugs.python.org (py.user) Date: Sun, 11 Mar 2012 00:46:32 +0000 Subject: [New-bugs-announce] [issue14250] regex.flags is never equal to 0 Message-ID: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> New submission from py.user : http://docs.python.org/py3k/library/re.html#re.regex.flags "or 0 if no flags were provided" >>> import re >>> p = re.compile(r'', 0) >>> p.flags 32 >>> ---------- assignee: docs at python components: Documentation, Regular Expressions messages: 155362 nosy: docs at python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: regex.flags is never equal to 0 versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 03:23:15 2012 From: report at bugs.python.org (rednaks) Date: Sun, 11 Mar 2012 02:23:15 +0000 Subject: [New-bugs-announce] [issue14251] [PATCH]HTMLParser decode issue Message-ID: <1331432595.42.0.705024671549.issue14251@psf.upfronthosting.co.za> New submission from rednaks : Hello ! while parsing a HTML code i got an decode Error : but this issue can be fixed by replacing the last string by s.decode() like in the diff file. I also tried to execute my script under python3.2 and it does not parsing any thing File "/usr/lib/python2.7/HTMLParser.py", line 111, in feed self.goahead(0) File "/usr/lib/python2.7/HTMLParser.py", line 155, in goahead k = self.parse_starttag(i) File "/usr/lib/python2.7/HTMLParser.py", line 260, in parse_starttag attrvalue = self.unescape(attrvalue) File "/usr/lib/python2.7/HTMLParser.py", line 410, in unescape return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));", replaceEntities, s) File "/usr/lib/python2.7/re.py", line 151, in sub return _compile(pattern, flags).sub(repl, string, count) UnicodeDecodeError: 'ascii' codec can't decode byte 0x97 in position 1: ordinal not in range(128) ---------- components: Library (Lib) files: patch.txt messages: 155366 nosy: rednaks priority: normal severity: normal status: open title: [PATCH]HTMLParser decode issue type: crash versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file24780/patch.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 17:02:48 2012 From: report at bugs.python.org (Dave Abrahams) Date: Sun, 11 Mar 2012 16:02:48 +0000 Subject: [New-bugs-announce] [issue14252] subprocess.Popen.terminate() inconsistent behavior on Windows Message-ID: <1331481768.76.0.379134642234.issue14252@psf.upfronthosting.co.za> New submission from Dave Abrahams : Try the following script on posix and Windows. On Posix: launched . . . exiting killed on Windows: launched . . . exiting Traceback (most recent call last): File "sp.py", line 16, in p.terminate() File "c:\Python26\lib\subprocess.py", line 949, in terminate _subprocess.TerminateProcess(self._handle, 1) WindowsError: [Error 5] Access is denied This inconsistency seems unnecessary and is an obstacle to writing portable code. from subprocess import * import sys, time p = Popen([sys.executable, '-c', ''' import time, sys for i in range(3): time.sleep(.3) print '.', sys.stdout.flush() print 'exiting' '''], stdout = sys.stdout, stderr = sys.stderr) print 'launched' time.sleep(2) p.terminate() print 'killed' ---------- components: Library (Lib) messages: 155391 nosy: dabrahams priority: normal severity: normal status: open title: subprocess.Popen.terminate() inconsistent behavior on Windows versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 17:39:44 2012 From: report at bugs.python.org (=?utf-8?q?Robert_Sj=C3=B6blom?=) Date: Sun, 11 Mar 2012 16:39:44 +0000 Subject: [New-bugs-announce] [issue14253] print() encodes characters to native system encoding Message-ID: <1331483984.27.0.0301545457628.issue14253@psf.upfronthosting.co.za> New submission from Robert Sj?blom : I'm on a cp932-encoded system. When I read in a cp1252-file, it's read into memory properly, but when printing it, Python tries to encode the output to cp932. Here's the relevant code: address = "C:/Path/to/file/file.ext" with open(address, encoding="cp1252") as alpha: print(line, end="") Traceback (most recent call last): File "C:\Python32\parser.py", line 8, in print(line) UnicodeEncodeError: 'cp932' codec can't encode character '\xe9' in position 13: illegal multibyte sequence Shouldn't the output be in unicode? ---------- components: Unicode messages: 155393 nosy: Robert.Sj?blom, ezio.melotti priority: normal severity: normal status: open title: print() encodes characters to native system encoding type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 18:51:13 2012 From: report at bugs.python.org (Roger Serwy) Date: Sun, 11 Mar 2012 17:51:13 +0000 Subject: [New-bugs-announce] [issue14254] IDLE - shell restart during readline does not reset readline Message-ID: <1331488273.19.0.978623849585.issue14254@psf.upfronthosting.co.za> New submission from Roger Serwy : In PyShell.py, the "readline" method enters a nested event loop for handling input. If the shell is restarted, the nested event loop remains until after the first press of "enter" causes the "enter_callback" to quit the nested event loop. The effect is that the first line of input to the prompt is ignored by the new shell. Attached is a patch against 3.3 to fix the problem. ---------- components: IDLE files: reading_reset.patch keywords: patch messages: 155398 nosy: serwy priority: normal severity: normal status: open title: IDLE - shell restart during readline does not reset readline type: behavior versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24784/reading_reset.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 02:12:42 2012 From: report at bugs.python.org (=?utf-8?b?5YuH5YiaIOe9lw==?=) Date: Mon, 12 Mar 2012 01:12:42 +0000 Subject: [New-bugs-announce] [issue14255] tempfile.gettempdir() didn't return the path with correct case. Message-ID: <1331514762.82.0.635964063955.issue14255@psf.upfronthosting.co.za> New submission from ?? ? : >>> print tempfile.gettempdir() c:\users\dreamkxd\appdata\local\temp >>> And the real path is C:\Users\dreamkxd\AppData\Local\Temp. ---------- messages: 155424 nosy: ??.? priority: normal severity: normal status: open title: tempfile.gettempdir() didn't return the path with correct case. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 02:24:17 2012 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 12 Mar 2012 01:24:17 +0000 Subject: [New-bugs-announce] [issue14256] test_logging fails if zlib is not present Message-ID: <1331515457.08.0.269897538589.issue14256@psf.upfronthosting.co.za> New submission from Eric V. Smith : Presumably this needs to use requires_zlib. $ time ./python -m test test_logging [1/1] test_logging test test_logging crashed -- Traceback (most recent call last): File "/home/eric/local/python/cpython/Lib/test/regrtest.py", line 1229, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/home/eric/local/python/cpython/Lib/test/test_logging.py", line 49, in import zlib ImportError: No module named 'zlib' 1 test failed: test_logging [111665 refs] ---------- components: Tests keywords: easy messages: 155425 nosy: eric.smith priority: normal severity: normal status: open title: test_logging fails if zlib is not present versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 02:27:06 2012 From: report at bugs.python.org (Chris Rebert) Date: Mon, 12 Mar 2012 01:27:06 +0000 Subject: [New-bugs-announce] [issue14257] minor error in glossary wording regarding __hash__ Message-ID: <1331515626.11.0.049158499672.issue14257@psf.upfronthosting.co.za> New submission from Chris Rebert : The entry for "dictionary" reads in part: [...] The keys can be any object with __hash__() function and __eq__() methods. [...] __hash__() is a method, not a function (well, it's a "hash function" in the computer science sense, but it's still confusing even if that reading is what was intended; I think delegating the hashing part of the explanation to __hash__()'s docs is fine). Remove the word "function" from said sentence. ---------- assignee: docs at python components: Documentation messages: 155427 nosy: cvrebert, docs at python priority: normal severity: normal status: open title: minor error in glossary wording regarding __hash__ versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 04:22:06 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 12 Mar 2012 03:22:06 +0000 Subject: [New-bugs-announce] [issue14258] Better explain re.LOCALE and re.UNICODE for \S and \W Message-ID: <1331522526.82.0.873716298557.issue14258@psf.upfronthosting.co.za> New submission from Senthil Kumaran : Opening the this bug following this discussion - http://mail.python.org/pipermail/docs/2012-March/007829.html library/re.html \S When the LOCALE and UNICODE flags are not specified, matches any non-whitespace character; this is equivalent to the set [^ \t\n\r\f\v] With LOCALE, it will match any character not in this set, and not defined as space in the current locale. If UNICODE is set, this will match anything other than [ \t\n\r\f\v] and characters marked as space in the Unicode character properties database. This is wrong. With LOCALE set, it should be [^ \t\n\r\f\v] plus any non-space character in that locale. ---------- assignee: orsenthil components: Documentation messages: 155434 nosy: orsenthil priority: low severity: normal status: open title: Better explain re.LOCALE and re.UNICODE for \S and \W type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 06:22:56 2012 From: report at bugs.python.org (py.user) Date: Mon, 12 Mar 2012 05:22:56 +0000 Subject: [New-bugs-announce] [issue14259] regex.finditer() doesn't accept keyword arguments Message-ID: <1331529776.72.0.83899551616.issue14259@psf.upfronthosting.co.za> New submission from py.user : >>> import re >>> p = re.compile(r'abc') >>> res = p.search('abcdefabcdef', pos=1, endpos=10) >>> res = p.match('abcdefabcdef', pos=1, endpos=10) >>> res = p.findall('abcdefabcdef', pos=1, endpos=10) >>> res = p.finditer('abcdefabcdef', pos=1, endpos=10) Traceback (most recent call last): File "", line 1, in TypeError: finditer() takes no keyword arguments >>> ---------- components: Regular Expressions messages: 155441 nosy: ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: regex.finditer() doesn't accept keyword arguments type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 06:28:23 2012 From: report at bugs.python.org (py.user) Date: Mon, 12 Mar 2012 05:28:23 +0000 Subject: [New-bugs-announce] [issue14260] regex.groupindex available for modification and continues to work, having incorrect data inside it Message-ID: <1331530103.22.0.0779581075646.issue14260@psf.upfronthosting.co.za> New submission from py.user : >>> import re >>> p = re.compile(r'abc(?Pdef)') >>> p.sub(r'\g', 'abcdef123abcdef') 'def123def' >>> p.groupindex['n'] = 2 >>> p.sub(r'\g', 'abcdef123abcdef') 'def123def' >>> p.groupindex {'n': 2} >>> ---------- components: Regular Expressions messages: 155442 nosy: ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: regex.groupindex available for modification and continues to work, having incorrect data inside it type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 13:04:10 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Mon, 12 Mar 2012 12:04:10 +0000 Subject: [New-bugs-announce] [issue14261] Cleanup in smtpd module Message-ID: <1331553850.91.0.315576733805.issue14261@psf.upfronthosting.co.za> New submission from Michele Orr? : This issue is related to 8739 . As pointed in http://bugs.python.org/issue8739#msg155385, ? tests are in the form FooTest instead of TestFoo, smtpd imports modules used only in __main__, warnings can be handled the appropriate module, __import__ shall not be used ? and, as bitdancer said in http://bugs.python.org/issue8739#msg153244 ?there are no tests for the smtpd command line functionality? Also, note that currently the main has a bug: s/options\.max_message_size/size_limit/ ---------- components: Library (Lib) messages: 155448 nosy: Juhana.Jauhiainen, ezio.melotti, maker, r.david.murray priority: normal severity: normal status: open title: Cleanup in smtpd module type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 14:13:08 2012 From: report at bugs.python.org (Ram Rachum) Date: Mon, 12 Mar 2012 13:13:08 +0000 Subject: [New-bugs-announce] [issue14262] Allow using decimals as arguments to `timedelta` Message-ID: <1331557988.1.0.944940856764.issue14262@psf.upfronthosting.co.za> New submission from Ram Rachum : Please allow using decimals as arguments to `timedelta`, so the following code won't raise an exception: Python 3.3.0a1 (default, Mar 4 2012, 17:27:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> import decimal >>> datetime.timedelta(hours=decimal.Decimal(7)) Traceback (most recent call last): File "", line 1, in TypeError: unsupported type for timedelta hours component: Decimal It's really annoying to have to convert all the arguments to `float` every time I instantiate a `timedelta`. ---------- components: Library (Lib) messages: 155449 nosy: cool-RR priority: normal severity: normal status: open title: Allow using decimals as arguments to `timedelta` versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:29:35 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 19:29:35 +0000 Subject: [New-bugs-announce] [issue14263] switch_index_if_fails fails on py2 Message-ID: <1331580575.36.0.0269890072564.issue14263@psf.upfronthosting.co.za> New submission from Tarek Ziad? : distutils2 pysetup install is not working on py2 because the wrapper tries to pull func.f_name, which does not exist. ---------- assignee: tarek messages: 155463 nosy: eric.araujo, j1m, tarek priority: critical severity: normal status: open title: switch_index_if_fails fails on py2 versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:30:56 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 19:30:56 +0000 Subject: [New-bugs-announce] [issue14264] can't install zope.event 3.4.0 Message-ID: <1331580656.26.0.657615907174.issue14264@psf.upfronthosting.co.za> Changes by Tarek Ziad? : ---------- assignee: tarek components: Distutils2 nosy: alexis, eric.araujo, j1m, tarek priority: high severity: normal status: open title: can't install zope.event 3.4.0 type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:59:47 2012 From: report at bugs.python.org (Michael Foord) Date: Mon, 12 Mar 2012 19:59:47 +0000 Subject: [New-bugs-announce] [issue14265] Fully qualified test name in failure output Message-ID: <1331582387.93.0.923571160232.issue14265@psf.upfronthosting.co.za> New submission from Michael Foord : Somewhere in the failure message for tests Guido would like to see the fully qualified test name, suitable for copying and pasting into a test runner invocation for running just that test. ---------- assignee: michael.foord components: Library (Lib) messages: 155467 nosy: michael.foord priority: normal severity: normal status: open title: Fully qualified test name in failure output versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:00:37 2012 From: report at bugs.python.org (Michael Foord) Date: Mon, 12 Mar 2012 21:00:37 +0000 Subject: [New-bugs-announce] [issue14266] pyunit script as shorthand for python -m unittest Message-ID: <1331586037.12.0.876793471383.issue14266@psf.upfronthosting.co.za> New submission from Michael Foord : "python -m unittest ..." is a pain to type. A "pyunit" script would be a nice shorthand. (unittest2 has a unit2 script that does this.) ---------- assignee: michael.foord components: Library (Lib) messages: 155476 nosy: michael.foord priority: normal severity: normal stage: needs patch status: open title: pyunit script as shorthand for python -m unittest versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:18:40 2012 From: report at bugs.python.org (Matt Mullins) Date: Mon, 12 Mar 2012 21:18:40 +0000 Subject: [New-bugs-announce] [issue14267] TimedRotatingFileHandler chooses wrong file name due to daylight saving time "spring forward" Message-ID: <1331587120.0.0.484868698983.issue14267@psf.upfronthosting.co.za> New submission from Matt Mullins : As logs were rotated at midnight this morning (at the end of the day 2012-03-11), we detected that the logs were incorrectly renamed to *.log.2012-03-10, causing logs from Saturday to be overwritten. I believe this bug is related to the transition to daylight saving time, as this is the only day in recent history that this has occurred. I have attached a script to reproduce this bug. This works reliably in the US/Pacific time zone. To run it, execute "rm foo.log* ; sudo date 03112359.55 && python logger_test.py". This will cause ten records to be logged, across the midnight boundary from 2012-03-11 23:59:55 to 2012-03-12 00:00:05. Expected behavior: the logs from 2012-03-11 up to, but not including, 2012-03-12 00:00:00 should be written to a file named "foo.log.2012-03-11", and the remainder of the log entries should be written to "foo.log". Actual behavior: the logs from 2012-03-11 23:59 through, but not including, 2012-03-12 00:00 are instead written to a file named "foo.log.2012-03-10", and the remainder of the log entries are written to "foo.log". This does not happen for any other day. For example: running "sudo date 02152359.55" in the above procedure correctly names the file "foo.log.2012-02-15". ---------- components: Library (Lib) files: logger_test.py messages: 155482 nosy: Matt.Mullins priority: normal severity: normal status: open title: TimedRotatingFileHandler chooses wrong file name due to daylight saving time "spring forward" type: behavior versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file24799/logger_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:33:35 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 21:33:35 +0000 Subject: [New-bugs-announce] [issue14268] _move_file is broken because of a bad mock Message-ID: <1331588015.42.0.677494046367.issue14268@psf.upfronthosting.co.za> New submission from Tarek Ziad? : the mocked list_installed_files() returns a list of files instead of a list of (path, md5, path) ---------- assignee: tarek components: Distutils2 messages: 155483 nosy: alexis, eric.araujo, tarek priority: normal severity: normal status: open title: _move_file is broken because of a bad mock versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:58:36 2012 From: report at bugs.python.org (Dan Boswell) Date: Mon, 12 Mar 2012 21:58:36 +0000 Subject: [New-bugs-announce] [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO Message-ID: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> New submission from Dan Boswell : The current SMTP RFC (5321) states that 'a client MUST issue HELO or EHLO before starting a mail transaction'. The SMTP server should issue '503 Bad sequence of commands' if a client sends MAIL, RCPT or DATA commands before it sends an HELO/EHLO; currently it does not. To reproduce: 1. Start smtpd.py 2. Telnet to localhost 8025 3. Send 'MAIL from:' To which you'll see '250 OK' instead of '503 Bad sequence of commands' ---------- components: Library (Lib) messages: 155490 nosy: fruitnuke priority: normal severity: normal status: open title: SMTPD server does not enforce client starting mail transaction with HELO or EHLO type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:18:25 2012 From: report at bugs.python.org (Mathieu Leduc-Hamel) Date: Mon, 12 Mar 2012 22:18:25 +0000 Subject: [New-bugs-announce] [issue14270] Can't install a package in a specific directory Message-ID: <1331590705.94.0.0465168087698.issue14270@psf.upfronthosting.co.za> New submission from Mathieu Leduc-Hamel : When using distutils2.install.install_from_infos to install a package, no matter if you have an install_path parameter or not, it doesn't work. The problem seems to resided at: distutils2.install._run_install_from_archive Doesn't have any dest_dir parameter ---------- assignee: eric.araujo components: Distutils2 messages: 155498 nosy: alexis, eric.araujo, mlhamel, tarek priority: normal severity: normal status: open title: Can't install a package in a specific directory versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:48:42 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 22:48:42 +0000 Subject: [New-bugs-announce] [issue14271] remove setup.py from the doc Message-ID: <1331592522.15.0.530448114821.issue14271@psf.upfronthosting.co.za> New submission from Tarek Ziad? : http://docs.python.org/dev/packaging/index.html we still have setup.py pages here from the old doc ---------- assignee: eric.araujo components: Distutils2 messages: 155503 nosy: alexis, eric.araujo, j1m, tarek priority: normal severity: normal status: open title: remove setup.py from the doc versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:48:53 2012 From: report at bugs.python.org (Stefan Krah) Date: Mon, 12 Mar 2012 22:48:53 +0000 Subject: [New-bugs-announce] [issue14272] ast.c: windows compile error Message-ID: <1331592533.68.0.501543996641.issue14272@psf.upfronthosting.co.za> New submission from Stefan Krah : The Windows build seems to be broken: Python-ast.c ..\Python\Python-ast.c(459) : error C2059: syntax error : ';' ..\Python\Python-ast.c(461) : error C2059: syntax error : '}' ..\Python\Python-ast.c(549) : error C2065: 'AST_object' : undeclared identifier ..\Python\Python-ast.c(581) : error C2065: 'AST_object' : undeclared identifier ..\Python\Python-ast.c(581) : error C2059: syntax error : ')' ..\Python\Python-ast.c(596) : fatal error C1903: unable to recover from previous error(s); stopping compilatio n dtoa.c 10>..\Python\dtoa.c ---------- components: Build messages: 155504 nosy: skrah priority: normal severity: normal status: open title: ast.c: windows compile error type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:56:18 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 22:56:18 +0000 Subject: [New-bugs-announce] [issue14273] handler not properly initialized Message-ID: <1331592978.94.0.127505196077.issue14273@psf.upfronthosting.co.za> New submission from Tarek Ziad? : $ ./pysetup dwqqwddwq No handlers could be found for logger "distutils2" ---------- assignee: eric.araujo components: Distutils2 messages: 155509 nosy: alexis, eric.araujo, tarek priority: high severity: normal status: open title: handler not properly initialized versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:04:24 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 23:04:24 +0000 Subject: [New-bugs-announce] [issue14274] pysetup does not look at requires.txt Message-ID: <1331593464.56.0.104629100703.issue14274@psf.upfronthosting.co.za> New submission from Tarek Ziad? : the installer needs to read requires.txt to build the deps list as well ---------- assignee: eric.araujo components: Distutils2 messages: 155513 nosy: alexis, eric.araujo, tarek priority: normal severity: normal status: open title: pysetup does not look at requires.txt type: behavior versions: 3rd party, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:11:58 2012 From: report at bugs.python.org (Jan-Jaap Driessen) Date: Mon, 12 Mar 2012 23:11:58 +0000 Subject: [New-bugs-announce] [issue14275] pysetup create doesn't handle install requirements Message-ID: <1331593918.19.0.128575459883.issue14275@psf.upfronthosting.co.za> New submission from Jan-Jaap Driessen : Distutils2 pysetup can take an existing setuptools based project and convert it into the distutils2 setup.cfg syntax using `pysetup create`. The install requirements are not converted: {{{ svn co svn+ssh://svn.zope.org/repos/main/zope.dublincore/trunk pysetup create }}} The original dependencies in 'install_requires' in setup.py are not found in the resulting setup.cfg. ---------- assignee: eric.araujo components: Distutils2 messages: 155514 nosy: alexis, eric.araujo, j1m, janjaapdriessen, tarek priority: normal severity: normal status: open title: pysetup create doesn't handle install requirements type: behavior versions: Python 2.6, Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:22:50 2012 From: report at bugs.python.org (Jan-Jaap Driessen) Date: Mon, 12 Mar 2012 23:22:50 +0000 Subject: [New-bugs-announce] [issue14276] install latest version of a package Message-ID: <1331594570.15.0.87827411475.issue14276@psf.upfronthosting.co.za> New submission from Jan-Jaap Driessen : I would like to install the latest version of a package. The pysetup command does not give me easy access to do this. Can we add an 'upgrade' method? ---------- assignee: eric.araujo components: Distutils2 messages: 155517 nosy: alexis, eric.araujo, janjaapdriessen, tarek priority: normal severity: normal status: open title: install latest version of a package versions: Python 2.6, Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:24:44 2012 From: report at bugs.python.org (Nicholas Riley) Date: Mon, 12 Mar 2012 23:24:44 +0000 Subject: [New-bugs-announce] [issue14277] time.monotonic docstring does not mention the time unit returned Message-ID: <1331594684.47.0.548556595506.issue14277@psf.upfronthosting.co.za> New submission from Nicholas Riley : Currently: >>> help(time.monotonic) Help on built-in function monotonic in module time: monotonic(...) monotonic() -> float Monotonic clock. The reference point of the returned value is undefined so only the difference of consecutive calls is valid. ---------- components: Library (Lib) messages: 155518 nosy: nriley priority: normal severity: normal status: open title: time.monotonic docstring does not mention the time unit returned versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:14:01 2012 From: report at bugs.python.org (Brian Jones) Date: Tue, 13 Mar 2012 00:14:01 +0000 Subject: [New-bugs-announce] [issue14278] email.utils.localtime throws exception if time.daylight is False Message-ID: <1331597641.5.0.510268852561.issue14278@psf.upfronthosting.co.za> New submission from Brian Jones : In email.utils.localtime, there's a variable 'offset' that will only exist if time.daylight evaluates to True. If time.daylight evaluates to False, you'll get an UnboundLocalError, because 'offset' is being referenced without being assigned. The attached patch fixes that issue, adds several tests, and also refactors an existing test containing 4-5 assertions into a test for each assertion. ---------- components: Library (Lib) files: localtime_fix.patch keywords: patch messages: 155535 nosy: Brian.Jones priority: normal severity: normal status: open title: email.utils.localtime throws exception if time.daylight is False versions: Python 3.3 Added file: http://bugs.python.org/file24808/localtime_fix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:29:48 2012 From: report at bugs.python.org (Jim Fulton) Date: Tue, 13 Mar 2012 00:29:48 +0000 Subject: [New-bugs-announce] [issue14279] simple indexes (in wrappers) should support flat directories of distributions Message-ID: <1331598588.13.0.0229993351988.issue14279@psf.upfronthosting.co.za> New submission from Jim Fulton : Currently, distutils2.pypi.wrapper has a notion of a simple index, which has subdirectories for each project as pypi/simple does. This is good. It should also support flat indexes ala a directory of files. ---------- assignee: eric.araujo components: Distutils2 messages: 155537 nosy: alexis, eric.araujo, j1m, tarek priority: normal severity: normal status: open title: simple indexes (in wrappers) should support flat directories of distributions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:40:35 2012 From: report at bugs.python.org (Jim Fulton) Date: Tue, 13 Mar 2012 00:40:35 +0000 Subject: [New-bugs-announce] [issue14280] simple indexes (in wrappers) should not require md5 hashes Message-ID: <1331599235.17.0.307385355427.issue14280@psf.upfronthosting.co.za> New submission from Jim Fulton : Requiring md5s makes it hard to implement simple indexes with simple web servers, where simple indexes include flat directories of distributions. ---------- assignee: eric.araujo components: Distutils2 messages: 155542 nosy: alexis, eric.araujo, j1m, tarek priority: normal severity: normal status: open title: simple indexes (in wrappers) should not require md5 hashes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 04:05:10 2012 From: report at bugs.python.org (Brian Landers) Date: Tue, 13 Mar 2012 03:05:10 +0000 Subject: [New-bugs-announce] [issue14281] Add unit test for cgi.escape method Message-ID: <1331607910.6.0.875213556559.issue14281@psf.upfronthosting.co.za> New submission from Brian Landers : The cgi.escape method is deprecated, but it should still have test coverage. This patch adds a test for it. ---------- components: Tests files: cgi_test_escape.patch keywords: patch messages: 155563 nosy: packetslave priority: normal severity: normal status: open title: Add unit test for cgi.escape method type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24811/cgi_test_escape.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 05:58:03 2012 From: report at bugs.python.org (Luke Macken) Date: Tue, 13 Mar 2012 04:58:03 +0000 Subject: [New-bugs-announce] [issue14282] lib2to3.fixer_util.touch_import('__future__', ...) can lead to SyntaxError in code Message-ID: <1331614683.04.0.297382545344.issue14282@psf.upfronthosting.co.za> New submission from Luke Macken : Problem: lib2to3.fixer_util.touch_import('__future__', ...) will insert the import statement below all other imports. This will then trigger the following error: SyntaxError: from __future__ imports must occur at the beginning of the file How to reproduce the issue (using modernize, which uses lib2to3): $ git clone https://github.com/mitsuhiko/python-modernize.git $ cd python-modernize $ echo << EOF >> test.py # test.py "Test case for lib2to3.fixer_util.touch_import('__future__', ...)" import os print "hi" EOF $ python modernize.py test.py --- test.py (original) +++ test.py (refactored) @@ -1,4 +1,5 @@ # test.py "Test case for lib2to3.fixer_util.touch_import('__future__', ...)" import os -print "hi" +from __future__ import print_function +print("hi") $ python3 test.py File "test.py", line 4 from __future__ import print_function ^ SyntaxError: from __future__ imports must occur at the beginning of the file The following patch to lib2to3 seems to solve the issue: --- /usr/lib64/python2.7/lib2to3/fixer_util.py.orig 2012-03-09 21:53:10.841083479 -0800 +++ /usr/lib64/python2.7/lib2to3/fixer_util.py 2012-03-09 21:58:18.678946683 -0800 @@ -306,14 +306,15 @@ # figure out where to insert the new import. First try to find # the first import and then skip to the last one. insert_pos = offset = 0 - for idx, node in enumerate(root.children): - if not is_import_stmt(node): - continue - for offset, node2 in enumerate(root.children[idx:]): - if not is_import_stmt(node2): - break - insert_pos = idx + offset - break + if package != '__future__': + for idx, node in enumerate(root.children): + if not is_import_stmt(node): + continue + for offset, node2 in enumerate(root.children[idx:]): + if not is_import_stmt(node2): + break + insert_pos = idx + offset + break # if there are no imports where we can insert, find the docstring. # if that also fails, we stick to the beginning of the file After the patch, all is well: $ python modernize.py test.py --- test.py (original) +++ test.py (refactored) @@ -1,4 +1,5 @@ # test.py "Test case for lib2to3.fixer_util.touch_import('__future__', ...)" +from __future__ import print_function import os -print "hi" +print("hi") $ python3 test.py hi ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 155569 nosy: lmacken priority: normal severity: normal status: open title: lib2to3.fixer_util.touch_import('__future__', ...) can lead to SyntaxError in code type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 06:06:49 2012 From: report at bugs.python.org (py.user) Date: Tue, 13 Mar 2012 05:06:49 +0000 Subject: [New-bugs-announce] [issue14283] match.pos describes that match object has methods search() and match() Message-ID: <1331615209.27.0.948367520003.issue14283@psf.upfronthosting.co.za> New submission from py.user : http://docs.python.org/py3k/library/re.html#re.match.pos http://docs.python.org/py3k/library/re.html#re.match.endpos "which was passed to the search() or match() method of a match object." http://docs.python.org/py3k/library/re.html#re.match.re match object -> regular expression object ---------- assignee: docs at python components: Documentation, Regular Expressions messages: 155571 nosy: docs at python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: match.pos describes that match object has methods search() and match() versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 07:22:28 2012 From: report at bugs.python.org (=?utf-8?q?Herv=C3=A9_Coatanhay?=) Date: Tue, 13 Mar 2012 06:22:28 +0000 Subject: [New-bugs-announce] [issue14284] unicodeobject error on macosx in build process Message-ID: <1331619748.31.0.990464365996.issue14284@psf.upfronthosting.co.za> New submission from Herv? Coatanhay : On a fresh install from mercurial on macosx. ./python -SE -m sysconfig --generate-posix-vars Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] Assertion failed: (compact->utf8_length == 0), function _PyUnicode_CheckConsistency, file Objects/unicodeobject.c, line 369. make: *** [Lib/_sysconfigdata.py] Abort trap: 6 This is reproduced with the following mercurial changesets: changeset reproduced 368a5d7d8a15 no (3.2 branch) fafe12f2a030 no (3.2 branch) 4a5eafcdde11 yes 6b8dd7724ec0 yes 0df295d590a8 yes 7e576ad85663 yes (tip on default) When compiled with pydebug I've got the following in gdb: #0 0x00007fff86c0282a in __kill () #1 0x00007fff8e61aa9c in abort () #2 0x00007fff8e64d5de in __assert_rtn () #3 0x00000001000d5589 in _PyUnicode_CheckConsistency (op=0x101024c40, check_content=0) at unicodeobject.c:369 #4 0x00000001000df567 in unicode_dealloc (unicode=0x101024c40) at unicodeobject.c:1503 #5 0x000000010009f025 in _Py_Dealloc (op=0x101024c40) at object.c:1765 #6 0x000000010019df6a in decode_unicode (c=0x7fff5fbf6d58, s=0x10087cc36 "ois Pinard]\n\nHeaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for\nall k, counting elements from 0. For the sake of comparison,\nnon-existing elements are considered to be infinite. Th"..., len=4720, rawmode=0, encoding=0x1002c6710 "utf-8") at ast.c:3759 #7 0x000000010019e3c6 in parsestr (c=0x7fff5fbf6d58, n=0x10103a118, bytesmode=0x7fff5fbf6944) at ast.c:3829 #8 0x000000010019e839 in parsestrplus (c=0x7fff5fbf6d58, n=0x10103a0d0, bytesmode=0x7fff5fbf6944) at ast.c:3874 #9 0x000000010019597a in ast_for_atom (c=0x7fff5fbf6d58, n=0x10103a0d0) at ast.c:1869 #10 0x000000010019744d in ast_for_power (c=0x7fff5fbf6d58, n=0x10103a088) at ast.c:2228 #11 0x0000000100197fa6 in ast_for_expr (c=0x7fff5fbf6d58, n=0x10103a088) at ast.c:2428 #12 0x0000000100198a11 in ast_for_testlist (c=0x7fff5fbf6d58, n=0x1007c1c90) at ast.c:2584 #13 0x0000000100198fbe in ast_for_expr_stmt (c=0x7fff5fbf6d58, n=0x10048b868) at ast.c:2680 #14 0x000000010019d248 in ast_for_stmt (c=0x7fff5fbf6d58, n=0x10048b868) at ast.c:3600 #15 0x0000000100191530 in PyAST_FromNode (n=0x10048b280, flags=0x7fff5fbf6f60, filename=0x100794ee0 "/Users/herve/Documents/workspace/mercurial_repository/python-vanilla/Lib/heapq.py", arena=0x10051f8f0) at ast.c:760 #16 0x000000010021b86f in PyParser_ASTFromFile (fp=0x7fff77c75140, filename=0x100794ee0 "/Users/herve/Documents/workspace/mercurial_repository/python-vanilla/Lib/heapq.py", enc=0x0, start=257, ps1=0x0, ps2=0x0, flags=0x7fff5fbf6f60, errcode=0x0, arena=0x10051f8f0) at pythonrun.c:1982 #17 0x00000001001f6d04 in parse_source_module (pathname=0x1007a5320, fp=0x7fff77c75140) at import.c:1186 #18 0x00000001001f822d in load_source_module (name=0x1007bd178, pathname=0x1007a5320, fp=0x7fff77c75140) at import.c:1509 #19 0x00000001001fd345 in load_module (name=0x1007bd178, fp=0x7fff77c75140, pathname=0x1007a5320, type=1, loader=0x0) at import.c:2477 #20 0x00000001002011f7 in import_submodule (mod=0x100340f80, subname=0x1007bd178, fullname=0x1007bd178) at import.c:3338 #21 0x00000001001ffb97 in load_next (mod=0x100340f80, altmod=0x100340f80, inputname=0x1007bd178, p_outputname=0x7fff5fbf7350, p_prefix=0x7fff5fbf7338) at import.c:3149 #22 0x00000001001fe5c7 in import_module_level (name=0x1007bd178, globals=0x10077cbe8, locals=0x10077cbe8, fromlist=0x100340f80, level=0) at import.c:2842 #23 0x00000001001feb00 in PyImport_ImportModuleLevelObject (name=0x1007bd178, globals=0x10077cbe8, locals=0x10077cbe8, fromlist=0x100340f80, level=0) at import.c:2904 #24 0x000000010019fd85 in builtin___import__ (self=0x100607420, args=0x10079e9f0, kwds=0x0) at bltinmodule.c:195 #25 0x0000000100096214 in PyCFunction_Call (func=0x100607510, arg=0x10079e9f0, kw=0x0) at methodobject.c:84 #26 0x0000000100010656 in PyObject_Call (func=0x100607510, arg=0x10079e9f0, kw=0x0) at abstract.c:2150 #27 0x00000001001c597d in PyEval_CallObjectWithKeywords (func=0x100607510, arg=0x10079e9f0, kw=0x0) at ceval.c:3932 #28 0x00000001001ba572 in PyEval_EvalFrameEx (f=0x10052f5d0, throwflag=0) at ceval.c:2332 #29 0x00000001001c3681 in PyEval_EvalCodeEx (_co=0x1007b9dc0, globals=0x10077cbe8, locals=0x10077cbe8, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at ceval.c:3426 #30 0x00000001001aaf0b in PyEval_EvalCode (co=0x1007b9dc0, globals=0x10077cbe8, locals=0x10077cbe8) at ceval.c:771 #31 0x00000001001f2d62 in PyImport_ExecCodeModuleObject (name=0x10077b9e0, co=0x1007b9dc0, pathname=0x10060ed60, cpathname=0x10060ed60) at import.c:868 #32 0x00000001001f820e in load_source_module (name=0x10077b9e0, pathname=0x1004bbbf8, fp=0x7fff77c750a8) at import.c:1505 #33 0x00000001001fd345 in load_module (name=0x10077b9e0, fp=0x7fff77c750a8, pathname=0x1004bbbf8, type=1, loader=0x0) at import.c:2477 #34 0x00000001001f8c71 in load_package (name=0x10077b9e0, pathname=0x1006ad6b8) at import.c:1640 #35 0x00000001001fd3a1 in load_module (name=0x10077b9e0, fp=0x0, pathname=0x1006ad6b8, type=5, loader=0x0) at import.c:2491 #36 0x00000001002011f7 in import_submodule (mod=0x100340f80, subname=0x10077b9e0, fullname=0x10077b9e0) at import.c:3338 #37 0x00000001001ffb97 in load_next (mod=0x100340f80, altmod=0x100340f80, inputname=0x100765510, p_outputname=0x7fff5fbf93c0, p_prefix=0x7fff5fbf93a8) at import.c:3149 #38 0x00000001001fe5c7 in import_module_level (name=0x100765510, globals=0x1006ac2f0, locals=0x1006ac2f0, fromlist=0x1007578b0, level=0) at import.c:2842 #39 0x00000001001feb00 in PyImport_ImportModuleLevelObject (name=0x100765510, globals=0x1006ac2f0, locals=0x1006ac2f0, fromlist=0x1007578b0, level=0) at import.c:2904 #40 0x000000010019fd85 in builtin___import__ (self=0x100607420, args=0x100760180, kwds=0x0) at bltinmodule.c:195 #41 0x0000000100096214 in PyCFunction_Call (func=0x100607510, arg=0x100760180, kw=0x0) at methodobject.c:84 #42 0x0000000100010656 in PyObject_Call (func=0x100607510, arg=0x100760180, kw=0x0) at abstract.c:2150 #43 0x00000001001c597d in PyEval_CallObjectWithKeywords (func=0x100607510, arg=0x100760180, kw=0x0) at ceval.c:3932 #44 0x00000001001ba572 in PyEval_EvalFrameEx (f=0x10052ae70, throwflag=0) at ceval.c:2332 #45 0x00000001001c3681 in PyEval_EvalCodeEx (_co=0x1007644c0, globals=0x1006ac2f0, locals=0x1006ac2f0, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at ceval.c:3426 #46 0x00000001001aaf0b in PyEval_EvalCode (co=0x1007644c0, globals=0x1006ac2f0, locals=0x1006ac2f0) at ceval.c:771 #47 0x00000001001f2d62 in PyImport_ExecCodeModuleObject (name=0x1006b04b8, co=0x1007644c0, pathname=0x1004bb748, cpathname=0x1004bb748) at import.c:868 #48 0x00000001001f820e in load_source_module (name=0x1006b04b8, pathname=0x1006b43b0, fp=0x7fff77c75010) at import.c:1505 #49 0x00000001001fd345 in load_module (name=0x1006b04b8, fp=0x7fff77c75010, pathname=0x1006b43b0, type=1, loader=0x0) at import.c:2477 #50 0x00000001002011f7 in import_submodule (mod=0x100340f80, subname=0x1006b04b8, fullname=0x1006b04b8) at import.c:3338 #51 0x00000001001ffb97 in load_next (mod=0x100340f80, altmod=0x100340f80, inputname=0x1006b04b8, p_outputname=0x7fff5fbfb310, p_prefix=0x7fff5fbfb2f8) at import.c:3149 #52 0x00000001001fe5c7 in import_module_level (name=0x1006b04b8, globals=0x1006ac1a8, locals=0x1006ac1a8, fromlist=0x100340f80, level=0) at import.c:2842 #53 0x00000001001feb00 in PyImport_ImportModuleLevelObject (name=0x1006b04b8, globals=0x1006ac1a8, locals=0x1006ac1a8, fromlist=0x100340f80, level=0) at import.c:2904 #54 0x000000010019fd85 in builtin___import__ (self=0x100607420, args=0x1006a6960, kwds=0x0) at bltinmodule.c:195 #55 0x0000000100096214 in PyCFunction_Call (func=0x100607510, arg=0x1006a6960, kw=0x0) at methodobject.c:84 #56 0x0000000100010656 in PyObject_Call (func=0x100607510, arg=0x1006a6960, kw=0x0) at abstract.c:2150 #57 0x00000001001c597d in PyEval_CallObjectWithKeywords (func=0x100607510, arg=0x1006a6960, kw=0x0) at ceval.c:3932 #58 0x00000001001ba572 in PyEval_EvalFrameEx (f=0x100529180, throwflag=0) at ceval.c:2332 #59 0x00000001001c3681 in PyEval_EvalCodeEx (_co=0x1006bd1c0, globals=0x1006ac1a8, locals=0x1006ac1a8, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at ceval.c:3426 #60 0x00000001001aaf0b in PyEval_EvalCode (co=0x1006bd1c0, globals=0x1006ac1a8, locals=0x1006ac1a8) at ceval.c:771 #61 0x00000001001f2d62 in PyImport_ExecCodeModuleObject (name=0x1006938c8, co=0x1006bd1c0, pathname=0x1004aead0, cpathname=0x1004aead0) at import.c:868 #62 0x00000001001f820e in load_source_module (name=0x1006938c8, pathname=0x1006ad040, fp=0x7fff77c74f78) at import.c:1505 #63 0x00000001001fd345 in load_module (name=0x1006938c8, fp=0x7fff77c74f78, pathname=0x1006ad040, type=1, loader=0x0) at import.c:2477 #64 0x00000001002011f7 in import_submodule (mod=0x100340f80, subname=0x1006938c8, fullname=0x1006938c8) at import.c:3338 #65 0x00000001001ffb97 in load_next (mod=0x100340f80, altmod=0x100340f80, inputname=0x1006938c8, p_outputname=0x7fff5fbfd260, p_prefix=0x7fff5fbfd248) at import.c:3149 #66 0x00000001001fe5c7 in import_module_level (name=0x1006938c8, globals=0x1006a0e78, locals=0x1006a0e78, fromlist=0x10063a1b0, level=0) at import.c:2842 #67 0x00000001001feb00 in PyImport_ImportModuleLevelObject (name=0x1006938c8, globals=0x1006a0e78, locals=0x1006a0e78, fromlist=0x10063a1b0, level=0) at import.c:2904 #68 0x000000010019fd85 in builtin___import__ (self=0x100607420, args=0x1006a6330, kwds=0x0) at bltinmodule.c:195 #69 0x0000000100096214 in PyCFunction_Call (func=0x100607510, arg=0x1006a6330, kw=0x0) at methodobject.c:84 #70 0x0000000100010656 in PyObject_Call (func=0x100607510, arg=0x1006a6330, kw=0x0) at abstract.c:2150 #71 0x00000001001c597d in PyEval_CallObjectWithKeywords (func=0x100607510, arg=0x1006a6330, kw=0x0) at ceval.c:3932 #72 0x00000001001ba572 in PyEval_EvalFrameEx (f=0x100528b00, throwflag=0) at ceval.c:2332 #73 0x00000001001c3681 in PyEval_EvalCodeEx (_co=0x1006a7700, globals=0x1006a0e78, locals=0x1006a0e78, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at ceval.c:3426 #74 0x00000001001aaf0b in PyEval_EvalCode (co=0x1006a7700, globals=0x1006a0e78, locals=0x1006a0e78) at ceval.c:771 #75 0x00000001001f2d62 in PyImport_ExecCodeModuleObject (name=0x100693380, co=0x1006a7700, pathname=0x1004ae520, cpathname=0x1004ae520) at import.c:868 #76 0x00000001001f820e in load_source_module (name=0x100693380, pathname=0x1004a8600, fp=0x7fff77c74ee0) at import.c:1505 #77 0x00000001001fd345 in load_module (name=0x100693380, fp=0x7fff77c74ee0, pathname=0x1004a8600, type=1, loader=0x0) at import.c:2477 #78 0x00000001002011f7 in import_submodule (mod=0x100340f80, subname=0x100693380, fullname=0x100693380) at import.c:3338 #79 0x00000001001ffb97 in load_next (mod=0x100340f80, altmod=0x100340f80, inputname=0x100693380, p_outputname=0x7fff5fbff1b0, p_prefix=0x7fff5fbff198) at import.c:3149 #80 0x00000001001fe5c7 in import_module_level (name=0x100693380, globals=0x1006a0d30, locals=0x1006a0d30, fromlist=0x10061c6f0, level=0) at import.c:2842 #81 0x00000001001feb00 in PyImport_ImportModuleLevelObject (name=0x100693380, globals=0x1006a0d30, locals=0x1006a0d30, fromlist=0x10061c6f0, level=0) at import.c:2904 #82 0x000000010019fd85 in builtin___import__ (self=0x100607420, args=0x100621b10, kwds=0x0) at bltinmodule.c:195 #83 0x0000000100096214 in PyCFunction_Call (func=0x100607510, arg=0x100621b10, kw=0x0) at methodobject.c:84 #84 0x0000000100010656 in PyObject_Call (func=0x100607510, arg=0x100621b10, kw=0x0) at abstract.c:2150 #85 0x0000000100010863 in call_function_tail (callable=0x100607510, args=0x100621b10) at abstract.c:2182 #86 0x0000000100010ab7 in PyObject_CallFunction (callable=0x100607510, format=0x1002e379f "OOOOi") at abstract.c:2206 #87 0x000000010020226c in PyImport_Import (module_name=0x100693380) at import.c:3533 #88 0x00000001001fdf6f in PyImport_ImportModule (name=0x1002cdeb8 "runpy") at import.c:2728 #89 0x00000001002484f1 in RunModule (modname=0x10048b0d0, set_argv0=1) at main.c:171 #90 0x000000010024a0a8 in Py_Main (argc=5, argv=0x10048b040) at main.c:663 #91 0x000000010000128b in main (argc=5, argv=0x7fff5fbffa40) at python.c:63 ---------- assignee: ronaldoussoren components: Macintosh messages: 155572 nosy: Alzakath, ronaldoussoren priority: normal severity: normal status: open title: unicodeobject error on macosx in build process type: compile error versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 07:50:36 2012 From: report at bugs.python.org (Marc Schlaich) Date: Tue, 13 Mar 2012 06:50:36 +0000 Subject: [New-bugs-announce] [issue14285] Traceback wrong on ImportError while executing a package Message-ID: <1331621436.28.0.000669565075438.issue14285@psf.upfronthosting.co.za> New submission from Marc Schlaich : It is very simple to reproduce this error. There is an executable package: package/ __init__.py __main__.py The __init__ imports a missing module: import missing_module And the __main__ imports from it: from . import missing_module Now I get the following output which is not what I am expecting: C:\Python27\python.exe: No module named missing_module; 'package' is a package and cannot be directly executed ---------- messages: 155574 nosy: ms4py priority: normal severity: normal status: open title: Traceback wrong on ImportError while executing a package type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 11:25:30 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 13 Mar 2012 10:25:30 +0000 Subject: [New-bugs-announce] [issue14286] xxlimited.obj: unresolved external symbol __imp__PyObject_New Message-ID: <1331634330.54.0.0691133791003.issue14286@psf.upfronthosting.co.za> New submission from Stefan Krah : Linking fails on Windows 64-bit. Perhaps Py_LIMITED_API ifdefs are missing. Creating library C:\Users\stefan\hg\cpython\PCbuild\\amd64\\xxlimited.lib and object C:\Users\stefan\hg\c python\PCbuild\\amd64\\xxlimited.exp xxlimited.obj : error LNK2001: unresolved external symbol __imp__PyObject_New xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyType_FromSpec xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyDict_New xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyDict_DelItemString xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyDict_GetItem xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyObject_GenericGetAttr xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyUnicode_Type xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyExc_AttributeError xxlimited.obj : error LNK2001: unresolved external symbol __imp__Py_NoneStruct xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyArg_ParseTuple xxlimited.obj : error LNK2001: unresolved external symbol __imp__Py_NotImplementedStruct xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyObject_Free xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyErr_SetString xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyModule_Create2 xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyErr_NewException xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyLong_FromLong xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyBaseObject_Type xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyType_GenericNew xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyModule_AddObject xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyDict_SetItemString C:\Users\stefan\hg\cpython\PCbuild\\amd64\\xxlimited.pyd : fatal error LNK1120: 20 unresolved externals ---------- components: Build messages: 155588 nosy: brett.cannon, skrah priority: normal severity: normal stage: needs patch status: open title: xxlimited.obj: unresolved external symbol __imp__PyObject_New type: compile error versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 15:07:05 2012 From: report at bugs.python.org (Musashi Tamura) Date: Tue, 13 Mar 2012 14:07:05 +0000 Subject: [New-bugs-announce] [issue14287] sys.stdin.readline and KeyboardInterrupt on windows Message-ID: <1331647625.41.0.2361094593.issue14287@psf.upfronthosting.co.za> New submission from Musashi Tamura : I run z.py and press Ctrl-C. '' Traceback (most recent call last): File "z.py", line 7, in print(repr(x)) KeyboardInterrupt I think '' should not be printed. This sometimes occurs on Python 3.2.2 and 2.7.2 AMD64 on Windows7, but doesn't occur on ubuntu. ---------- components: Windows files: z.py messages: 155612 nosy: miwa priority: normal severity: normal status: open title: sys.stdin.readline and KeyboardInterrupt on windows type: behavior versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file24821/z.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 17:10:20 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 13 Mar 2012 16:10:20 +0000 Subject: [New-bugs-announce] [issue14288] Make iterators pickleable Message-ID: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> New submission from Kristj?n Valur J?nsson : A common theme in many talks last year about cloud computing was the need to suspend execution, pickle state, and resume it on a different node. This patch is the result of last year's stackless sprint at pycon, finally completed and submitted for review. Python does not currently support pickling of many run-time structures, but pickling for things like iterators is trivial. A large piece of Stackless' branch is to make sure that various run-time constructs are pickleable, including function objects. While this patch does not do that, it does add pickling for dictiter, and the lot. This makes it possible to have compilcated data sets, iterate through them, and pickle them in a semi-consumed state. Please note that a slight hack is needed to pickle some iterators. Many of these classes are namely "hidden" and there is no way to access their constructors by name. instead, an unpickling trick is to invoke "iter" on an object of the target type instead. Not the most elegant solution but I didn't want to complicate matters by adding iterator classes into namespaces. Where should stringiter live for example? Be a builtin like str? We also didn't aim to make all iterators copy.copy-able using the __reduce__ protocol. Some iterators actually use internal iterators themselves, and if a (non-deep) copy were to happen, we would have to shallow copy those internal objects. Instead, we just return the internal iterator object directly from __reduce__ and allow recursive pickling to proceed. ---------- files: pickling.patch keywords: patch messages: 155626 nosy: krisvale, loewis, michael.foord priority: normal severity: normal status: open title: Make iterators pickleable type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file24822/pickling.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:39:38 2012 From: report at bugs.python.org (Nam Nguyen) Date: Tue, 13 Mar 2012 19:39:38 +0000 Subject: [New-bugs-announce] [issue14289] Prebuilt CHM file on Docs download page Message-ID: <1331667578.7.0.0463792055808.issue14289@psf.upfronthosting.co.za> New submission from Nam Nguyen : Before 2.7, one can easily find .CHM files in the Documentation download page. When 2.7 come out, the only way to get CHM files is downloading the Windows installers (EXE or MSI), installing it on Windows, and grabbing the CHM files. This is unwieldy. I am on a Mac at work, have a desktop running Linux and Windows at home. In all cases, I usually rely on the CHM file. It is self-packaged, indexable, and easily searchable. There are CHM readers out there that work across different OSes such as the cross platform xCHM. Therefore, I'd like to request for a prebuilt .CHM file for download, in addition to what there already are. ---------- assignee: docs at python components: Documentation messages: 155650 nosy: Nam.Nguyen, docs at python priority: normal severity: normal status: open title: Prebuilt CHM file on Docs download page _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:40:42 2012 From: report at bugs.python.org (Robert) Date: Tue, 13 Mar 2012 19:40:42 +0000 Subject: [New-bugs-announce] [issue14290] Importing script as module causes ImportError with pickle.load Message-ID: <1331667642.01.0.680129740358.issue14290@psf.upfronthosting.co.za> New submission from Robert : I implemented a data-structure as an object in a script, let's call it objectScript.py. I'm using this data-structure in other scripts like so: from objectScript import data-structure Populating this data-structure requires quite a bit of time, so when I'm done with it, I like to pickle it. However, if I try to load it from the pickled file, I get the following error: ImportError: No module named objectScript However, if I replace my 'from objectScript import data-structure' statement with the actual data-structure class definition from the objectScript.py file when I am pickling the object but then revert to the import statement when I am unpickling the object, everything works fine. ---------- components: Library (Lib) messages: 155651 nosy: rj3d priority: normal severity: normal status: open title: Importing script as module causes ImportError with pickle.load type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:55:34 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Mar 2012 19:55:34 +0000 Subject: [New-bugs-announce] [issue14291] Regression in Python3 of email handling of unicode strings in headers Message-ID: <1331668534.02.0.642658515735.issue14291@psf.upfronthosting.co.za> New submission from R. David Murray : In Python2, this works: >>> from email.mime.text import MIMEText >>> m = MIMEText('abc') >>> str(m) 'From nobody Tue Mar 13 15:44:59 2012\nContent-Type: text/plain; charset="us-ascii"\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\n\nabc' >>> m['Subject'] = u'? test' >>> str(m) 'From nobody Tue Mar 13 15:48:11 2012\nContent-Type: text/plain; charset="us-ascii"\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\nSubject: =?utf-8?q?=C3=89_test?=\n\nabc' That is, unicode string automatically get turned into encoded words. In Python3 this no longer works: >>> from email.mime.text import MIMEText >>> m = MIMEText('abc') >>> str(m) 'Content-Type: text/plain; charset="us-ascii"\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\n\nabc' >>> m['Subject'] = u'? test' >>> str(m) Traceback (most recent call last): File "", line 1, in File "/home/rdmurray/python/p33/Lib/email/message.py", line 154, in __str__ return self.as_string() File "/home/rdmurray/python/p33/Lib/email/message.py", line 168, in as_string g.flatten(self, unixfrom=unixfrom) File "/home/rdmurray/python/p33/Lib/email/generator.py", line 99, in flatten self._write(msg) File "/home/rdmurray/python/p33/Lib/email/generator.py", line 152, in _write self._write_headers(msg) File "/home/rdmurray/python/p33/Lib/email/generator.py", line 186, in _write_headers header_name=h) File "/home/rdmurray/python/p33/Lib/email/header.py", line 205, in __init__ self.append(s, charset, errors) File "/home/rdmurray/python/p33/Lib/email/header.py", line 286, in append s.encode(output_charset, errors) UnicodeEncodeError: 'ascii' codec can't encode character '\xc9' in position 0: ordinal not in range(128) Presumably the problem is that the Python2 code tests for 'string' and if it isn't string handles it by CTE encoding it. In Python3 everything is a string. Probably what should happen is the encoding error should be caught, and the CTE encoding done at that point, based on the model of how Python2 handled unicode strings. ---------- assignee: r.david.murray components: Library (Lib) keywords: easy messages: 155656 nosy: aikinci, r.david.murray priority: high severity: normal stage: needs patch status: open title: Regression in Python3 of email handling of unicode strings in headers type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 21:44:25 2012 From: report at bugs.python.org (Nicholas Riley) Date: Tue, 13 Mar 2012 20:44:25 +0000 Subject: [New-bugs-announce] [issue14292] OS X installer build script doesn't set $CXX, so it ends up as "c++" Message-ID: <1331671465.67.0.741908765122.issue14292@psf.upfronthosting.co.za> New submission from Nicholas Riley : % python build-installer.py \ --sdk-path=/Developer/SDKs/MacOSX10.6.sdk \ --universal-archs=intel \ --dep-target=10.6 Settings: * Source directory: /Users/nicholas/src/cpython * Build directory: /tmp/_py * SDK location: /Developer/SDKs/MacOSX10.6.sdk * Third-party source: /tmp/_py/third-party * Deployment target: 10.6 * Universal architectures: ('i386', 'x86_64') * C compiler: gcc-4.2 [...] Building a universal python for intel architectures [...] checking for c++... c++ configure: WARNING: By default, distutils will build C++ extension modules with "c++". If this is not intended, then set CXX on the configure command line. ---------- assignee: ronaldoussoren components: Macintosh messages: 155663 nosy: ned.deily, nriley, ronaldoussoren priority: normal severity: normal status: open title: OS X installer build script doesn't set $CXX, so it ends up as "c++" versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:12:53 2012 From: report at bugs.python.org (Brian Jones) Date: Tue, 13 Mar 2012 22:12:53 +0000 Subject: [New-bugs-announce] [issue14293] Message methods delegated via __getattr__ inaccessible using super(). Message-ID: <1331676773.49.0.0306891177672.issue14293@psf.upfronthosting.co.za> New submission from Brian Jones : In email6, the message.Message class tries to delegate calls to methods not defined in Message to message._HeaderList. However, delegating in this way makes the methods inaccessible when accessing them through a call to super(). This comes into play in the http.HTTPMessage class, which attempts to call the _HeaderList 'get' method as 'super().get()'. An AttributeError is raised in this case, because super is only examining the class, and not the instance, and isn't executing __getattr__ to get at methods defined in _HeaderList methods. I've attached a patch that only patches the appropriate test module to add a test to prove the failure. The fix involves a bit more complexity, and I've had some trouble getting my brain to not reject the kind of conflation of concepts and overlapping of responsibility that needs to take place to implement the ideas I was able to come up with. I'm happy to help implement a sane solution if anyone has other ideas. A couple of ideas that came up (at the PyCon sprints) were: 1. Make _HeaderList *not* extend 'list', and then have Message inherit from _HeaderList. However, that means basically reimplementing all of the methods in the 'list' interface inside of _HeaderList, and by extension, Message becomes something of a 'list' object for the purpose of header manipulation, but not for anything else (like, say, payload). 2. Just get rid of _HeaderList and put it all inside of Message. See item 1 for issues with this idea. 3. Expose a public 'headers' attribute, which opens a lot of doors in terms of design flexibility, elegance, and cleanliness, but changes the API. 4. Create a base class that defines the non-list-specific interface for _HeaderList. _HeaderList would then inherit from this class, adding the list-specific methods on top, and Message would inherit it and only override non-list-specific methods. This could have some benefits in terms of testing, but arguably it muddies the waters for those maintaining/extending the _HeaderList or Message code. Other ideas? Also let me know if I've done something silly in writing the test to trigger the problem. ---------- components: Library (Lib) files: msg_api_subclass_bug_test.patch keywords: patch messages: 155679 nosy: Brian.Jones, r.david.murray priority: normal severity: normal status: open title: Message methods delegated via __getattr__ inaccessible using super(). versions: Python 3.3 Added file: http://bugs.python.org/file24829/msg_api_subclass_bug_test.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:44:03 2012 From: report at bugs.python.org (Preston Holmes) Date: Wed, 14 Mar 2012 00:44:03 +0000 Subject: [New-bugs-announce] [issue14294] Requirements are not properly copied into metatdata of dist-info Message-ID: <1331685843.64.0.290498671343.issue14294@psf.upfronthosting.co.za> New submission from Preston Holmes : the egginfo_to_distinfo util method is not converting requirements properly from a requirements.txt file into the metadata file of the dist-info dir ---------- assignee: eric.araujo components: Distutils2 messages: 155696 nosy: Preston.Holmes, alexis, eric.araujo, tarek priority: normal severity: normal status: open title: Requirements are not properly copied into metatdata of dist-info type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 02:20:38 2012 From: report at bugs.python.org (Michael Foord) Date: Wed, 14 Mar 2012 01:20:38 +0000 Subject: [New-bugs-announce] [issue14295] PEP 417: adding mock module Message-ID: <1331688038.8.0.131181977771.issue14295@psf.upfronthosting.co.za> New submission from Michael Foord : PEP 417: Including mock in the Standard Library http://www.python.org/dev/peps/pep-0417/ Tasks: * Add mock with tests * Cleanup mock code to remove Python 2 compatibility * Add documentation I'll close this issue when all the tasks are complete. ---------- assignee: michael.foord components: Library (Lib) messages: 155705 nosy: michael.foord priority: normal severity: normal status: open title: PEP 417: adding mock module versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 02:23:01 2012 From: report at bugs.python.org (=?utf-8?q?Herv=C3=A9_Coatanhay?=) Date: Wed, 14 Mar 2012 01:23:01 +0000 Subject: [New-bugs-announce] [issue14296] Compilation error on CentOS 5.8 Message-ID: <1331688181.08.0.800421526529.issue14296@psf.upfronthosting.co.za> New submission from Herv? Coatanhay : Linux Version: 2.6.18-238.19.1.el5 / CentOS release 5.8 (Final) Since changeset 71704:89e92e684b37 , I have the following compilation error: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c: In function ?cpu_set_dealloc?: ./Modules/posixmodule.c:4769: attention : implicit declaration of function ?CPU_FREE? ./Modules/posixmodule.c: In function ?make_new_cpu_set?: ./Modules/posixmodule.c:4786: attention : implicit declaration of function ?CPU_ALLOC_SIZE? ./Modules/posixmodule.c:4787: attention : implicit declaration of function ?CPU_ALLOC? ./Modules/posixmodule.c:4787: attention : assignment makes pointer from integer without a cast ./Modules/posixmodule.c:4793: attention : implicit declaration of function ?CPU_ZERO_S? ./Modules/posixmodule.c: In function ?cpu_set_set?: ./Modules/posixmodule.c:4847: attention : implicit declaration of function ?CPU_SET_S? ./Modules/posixmodule.c: In function ?cpu_set_count?: ./Modules/posixmodule.c:4858: attention : implicit declaration of function ?CPU_COUNT_S? ./Modules/posixmodule.c: In function ?cpu_set_clear?: ./Modules/posixmodule.c:4871: attention : implicit declaration of function ?CPU_CLR_S? ./Modules/posixmodule.c: In function ?cpu_set_isset?: ./Modules/posixmodule.c:4885: attention : implicit declaration of function ?CPU_ISSET_S? ./Modules/posixmodule.c: In function ?cpu_set_richcompare?: ./Modules/posixmodule.c:4910: attention : implicit declaration of function ?CPU_EQUAL_S? ./Modules/posixmodule.c: In function ?do_cpu_set_and?: ./Modules/posixmodule.c:4946: attention : implicit declaration of function ?CPU_AND_S? ./Modules/posixmodule.c: In function ?do_cpu_set_or?: ./Modules/posixmodule.c:4947: attention : implicit declaration of function ?CPU_OR_S? ./Modules/posixmodule.c: In function ?do_cpu_set_xor?: ./Modules/posixmodule.c:4948: attention : implicit declaration of function ?CPU_XOR_S? ... gcc -pthread -Xlinker -export-dynamic -o python Modules/python.o libpython3.3m.a -lpthread -ldl -lutil -lm libpython3.3m.a(posixmodule.o): In function `cpu_set_zero': /home/proexp/cpython2/./Modules/posixmodule.c:4897: undefined reference to `CPU_ZERO_S' libpython3.3m.a(posixmodule.o): In function `cpu_set_count': /home/proexp/cpython2/./Modules/posixmodule.c:4858: undefined reference to `CPU_COUNT_S' libpython3.3m.a(posixmodule.o): In function `cpu_set_clear': /home/proexp/cpython2/./Modules/posixmodule.c:4871: undefined reference to `CPU_CLR_S' libpython3.3m.a(posixmodule.o): In function `make_new_cpu_set': /home/proexp/cpython2/./Modules/posixmodule.c:4786: undefined reference to `CPU_ALLOC_SIZE' /home/proexp/cpython2/./Modules/posixmodule.c:4787: undefined reference to `CPU_ALLOC' /home/proexp/cpython2/./Modules/posixmodule.c:4793: undefined reference to `CPU_ZERO_S' libpython3.3m.a(posixmodule.o): In function `do_cpu_set_or': /home/proexp/cpython2/./Modules/posixmodule.c:4947: undefined reference to `CPU_OR_S' libpython3.3m.a(posixmodule.o): In function `do_cpu_set_xor': /home/proexp/cpython2/./Modules/posixmodule.c:4948: undefined reference to `CPU_XOR_S' libpython3.3m.a(posixmodule.o): In function `do_cpu_set_and': /home/proexp/cpython2/./Modules/posixmodule.c:4946: undefined reference to `CPU_AND_S' libpython3.3m.a(posixmodule.o): In function `cpu_set_richcompare': /home/proexp/cpython2/./Modules/posixmodule.c:4910: undefined reference to `CPU_EQUAL_S' libpython3.3m.a(posixmodule.o): In function `cpu_set_dealloc': /home/proexp/cpython2/./Modules/posixmodule.c:4769: undefined reference to `CPU_FREE' libpython3.3m.a(posixmodule.o): In function `do_cpu_set_xor': /home/proexp/cpython2/./Modules/posixmodule.c:4948: undefined reference to `CPU_XOR_S' libpython3.3m.a(posixmodule.o): In function `do_cpu_set_and': /home/proexp/cpython2/./Modules/posixmodule.c:4946: undefined reference to `CPU_AND_S' libpython3.3m.a(posixmodule.o): In function `do_cpu_set_or': /home/proexp/cpython2/./Modules/posixmodule.c:4947: undefined reference to `CPU_OR_S' libpython3.3m.a(posixmodule.o): In function `cpu_set_set': /home/proexp/cpython2/./Modules/posixmodule.c:4847: undefined reference to `CPU_SET_S' libpython3.3m.a(posixmodule.o): In function `cpu_set_isset': /home/proexp/cpython2/./Modules/posixmodule.c:4885: undefined reference to `CPU_ISSET_S' ---------- components: Build files: sched.h messages: 155706 nosy: Alzakath priority: normal severity: normal status: open title: Compilation error on CentOS 5.8 versions: Python 3.3 Added file: http://bugs.python.org/file24836/sched.h _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 03:03:00 2012 From: report at bugs.python.org (Paul McMillan) Date: Wed, 14 Mar 2012 02:03:00 +0000 Subject: [New-bugs-announce] [issue14297] Custom string formatter doesn't work like builtin str.format Message-ID: <1331690580.32.0.967691211794.issue14297@psf.upfronthosting.co.za> New submission from Paul McMillan : In Python 2.7, I can use an empty format string to indicate automatically numbered positional arguments when formatting the builtin string object. http://docs.python.org/release/2.7/library/string.html#format-string-syntax If I subclass string.Formatter, this expected functionality doesn't work. http://docs.python.org/release/2.7/library/string.html#string-formatting Python 2.7.2+ (default, Oct 4 2011, 20:06:09) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from string import Formatter >>> class MyFormatter(Formatter): ... pass ... >>> fs_a = 'a{0}b{1}c' >>> fs_b = 'a{}b{}c' >>> fs_a.format(1, 2) 'a1b2c' >>> fs_b.format(1, 2) 'a1b2c' >>> fmt = MyFormatter() >>> fmt.format(fs_a, 1, 2) 'a1b2c' >>> fmt.format(fs_b, 1, 2) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/string.py", line 545, in format return self.vformat(format_string, args, kwargs) File "/usr/lib/python2.7/string.py", line 549, in vformat result = self._vformat(format_string, args, kwargs, used_args, 2) File "/usr/lib/python2.7/string.py", line 571, in _vformat obj, arg_used = self.get_field(field_name, args, kwargs) File "/usr/lib/python2.7/string.py", line 632, in get_field obj = self.get_value(first, args, kwargs) File "/usr/lib/python2.7/string.py", line 591, in get_value return kwargs[key] KeyError: '' ---------- messages: 155708 nosy: PaulMcMillan priority: normal severity: normal status: open title: Custom string formatter doesn't work like builtin str.format versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 03:51:17 2012 From: report at bugs.python.org (Chris Rebert) Date: Wed, 14 Mar 2012 02:51:17 +0000 Subject: [New-bugs-announce] [issue14298] account for dict randomization in Design & History FAQ Message-ID: <1331693477.45.0.106920867641.issue14298@psf.upfronthosting.co.za> New submission from Chris Rebert : The randomization introduced by the fix for issue 13703 means that the example string hash values given in http://docs.python.org/dev/faq/design.html#how-are-dictionaries-implemented are liable to become more difficult to reproduce (in fact, the example already currently implicitly assumes a 32-bit build). Either the phrasing should be changed to emphasize that these are *possible* values the strings *might* hash to, or no concrete hash values should be given at all. ---------- assignee: docs at python components: Documentation messages: 155714 nosy: cvrebert, docs at python priority: normal severity: normal status: open title: account for dict randomization in Design & History FAQ versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 04:21:02 2012 From: report at bugs.python.org (Nicholas Riley) Date: Wed, 14 Mar 2012 03:21:02 +0000 Subject: [New-bugs-announce] [issue14299] OS X installer build script: permissions not ensured Message-ID: <1331695262.49.0.711005270468.issue14299@psf.upfronthosting.co.za> New submission from Nicholas Riley : The OS X installer build script does not ensure that files had the correct permissions when being packaged; some files' permissions were affected by your umask when running the build script, and others by the permissions of the source tree. This patch sets the umask, so script-created files get correct permissions, wraps shutil.copy so it does the same thing, and adapts the existing os.walk-based permissions fixer to run over everything else. It also removes group writability for the Python framework, as this is more secure and consistent with how Apple installs Python in 10.7 and later. If you need to install a Python package without being root, either use virtualenv/pythonv, ~/Library or ~/.local. Ned Deily and I discussed this at the PyCon sprints and he will update the documentation to match. ---------- assignee: ronaldoussoren components: Macintosh files: perm.patch keywords: patch messages: 155716 nosy: nriley, ronaldoussoren priority: normal severity: normal status: open title: OS X installer build script: permissions not ensured type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file24837/perm.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 13:59:46 2012 From: report at bugs.python.org (sbt) Date: Wed, 14 Mar 2012 12:59:46 +0000 Subject: [New-bugs-announce] [issue14300] dup_socket() on Windows should use WSA_FLAG_OVERLAPPED Message-ID: <1331729986.5.0.388536898962.issue14300@psf.upfronthosting.co.za> New submission from sbt : According to Microsoft's documentation sockets created using socket() have the overlapped attribute, but sockets created with WSASocket() do not unless you pass the WSA_FLAG_OVERLAPPED flag. The documentation for WSADuplicateSocket() says If the source process uses the socket function to create the socket, the destination process must pass the WSA_FLAG_OVERLAPPED flag to its WSASocket function call. This means that dup_socket() in socketmodule.c should use return WSASocket(FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, &info, 0, WSA_FLAG_OVERLAPPED); instead of return WSASocket(FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, &info, 0, 0); (On Windows, the new multiprocessing.connection.wait() function depends on the overlapped attribute, although it is primarily intended for use with pipe connections not sockets.) Patch attached. ---------- files: socket_dup.patch keywords: patch messages: 155748 nosy: sbt priority: normal severity: normal status: open title: dup_socket() on Windows should use WSA_FLAG_OVERLAPPED versions: Python 3.3 Added file: http://bugs.python.org/file24841/socket_dup.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 15:34:18 2012 From: report at bugs.python.org (Kees Bos) Date: Wed, 14 Mar 2012 14:34:18 +0000 Subject: [New-bugs-announce] [issue14301] xmlrpc client transport and threading problem Message-ID: <1331735658.17.0.761953257498.issue14301@psf.upfronthosting.co.za> New submission from Kees Bos : The transport (second parameter to ServerProxy) must be unique for every thread. This was not the case in pre-python2.7. It is caused by the reuse of the connection (stored in _connection). This could be handled by saving the thread id too. I don't know whether this is a coding error or a documentation omission. ---------- components: None messages: 155751 nosy: kees priority: normal severity: normal status: open title: xmlrpc client transport and threading problem type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 17:29:35 2012 From: report at bugs.python.org (Brian Curtin) Date: Wed, 14 Mar 2012 16:29:35 +0000 Subject: [New-bugs-announce] [issue14302] Move python.exe to bin/ Message-ID: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> New submission from Brian Curtin : After talks at PyCon with several people, python.exe will live in C:\Python33\bin rather than C:\Python33 to come more in line with the Unix layout. This will also simplify another issue with the Path option for the 3.3 installer as well as packaging's target directory for top-level scripts (used to be Scripts/, will be bin/). ---------- assignee: brian.curtin components: Build, Installation, Windows messages: 155762 nosy: brian.curtin priority: high severity: normal stage: needs patch status: open title: Move python.exe to bin/ type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 17:58:18 2012 From: report at bugs.python.org (Shane Hansen) Date: Wed, 14 Mar 2012 16:58:18 +0000 Subject: [New-bugs-announce] [issue14303] Incorrect documentation for socket.py on linux Message-ID: <1331744298.15.0.025379356395.issue14303@psf.upfronthosting.co.za> New submission from Shane Hansen : The python docs state that for socket.makefile "The file object references a dup()ped version of the socket file descriptor, so the file object and socket object may be closed or garbage-collected independently." In fact for socket.py dup() is never called, and no additional files are opened. Instead an object is returned which uses the original socket and does buffering. For me, this is the desired behaviour, but just thought I'd mention the docs were off. ---------- assignee: docs at python components: Documentation, IO files: test.py messages: 155768 nosy: Shane.Hansen, docs at python, georg.brandl, pitrou priority: normal severity: normal status: open title: Incorrect documentation for socket.py on linux type: behavior versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file24843/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:01:10 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 14 Mar 2012 21:01:10 +0000 Subject: [New-bugs-announce] [issue14304] Implement utf-8-bmp codec Message-ID: <1331758870.76.0.606902244655.issue14304@psf.upfronthosting.co.za> New submission from Andrew Svetlov : Tkinter (and IDLE specially) can use only UCS-2 characters. In PyShell IDLE tries to escape non-ascii. To better result we should to escape only non-BMP chars leaving BMP characters untouched. ---------- assignee: asvetlov messages: 155793 nosy: asvetlov priority: normal severity: normal status: open title: Implement utf-8-bmp codec versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:17:15 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 14 Mar 2012 21:17:15 +0000 Subject: [New-bugs-announce] [issue14305] fix typos Message-ID: <1331759835.12.0.380682525613.issue14305@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- hgrepos: 116 nosy: tshepang priority: normal severity: normal status: open title: fix typos _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:41:19 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 14 Mar 2012 21:41:19 +0000 Subject: [New-bugs-announce] [issue14306] try/except block is both efficient and expensive? Message-ID: <1331761279.09.0.327606618026.issue14306@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : In Doc/faq/design.rst, we got this text: "A try/except block is extremely efficient. Actually catching an exception is expensive." The 2 sentences appear contradictory. ---------- assignee: docs at python components: Documentation messages: 155798 nosy: docs at python, tshepang priority: normal severity: normal status: open title: try/except block is both efficient and expensive? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 00:22:58 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 14 Mar 2012 23:22:58 +0000 Subject: [New-bugs-announce] [issue14307] Make subclassing SocketServer simpler for non-blocking frameworks Message-ID: <1331767378.71.0.470789063251.issue14307@psf.upfronthosting.co.za> New submission from Kristj?n Valur J?nsson : SocketServer employs select.select to achieve timeout behaviour on accepting new requests. Unfortunately, the way this is implemented makes it tricky to bypass this behaviour for users that want to achieve timeout in a different manner. This defect presents two patches. One shows how we delegate the timeout to a new function, _get_request_timeout(), that can be overridden by subclasses. The second shows a concrete version of this function, one that uses the socket's own timeout property rather than select, to get the same behaviour. ---------- files: 75646.patch keywords: patch messages: 155816 nosy: krisvale priority: normal severity: normal status: open title: Make subclassing SocketServer simpler for non-blocking frameworks type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file24850/75646.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 00:48:20 2012 From: report at bugs.python.org (Dustin Kirkland) Date: Wed, 14 Mar 2012 23:48:20 +0000 Subject: [New-bugs-announce] [issue14308] Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'", ) in ignored Message-ID: <1331768900.76.0.717773710833.issue14308@psf.upfronthosting.co.za> New submission from Dustin Kirkland : My Apache2 logs are filled with the following error kicked out by my python wsgi script: [Wed Mar 14 18:16:38 2012] [error] Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in ignored I was able to silence these with a simple conditional in /usr/lib/python2.7/threading.pyc: - del self._Thread__block + if hasattr(self, '_Thread__block'): + del self._Thread__block Full patch attached. ---------- files: thread.py.patch keywords: patch messages: 155818 nosy: Dustin.Kirkland priority: normal severity: normal status: open title: Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in ignored type: crash versions: Python 2.7 Added file: http://bugs.python.org/file24852/thread.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 01:52:02 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Mar 2012 00:52:02 +0000 Subject: [New-bugs-announce] [issue14309] Deprecate time.clock() Message-ID: <1331772722.48.0.0484604711161.issue14309@psf.upfronthosting.co.za> New submission from STINNER Victor : Python 3.3 has 3 functions to get time: - time.clock() - time.steady() - time.time() Antoine Pitrou suggested to deprecated time.clock() in msg120149 (issue #10278). "The problem is time.clock(), since it does two wildly different things depending on the OS. I would suggest to deprecate time.clock() at the same time as we add time.wallclock(). For the Unix-specific definition of time.clock(), there is already os.times() (which gives even richer information)." (time.wallclock was the old name of time.steady) ---------- components: Library (Lib) messages: 155831 nosy: haypo, pitrou priority: normal severity: normal status: open title: Deprecate time.clock() versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 02:38:06 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 15 Mar 2012 01:38:06 +0000 Subject: [New-bugs-announce] [issue14310] Socket duplication for windows Message-ID: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> New submission from Kristj?n Valur J?nsson : winsock natively supports the duplciation of sockets for use on different processes. This patch proposes to add that functionality: socket.duplicate(target_pid) gets a bytes representation of the duplicate socket, usable for the target process. socket.socket(x,y,z,data) creates the socket object from the bytes representation. The patch contains a test using multiprocessing that works. Note that multiprocessing already contains its own code to achieve this, and that code can possibly be simplified with this patch. Note also the new function "duplicate." Perhaps "dup(target_pid) would be better? But it would have different semantics. Also notice how we overload the "fromfd" parameter in socket.socket() to recreate a socket from a bytes representation. Maybe this is not ideal? Looking for thoughs here. ---------- components: Interpreter Core files: duplicate.patch keywords: patch messages: 155842 nosy: krisvale priority: normal severity: normal status: open title: Socket duplication for windows type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file24854/duplicate.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 03:24:52 2012 From: report at bugs.python.org (Sean Wang) Date: Thu, 15 Mar 2012 02:24:52 +0000 Subject: [New-bugs-announce] [issue14311] ConfigParser does not parse utf-8 files with BOM bytes Message-ID: <1331778292.28.0.574531846286.issue14311@psf.upfronthosting.co.za> New submission from Sean Wang : ConfigParser failed to parse a utf-8 file with BOM bytes('\xef\xbb\xbf'), it would raise ConfigParser.MissingSectionHeaderError. I think that other files with BOM would have the same problem; because the argument "SECTCRE" does not consider the BOM conditions. Now the workaround is like below: cp=ConfigParser.ConfigParser() cfgfile=os.path.join(curpath,'config.cfg') cp.readfp(codecs.open(cfgfile, 'r','utf-8-sig')) ---------- components: Library (Lib) messages: 155843 nosy: Sean.Wang priority: normal severity: normal status: open title: ConfigParser does not parse utf-8 files with BOM bytes type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 05:07:55 2012 From: report at bugs.python.org (Berker Peksag) Date: Thu, 15 Mar 2012 04:07:55 +0000 Subject: [New-bugs-announce] [issue14312] Convert PEP 7 to reStructuredText for readability purposes Message-ID: <1331784475.88.0.114777219074.issue14312@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- assignee: docs at python components: Documentation files: pep-0007_v1.diff keywords: patch nosy: berker.peksag, docs at python priority: normal severity: normal status: open title: Convert PEP 7 to reStructuredText for readability purposes type: enhancement Added file: http://bugs.python.org/file24856/pep-0007_v1.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 05:35:35 2012 From: report at bugs.python.org (Sergey Dorofeev) Date: Thu, 15 Mar 2012 04:35:35 +0000 Subject: [New-bugs-announce] [issue14313] zipfile does not unpack files from archive (files extracted have zero length) Message-ID: <1331786135.76.0.307574406169.issue14313@psf.upfronthosting.co.za> New submission from Sergey Dorofeev : unzip does extract files but zipfile no works fine with python2.7 but fails with python 3.2.2 tested on solaris 11 express and windows xp >>> import zipfile >>> zipfile.ZipFile("test.zip") >>> z=_ >>> z.namelist > >>> z.namelist() ['19A7B5A4.PKT'] >>> z.read('19A7B5A4.PKT') b'' ---------- components: Library (Lib) files: test.zip messages: 155854 nosy: fidoman priority: normal severity: normal status: open title: zipfile does not unpack files from archive (files extracted have zero length) type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file24857/test.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 05:59:35 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 15 Mar 2012 04:59:35 +0000 Subject: [New-bugs-announce] [issue14314] logging smtp handler (and test) timeout issue Message-ID: <1331787575.82.0.497209791656.issue14314@psf.upfronthosting.co.za> New submission from R. David Murray : I'm working on a patch that updates smtpd, and when I ran the full test suite I got a hang in test_logging. This means there's a bug in my update, but there is also a bug in the logging test. But see below for another issue I noticed while investigating this, that is the real focus of this report. This traceback occurs before the test hang: test_basic (test.test_logging.SMTPHandlerTest) ... error: uncaptured python exception, closing channel (:TestSMTPChannel inst) Traceback (most recent call last): File "/home/rdmurray/python/p33/Lib/logging/handlers.py", line 935, in emit smtp.sendmail(self.fromaddr, self.toaddrs, msg) File "/home/rdmurray/python/p33/Lib/smtplib.py", line 741, in sendmail self.ehlo_or_helo_if_needed() File "/home/rdmurray/python/p33/Lib/smtplib.py", line 550, in ehlo_or_helo_if_needed if not (200 <= self.ehlo()[0] <= 299): File "/home/rdmurray/python/p33/Lib/smtplib.py", line 417, in ehlo (code, msg) = self.getreply() File "/home/rdmurray/python/p33/Lib/smtplib.py", line 372, in getreply raise SMTPServerDisconnected("Connection unexpectedly closed") smtplib.SMTPServerDisconnected: Connection unexpectedly closed Logged from file , line 0 I think the event.wait() in the test should have a timeout; setting it to, say, 5 lets the tests complete (with a failure) in this situation. Now the real issue: Looking at the smtp handler code, I notice that unlike the socket handler it doesn't provide any way to set the timeout. This means it could potentially hang forever trying to log an event, which while not related to the above issue is something that I think should be fixed. I've marked this as behavior, since the SMTP connection should probably get a reasonable default timeout even in bug fix releases, but in 3.3 you'll probably want to make it settable and perhaps shorten the default relative to what you use for the maint releases. ---------- components: Library (Lib) keywords: easy messages: 155858 nosy: r.david.murray, vinay.sajip priority: normal severity: normal stage: needs patch status: open title: logging smtp handler (and test) timeout issue type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 12:15:46 2012 From: report at bugs.python.org (pleed) Date: Thu, 15 Mar 2012 11:15:46 +0000 Subject: [New-bugs-announce] [issue14315] zipfile.ZipFile() unable to open zip File Message-ID: <1331810146.14.0.995585507713.issue14315@psf.upfronthosting.co.za> New submission from pleed : zipfile.ZipFile("bla.apk") crashes, but should not since other tools work perfectly with this file. Python 2.7.2+ (default, Oct 4 2011, 20:06:09) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import zipfile >>> zipfile.ZipFile("bla.apk") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/zipfile.py", line 710, in __init__ self._GetContents() File "/usr/lib/python2.7/zipfile.py", line 744, in _GetContents self._RealGetContents() File "/usr/lib/python2.7/zipfile.py", line 803, in _RealGetContents x._decodeExtra() File "/usr/lib/python2.7/zipfile.py", line 369, in _decodeExtra tp, ln = unpack(' _______________________________________ From report at bugs.python.org Thu Mar 15 15:25:19 2012 From: report at bugs.python.org (Berker Peksag) Date: Thu, 15 Mar 2012 14:25:19 +0000 Subject: [New-bugs-announce] [issue14316] Broken link in grammar.html Message-ID: <1331821519.86.0.740460407781.issue14316@psf.upfronthosting.co.za> New submission from Berker Peksag : In the rationale section: http://docs.python.org/devguide/grammar.html#rationale This link is not working: http://docs.python.org/devguide/HowtoChangePython%27sGrammar ---------- components: Devguide messages: 155888 nosy: berker.peksag, ezio.melotti priority: normal severity: normal status: open title: Broken link in grammar.html _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 16:15:25 2012 From: report at bugs.python.org (Pierre Lecointre) Date: Thu, 15 Mar 2012 15:15:25 +0000 Subject: [New-bugs-announce] [issue14317] index.simple module licking in distutils2 Message-ID: <1331824525.48.0.828054000089.issue14317@psf.upfronthosting.co.za> New submission from Pierre Lecointre : Got an error, in debian squeeze (python 2.6) and Ubuntu 11.10 (python 2.7) : plec at cezoffsrv04:~$ python Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from distutils2.index.simple import Crawler Traceback (most recent call last): File "", line 1, in ImportError: No module named index.simple >>> ---------- assignee: eric.araujo components: Distutils2 messages: 155893 nosy: Pierre.Lecointre, alexis, eric.araujo, tarek priority: normal severity: normal status: open title: index.simple module licking in distutils2 type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 16:38:21 2012 From: report at bugs.python.org (Jim Jewett) Date: Thu, 15 Mar 2012 15:38:21 +0000 Subject: [New-bugs-announce] [issue14318] clarify http://docs.python.org/dev/library/time.html#time.steady Message-ID: <1331825901.59.0.838853491009.issue14318@psf.upfronthosting.co.za> Changes by Jim Jewett : ---------- assignee: docs at python components: Documentation nosy: Jim.Jewett, docs at python priority: normal severity: normal status: open title: clarify http://docs.python.org/dev/library/time.html#time.steady type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:26:57 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Thu, 15 Mar 2012 16:26:57 +0000 Subject: [New-bugs-announce] [issue14319] cleanup index switching mechanism on packaging.pypi Message-ID: <1331828817.11.0.332015599072.issue14319@psf.upfronthosting.co.za> New submission from Alexis Metaireau : I need to do some general cleanup on packaging/d2, and especially on this bit. Currently, the implementation is way too complicated for what it does. ---------- assignee: alexis components: Distutils2 messages: 155903 nosy: alexis, tarek priority: normal severity: normal status: open title: cleanup index switching mechanism on packaging.pypi type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:55:45 2012 From: report at bugs.python.org (Matt Joiner) Date: Thu, 15 Mar 2012 16:55:45 +0000 Subject: [New-bugs-announce] [issue14320] set.add can return boolean indicate newly added item Message-ID: <1331830545.62.0.37534358264.issue14320@psf.upfronthosting.co.za> New submission from Matt Joiner : set.add can return True to indicate a newly added item to the set, or False if the item was already present. The C function PySet_Add returns -1 on error, and 0 on success currently. This is extended to return 1 if the item is newly added, and 0 if it was already present. Precedents exist for PySet_Contains and PySet_Discard with the same semantics. There are only 3 calls that need to be patched in the entire core, these are included in the patch. The Python function set.add currently returns None. This is extended to return True if if the item is new to the set, and False otherwise. No object overhead is introduced as set.add is already currently executing Py_RETURN_NONE. Benchmarks indicate that set.add if the item isn't already present (returning True in the patched instance) reduces time by 5-9%. set.add if the item already exists increases time by 1-3%. I'm happy to put these down to effects of touching True and False instead of None on return from set.add. Patch and primitive performance test attached. ---------- components: Interpreter Core files: set-add-return-bool.patch keywords: patch messages: 155909 nosy: anacrolix, eric.araujo, gvanrossum, petri.lehtinen priority: normal severity: normal status: open title: set.add can return boolean indicate newly added item type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24862/set-add-return-bool.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:07:24 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 17:07:24 +0000 Subject: [New-bugs-announce] [issue14321] Do not run pgen during the build if files are up to date Message-ID: <1331831244.15.0.8026915878.issue14321@psf.upfronthosting.co.za> New submission from Matthias Klose : For a cross build, make tries to run pgen built for the host machine, not the build machine. However it is not necessary to run pgen at all if all the files are up to date. This change implements it. The release script (if something like this exists) should make sure that the time stamps are correct, and then pgen isn't even built for a native build. reviewed by MvL ---------- assignee: doko components: Build files: pgen.diff keywords: patch messages: 155910 nosy: doko priority: normal severity: normal status: open title: Do not run pgen during the build if files are up to date versions: Python 3.3 Added file: http://bugs.python.org/file24864/pgen.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:13:29 2012 From: report at bugs.python.org (Brian Landers) Date: Thu, 15 Mar 2012 17:13:29 +0000 Subject: [New-bugs-announce] [issue14322] More test coverage for hmac.py Message-ID: <1331831609.33.0.520236800519.issue14322@psf.upfronthosting.co.za> New submission from Brian Landers : Adding some tests to non-default code paths in hmac.py to get to 100% coverage. ---------- components: Tests files: test_hmac.patch keywords: patch messages: 155913 nosy: packetslave priority: normal severity: normal status: open title: More test coverage for hmac.py type: enhancement versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24865/test_hmac.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:19:37 2012 From: report at bugs.python.org (Brian Landers) Date: Thu, 15 Mar 2012 17:19:37 +0000 Subject: [New-bugs-announce] [issue14323] Normalize math precision in RGB/YIQ conversion Message-ID: <1331831977.5.0.174772346075.issue14323@psf.upfronthosting.co.za> New submission from Brian Landers : There doesn't seem to be a standard definition for the constants to use when doing the matrix calculations to convert RGB to YIQ or vise versa. Also, the current colorsys library uses two digits of precision for RGB-YIQ but six digits for YIQ-RGB. The attached patch standardizes both functions to use the same constants as Matlab, using the same 3 digits of precision. This makes a roundtrip of RGB->YIQ->RGB return the original values (for 3 digits of precision). Also added tests, which brings colorsys.py to 100% coverage. ---------- components: Library (Lib) files: colorlib.patch keywords: patch messages: 155915 nosy: packetslave priority: normal severity: normal status: open title: Normalize math precision in RGB/YIQ conversion type: enhancement versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24866/colorlib.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:23:09 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 17:23:09 +0000 Subject: [New-bugs-announce] [issue14324] Do not rely on AC_RUN_IFELSE tests in the configury Message-ID: <1331832189.68.0.401858624599.issue14324@psf.upfronthosting.co.za> New submission from Matthias Klose : AC_RUN_IFELSE tests can't be used in cross builds, and have to fall back to some default in the case of a cross build. This is a meta issue to collect changes for the conversion of such tests. ---------- assignee: doko components: Cross-Build keywords: patch messages: 155918 nosy: doko priority: normal severity: normal status: open title: Do not rely on AC_RUN_IFELSE tests in the configury versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:22:40 2012 From: report at bugs.python.org (Jean-Paul Calderone) Date: Thu, 15 Mar 2012 18:22:40 +0000 Subject: [New-bugs-announce] [issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist Message-ID: <1331835760.38.0.280902502881.issue14325@psf.upfronthosting.co.za> New submission from Jean-Paul Calderone : Allocating a Python list and a bunch of Capsules for each PyArg_ParseTuple call is expensive and unnecessarily complicated. The freelist never escapes getargs.c (if it ever did, it would be a bug). The same job can be accomplished with a normal C array. ---------- assignee: exarkun messages: 155926 nosy: exarkun priority: normal severity: normal status: open title: Stop using the garbage collector to manage the lifetime of the getargs.c freelist type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:15:21 2012 From: report at bugs.python.org (Roger Serwy) Date: Thu, 15 Mar 2012 19:15:21 +0000 Subject: [New-bugs-announce] [issue14326] IDLE - allow shell to support different locales Message-ID: <1331838921.21.0.772661396628.issue14326@psf.upfronthosting.co.za> New submission from Roger Serwy : Per Martin's request, this issue has been separated from Issue14200. The IDLE shell presently has an effective locale of "BMP UTF8" due to a limitation in Tkinter, described in Issue12342. IDLE should support different output codecs, like "ascii" and "utf8". In order to work around Tkinter's limitations, unsupported characters would be replaced (this is related to #14304). This amounts to adding some extra code to OutputWindow's write() to raise encoding errors if the string contains unsupported characters. ---------- components: IDLE messages: 155939 nosy: serwy priority: normal severity: normal status: open title: IDLE - allow shell to support different locales type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 21:14:33 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 20:14:33 +0000 Subject: [New-bugs-announce] [issue14327] replace use of uname in the configury with macros set by AC_CANONICAL_HOST Message-ID: <1331842473.11.0.734789766158.issue14327@psf.upfronthosting.co.za> New submission from Matthias Klose : the configury uses uname, which fails for cross builds. this issue tracks patches tor replace the uname calls with the use of macros set by AC_CANONICAL_HOST (host*, build*) ---------- assignee: doko components: Cross-Build keywords: needs review messages: 155950 nosy: doko priority: normal severity: normal status: open title: replace use of uname in the configury with macros set by AC_CANONICAL_HOST _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 22:49:18 2012 From: report at bugs.python.org (Larry Hastings) Date: Thu, 15 Mar 2012 21:49:18 +0000 Subject: [New-bugs-announce] [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords Message-ID: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> New submission from Larry Hastings : This has been split off from #14127 at Antoine's request. The attached patch adds support for keyword-only arguments to the PyArg_ParseTupleAndKeywords() family of functions. Includes doc and test. I used '$' to indicate "all parameters after this are keyword-only"; since they must also be optional it must follow a '|'. (I would have used '*' but we already use that for 'U*' 's* etc.) The patch already received one review from Greg P. Smith on the previous issue; the patch I'm attaching here is the second revision incorporating his suggestions. ---------- assignee: larry components: Interpreter Core files: larry.parsekwonly.diff.2.txt keywords: patch messages: 155961 nosy: gregory.p.smith, larry, pitrou priority: normal severity: normal stage: patch review status: open title: Add keyword-only parameter support to PyArg_ParseTupleAndKeywords type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24878/larry.parsekwonly.diff.2.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:49:14 2012 From: report at bugs.python.org (Serge Droz) Date: Thu, 15 Mar 2012 22:49:14 +0000 Subject: [New-bugs-announce] [issue14329] proxy_bypass_macosx_sysconf does not handle singel ip addresses correctly Message-ID: <1331851754.34.0.615850283155.issue14329@psf.upfronthosting.co.za> New submission from Serge Droz : On MacOS in urllib the function proxy_bypass_macosx_sysconf does not handle proxy settings which are just IP addresses correctly: If there is any IP address, always true is reported. Reason: the mask is calculated wrong. The attached patch fixes this. NB This is also an issue in other python versions ---------- assignee: ronaldoussoren components: Macintosh files: urllib_macos.diff keywords: patch messages: 155973 nosy: Serge.Droz, ronaldoussoren priority: normal severity: normal status: open title: proxy_bypass_macosx_sysconf does not handle singel ip addresses correctly versions: Python 2.6 Added file: http://bugs.python.org/file24880/urllib_macos.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 01:14:10 2012 From: report at bugs.python.org (Matthias Klose) Date: Fri, 16 Mar 2012 00:14:10 +0000 Subject: [New-bugs-announce] [issue14330] do not use the host python for cross builds Message-ID: <1331856850.28.0.590122825265.issue14330@psf.upfronthosting.co.za> New submission from Matthias Klose : for various tasks, the just built python for the host is used. this patch searches for a suitable python for the build machine and uses it for the build. ---------- assignee: doko components: Cross-Build files: no-host-python-for-build.diff keywords: needs review, patch messages: 155976 nosy: doko priority: normal severity: normal status: open title: do not use the host python for cross builds versions: Python 3.3 Added file: http://bugs.python.org/file24881/no-host-python-for-build.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 01:42:29 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 16 Mar 2012 00:42:29 +0000 Subject: [New-bugs-announce] [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN Message-ID: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> New submission from Gregory P. Smith : Python/import.c in 2.7 and 3.2 consume a lot of stack space when importing modules. In stack constrained environments (think: 64k stack) this can cause a crash when you have a large chain of imports. The bulk of this likely comes from places where a char buf[MAXPATHLEN+1] or similar is declared on the stack in the call chain. MAXPATHLEN is commonly defined to be in the 256..1024 range depending on the OS. Changing the code to not put the large buffer on the stack but to malloc and free it instead is a pretty straightforward re-factor. import is being significantly reworked in 3.3 so I won't consider this issue there until after that settles as it may no longer apply. ---------- assignee: gregory.p.smith messages: 155981 nosy: brett.cannon, gregory.p.smith, ncoghlan, twouters priority: normal severity: normal status: open title: Python/import.c uses a lot of stack space due to MAXPATHLEN versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 06:52:05 2012 From: report at bugs.python.org (Weronika Patena) Date: Fri, 16 Mar 2012 05:52:05 +0000 Subject: [New-bugs-announce] [issue14332] difflib.ndiff appears to ignore linejunk argument Message-ID: <1331877125.66.0.103153393744.issue14332@psf.upfronthosting.co.za> New submission from Weronika Patena : According to difflib.ndiff help, the optional linejunk argument is "A function that should accept a single string argument, and return true iff the string is junk." Presumably the point is to ignore the junk lines in the comparison. But the function doesn't appear to actually do this - in fact I haven't been able to make the linejunk argument change the output in any way. Expected difflib.ndiff behavior with no linejunk argument given: >>> test_lines_1 = ['# something\n', 'real data\n'] >>> test_lines_2 = ['# something else\n', 'real data\n'] >>> print ''.join(difflib.ndiff(test_lines_1,test_lines_2)) - # something + # something else ? +++++ real data Now I'm providing a linejunk function to ignore all lines starting with '#', but the output is still the same: >>> print ''.join(difflib.ndiff(test_lines_1, test_lines_2, linejunk=lambda line: line.startswith('#'))) - # something + # something else ? +++++ real data In fact if I make linejunk always return True (or False), nothing changes either: >>> print ''.join(difflib.ndiff(test_lines_1, test_lines_2, linejunk=lambda line: True)) - # something + # something else ? +++++ real data It certainly looks like an error, although it's possible that I'm just misunderstanding how this should work. I'm using Python 2.6.5, on Ubuntu Linux 10.04. ---------- components: Library (Lib) messages: 155992 nosy: patena, tim_one priority: normal severity: normal status: open title: difflib.ndiff appears to ignore linejunk argument type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 08:45:45 2012 From: report at bugs.python.org (Matt Joiner) Date: Fri, 16 Mar 2012 07:45:45 +0000 Subject: [New-bugs-announce] [issue14333] queue unittest errors Message-ID: <1331883945.34.0.322652565121.issue14333@psf.upfronthosting.co.za> New submission from Matt Joiner : $ python3.3 -m unittest test.test_queue Generates errors in the unit test code of the form AttributeError: 'BaseQueueTest' object has no attribute 'type2test' ---------- components: Tests messages: 156006 nosy: anacrolix, benjamin.peterson, rhettinger priority: normal severity: normal status: open title: queue unittest errors type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 13:33:41 2012 From: report at bugs.python.org (Stefan Krah) Date: Fri, 16 Mar 2012 12:33:41 +0000 Subject: [New-bugs-announce] [issue14334] Invalid free in _PyUnicode_Ready() Message-ID: <1331901221.34.0.872170817389.issue14334@psf.upfronthosting.co.za> New submission from Stefan Krah : Hi -- I'm getting a segfault running the attached crasher.py script. Valgrind traces it down to an Invalid free() / delete / delete[] in _PyUnicode_Ready(). Reproduce: ========== Rev: 870c0ef7e8a2 Build: ./configure --without-pymalloc CFLAGS="-O0 -g" && make $ ./python crasher.py Segmentation fault $ valgrind --db-attach=yes --suppressions=./Misc/valgrind-python.supp ./python crasher.py ==3476== Memcheck, a memory error detector ==3476== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==3476== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==3476== Command: ./python crasher.py ==3476== ==3476== Invalid free() / delete / delete[] ==3476== at 0x4C2748D: free (vg_replace_malloc.c:366) ==3476== by 0x44763C: _PyUnicode_Ready (unicodeobject.c:1405) ==3476== by 0x44ACF8: PyUnicode_FromFormatV (unicodeobject.c:2500) ==3476== by 0x4A1CF4: PyErr_Format (errors.c:621) ==3476== by 0x42F8FE: type_getattro (typeobject.c:2551) ==3476== by 0x43493A: wrap_binaryfunc (typeobject.c:4317) ==3476== by 0x550008: wrapper_call (descrobject.c:1067) ==3476== by 0x532C93: PyObject_Call (abstract.c:2150) ==3476== by 0x49012B: PyEval_CallObjectWithKeywords (ceval.c:3920) ==3476== by 0x54F136: wrapperdescr_call (descrobject.c:309) ==3476== by 0x532C93: PyObject_Call (abstract.c:2150) ==3476== by 0x491A1E: ext_do_call (ceval.c:4355) ==3476== Address 0x4 is not stack'd, malloc'd or (recently) free'd ==3476== ---------- components: Interpreter Core files: crasher.py messages: 156017 nosy: haypo, loewis, skrah priority: high severity: normal stage: needs patch status: open title: Invalid free in _PyUnicode_Ready() type: crash versions: Python 3.3 Added file: http://bugs.python.org/file24886/crasher.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:04:48 2012 From: report at bugs.python.org (sbt) Date: Fri, 16 Mar 2012 14:04:48 +0000 Subject: [New-bugs-announce] [issue14335] Reimplement multiprocessing's ForkingPickler using dispatch_table Message-ID: <1331906688.53.0.0988257452578.issue14335@psf.upfronthosting.co.za> New submission from sbt : The attached patch reimplements ForkingPickler using the new dispatch_table attribute. This allows ForkingPickler to subclass Pickler (implemented in C) instead of _Pickler (implemented in Python). ---------- components: Library (Lib) files: mp_forking_pickler.patch keywords: patch messages: 156028 nosy: sbt priority: normal severity: normal status: open title: Reimplement multiprocessing's ForkingPickler using dispatch_table type: performance versions: Python 3.3 Added file: http://bugs.python.org/file24887/mp_forking_pickler.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 20:03:39 2012 From: report at bugs.python.org (sbt) Date: Fri, 16 Mar 2012 19:03:39 +0000 Subject: [New-bugs-announce] [issue14336] Difference between pickle implementations for function objects Message-ID: <1331924619.34.0.890923032137.issue14336@psf.upfronthosting.co.za> New submission from sbt : When pickling a function object, if it cannot be saved as a global the C implementation falls back to using copyreg/__reduce__/__reduce_ex__. The comment for the changeset which added this fallback claims that it is for compatibility with the Python implementation. See http://hg.python.org/cpython/rev/c6753db9c6af However, the current python implementations do not have any such fallback. This affects both 2.x and 3.x. For example Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import pickle, cPickle, copy_reg >>> def f(): ... pass ... >>> _f = f >>> del f >>> copy_reg.pickle(type(_f), lambda obj: (str, ("FALLBACK",))) >>> cPickle.dumps(_f) "c__builtin__\nstr\np1\n(S'FALLBACK'\np2\ntp3\nRp4\n." >>> pickle.dumps(_f) Traceback (most recent call last): File "", line 1, in File "c:\Python27\lib\pickle.py", line 1374, in dumps Pickler(file, protocol).dump(obj) File "c:\Python27\lib\pickle.py", line 224, in dump self.save(obj) File "c:\Python27\lib\pickle.py", line 286, in save f(self, obj) # Call unbound method with explicit self File "c:\Python27\lib\pickle.py", line 748, in save_global (obj, module, name)) pickle.PicklingError: Can't pickle : it's not found as __main__.f I don't know what should be done. I would be tempted to always fall back to copyreg/__reduce__/__reduce_ex__ when save_global fails (not just for function objects) but that might make error messages less helpful. ---------- components: Library (Lib) messages: 156069 nosy: sbt priority: normal severity: normal status: open title: Difference between pickle implementations for function objects type: behavior versions: Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 20:32:03 2012 From: report at bugs.python.org (Stefan Krah) Date: Fri, 16 Mar 2012 19:32:03 +0000 Subject: [New-bugs-announce] [issue14337] test_builtin: refleaks Message-ID: <1331926323.93.0.0839449921053.issue14337@psf.upfronthosting.co.za> New submission from Stefan Krah : I don't see immediately why, but since 3877bf2e323 test_builtin and a couple of other tests leak in refcounting mode: hg up 8a5742b7a14d make distclean && ./configure --with-pydebug && make ./python -m test -uall -R :: test_builtin [1/1] test_builtin beginning 9 repetitions 123456789 ......... 1 test OK. [154630 refs] hg up 3877bf2e323 make distclean && ./configure --with-pydebug && make ./python -m test -uall -R :: test_builtin [1/1] test_builtin beginning 9 repetitions 123456789 ......... test_builtin leaked [880, 880, 880, 880] references, sum=3520 1 test failed: test_builtin [163380 refs] ---------- components: Tests messages: 156071 nosy: benjamin.peterson, skrah priority: normal severity: normal status: open title: test_builtin: refleaks type: resource usage versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 21:25:01 2012 From: report at bugs.python.org (beeNuts) Date: Fri, 16 Mar 2012 20:25:01 +0000 Subject: [New-bugs-announce] [issue14338] urllib2 HowTo for overriding post/3xx behavior. Message-ID: <1331929501.86.0.889924099512.issue14338@psf.upfronthosting.co.za> New submission from beeNuts : Issue #14144, with the title "urllib2 HTTPRedirectHandler not forwarding POST data in redirect" was recently closed with these comments: "This could be cookbook recipe style example, if it's utility value is high. I am closing this issue as I feel that the requirement may not be addressed by a change. If there is patch for HowTo, we can tackle that in another issue. Thank you for contribution." The decision that documents on this issue were preferable to a patch seems like a fair compromise, especially considering that the RFC is decidedly ambiguous.I was wondering if the HowTo would be forthcoming? It seems to me that the value/utility would certainly be high. I'd submit it myself but I'm so new to Python that I don't trust my ability to do it correctly. It's something I would find highly useful, though. ---------- assignee: docs at python components: Documentation messages: 156080 nosy: beerNuts, docs at python priority: normal severity: normal status: open title: urllib2 HowTo for overriding post/3xx behavior. versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 22:09:31 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Mar 2012 21:09:31 +0000 Subject: [New-bugs-announce] [issue14339] Optimizing bin, oct and hex Message-ID: <1331932171.45.0.56771909125.issue14339@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : This patch slightly optimize conversion int to string with base 2, 8 or 16 by calculating exactly number of digits and avoiding unnecessary memory allocation. The code is similar to used for decimal conversion. Without patch: $ ./python -m timeit -s 'x=1' 'bin(x)' 1000000 loops, best of 3: 0.295 usec per loop $ ./python -m timeit -s 'x=1' 'oct(x)' 1000000 loops, best of 3: 0.327 usec per loop $ ./python -m timeit -s 'x=1' 'hex(x)' 1000000 loops, best of 3: 0.298 usec per loop $ ./python -m timeit -s 'x=9**999' 'bin(x)' 100000 loops, best of 3: 11.9 usec per loop $ ./python -m timeit -s 'x=9**999' 'oct(x)' 100000 loops, best of 3: 4.55 usec per loop $ ./python -m timeit -s 'x=9**999' 'hex(x)' 100000 loops, best of 3: 3.99 usec per loop With patch: $ ./python -m timeit -s 'x=1' 'bin(x)' 1000000 loops, best of 3: 0.213 usec per loop $ ./python -m timeit -s 'x=1' 'oct(x)' 1000000 loops, best of 3: 0.228 usec per loop $ ./python -m timeit -s 'x=1' 'hex(x)' 1000000 loops, best of 3: 0.215 usec per loop $ ./python -m timeit -s 'x=9**999' 'bin(x)' 100000 loops, best of 3: 9.76 usec per loop $ ./python -m timeit -s 'x=9**999' 'oct(x)' 100000 loops, best of 3: 3.58 usec per loop $ ./python -m timeit -s 'x=9**999' 'hex(x)' 100000 loops, best of 3: 3.3 usec per loop ---------- components: Library (Lib) files: long_to_binary_base.patch keywords: patch messages: 156085 nosy: storchaka priority: normal severity: normal status: open title: Optimizing bin, oct and hex type: performance versions: Python 3.3 Added file: http://bugs.python.org/file24891/long_to_binary_base.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 22:28:26 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 16 Mar 2012 21:28:26 +0000 Subject: [New-bugs-announce] [issue14340] Update embedded copy of expat - fix security & crash issues Message-ID: <1331933306.8.0.658837557797.issue14340@psf.upfronthosting.co.za> New submission from Gregory P. Smith : As pointed out in #14234, our embedded copy of expat used by pyexpat for xml parsing in Modules/expat/ is out of date. There have been many fixes to expat that we have not applied including a few potential crash and security fixes. We should upgrade it wholesale to the latest version for 3.3. Someone should also audit expat changes to see if there are security fixes for expat that should be backported to 2.6/2.7/3.1/3.2 as platforms without a system expat such as Windows (and 2.6 and 3.1) will contain those problems. I am marking this a release blocker for 3.3 to ensure expat is updated before then. I would *not* hold up the existing round of release candidates for this, the next security+bugfix updates can contain these changes. ---------- components: Extension Modules messages: 156087 nosy: Arfrever, Jim.Jewett, amaury.forgeotdarc, barry, benjamin.peterson, dmalcolm, georg.brandl, gregory.p.smith, pitrou priority: release blocker severity: normal status: open title: Update embedded copy of expat - fix security & crash issues type: security versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 01:26:09 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 17 Mar 2012 00:26:09 +0000 Subject: [New-bugs-announce] [issue14341] sporadic (?) test_urllib2 failures Message-ID: <1331943969.2.0.17966534502.issue14341@psf.upfronthosting.co.za> New submission from Antoine Pitrou : ====================================================================== FAIL: test_method_deprecations (test.test_urllib2.OpenerDirectorTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/test/test_urllib2.py", line 628, in test_method_deprecations req.get_host() File "/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/contextlib.py", line 54, in __exit__ next(self.gen) File "/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/test/support.py", line 776, in _filterwarnings missing[0]) AssertionError: filter ('', DeprecationWarning) did not catch any warning ---------- assignee: orsenthil components: Library (Lib), Tests messages: 156111 nosy: orsenthil, pitrou priority: normal severity: normal stage: needs patch status: open title: sporadic (?) test_urllib2 failures type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 01:48:28 2012 From: report at bugs.python.org (py.user) Date: Sat, 17 Mar 2012 00:48:28 +0000 Subject: [New-bugs-announce] [issue14342] In re's examples the example with recursion doesn't work Message-ID: <1331945308.4.0.250244486328.issue14342@psf.upfronthosting.co.za> New submission from py.user : http://docs.python.org/py3k/library/re.html#avoiding-recursion >>> import sys >>> sys.getrecursionlimit() 1000 >>> import re >>> s = 'Begin ' + 1000*'a very long string ' + 'end' >>> re.match('Begin (\w| )*? end', s).end() 19009 >>> ---------- assignee: docs at python components: Documentation, Regular Expressions messages: 156112 nosy: docs at python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: In re's examples the example with recursion doesn't work versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 01:50:34 2012 From: report at bugs.python.org (py.user) Date: Sat, 17 Mar 2012 00:50:34 +0000 Subject: [New-bugs-announce] [issue14343] In re's examples the example with re.split() overlaps builtin input() Message-ID: <1331945434.37.0.313316190883.issue14343@psf.upfronthosting.co.za> New submission from py.user : http://docs.python.org/py3k/library/re.html#making-a-phonebook input -> text ---------- assignee: docs at python components: Documentation, Regular Expressions messages: 156114 nosy: docs at python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: In re's examples the example with re.split() overlaps builtin input() type: enhancement versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 03:54:58 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 17 Mar 2012 02:54:58 +0000 Subject: [New-bugs-announce] [issue14344] repr of email policies is wrong Message-ID: <1331952898.09.0.346715938946.issue14344@psf.upfronthosting.co.za> New submission from ?ric Araujo : >>> import email.policy as p >>> p.default Policy() >>> p.HTTP Policy(["linesep='\\r\\n'", 'max_line_length=None']) I think you wanted Policy(linesep='\r\n', max_line_length=None); the problem comes from __repr__ where a format field is replaced by a list, which should have been something ', '.join(args) instead. I can commit this minor thing if you want, I just wanted to check if I was right first. ---------- components: Library (Lib) messages: 156130 nosy: eric.araujo, r.david.murray priority: low severity: normal status: open title: repr of email policies is wrong type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 06:43:02 2012 From: report at bugs.python.org (anatoly techtonik) Date: Sat, 17 Mar 2012 05:43:02 +0000 Subject: [New-bugs-announce] [issue14345] Document socket.SOL_SOCKET Message-ID: <1331962982.1.0.381278454339.issue14345@psf.upfronthosting.co.za> New submission from anatoly techtonik : socket.get/setsockopt() docs can be improved by providing description for SOL_SOCKET constant, and link to source code for other level constants and socket level options. ---------- assignee: docs at python components: Documentation messages: 156140 nosy: docs at python, techtonik priority: normal severity: normal status: open title: Document socket.SOL_SOCKET _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 10:59:04 2012 From: report at bugs.python.org (Dionysios Kalofonos) Date: Sat, 17 Mar 2012 09:59:04 +0000 Subject: [New-bugs-announce] [issue14346] Typos in Mac/README Message-ID: <1331978344.42.0.979821037918.issue14346@psf.upfronthosting.co.za> New submission from Dionysios Kalofonos : Mac/README had a few typos (see attached file for details). ---------- files: typos.patch keywords: patch messages: 156148 nosy: dk priority: normal severity: normal status: open title: Typos in Mac/README versions: Python 2.7 Added file: http://bugs.python.org/file24903/typos.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 13:12:25 2012 From: report at bugs.python.org (Dionysios Kalofonos) Date: Sat, 17 Mar 2012 12:12:25 +0000 Subject: [New-bugs-announce] [issue14347] Misc/README Message-ID: <1331986345.75.0.966769562204.issue14347@psf.upfronthosting.co.za> New submission from Dionysios Kalofonos : Misc/README does not enumerate all the files in the Misc directory (see the attached file for more information). ---------- components: None files: files.patch keywords: patch messages: 156154 nosy: dk priority: normal severity: normal status: open title: Misc/README versions: Python 3.3 Added file: http://bugs.python.org/file24904/files.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 14:20:03 2012 From: report at bugs.python.org (Dionysios Kalofonos) Date: Sat, 17 Mar 2012 13:20:03 +0000 Subject: [New-bugs-announce] [issue14348] Whitespace - Lib/base64.py Message-ID: <1331990403.5.0.414904918457.issue14348@psf.upfronthosting.co.za> New submission from Dionysios Kalofonos : Whitespace changes as of PEP8. ---------- components: Library (Lib) files: base64.patch keywords: patch messages: 156156 nosy: dk priority: normal severity: normal status: open title: Whitespace - Lib/base64.py versions: Python 3.3 Added file: http://bugs.python.org/file24905/base64.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 16:08:06 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 17 Mar 2012 15:08:06 +0000 Subject: [New-bugs-announce] [issue14349] The documentation of 'dis' doesn't describe MAKE_FUNCTION correctly Message-ID: <1331996886.47.0.46755295506.issue14349@psf.upfronthosting.co.za> New submission from Eli Bendersky : The documentation of the MAKE_FUNCTION opcode in 'dis' says: "Pushes a new function object on the stack. TOS is the code associated with the function. " Which doesn't appear to be true. In Python/ceval.c: [...] TARGET_WITH_IMPL(MAKE_CLOSURE, _make_function) TARGET(MAKE_FUNCTION) _make_function: { int posdefaults = oparg & 0xff; int kwdefaults = (oparg>>8) & 0xff; int num_annotations = (oparg >> 16) & 0x7fff; w = POP(); /* qualname */ v = POP(); /* code object */ x = PyFunction_NewWithQualName(v, f->f_globals, w); [...] ---------- assignee: docs at python components: Documentation messages: 156161 nosy: docs at python, eli.bendersky, ncoghlan priority: normal severity: normal stage: needs patch status: open title: The documentation of 'dis' doesn't describe MAKE_FUNCTION correctly type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 20:04:26 2012 From: report at bugs.python.org (Jakob Bowyer) Date: Sat, 17 Mar 2012 19:04:26 +0000 Subject: [New-bugs-announce] [issue14350] Strange Exception from copying an iterable Message-ID: <1332011066.2.0.397754612752.issue14350@psf.upfronthosting.co.za> New submission from Jakob Bowyer : Running: Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] Code: import copy copy.copy(iter([1,2,3])) Exception: --------------------------------------------------------------------------- TypeError Traceback (most recent call last) T:\languages\Python27\Scripts\ in () ----> 1 copy.copy(iter([1,2,3])) T:\languages\Python27\lib\copy.pyc in copy(x) 94 raise Error("un(shallow)copyable object of type %s" % cl s) 95 ---> 96 return _reconstruct(x, rv, 0) 97 98 T:\languages\Python27\lib\copy.pyc in _reconstruct(x, info, deep, memo) 327 if deep: 328 args = deepcopy(args, memo) --> 329 y = callable(*args) 330 memo[id(x)] = y 331 T:\languages\Python27\lib\copy_reg.pyc in __newobj__(cls, *args) 91 92 def __newobj__(cls, *args): ---> 93 return cls.__new__(cls, *args) 94 95 def _slotnames(cls): TypeError: object.__new__(listiterator) is not safe, use listiterator.__new__() Either this is a bug or not a clear error message in the exception ---------- components: None messages: 156189 nosy: Jakob.Bowyer priority: normal severity: normal status: open title: Strange Exception from copying an iterable type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 20:51:32 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 17 Mar 2012 19:51:32 +0000 Subject: [New-bugs-announce] [issue14351] Script error in 3.2.3rc1 Windows doc Message-ID: <1332013892.73.0.333055094928.issue14351@psf.upfronthosting.co.za> New submission from Terry J. Reedy : 3.2.3rc1: When I click the Python manuals Start Menu icon, the Windows help version of the docs comes up, but with a Script Error box. Contents of the box: A error has occurred in the script on this page Line : 1 Char : 1 Error : The value of the property '$' is null or undefined, not a Function object Code : 0 URL : mk:@MSITStore:C:\<...>\pthon323rc1.chm:/_static/copybuttom.js Do you want to continue running script on this page? [yes] [no] Whether I click yes or no, clicking on anything, for instance, Language Reference, brings up the the error box again. After clicking away the error box, I get what I intended, but having to do that with every click makes that nice form of the doc, which I use daily, unusable. So I think this should be a release blocker. I did not notice before because I have been using and testing 3.3.0a1. The chm manual for that works fine, as normal. I have not loaded 2.7.3rc1. I am on Win7, 64bit. ---------- assignee: docs at python components: Documentation, Windows messages: 156195 nosy: docs at python, georg.brandl, loewis, terry.reedy priority: normal severity: normal status: open title: Script error in 3.2.3rc1 Windows doc type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 20:55:49 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sat, 17 Mar 2012 19:55:49 +0000 Subject: [New-bugs-announce] [issue14352] Distutils2 won't install on Ubuntu Message-ID: <1332014149.79.0.895203792627.issue14352@psf.upfronthosting.co.za> New submission from Alex Gr?nholm : Running distutils2 hg tip (changeset 2cec52b682a9): The command "pysetup install" fails with: u'Python': u'2.7.2+' is not a valid version (field 'Version') Not that it should matter, but this is Ubuntu 11.10. Also, distutils2 installs fine using setup.py. ---------- assignee: eric.araujo components: Distutils2 files: d2log.txt messages: 156196 nosy: agronholm, alexis, eric.araujo, tarek priority: normal severity: normal status: open title: Distutils2 won't install on Ubuntu type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file24914/d2log.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 21:49:57 2012 From: report at bugs.python.org (Mel Flynn) Date: Sat, 17 Mar 2012 20:49:57 +0000 Subject: [New-bugs-announce] [issue14353] Proper gettext support in locale module Message-ID: <1332017397.14.0.261241263671.issue14353@psf.upfronthosting.co.za> New submission from Mel Flynn : Gettext support in Python is configured by two tests: - textdomain in libc or libintl - bind_textdomain_codeset in libc only The latter causes incomplete gettext support in the locale module. Since the implementation uses two different defines, the provided patch provides them and also ensures they exist. The issue is not present in 3.x branches, as only a single test is done for full gettext support in locale. ---------- components: Build files: python26-configure.in.patch keywords: patch messages: 156203 nosy: melflynn priority: normal severity: normal status: open title: Proper gettext support in locale module type: enhancement versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file24917/python26-configure.in.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 21:55:44 2012 From: report at bugs.python.org (Joe Rumsey) Date: Sat, 17 Mar 2012 20:55:44 +0000 Subject: [New-bugs-announce] [issue14354] Crash in _ctypes_alloc_callback Message-ID: <1332017744.32.0.532482393485.issue14354@psf.upfronthosting.co.za> New submission from Joe Rumsey : I have reproduced this crash in Apple's default 2.7.1 python, and in 2.7.3 built from source myself. But only in release mode. If I rebuild 2.7.3 in debug, the crash goes away. The attached file reproduces the issue, which has to do with a union containing multiple structs being used as a value for a callback argument. I've stripped it down as much as I can. Removing any fields from either the union or the Dice struct will cause this to no longer crash. The original source of this is libtcod's python wrapper library, which seems to work fine on platforms other than Mac, though it had a lot of other problems on 64-bit systems before I got to this one. This issue may also be more 64-bit specific than Mac specific. This is the callstack from Apple's python: #0 0x00000001010c7712 in _ctypes_alloc_callback () #1 0x00000001010c4a1c in PyCData_AtAddress () #2 0x0000000100050afa in icu::DigitList::getDouble () #3 0x000000010000bd32 in PyObject_Call () #4 0x000000010008bf63 in ubrk_swap () #5 0x000000010008ecd8 in triedict_swap () #6 0x000000010008ed4d in triedict_swap () #7 0x00000001000a608f in ucnv_openStandardNames () #8 0x00000001000a614f in ucnv_openStandardNames () #9 0x00000001000a72a2 in ucnv_getUnicodeSet () #10 0x00000001000b72af in ucnv_getDisplayName () #11 0x0000000100000e88 in ?? () ---------- assignee: ronaldoussoren components: Macintosh, ctypes files: testctypes.py messages: 156205 nosy: ogre, ronaldoussoren priority: normal severity: normal status: open title: Crash in _ctypes_alloc_callback type: crash versions: Python 2.7 Added file: http://bugs.python.org/file24919/testctypes.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 21:58:49 2012 From: report at bugs.python.org (Eric Snow) Date: Sat, 17 Mar 2012 20:58:49 +0000 Subject: [New-bugs-announce] [issue14355] imp module should omit references to init_frozen Message-ID: <1332017929.34.0.162160469146.issue14355@psf.upfronthosting.co.za> New submission from Eric Snow : The imp.init_frozen() function was removed from the documentation prior to 3.2 (changeset 2cf7bb2bbfb8). One reference to the function was left behind. I've attached a very intricate patch. ---------- assignee: docs at python components: Documentation files: imp_doc.rst messages: 156206 nosy: docs at python, eric.snow priority: normal severity: normal status: open title: imp module should omit references to init_frozen versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24920/imp_doc.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 07:10:35 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sun, 18 Mar 2012 06:10:35 +0000 Subject: [New-bugs-announce] [issue14356] Distutils2 ignores site-local configuration Message-ID: <1332051035.41.0.153841644882.issue14356@psf.upfronthosting.co.za> New submission from Alex Gr?nholm : Distutils2 seems to rely solely on a sysconfig.cfg shipped with distutils2 to get the path where to install packages. Ignoring site-local configuration means that it won't work on Python distributions where the site configuration has been customized. On Ubuntu, packages are supposed to go to /usr/local/lib/python2.7/dist-packages but distutils2 tries to install them to /usr/lib/python2.7/site-packages. ---------- assignee: eric.araujo components: Distutils2 messages: 156230 nosy: agronholm, alexis, eric.araujo, tarek priority: normal severity: normal status: open title: Distutils2 ignores site-local configuration type: behavior versions: 3rd party, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 07:26:52 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sun, 18 Mar 2012 06:26:52 +0000 Subject: [New-bugs-announce] [issue14357] Distutils2 does not work with virtualenv Message-ID: <1332052012.13.0.374309146875.issue14357@psf.upfronthosting.co.za> New submission from Alex Gr?nholm : The installed pysetup script launches (at least on my system) with /usr/bin/python regardless of the interpreter used for installing it. ---------- assignee: eric.araujo components: Distutils2 messages: 156231 nosy: agronholm, alexis, eric.araujo, tarek priority: normal severity: normal status: open title: Distutils2 does not work with virtualenv versions: 3rd party, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 08:16:52 2012 From: report at bugs.python.org (Ben Hayden) Date: Sun, 18 Mar 2012 07:16:52 +0000 Subject: [New-bugs-announce] [issue14358] test_os failing with errno 61: No Data Available Message-ID: <1332055012.37.0.633152160174.issue14358@psf.upfronthosting.co.za> New submission from Ben Hayden : When running the test suite on Linux 3.2.9-1, I get the following error on the test_os suite: test test_os crashed -- Traceback (most recent call last): File "/home/benhayden/Documents/cpython/Lib/test/regrtest.py", line 1229, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/home/benhayden/Documents/cpython/Lib/test/test_os.py", line 1767, in @unittest.skipUnless(supports_extended_attributes(), File "/home/benhayden/Documents/cpython/Lib/test/test_os.py", line 1754, in supports_extended_attributes os.fsetxattr(fp.fileno(), b"user.test", b"") OSError: [Errno 61] No data available I don't know the best way to handle this error, but instead of raising it, I just let the decorator return False. This allowed test_os to finish (and finish successfully) on my machine. Once again, I don't really know what ENODATA might mean, so I just tried the first thing that worked for me. ---------- components: Tests files: test_os_support_ext.patch keywords: patch messages: 156232 nosy: beardedp priority: normal severity: normal status: open title: test_os failing with errno 61: No Data Available type: crash versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file24921/test_os_support_ext.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 09:04:38 2012 From: report at bugs.python.org (=?utf-8?q?Herv=C3=A9_Coatanhay?=) Date: Sun, 18 Mar 2012 08:04:38 +0000 Subject: [New-bugs-announce] [issue14359] _posixsubprocess.o compilation error on CentOS 5.8 Message-ID: <1332057878.8.0.554902086593.issue14359@psf.upfronthosting.co.za> New submission from Herv? Coatanhay : Linux Version: 2.6.18-238.19.1.el5 / CentOS release 5.8 (Final) On changeset 75803:b26056192653 , I have the following compilation error: gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -IInclude -I. -I./Include -I/usr/local/include -I/home/proexp/cpython2 -c /home/proexp/cpython2/Modules/_posixsubprocess.c -o build/temp.linux-x86_64-3.3/home/proexp/cpython2/Modules/_posixsubprocess.o /home/proexp/cpython2/Modules/_posixsubprocess.c: In function ?_close_open_fd_range_safe?: /home/proexp/cpython2/Modules/_posixsubprocess.c:207: erreur: ?O_CLOEXEC? undeclared (first use in this function) /home/proexp/cpython2/Modules/_posixsubprocess.c:207: erreur: (Each undeclared identifier is reported only once /home/proexp/cpython2/Modules/_posixsubprocess.c:207: erreur: for each function it appears in.) The problem is the too old kernel version provided on CentOS 5 and RHEL 5 whic does not support O_CLOEXEC. I join my proposed patch for this issue. ---------- components: Build files: _posixmodule.patch keywords: patch messages: 156237 nosy: Alzakath priority: normal severity: normal status: open title: _posixsubprocess.o compilation error on CentOS 5.8 type: compile error versions: Python 3.3 Added file: http://bugs.python.org/file24922/_posixmodule.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 10:36:35 2012 From: report at bugs.python.org (Dmitry Shachnev) Date: Sun, 18 Mar 2012 09:36:35 +0000 Subject: [New-bugs-announce] [issue14360] email.encoders.encode_quopri doesn't work with python 3.2 Message-ID: <1332063395.16.0.293436373736.issue14360@psf.upfronthosting.co.za> New submission from Dmitry Shachnev : Currently my /usr/lib/python3.2/email/encoders.py has this code: def _qencode(s): enc = _encodestring(s, quotetabs=True) # Must encode spaces, which quopri.encodestring() doesn't do return enc.replace(' ', '=20') The problem is that _encodestring (which is just quopri.encodestring) always returns bytes, trying to run replace() on bytes raises "TypeError: expected an object with the buffer interface". This leads to email.encoders.encode_quopri never working. So, I think this should be changed to something like this: <...> return enc.decode().replace(' ', '=20') Example log: Python 3.2.3rc1 (default, Mar 9 2012, 23:02:43) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import email.encoders >>> from email.mime.text import MIMEText >>> msg = MIMEText(b'some text here') >>> email.encoders.encode_quopri(msg) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.2/email/encoders.py", line 44, in encode_quopri encdata = _qencode(orig) File "/usr/lib/python3.2/email/encoders.py", line 23, in _qencode return enc.replace(' ', '=20') TypeError: expected an object with the buffer interface Reproduced on Ubuntu precise with Python 3.2.3rc1. Replacing encode_quopri with encode_base64 works fine. ---------- components: Library (Lib) messages: 156238 nosy: barry, mitya57 priority: normal severity: normal status: open title: email.encoders.encode_quopri doesn't work with python 3.2 type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 12:14:27 2012 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 18 Mar 2012 11:14:27 +0000 Subject: [New-bugs-announce] [issue14361] No link to issue tracker on Python home page Message-ID: <1332069267.85.0.0257661397774.issue14361@psf.upfronthosting.co.za> New submission from Steven D'Aprano : There is no link to the tracker http://bugs.python.org/ on the Python website http://www.python.org/ (or if there is, it's so well hidden I can't see it). I seem to remember that there used to be; whether or not there was, there should be. Curiously, the issue tracker itself includes a link to the issue tracker, in the side-bar. Tested with Firefox 3.6, Konqueror, and wget + grep. ---------- messages: 156241 nosy: stevenjd priority: normal severity: normal status: open title: No link to issue tracker on Python home page _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 12:18:24 2012 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 18 Mar 2012 11:18:24 +0000 Subject: [New-bugs-announce] [issue14362] No mention of collections.ChainMap in What's New for 3.3 Message-ID: <1332069504.3.0.514334264343.issue14362@psf.upfronthosting.co.za> New submission from Steven D'Aprano : The 3.3 What's New doesn't mention collections.ChainMap ---------- assignee: docs at python components: Documentation messages: 156244 nosy: docs at python, stevenjd priority: normal severity: normal status: open title: No mention of collections.ChainMap in What's New for 3.3 versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 13:03:16 2012 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 18 Mar 2012 12:03:16 +0000 Subject: [New-bugs-announce] [issue14363] Can't build Python 3.3a1 on Centos 5 Message-ID: <1332072196.05.0.286336740543.issue14363@psf.upfronthosting.co.za> New submission from Steven D'Aprano : I attempted to build Python 3.3a1 but failed. I am running Centos 5. After running ./configure (no apparent errors), I ran make and got a whole lot of warnings and errors, ending with: collect2: ld returned 1 exit status make: *** [python] Error 1 Output attached as a file. ---------- components: Build files: out messages: 156248 nosy: stevenjd priority: normal severity: normal status: open title: Can't build Python 3.3a1 on Centos 5 versions: Python 3.3 Added file: http://bugs.python.org/file24925/out _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 15:29:13 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Sun, 18 Mar 2012 14:29:13 +0000 Subject: [New-bugs-announce] [issue14364] Argparse incorrectly handles '--' Message-ID: <1332080953.55.0.495639573781.issue14364@psf.upfronthosting.co.za> New submission from Michele Orr? : http://docs.python.org/library/argparse.html#arguments-containing The attached file shows different behaviours when using '--' immediately after an optional argument. tumbolandia:cpython maker$ python foo.py --test=-- foo [] tumbolandia:cpython maker$ python foo.py --test -- foo usage: foo.py [-h] [-t TEST] [yuri] foo.py: error: argument -t/--test: expected 1 argument(s) The same is for single-dash arguments. tumbolandia:cpython maker$ python foo.py -t -- foo usage: foo.py [-h] [-t TEST] [yuri] foo.py: error: argument -t/--test: expected 1 argument(s) tumbolandia:cpython maker$ python foo.py -t-- foo [] Obviously argparse should return an error in both cases. The bug is probably due to Lib/argparser.py:2211 ---------- files: foo.py messages: 156254 nosy: maker priority: normal severity: normal status: open title: Argparse incorrectly handles '--' versions: Python 2.7, Python 3.1 Added file: http://bugs.python.org/file24926/foo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 21:28:00 2012 From: report at bugs.python.org (Jakub Warmuz) Date: Sun, 18 Mar 2012 20:28:00 +0000 Subject: [New-bugs-announce] [issue14365] argparse: subparsers, argument abbreviations and ambiguous option Message-ID: <1332102480.28.0.401837291603.issue14365@psf.upfronthosting.co.za> New submission from Jakub Warmuz : Assuming following: 1. optional argument, say "--foo", in a subparser; 2. at least two different optional arguments in the main parser prefixed with "--foo", say "--foo1" and "--foo2"; parsing fails with "error: ambiguous option: --foo could match --foo1, --foo2". It seems like argument abbreviation mechanism described at http://docs.python.org/library/argparse.html#argument-abbreviations is not working properly when in use with subparsers... ---------- components: Library (Lib) files: argparse_subparsers_ambiguous_bug.py messages: 156272 nosy: bethard, jakub priority: normal severity: normal status: open title: argparse: subparsers, argument abbreviations and ambiguous option type: behavior versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file24928/argparse_subparsers_ambiguous_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 00:10:36 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Mar 2012 23:10:36 +0000 Subject: [New-bugs-announce] [issue14366] Suporting bzip2 and lzma compression in zip files Message-ID: <1332112236.1.0.964135054036.issue14366@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : ZIP files specification supports new compression algorithms since 2006. Since bzip2 and lzma now contained in Python standart library, it would be nice to add support for these methods in zipfile. This will allow to process more foreign zip files and create more compact distributives. The proposed patch adds two new methods ZIP_BZIP2 and ZIP_LZMA, which are automatically detecting when unpacking and that can be used for packing. ---------- components: Library (Lib) files: bzip2_and_lzma_in_zip.patch keywords: patch messages: 156288 nosy: storchaka priority: normal severity: normal status: open title: Suporting bzip2 and lzma compression in zip files type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24931/bzip2_and_lzma_in_zip.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 05:42:23 2012 From: report at bugs.python.org (Dave Burton) Date: Mon, 19 Mar 2012 04:42:23 +0000 Subject: [New-bugs-announce] [issue14367] try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2 Message-ID: <1332132143.66.0.7093323157.issue14367@psf.upfronthosting.co.za> New submission from Dave Burton : I noticed that pydoc doesn't work for pygame under python 3.2.1 or 3.2.2 for Win32; it just reports: NotImplementedError: scrap module not available (ImportError: No module named scrap) I made a small patch to inspect.py to solve the problem (I just added a try/expect around the failing statement in ismethoddescriptor). Here's the diff: http://www.burtonsys.com/python32/inspect.diff With that patch, pydoc works with pygame, and reports just a few pygame issues: *scrap* = *sndarray* = *surfarray* = ---------- components: Library (Lib) files: inspect.diff keywords: patch messages: 156314 nosy: ncdave4life priority: normal severity: normal status: open title: try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2 type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file24935/inspect.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 13:28:50 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Mar 2012 12:28:50 +0000 Subject: [New-bugs-announce] [issue14368] floattime() should not raise an exception Message-ID: <1332160130.55.0.774132301526.issue14368@psf.upfronthosting.co.za> New submission from STINNER Victor : floattime() raises an OSError if _PyTime_gettimeofday() returns secs=0 and usec=0. This is wrong because _PyTime_gettimeofday() cannot fail and secs=0 is valid if the current time is 0 (1970.1.1 at 12:00 UTC). Extract of _PyTime_gettimeofday() "doc": /* Similar to POSIX gettimeofday but cannot fail. If system gettimeofday * fails or is not available, fall back to lower resolution clocks. */ PyAPI_FUNC(void) _PyTime_gettimeofday(_PyTime_timeval *tp); In practice, I suppose that nobody noticed the bug because we are in 2012, not in 1969 :-) And even if you change your system clock to 1969.11.31, you may not be able to reproduce the bug because you have to call gettimeofday() exactly at midnight to get also usec=0 ... Attached patch removes the exception. ---------- components: Library (Lib) files: floattime.patch keywords: patch messages: 156334 nosy: haypo priority: normal severity: normal status: open title: floattime() should not raise an exception versions: Python 3.3 Added file: http://bugs.python.org/file24939/floattime.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 18:51:17 2012 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 19 Mar 2012 17:51:17 +0000 Subject: [New-bugs-announce] [issue14369] make __closure__ writable Message-ID: <1332179477.04.0.11685261564.issue14369@psf.upfronthosting.co.za> New submission from Yury Selivanov : __code__ and __closure__ are designed to work together. There is no point in allowing to completely substitute the __code__ object, but protecting the __closure__. ---------- components: Interpreter Core files: writable_closure.patch keywords: patch messages: 156350 nosy: Yury.Selivanov, asvetlov, pitrou priority: normal severity: normal status: open title: make __closure__ writable type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24943/writable_closure.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 05:37:13 2012 From: report at bugs.python.org (aaron315) Date: Tue, 20 Mar 2012 04:37:13 +0000 Subject: [New-bugs-announce] [issue14370] enumerate() lead to system crashes Message-ID: <1332218233.23.0.940342826692.issue14370@psf.upfronthosting.co.za> New submission from aaron315 : alist=list(range(5)) alist.extend(enumerate(alist)) the computer will down !!! ---------- messages: 156379 nosy: aaron315 priority: normal severity: normal status: open title: enumerate() lead to system crashes type: performance versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 12:30:41 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Mar 2012 11:30:41 +0000 Subject: [New-bugs-announce] [issue14371] Add support for bzip2 compression to the zipfile module Message-ID: <1332243041.43.0.499117498297.issue14371@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : ZIP File Format Specification (http://www.pkware.com/documents/casestudies/APPNOTE.TXT) supports bzip2 compression since at least 2003. Since bzip2 contained in Python standart library, it would be nice to add support for these method in zipfile. This will allow to process more foreign zip files and create more compact distributives. The proposed patch adds new method ZIP_BZIP2, which is automatically detecting when unpacking and that can be used for packing. ---------- components: Library (Lib) files: bzip2_in_zip.patch keywords: patch messages: 156394 nosy: storchaka priority: normal severity: normal status: open title: Add support for bzip2 compression to the zipfile module type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24956/bzip2_in_zip.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 13:43:44 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Mar 2012 12:43:44 +0000 Subject: [New-bugs-announce] [issue14372] Fix all invalid usage of borrowed references Message-ID: <1332247424.34.0.747604429133.issue14372@psf.upfronthosting.co.za> New submission from STINNER Victor : I fixed the issues #14211 and #14231. These issues were invalid usage of borrowed reference: the reference can be destroyed before the reference is used. Armin Rigo replied: "I will attempt a last time to mention that the docstrings in borrowed_ref_*.py used to say they were *examples*. That means: (1) find any internal or external C function that returns a borrowed reference; (2) find all callers and write down all the places that don't immediately either Py_INCREF() the returned value or immediately forget about it; (3) for each such place, either come up painfully with a complicated explanation of why it's safe in all possible cases, or in doubt, just fix it by adding Py_INCREF()/Py_DECREF(). What I did in writing these two borrowed_ref_*.py was to do instead (3') spend a few hours figuring out how to exploit the issue until we get a segfault. I did it for two examples, but what I'm definitely not going to do is spend N times a few hours for a large number N. If python-dev people just fix the two examples, remove the crashers, and just forget about the issue, then well, the point is missed, but I'm not going to fight it." Sorry Armin, I didn't know that the issue of borrowed was a generic issue and more code need to be fixed. So I'm opening this issue to track of invalid usage of borrowed references. ---------- components: Interpreter Core, Library (Lib) messages: 156401 nosy: haypo priority: normal severity: normal status: open title: Fix all invalid usage of borrowed references type: crash versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 14:40:46 2012 From: report at bugs.python.org (Matt Joiner) Date: Tue, 20 Mar 2012 13:40:46 +0000 Subject: [New-bugs-announce] [issue14373] C implementation of functools.lru_cache Message-ID: <1332250846.11.0.753199667334.issue14373@psf.upfronthosting.co.za> New submission from Matt Joiner : functools.lru_cache is optimized to the point that it may benefit from a C implementation. ---------- components: Interpreter Core, Library (Lib) messages: 156405 nosy: anacrolix, rhettinger priority: normal severity: normal status: open title: C implementation of functools.lru_cache type: performance versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 16:34:52 2012 From: report at bugs.python.org (donchen) Date: Tue, 20 Mar 2012 15:34:52 +0000 Subject: [New-bugs-announce] [issue14374] Compiling Python 2.7.2 on HP11i PA-RISC ends with segmentation fault in Python executable Message-ID: <1332257692.97.0.440321951611.issue14374@psf.upfronthosting.co.za> New submission from donchen : Hello, I am compiling Python2.7 on a HP11i PA-RISC machine and received a segmentation fault. Platform Information "uname -a" = HP-UX hpdev2 B.11.11 U 9000/800 2280874925 unlimited-user license Steps 1) uncompress Python tgz file 2) run "configure CC=aCC CXX=aCC" 3) make Result: Segmentation fault at library generation time. $> ranlib libpython2.7.a aCC -Ae -Wl,-E -Wl,+s -o python \ Modules/python.o \ libpython2.7.a -lnsl -lrt -ldld -lpthread -lm sh[3]: 15168 Bus error(coredump) *** Error exit code 138 Analysis: core file generated by Python executable $> file python python: PA-RISC2.0 shared executable dynamically linked -not stripped $> file libpython2.7.a libpython2.7.a: archive file -PA-RISC2.0 relocatable library $> strings core|more _______________________________________ From report at bugs.python.org Tue Mar 20 17:53:11 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 20 Mar 2012 16:53:11 +0000 Subject: [New-bugs-announce] [issue14375] Add socketserver.running property Message-ID: <1332262391.3.0.759761369976.issue14375@psf.upfronthosting.co.za> New submission from Giampaolo Rodola' : Patch in attachment adds a "running" property to figure out whether the server is running or not. Also it raises an exception in case the server has already been started or stopped. IMO such an event should be prevented beforehand as it signals an application error. Finally, __repr__ has been modified in order to reflect the current server status. ---------- files: socketserver.patch keywords: patch messages: 156432 nosy: giampaolo.rodola, pitrou priority: normal severity: normal stage: patch review status: open title: Add socketserver.running property versions: Python 3.3 Added file: http://bugs.python.org/file24970/socketserver.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 01:08:00 2012 From: report at bugs.python.org (Gareth Rees) Date: Wed, 21 Mar 2012 00:08:00 +0000 Subject: [New-bugs-announce] [issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int" Message-ID: <1332288480.19.0.200013792885.issue14376@psf.upfronthosting.co.za> New submission from Gareth Rees : The documentation for sys.exit says, "The optional argument arg can be an integer giving the exit status (defaulting to zero), or another type of object". However, the arguments that are treated as exit statuses are actually "subtypes of int". So, a bool argument is fine: $ python2.7 -c "import sys; sys.exit(False)"; echo $? 0 But a long argument is not: $ python2.7 -c "import sys; sys.exit(long(0))"; echo $? 0 1 The latter behaviour can be surprising since functions like os.spawnv may return the exit status of the executed process as a long on some platforms, so that if you try to pass on the exit code via code = os.spawnv(...) sys.exit(code) you may get a mysterious surprise: code is 0 but exit code is 1. It would be simple to change line 1112 of pythonrun.c from if (PyInt_Check(value)) to if (PyInt_Check(value) || PyLong_Check(value)) (This issue is not present in Python 3 because there is no longer a distinction between int and long.) ---------- components: Library (Lib) messages: 156470 nosy: Gareth.Rees priority: normal severity: normal status: open title: sys.exit documents argument as "integer" but actually requires "subtype of int" type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 05:46:26 2012 From: report at bugs.python.org (Ariel Poliak) Date: Wed, 21 Mar 2012 04:46:26 +0000 Subject: [New-bugs-announce] [issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing Message-ID: <1332305186.87.0.484792091693.issue14377@psf.upfronthosting.co.za> New submission from Ariel Poliak : As it stands in Hg, when the write() method of an xml.etree.ElementTree object is called, and a tag within the XML tree has no child tags or defined text, the tag is written using the short notation "". Whether or not the short notation is used instead of the long "" notation is used should be configurable by the programmer, without having to resort to serializing the XML into a string and then doing replace() on said string. The attached patch adds an optional parameter to the write() method that provides this choice. If the 'use_long_xml_tags' parameter is not set (or otherwise evaluates to the boolean False), the current behavior applies. If this parameter evaluates to the boolean True, long tags are used when producing XML output. ---------- components: Library (Lib) files: ElementTree_py-force_long_tags.patch keywords: patch messages: 156472 nosy: adpoliak priority: normal severity: normal status: open title: Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing type: enhancement versions: Python 3.2 Added file: http://bugs.python.org/file24978/ElementTree_py-force_long_tags.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 07:19:42 2012 From: report at bugs.python.org (J. D. Bartlett) Date: Wed, 21 Mar 2012 06:19:42 +0000 Subject: [New-bugs-announce] [issue14378] __future__ imports fail when compiling from python ast Message-ID: <1332310782.47.0.882635712321.issue14378@psf.upfronthosting.co.za> New submission from J. D. Bartlett : GOAL I am trying to compile an AST which contains an ImportFrom node which performs a __future__ import. The ImportFrom node in question is the first node within the AST's body (as it should be, because __future__ imports must occur at the beginning of modules). ISSUE Compiling the AST fails with the error "SyntaxError: from __future__ imports must occur at the beginning of the file". ANALYSIS The future_parse() function in future.c looks for __future__ imports and identifies them based on the condition (ds->v.ImportFrom.module == future) where future is constructed using PyString_InternFromString("__future__"). That is, the module attribute of the ImportFrom node is compared by identity with the interned string "__future__". The AST which I was compiling used the string "__future__" after extracting that string from a much longer string of user input, and as a result, the string was not interned. The attached file futureimport.py is a simple script demonstrating this issue. I have confirmed that the issue occurs in Python 2.7.2 and 3.2.2. ---------- components: Interpreter Core files: futureimport.py messages: 156477 nosy: talljosh priority: normal severity: normal status: open title: __future__ imports fail when compiling from python ast type: behavior versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file24981/futureimport.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 12:06:47 2012 From: report at bugs.python.org (anatoly techtonik) Date: Wed, 21 Mar 2012 11:06:47 +0000 Subject: [New-bugs-announce] [issue14379] Several traceback docs improvements Message-ID: <1332328007.08.0.704590425302.issue14379@psf.upfronthosting.co.za> New submission from anatoly techtonik : Some notes about current `traceback` documentation: http://docs.python.org/library/traceback.html 1. It needs a mentioning that traceback module works with traceback objects and frame objects 2. Functions that work with frames should probably be grouped together 3. Docs for frame function should include info about where to get frames (e.g. http://docs.python.org/library/inspect.html#the-interpreter-stack) 4. There is no traceback object description, which should be at http://docs.python.org/library/sys.html#sys.exc_info ---------- assignee: docs at python components: Documentation messages: 156486 nosy: docs at python, techtonik priority: normal severity: normal status: open title: Several traceback docs improvements _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 18:34:48 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 21 Mar 2012 17:34:48 +0000 Subject: [New-bugs-announce] [issue14380] MIMEText should default to utf8 charset if input text contains non-ASCII Message-ID: <1332351288.3.0.0981603454883.issue14380@psf.upfronthosting.co.za> New submission from R. David Murray : The MIMEText class of the email package in Python3 requires that a character set be specified in order for the resulting email to be valid. If no character set is specified, it currently assumes ascii but puts a unicode payload in the message. Because someone might actually be making use of this bug, I'm not going to backport a fix, but I do want to make utf8 the default if there are non-ascii characters in the input, in a similar fashion to how it is done for headers (well, now that *that* bug has been fixed). ---------- assignee: r.david.murray components: Library (Lib) keywords: easy messages: 156501 nosy: mitya57, r.david.murray priority: normal severity: normal stage: test needed status: open title: MIMEText should default to utf8 charset if input text contains non-ASCII type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 18:47:23 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 21 Mar 2012 17:47:23 +0000 Subject: [New-bugs-announce] [issue14381] Intern certain integral floats for memory savings and performance Message-ID: <1332352043.3.0.236525644282.issue14381@psf.upfronthosting.co.za> New submission from Kristj?n Valur J?nsson : Michael Foord reminded me of this issue recently. It was discussed on pydev a few years back and met with limited enthusiasm. I speak from experience in live production with EVE that this simple change saved us a lot of memory. Integral floating point numbers are surprisingly common, falling out of mathematical operations and when reading tabular data. 0.0 and 1.0 in particular. ---------- components: Interpreter Core files: internfloat.patch keywords: patch messages: 156502 nosy: krisvale, michael.foord priority: normal severity: normal status: open title: Intern certain integral floats for memory savings and performance type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24986/internfloat.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 01:07:17 2012 From: report at bugs.python.org (Ned Deily) Date: Thu, 22 Mar 2012 00:07:17 +0000 Subject: [New-bugs-announce] [issue14382] test_unittest crashes loading 'unittest.test.testmock' when run from installed Python Message-ID: <1332374837.69.0.204107861729.issue14382@psf.upfronthosting.co.za> New submission from Ned Deily : When run from an installed location, rather than from the build directory, test_unittest now crashes: $ ./root/bin/python3.3 -m test -w -uall,-largefile test_unittest [1/1] test_unittest test test_unittest crashed -- Traceback (most recent call last): File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/test/regrtest.py", line 1236, in runtest_inner indirect_test() File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/test/test_unittest.py", line 8, in test_main support.run_unittest(unittest.test.suite()) File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/unittest/test/__init__.py", line 17, in suite suite.addTest(loader.loadTestsFromName('unittest.test.testmock')) File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/unittest/loader.py", line 105, in loadTestsFromName parent, obj = obj, getattr(obj, part) AttributeError: 'module' object has no attribute 'testmock' 1 test failed: test_unittest Re-running failed tests in verbose mode Re-running test 'test_unittest' in verbose mode test test_unittest crashed -- Traceback (most recent call last): File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/test/regrtest.py", line 1236, in runtest_inner indirect_test() File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/test/test_unittest.py", line 8, in test_main support.run_unittest(unittest.test.suite()) File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/unittest/test/__init__.py", line 17, in suite suite.addTest(loader.loadTestsFromName('unittest.test.testmock')) File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/unittest/loader.py", line 105, in loadTestsFromName parent, obj = obj, getattr(obj, part) AttributeError: 'module' object has no attribute 'testmock' ---------- components: Tests messages: 156526 nosy: michael.foord, ned.deily priority: normal severity: normal stage: needs patch status: open title: test_unittest crashes loading 'unittest.test.testmock' when run from installed Python versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:08:10 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 01:08:10 +0000 Subject: [New-bugs-announce] [issue14383] Generalize the use of _Py_IDENTIFIER in ceval.c and typeobject.c Message-ID: <1332378490.99.0.0291853361655.issue14383@psf.upfronthosting.co.za> New submission from STINNER Victor : Attached patch adds the followig functions: - _PyDict_GetItemId() - _PyDict_SetItemId() - _PyType_LookupId() (private) And it uses identifiers in ceval.c and typeobject.c where it is revelant. I expect a small speedup. The patch does also simplify the code: use the new identifier API instead of an explicit static keyword and call to PyUnicode_InternXXX. I can split the patch into smaller parts if you prefer. ---------- components: Interpreter Core files: identifier.patch keywords: patch messages: 156529 nosy: haypo, loewis, pitrou priority: normal severity: normal status: open title: Generalize the use of _Py_IDENTIFIER in ceval.c and typeobject.c type: performance versions: Python 3.3 Added file: http://bugs.python.org/file24987/identifier.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:09:19 2012 From: report at bugs.python.org (Miki Tebeka) Date: Thu, 22 Mar 2012 01:09:19 +0000 Subject: [New-bugs-announce] [issue14384] Add "default" kw argument to operator.itemgetter and operator.attrgetter Message-ID: <1332378559.49.0.430445927373.issue14384@psf.upfronthosting.co.za> New submission from Miki Tebeka : This way they will behave more like getattr and the dictionary get. If default is not specified, then if the item/attr not found, an execption will be raised, which is the current behavior. However if default is specified, then return it in case when item/attr not found - default value will be returned. I wanted this when trying to get configuration from a list of objects. I'd like to do get = attrgetter('foo', None) return get(args) or get(config) or get(env) ---------- components: Library (Lib) messages: 156531 nosy: tebeka priority: normal severity: normal status: open title: Add "default" kw argument to operator.itemgetter and operator.attrgetter versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:35:35 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 01:35:35 +0000 Subject: [New-bugs-announce] [issue14385] Support other types than dict for __builtins__ Message-ID: <1332380135.46.0.264363154256.issue14385@psf.upfronthosting.co.za> New submission from STINNER Victor : CPython expects __builtins__ to be a dict, but it is interesting to be able to use another type. For example, my pysandbox project (sandbox to secure Python) requires a read-only mapping for __builtins__. The PEP 416 was rejected, so there is no builtin frozendict type, but it looks like the dictproxy type will be exposed as a public type. Attached patch uses PyDict_CheckExact() to check if __builtins__ is a dict and add a "slow-path" for other types. The overhead on runtime performance should be very low (near zero), PyDict_CheckExact() just dereference a pointer (to read the object type) and compare two pointers. The patch depends on issue #14383 patch (identifier.patch) for the __build_class__ identifier. I can write a new patch without this dependency if needed. ---------- components: Interpreter Core files: builtins.patch keywords: patch messages: 156534 nosy: haypo priority: normal severity: normal status: open title: Support other types than dict for __builtins__ type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24989/builtins.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:50:04 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 01:50:04 +0000 Subject: [New-bugs-announce] [issue14386] Expose dictproxy as a public type Message-ID: <1332381004.13.0.167648412562.issue14386@psf.upfronthosting.co.za> New submission from STINNER Victor : Attached patch makes the dictproxy type public. Example: $ ./python Python 3.3.0a1+ (default:059489cec7b9+, Mar 22 2012, 02:45:36) >>> d=dictproxy({1:2}) >>> d dict_proxy({1: 2}) >>> d[1] 2 >>> d[1]=3 TypeError: 'dictproxy' object does not support item assignment >>> del d[1] TypeError: 'dictproxy' object doesn't support item deletion >>> d.copy() {1: 2} >>> dir(d) [..., '__getitem__', 'copy', 'get', 'items', 'keys', 'values'] The patch doesn't have any test or documentation yet. See also the (now rejected) PEP 416 (frozendict). ---------- components: Interpreter Core files: dictproxy.patch keywords: patch messages: 156536 nosy: gvanrossum, haypo priority: normal severity: normal status: open title: Expose dictproxy as a public type versions: Python 3.3 Added file: http://bugs.python.org/file24990/dictproxy.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 12:53:04 2012 From: report at bugs.python.org (Jeff Robbins) Date: Thu, 22 Mar 2012 11:53:04 +0000 Subject: [New-bugs-announce] [issue14387] Include\accu.h incompatible with Windows.h Message-ID: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> New submission from Jeff Robbins : Windows.h includes RpcNdr.h which does this: #define small char accu.h in Python\Include (Python 3.2.3rc2) has this in it: typedef struct { PyObject *large; /* A list of previously accumulated large strings */ PyObject *small; /* Pending small strings */ } _PyAccu; An extension which includes both Windows.h and Python.h won't compile due to the Windows.h definition of "small". The compiler error (VS2008) starts with: c:\python32\include\accu.h(21) : error C2059: syntax error : 'type' ---------- components: Build, Windows messages: 156546 nosy: jeffr at livedata.com priority: normal severity: normal status: open title: Include\accu.h incompatible with Windows.h type: compile error versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 14:40:33 2012 From: report at bugs.python.org (Sol Jerome) Date: Thu, 22 Mar 2012 13:40:33 +0000 Subject: [New-bugs-announce] [issue14388] configparser.py traceback Message-ID: <1332423633.15.0.137948334138.issue14388@psf.upfronthosting.co.za> New submission from Sol Jerome : This seems like it could be user error, but the traceback doesn't provide useful information on where the problem could be. The relevant class is at the following URL. https://github.com/Bcfg2/bcfg2/blob/master/src/lib/Server/Plugin.py#L1180 Traceback (most recent call last): File "/root/bcfg2/Bcfg2/Server/FileMonitor.py", line 64, in handle_one_event self.handles[event.requestID].HandleEvent(event) File "/root/bcfg2/Bcfg2/Server/Plugins/Packages/PackagesSources.py", line 52, in HandleEvent self.pkg_obj.Reload() File "/root/bcfg2/Bcfg2/Server/Plugins/Packages/__init__.py", line 193, in Reload self._load_config() File "/root/bcfg2/Bcfg2/Server/Plugins/Packages/__init__.py", line 203, in _load_config self._load_sources(force_update) File "/root/bcfg2/Bcfg2/Server/Plugins/Packages/__init__.py", line 221, in _load_sources if not self.disableMetaData: File "/root/bcfg2/Bcfg2/Server/Plugins/Packages/__init__.py", line 65, in disableMetaData return not self.config.getboolean("global", "resolver") File "/root/bcfg2/Bcfg2/Server/Plugin.py", line 1216, in getboolean section, option) File "/usr/lib64/python3.2/configparser.py", line 819, in getboolean raw=raw, vars=vars) File "/usr/lib64/python3.2/configparser.py", line 793, in _get return conv(self.get(section, option, **kwargs)) TypeError: get() got an unexpected keyword argument 'raw' Please let me know if more information is required. ---------- components: Library (Lib) messages: 156559 nosy: solj priority: normal severity: normal status: open title: configparser.py traceback type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:37:16 2012 From: report at bugs.python.org (Practicing Zazen) Date: Thu, 22 Mar 2012 15:37:16 +0000 Subject: [New-bugs-announce] [issue14389] Mishandling of large numbers Message-ID: <1332430636.96.0.433531616111.issue14389@psf.upfronthosting.co.za> New submission from Practicing Zazen : Please let me know if this is accepted behavior or not. >>> 99999*99999999999 9999899999900001 >>> 99999*99999999999+0.1 9999899999900000.0 >>> 99999*99999999999+1 9999899999900002 ---------- messages: 156576 nosy: Practicing.Zazen priority: normal severity: normal status: open title: Mishandling of large numbers _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:48:31 2012 From: report at bugs.python.org (John Bollinger) Date: Thu, 22 Mar 2012 20:48:31 +0000 Subject: [New-bugs-announce] [issue14390] Tkinter single-threaded deadlock Message-ID: <1332449311.13.0.974359232681.issue14390@psf.upfronthosting.co.za> New submission from John Bollinger : This is the same as issue 452973, created as a new issue pursuant to the instruction given when 452973 was closed as "out of date". In a nutshell, in a program using combining Tkinter with Tcl callbacks written in C, it is possible for even a single-threaded program to deadlock. The case I ran into had these particulars: The main program is in Python, but it relies on a custom extension written in C. Through that extension, C callbacks are registered for various Tcl GUI events, and most of these invoke Python functions via Python's C API. Many of those Python functions invoke Tkinter methods. For example, many of the callbacks are bound to menu item activations, and these typically [try to] contruct a Tkinter dialog the first time they are called. What happens in practice is that the program starts fine, but the GUI freezes as soon as any menu item is activated that has one of the affected callbacks bound to it. Gdb and I are confident that the problem is as described in issue 452973: the program's single thread acquires TKinter's internal Tcl lock when the mouse event processing begins, and does not release it before control re-enters Python (there is no public API by which it can be made to do so). When the Python function invokes Tkinter methods, tkinter attempts to acquire the lock again, at which point it deadlocks because it holds the lock already. I encountered this issue on CentOS 6 (thus Python 2.6.6), but it appears that the problem is still present in the Python 3 trunk. I have flagged this issue only for version 2.6, however, because I cannot currently confirm that it affects later versions (see below regarding testing). I developed a patch against 2.6.6. It fixes the problem by allowing the Tcl lock to be acquired multiple times by any one thread (and requiring it to be released the same number of times before another thread can acquire it). That is perhaps technically inferior to creating public functions around _tkinter.c's ENTER_PYTHON and LEAVE_PYTHON macros, but it doesn't touch the public API. Even if new public functions were provided, the reentrant locking might still be a good fallback. The patch applies cleanly to the trunk, so probably also to every version between that and 2.6.6. I would be happy to contribute the patch, but I am a bit at a loss as to how to write an automated test for it because (1) such a test must depend on an extension module, and (2) test failure means causing a deadlock. Any advice as to whether such a patch would be considered, or as to how best to test it would be welcome. ---------- components: Tkinter messages: 156619 nosy: jcbollinger priority: normal severity: normal status: open title: Tkinter single-threaded deadlock type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 07:25:33 2012 From: report at bugs.python.org (Toshihiro Kamishima) Date: Fri, 23 Mar 2012 06:25:33 +0000 Subject: [New-bugs-announce] [issue14391] misc TYPO in argparse.Action docstring Message-ID: <1332483933.58.0.148840583117.issue14391@psf.upfronthosting.co.za> New submission from Toshihiro Kamishima : Keywords to specify as string type are incorrect. 'string' should be 'str' ---------- components: Library (Lib) files: argparse.py.patch keywords: patch messages: 156635 nosy: shima__shima priority: normal severity: normal status: open title: misc TYPO in argparse.Action docstring type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file25000/argparse.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 08:03:28 2012 From: report at bugs.python.org (Toshihiro Kamishima) Date: Fri, 23 Mar 2012 07:03:28 +0000 Subject: [New-bugs-announce] [issue14392] type=bool doesn't raise error in argparse.Action Message-ID: <1332486208.67.0.940302931961.issue14392@psf.upfronthosting.co.za> New submission from Toshihiro Kamishima : According to the documentation of "argparse.Action", a keyword 'bool' is not allowed for type argument, but it doesn't raise no errors. One possible way to fix this issue is to check in the "argparse._ActionsContainer.add_argument" method. ---------- components: Library (Lib) files: argparse.py.patch keywords: patch messages: 156636 nosy: shima__shima priority: normal severity: normal status: open title: type=bool doesn't raise error in argparse.Action versions: Python 2.7 Added file: http://bugs.python.org/file25001/argparse.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 10:01:35 2012 From: report at bugs.python.org (Dirkjan Ochtman) Date: Fri, 23 Mar 2012 09:01:35 +0000 Subject: [New-bugs-announce] [issue14393] Incorporate Guide to Magic Methods? Message-ID: <1332493295.71.0.816804721304.issue14393@psf.upfronthosting.co.za> New submission from Dirkjan Ochtman : Should we perhaps ask if we can include https://github.com/RafeKettler/magicmethods in the official docs? It seems nice (and now ranks higher on Google than the official docs...). ---------- assignee: docs at python components: Documentation messages: 156639 nosy: djc, docs at python priority: normal severity: normal status: open title: Incorporate Guide to Magic Methods? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 10:51:11 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Fri, 23 Mar 2012 09:51:11 +0000 Subject: [New-bugs-announce] [issue14394] missing links on performance claims of cdecimal Message-ID: <1332496271.62.0.623566153633.issue14394@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : Looking at "What's New" section for cdecimal [1], I see this claim: "Performance gains range from 12x for database applications to 80x for numerically intensive applications..." But there's no link on the benchmark code. [1] http://hg.python.org/cpython/file/9ceac471bd8c/Doc/whatsnew/3.3.rst#l599 ---------- assignee: docs at python components: Documentation messages: 156640 nosy: docs at python, tshepang priority: normal severity: normal status: open title: missing links on performance claims of cdecimal versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 22:51:39 2012 From: report at bugs.python.org (Parand Darugar) Date: Fri, 23 Mar 2012 21:51:39 +0000 Subject: [New-bugs-announce] [issue14395] sftp: downloading files with % in name fails due to logging Message-ID: <1332539499.99.0.427604152776.issue14395@psf.upfronthosting.co.za> New submission from Parand Darugar : Attempting to download a file with a "%" as part of the name (eg. "test%sfile") , sftp.get fails with: File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 328, in getMessage msg = msg % self.args TypeError: not enough arguments for format string This appears to be because of the logging in sftp.py: def _log(self, level, msg, *args): self.logger.log(level, msg, *args) I'm able to work around it by escaping the "%" to "%%" before calling sftp.get . ---------- messages: 156678 nosy: darugar priority: normal severity: normal status: open title: sftp: downloading files with % in name fails due to logging type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 05:04:24 2012 From: report at bugs.python.org (Adin Scannell) Date: Sat, 24 Mar 2012 04:04:24 +0000 Subject: [New-bugs-announce] [issue14396] Popen wait() doesn't handle spurious wakeups Message-ID: <1332561864.36.0.581817043223.issue14396@psf.upfronthosting.co.za> New submission from Adin Scannell : While running a complex python process that executes a bunch of subprocesses (using the subprocess module, specifically calling communicate()), I found myself with occasional zombie processes piling up. Turns out Python is not correctly wait()ing for the children. Although in my case it happens for < 5% of subprocesses, it happens for random Popen objects, used in different ways (using Popen() and then read()/write()/wait() directly or with communicate()). I'd love to find out I'm crazy, but I'm not doing anything too sneaky and the patch below fixes the problem. I'm not sure why it's happening in my particular environment (maybe it just so happens that the child processes enter into states with particular timing, or the parent receives signals at the wrong moments) but it's very reproducible for me. I believe that the cause of the zombie processes is as follows: If you read the description of the waitpid system call (http://www.kernel.org/doc/man-pages/online/pages/man2/wait.2.html), there are several events that could cause waitpid() to return. I have no idea why, but even without WNOHANG set, it looks I'm getting back an occasional 0 return value from waitpid(). Interrupted system call? Stopped child process? Not sure why at the moment. The documentation is a bit ambiguous as to whether this can happen, BUT looking at the example code at the bottom, it seems to handle this spurious wakeup case (which subprocess does not). The net result is that this process has *not* exited or been killed. The python code paths don't consider this possibility (as I believe in normal circumstances, it rarely happens!). I discovered this bug on 2.7.2. I've prepared a patch for the 2.7 branch (75701:d46c1973d3c4), although I'm certain almost all versions, including the tip suffer from this problem. I'm happy to port to other branches if necessary, although I think appropriate maintainers could whip it up in no time flat. I've tested my 2.7 fix and it solves my problem -- no more zombies. This patch does not change the behaviour of the Popen class in the normal case but allows it to handle spurious wakeups. ---------- components: Library (Lib) files: waitpid-2.7.patch keywords: patch messages: 156683 nosy: amscanne priority: normal severity: normal status: open title: Popen wait() doesn't handle spurious wakeups type: behavior 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/file25009/waitpid-2.7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 11:44:41 2012 From: report at bugs.python.org (STINNER Victor) Date: Sat, 24 Mar 2012 10:44:41 +0000 Subject: [New-bugs-announce] [issue14397] Use GetTickCount/GetTickCount64 instead of QueryPerformanceCounter for monotonic clock Message-ID: <1332585881.7.0.0863389959921.issue14397@psf.upfronthosting.co.za> New submission from STINNER Victor : QueryPerformanceCounter() is not monotonic on a multiprocessor computer on Windows XP. Extract of its documentation: "Remarks On a multiprocessor computer, it should not matter which processor is called. However, you can get different results on different processors due to bugs in the basic input/output system (BIOS) or the hardware abstraction layer (HAL). To specify processor affinity for a thread, use the SetThreadAffinityMask function." See also: http://bytes.com/topic/python/answers/527849-time-clock-going-backwards time.steady(strict-True) (or "time.monotonic()"? the function name is not decided yet :?)) should use GetTickCounter64(), or GetTickCounter(). GetTickCount64() was added to Windows Seven / Server 2008. GetTickCount() overflows after 49 days. QueryPerformanceCounter() has a better resolution than GetTickCount[64]() and so it's maybe better to keep it for time.steady(strict-False)? ---------- components: Library (Lib), Windows messages: 156690 nosy: haypo priority: normal severity: normal status: open title: Use GetTickCount/GetTickCount64 instead of QueryPerformanceCounter for monotonic clock versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:15:19 2012 From: report at bugs.python.org (Laurent Gautier) Date: Sat, 24 Mar 2012 16:15:19 +0000 Subject: [New-bugs-announce] [issue14398] bz2.BZ2DEcompressor.decompress fail on large files Message-ID: <1332605719.75.0.496276331472.issue14398@psf.upfronthosting.co.za> New submission from Laurent Gautier : The call ends with: Objects/stringobject.c:3884: bad argument to internal function sys.version: '2.7.2 (default, Jun 13 2011, 15:14:50) \n[GCC 4.4.5]' (on 64bit Linux) ---------- messages: 156698 nosy: Laurent.Gautier priority: normal severity: normal status: open title: bz2.BZ2DEcompressor.decompress fail on large files type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:27:11 2012 From: report at bugs.python.org (Cassaigne) Date: Sat, 24 Mar 2012 16:27:11 +0000 Subject: [New-bugs-announce] [issue14399] zipfile and creat/update comment Message-ID: <1332606431.21.0.286905846716.issue14399@psf.upfronthosting.co.za> New submission from Cassaigne : I want to update or create a comment to zip file. For instance, I have test.zip file. I'm using these statement to create a comment : from zipfile import ZipFile z=ZipFile('test.zip','a') z.comment='Create a new comment' z.close() After to ran this script, the zip file test.zip doesn't including the new comment ! I can have the expected behavior when I add a new file inner zip archive. ---------- components: Library (Lib) files: bug_zipfile_comment.py messages: 156699 nosy: acassaigne priority: normal severity: normal status: open title: zipfile and creat/update comment type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file25011/bug_zipfile_comment.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:27:48 2012 From: report at bugs.python.org (Dionysios Kalofonos) Date: Sat, 24 Mar 2012 16:27:48 +0000 Subject: [New-bugs-announce] [issue14400] Typo in cporting.rst Message-ID: <1332606468.59.0.165889017465.issue14400@psf.upfronthosting.co.za> New submission from Dionysios Kalofonos : A typo (see attached file). ---------- assignee: docs at python components: Documentation files: typo.diff keywords: patch messages: 156700 nosy: dk, docs at python priority: normal severity: normal status: open title: Typo in cporting.rst versions: Python 2.7 Added file: http://bugs.python.org/file25012/typo.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 18:32:13 2012 From: report at bugs.python.org (Dionysios Kalofonos) Date: Sat, 24 Mar 2012 17:32:13 +0000 Subject: [New-bugs-announce] [issue14401] Typos in curses.rst Message-ID: <1332610333.54.0.189521557338.issue14401@psf.upfronthosting.co.za> New submission from Dionysios Kalofonos : Typos (see attached file). ---------- assignee: docs at python components: Documentation files: curses.diff keywords: patch messages: 156708 nosy: dk, docs at python priority: normal severity: normal status: open title: Typos in curses.rst versions: Python 2.7, Python 3.1, Python 3.3 Added file: http://bugs.python.org/file25014/curses.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 21:21:22 2012 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 24 Mar 2012 20:21:22 +0000 Subject: [New-bugs-announce] [issue14402] Notice PayPaI : Your account was accesed by a third party. Message-ID: New submission from Guido van Rossum : Dear Member of PayPaI, We have reason to believe that your account was accessed by a third party. Please download the form and follow the instructions on your screen. We apologize for any inconvenience this may have caused. Copyright ? 1999-2012 PayPal. All rights reserved. Sincerely, The PayPal Team PayPal Email ID PP529 ---------- files: Restore Your Account.html messages: 156719 nosy: gvanrossum priority: normal severity: normal status: open title: Notice PayPaI : Your account was accesed by a third party. Added file: http://bugs.python.org/file25017/Restore Your Account.html _______________________________________ Python tracker _______________________________________ -------------- next part -------------- ??? Security - Issue - PayPaI