From report at bugs.python.org Sat Oct 1 02:24:38 2011 From: report at bugs.python.org (Alexander) Date: Sat, 01 Oct 2011 00:24:38 +0000 Subject: [New-bugs-announce] [issue13082] Can't open new window in python Message-ID: <1317428678.05.0.613085535741.issue13082@psf.upfronthosting.co.za> New submission from Alexander : When I try to open a new window in python to actually type a program and not just make single python instructions (this is while running on IDLE), python stops working and I have to force quit ---------- assignee: ronaldoussoren components: Macintosh messages: 144711 nosy: Reason2Rage, ronaldoussoren priority: normal severity: normal status: open title: Can't open new window in python type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 1 03:50:51 2011 From: report at bugs.python.org (STINNER Victor) Date: Sat, 01 Oct 2011 01:50:51 +0000 Subject: [New-bugs-announce] [issue13083] _sre: getstring() releases the buffer before using it Message-ID: <1317433851.47.0.137164360321.issue13083@psf.upfronthosting.co.za> New submission from STINNER Victor : getstring() of the _sre module contains the following code: ------------- ... buffer = Py_TYPE(string)->tp_as_buffer; if (!buffer || !buffer->bf_getbuffer || (*buffer->bf_getbuffer)(string, &view, PyBUF_SIMPLE) < 0) { PyErr_SetString(PyExc_TypeError, "expected string or buffer"); return NULL; } /* determine buffer size */ bytes = view.len; ptr = view.buf; /* Release the buffer immediately --- possibly dangerous but doing something else would require some re-factoring */ PyBuffer_Release(&view); ... ------------- getstring() is used to initialize a state or a pattern. State and pattern have destructors (pattern_dealloc() and state_fini()), so it should be possible to keep the view active and call PyBuffer_Release() in the destructor. ---------- components: Library (Lib) messages: 144714 nosy: haypo, pitrou priority: normal severity: normal status: open title: _sre: getstring() releases the buffer before using it versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 1 11:48:23 2011 From: report at bugs.python.org (Stefan Krah) Date: Sat, 01 Oct 2011 09:48:23 +0000 Subject: [New-bugs-announce] [issue13084] test_signal failure Message-ID: <1317462503.63.0.0518543153457.issue13084@psf.upfronthosting.co.za> New submission from Stefan Krah : Got this failure on Debian lenny amd64: [1/1] test_signal test test_signal failed -- Traceback (most recent call last): File "/home/stefan/cpython/Lib/test/test_signal.py", line 339, in test_pending """, *signals) File "/home/stefan/cpython/Lib/test/test_signal.py", line 263, in check_wakeup assert_python_ok('-c', code) File "/home/stefan/cpython/Lib/test/script_helper.py", line 50, in assert_python_ok return _assert_python(True, *args, **env_vars) File "/home/stefan/cpython/Lib/test/script_helper.py", line 42, in _assert_python "stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore'))) AssertionError: Process return code is 1, stderr follows: Traceback (most recent call last): File "", line 41, in File "", line 16, in check_signum Exception: (10, 12) != (12, 10) 1 test failed: test_signal [103837 refs] ---------- components: Tests messages: 144718 nosy: skrah priority: normal severity: normal status: open title: test_signal failure versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 1 11:51:39 2011 From: report at bugs.python.org (Stefan Krah) Date: Sat, 01 Oct 2011 09:51:39 +0000 Subject: [New-bugs-announce] [issue13085] : memory leaks Message-ID: <1317462699.45.0.870961708747.issue13085@psf.upfronthosting.co.za> New submission from Stefan Krah : I think a couple of leaks were introduced by the pep-393 changes (see the patch). ---------- components: Interpreter Core files: pep-393-leaks.diff keywords: patch messages: 144719 nosy: haypo, loewis, skrah priority: normal severity: normal stage: patch review status: open title: : memory leaks type: resource usage versions: Python 3.3 Added file: http://bugs.python.org/file23281/pep-393-leaks.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 1 12:57:42 2011 From: report at bugs.python.org (Larry Hastings) Date: Sat, 01 Oct 2011 10:57:42 +0000 Subject: [New-bugs-announce] [issue13086] Update howto/cporting.rst so it talks about 3.x instead of 3.0 Message-ID: <1317466662.3.0.331555988129.issue13086@psf.upfronthosting.co.za> New submission from Larry Hastings : The title of howto/cporting.rst is "Porting Extension Modules To 3.0". It then talks about 3.0 in a whole bunch of places. Considering that we're working on 3.3, and considering that 3.0 is end-of-lifed (not even meriting a branch in hg), wouldn't it be better for the document to talk about "3.x"? It already talks about "2.x" in several places, so it's not like this would confuse the reader. Alternatively, we could remove the ".0" (and maybe the ".x"s) so the document talks about porting from "Python 2" to "Python 3". I'd be happy to make the patch / check in the change. ---------- assignee: larry components: Documentation messages: 144721 nosy: larry priority: low severity: normal status: open title: Update howto/cporting.rst so it talks about 3.x instead of 3.0 type: feature request versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 2 00:32:49 2011 From: report at bugs.python.org (John O'Connor) Date: Sat, 01 Oct 2011 22:32:49 +0000 Subject: [New-bugs-announce] [issue13087] C BufferedReader seek() is inconsistent with UnsupportedOperation for unseekable streams Message-ID: <1317508369.4.0.585699022019.issue13087@psf.upfronthosting.co.za> New submission from John O'Connor : The C implementation of BufferedReader.seek() does not throw an UnsupportedOperation exception when its underlying stream is unseekable IF the current buffer can accommodate the seek in memory. It probably saves a few cycles for the seekable streams but, I think currently, it is inconsistent with the _pyio implementation and documentation. ---------- components: IO files: unseekable.patch keywords: patch messages: 144751 nosy: haypo, jcon, pitrou priority: normal severity: normal status: open title: C BufferedReader seek() is inconsistent with UnsupportedOperation for unseekable streams type: behavior versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file23287/unseekable.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 2 01:32:57 2011 From: report at bugs.python.org (STINNER Victor) Date: Sat, 01 Oct 2011 23:32:57 +0000 Subject: [New-bugs-announce] [issue13088] Add Py_hexdigits constant: use one unique constant to format a digit to hexadecimal Message-ID: <1317511977.11.0.738521421258.issue13088@psf.upfronthosting.co.za> New submission from STINNER Victor : CPython source code contains a lot of duplicate "0123456789abcdef" constants, declared as static variables. Attached patch uses one unique variable. Use also Py_hexdigit instead of ((c>9) ? c+'a'-10 : c + '0') in binascii, _hashopenssl, md5, sha1, sha256 and sha512 modules. ---------- files: hexdigits.patch keywords: patch messages: 144754 nosy: haypo priority: normal severity: normal status: open title: Add Py_hexdigits constant: use one unique constant to format a digit to hexadecimal versions: Python 3.3 Added file: http://bugs.python.org/file23288/hexdigits.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 2 10:50:16 2011 From: report at bugs.python.org (Stefan Krah) Date: Sun, 02 Oct 2011 08:50:16 +0000 Subject: [New-bugs-announce] [issue13089] parsetok.c: memory leak Message-ID: <1317545416.55.0.717898890924.issue13089@psf.upfronthosting.co.za> New submission from Stefan Krah : Seen in test_mailbox: ==31621== 6 bytes in 2 blocks are definitely lost in loss record 27 of 10,370 ==31621== at 0x4C2154B: malloc (vg_replace_malloc.c:236) ==31621== by 0x5271A5: parsetok (parsetok.c:179) ==31621== by 0x526E8A: PyParser_ParseStringFlagsFilenameEx (parsetok.c:67) ==31621== by 0x4BC385: PyParser_ASTFromString (pythonrun.c:1898) ==31621== by 0x4BC1E1: Py_CompileStringExFlags (pythonrun.c:1842) ==31621== by 0x478AB8: builtin_compile (bltinmodule.c:626) ==31621== by 0x5759F3: PyCFunction_Call (methodobject.c:84) ==31621== by 0x48F2CF: ext_do_call (ceval.c:4292) ==31621== by 0x489992: PyEval_EvalFrameEx (ceval.c:2646) ==31621== by 0x48E67B: fast_function (ceval.c:4068) ==31621== by 0x48E3C7: call_function (ceval.c:4001) ==31621== by 0x4895E1: PyEval_EvalFrameEx (ceval.c:2605) ---------- components: Interpreter Core messages: 144763 nosy: skrah priority: normal severity: normal stage: needs patch status: open title: parsetok.c: memory leak type: resource usage versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 2 11:10:29 2011 From: report at bugs.python.org (Stefan Krah) Date: Sun, 02 Oct 2011 09:10:29 +0000 Subject: [New-bugs-announce] [issue13090] posix_read: memory leak Message-ID: <1317546629.79.0.861373881282.issue13090@psf.upfronthosting.co.za> New submission from Stefan Krah : Seen in test_multiprocessing: ==31662== 37 bytes in 1 blocks are definitely lost in loss record 629 of 10,548 ==31662== at 0x4C2154B: malloc (vg_replace_malloc.c:236) ==31662== by 0x53BBE9: PyBytes_FromStringAndSize (bytesobject.c:98) ==31662== by 0x4E2363: posix_read (posixmodule.c:6980) ==31662== by 0x5759D8: PyCFunction_Call (methodobject.c:81) ==31662== by 0x48E294: call_function (ceval.c:3980) ==31662== by 0x4895E1: PyEval_EvalFrameEx (ceval.c:2605) ==31662== by 0x48C54F: PyEval_EvalCodeEx (ceval.c:3355) ==31662== by 0x48E786: fast_function (ceval.c:4078) ==31662== by 0x48E3C7: call_function (ceval.c:4001) ==31662== by 0x4895E1: PyEval_EvalFrameEx (ceval.c:2605) ==31662== by 0x48C54F: PyEval_EvalCodeEx (ceval.c:3355) ==31662== by 0x48E786: fast_function (ceval.c:4078) ---------- components: Extension Modules messages: 144764 nosy: skrah priority: normal severity: normal stage: needs patch status: open title: posix_read: memory leak type: resource usage versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 2 11:11:58 2011 From: report at bugs.python.org (Stefan Krah) Date: Sun, 02 Oct 2011 09:11:58 +0000 Subject: [New-bugs-announce] [issue13091] ctypes: memory leak Message-ID: <1317546718.25.0.742978918789.issue13091@psf.upfronthosting.co.za> New submission from Stefan Krah : Seen in test_multiprocessing: ==31662== 44 bytes in 1 blocks are definitely lost in loss record 687 of 10,548 ==31662== at 0x4C2154B: malloc (vg_replace_malloc.c:236) ==31662== by 0x41CC27: PyMem_Malloc (object.c:1699) ==31662== by 0x127D9F51: resize (callproc.c:1664) ==31662== by 0x5759D8: PyCFunction_Call (methodobject.c:81) ==31662== by 0x48E294: call_function (ceval.c:3980) ==31662== by 0x4895E1: PyEval_EvalFrameEx (ceval.c:2605) ==31662== by 0x48E67B: fast_function (ceval.c:4068) ==31662== by 0x48E3C7: call_function (ceval.c:4001) ==31662== by 0x4895E1: PyEval_EvalFrameEx (ceval.c:2605) ==31662== by 0x48C54F: PyEval_EvalCodeEx (ceval.c:3355) ==31662== by 0x48E786: fast_function (ceval.c:4078) ==31662== by 0x48E3C7: call_function (ceval.c:4001) ---------- components: Extension Modules messages: 144765 nosy: skrah priority: normal severity: normal stage: needs patch status: open title: ctypes: memory leak type: resource usage versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 2 11:49:05 2011 From: report at bugs.python.org (Stefan Krah) Date: Sun, 02 Oct 2011 09:49:05 +0000 Subject: [New-bugs-announce] [issue13092] pep-393: memory leaks #2 Message-ID: <1317548945.05.0.236513746453.issue13092@psf.upfronthosting.co.za> New submission from Stefan Krah : I found a couple of additional leaks related to the PEP-393 changes. ---------- components: Interpreter Core files: pep-393-leaks-2.diff keywords: patch messages: 144767 nosy: loewis, skrah priority: normal severity: normal stage: patch review status: open title: pep-393: memory leaks #2 type: resource usage versions: Python 3.3 Added file: http://bugs.python.org/file23293/pep-393-leaks-2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 2 17:39:15 2011 From: report at bugs.python.org (Stefan Krah) Date: Sun, 02 Oct 2011 15:39:15 +0000 Subject: [New-bugs-announce] [issue13093] Redundant code in PyUnicode_EncodeDecimal() Message-ID: <1317569955.86.0.21646060057.issue13093@psf.upfronthosting.co.za> New submission from Stefan Krah : I can't see what this code is supposed to accomplish (see patch): while (collend < end) { if ((0 < *collend && *collend < 256) || !Py_UNICODE_ISSPACE(*collend) || Py_UNICODE_TODECIMAL(*collend)) break; } Since 'collend' and 'end' don't change in the loop, it would be infinite if the 'if' condition evaluated to false. But the 'if' condition is always true. ---------- components: Interpreter Core files: encode_decimal_redundant_code.diff keywords: needs review, patch messages: 144774 nosy: skrah priority: normal severity: normal stage: patch review status: open title: Redundant code in PyUnicode_EncodeDecimal() type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file23295/encode_decimal_redundant_code.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 3 16:39:57 2011 From: report at bugs.python.org (=?utf-8?b?VG9tw6HFoSBEdm/FmcOhaw==?=) Date: Mon, 03 Oct 2011 14:39:57 +0000 Subject: [New-bugs-announce] [issue13094] setattr misbehaves when used with lambdas inside for loop Message-ID: <1317652797.3.0.357677492942.issue13094@psf.upfronthosting.co.za> New submission from Tom?? Dvo??k : I have this python script, and run it in python 2.7.2 (installed from EPD_free 7.1-2 (32-bit), but I guess this has nothing to do with EPD. ----8<---fail.py------ class X(object): pass x = X() items = ["foo", "bar", "baz"] for each in items: setattr(x, each, lambda: each) print("foo", x.foo()) print("bar", x.bar()) print("baz", x.baz()) ----8<---fail.py------ I'd naively expect it to print ('foo', 'foo') ('bar', 'bar') ('baz', 'baz') ,but it surprisingly (and annoyingly) outputs ('foo', 'baz') ('bar', 'baz') ('baz', 'baz') Please, tell me that this is a bug :) I'd hate it if this was the intended behaviour. I spent two hours today before I found out this was the cause of my program to fail. Best regards, Tom?? Dvo??k ---------- components: None messages: 144819 nosy: Tom??.Dvo??k priority: normal severity: normal status: open title: setattr misbehaves when used with lambdas inside for loop versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 3 20:39:55 2011 From: report at bugs.python.org (Cal Leeming) Date: Mon, 03 Oct 2011 18:39:55 +0000 Subject: [New-bugs-announce] [issue13095] Support for splitting lists/tuples into chunks Message-ID: <1317667195.74.0.956951285114.issue13095@psf.upfronthosting.co.za> New submission from Cal Leeming : After a while of digging around, I noticed that the core libs don't provide an easy way of splitting a list/tuple into chunks - as per the following discussion: http://www.aspwinhost.com/In-what-way-do-you-split-an-list-into-evenly-sized-chunks-on-Python/ Therefore, I'd like to +1 feature request this. Any thoughts?? Cal ---------- components: Library (Lib) messages: 144831 nosy: sleepycal priority: normal severity: normal status: open title: Support for splitting lists/tuples into chunks type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Oct 4 05:47:39 2011 From: report at bugs.python.org (Meador Inge) Date: Tue, 04 Oct 2011 03:47:39 +0000 Subject: [New-bugs-announce] [issue13096] ctypes: segfault with large POINTER type names Message-ID: <1317700059.13.0.375039668353.issue13096@psf.upfronthosting.co.za> New submission from Meador Inge : Reproducible in 2.7 and tip: [meadori at motherbrain cpython]$ ./python Python 3.3.0a0 (default:61de28fa5537+d05350c14e77+, Oct 3 2011, 21:47:04) [GCC 4.6.0 20110603 (Red Hat 4.6.0-10)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes import * >>> T = type('x' * 2 ** 25, (Structure,), {}) >>> p = POINTER(T) Segmentation fault (core dumped) ---------- components: Extension Modules, ctypes messages: 144850 nosy: amaury.forgeotdarc, belopolsky, meador.inge priority: normal severity: normal stage: needs patch status: open title: ctypes: segfault with large POINTER type names type: crash versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Oct 4 05:57:17 2011 From: report at bugs.python.org (Meador Inge) Date: Tue, 04 Oct 2011 03:57:17 +0000 Subject: [New-bugs-announce] [issue13097] ctypes: segfault with large number of callback arguments Message-ID: <1317700637.71.0.186696346618.issue13097@psf.upfronthosting.co.za> New submission from Meador Inge : Reproducible in 2.7 and tip: [meadori at motherbrain cpython]$ ./python Python 3.3.0a0 (default:61de28fa5537+d05350c14e77+, Oct 3 2011, 21:47:04) [GCC 4.6.0 20110603 (Red Hat 4.6.0-10)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes import * >>> NARGS = 2 ** 20 >>> proto = CFUNCTYPE(None, *(c_int,) * NARGS) >>> def func(*args): ... return (1, "abc", None) ... >>> cb = proto(func) >>> cb(*(1,) * NARGS) Segmentation fault (core dumped) ---------- components: ctypes messages: 144852 nosy: amaury.forgeotdarc, belopolsky, meador.inge priority: normal severity: normal stage: needs patch status: open title: ctypes: segfault with large number of callback arguments type: crash versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Oct 4 11:52:30 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 04 Oct 2011 09:52:30 +0000 Subject: [New-bugs-announce] [issue13098] the struct module should support storage for size_t / Py_ssize_t C types Message-ID: <1317721950.11.0.748294685734.issue13098@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Title says it all. ---------- components: Library (Lib) messages: 144867 nosy: mark.dickinson, meador.inge, pitrou, skrah priority: normal severity: normal stage: needs patch status: open title: the struct module should support storage for size_t / Py_ssize_t C types type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Oct 4 12:46:39 2011 From: report at bugs.python.org (Thomas Kluyver) Date: Tue, 04 Oct 2011 10:46:39 +0000 Subject: [New-bugs-announce] [issue13099] Sqlite3 & turkish locale Message-ID: <1317725199.69.0.486458552577.issue13099@psf.upfronthosting.co.za> New submission from Thomas Kluyver : When using sqlite3 with the Turkish locale, cursor.lastrowid is not accessible after an insert statement if "INSERT" is upper case. I believe that the cause is that the detect_statement_kind function [1] calls the locale-dependent C function tolower(). The Turkish locale specifies a different case mapping for I (to a dotless lowercase i: ?), so it's not recognised as an insert statement, which looks like it will cause the transaction to be committed immediately. See also the discussion on issue 1813 [2], and a Redhat bug with a test case for this [3]. [1] http://hg.python.org/cpython/file/c4b6d9312da1/Modules/_sqlite/cursor.c#l41 [2] http://bugs.python.org/issue1813 [3] https://bugzilla.redhat.com/show_bug.cgi?id=720209 ---------- components: Extension Modules messages: 144873 nosy: takluyver priority: normal severity: normal status: open title: Sqlite3 & turkish locale versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Oct 4 19:11:58 2011 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Oct 2011 17:11:58 +0000 Subject: [New-bugs-announce] [issue13100] sre_compile._optimize_unicode() needs a cleanup Message-ID: <1317748318.81.0.992039803801.issue13100@psf.upfronthosting.co.za> New submission from STINNER Victor : The following comment is wrong, except IndexError: # non-BMP characters; XXX now they should work return charset sys.maxunicode != 65535 is now always true in Python 3.3 if sys.maxunicode != 65535: # XXX: negation does not work with big charsets # XXX2: now they should work, but removing this will make the # charmap 17 times bigger return charset See the related commit: f39b26ca7f3d (from issue #13054). ---------- components: Library (Lib), Regular Expressions, Unicode messages: 144905 nosy: ezio.melotti, haypo, pitrou priority: normal severity: normal status: open title: sre_compile._optimize_unicode() needs a cleanup versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Oct 4 20:36:49 2011 From: report at bugs.python.org (Brian Curtin) Date: Tue, 04 Oct 2011 18:36:49 +0000 Subject: [New-bugs-announce] [issue13101] Module Doc viewer closes when browser window closes on Windows 8 Message-ID: <1317753409.09.0.358970019617.issue13101@psf.upfronthosting.co.za> New submission from Brian Curtin : Reported by Ryan Wells (v-rywel at microsoft.com) of Microsoft, in reference to a problem with the Module Doc viewer on Windows 8 when using Internet Explorer 10. This was reported on 3.2.2, but it's likely the same on 2.7. Reference #: 70652 Description of the Problem: The application Python Module Doc is automatically closed when Internet Explorer 10 is closed. Steps to Reproduce: 1. Install Windows Developer Preview 2. Install Python 3.2.2 3. Launch Module Doc. Start Menu -> All Program -> Python -> Manual Docs 4. Click on the button open browser 5. It should open the site http://localhost:7464/ In Internet Explorer 10 and the contents should be displayed 6. Should be able to view list of Modules, Scripts, DLLs, and Libraries etc. 7. Close Internet Explorer Expected Result: Internet Explorer 10 should only get closed and we should be able to work with the application Module Doc. Actual Result: The application Module Doc is closed with Internet Explorer 10. Developer Notes: There is likely a difference in return values between IE8 and IE9/10 when launched from the app. ---------- assignee: docs at python components: Documentation, Windows messages: 144918 nosy: brian.curtin, docs at python priority: normal severity: normal status: open title: Module Doc viewer closes when browser window closes on Windows 8 type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Oct 4 22:11:54 2011 From: report at bugs.python.org (Glenn Washburn) Date: Tue, 04 Oct 2011 20:11:54 +0000 Subject: [New-bugs-announce] [issue13102] xml.dom.minidom does not support default namespaces Message-ID: <1317759114.05.0.782450819911.issue13102@psf.upfronthosting.co.za> New submission from Glenn Washburn : When using getAttributeNS, attributes with no namespace should be considered as having the default namespace for that scope. See examples in http://www.w3.org/TR/REC-xml-names/#defaulting. Python's xml.dom.minidom will always set the namespace to None for attributes that have no namespace prefix. I've attached a test program to illustrate this issue in action. The output I get is: [((None, u'attr'), u'value1')] [(('http://www.w3.org/2000/xmlns/', 'xmlns'), u'http://path/to/ns2#'), ((None, u'attr'), u'value2')] [((u'http://path/to/ns2#', u'attr'), u'value3')] Successfully got child3 attr value In the first two cases the namespaceURI is None, but it should be set to the default namespace specified in the root element. I believe this problem occurs with all *NS functions. Not tested in 3.x. ---------- components: XML files: test.py messages: 144924 nosy: crass priority: normal severity: normal status: open title: xml.dom.minidom does not support default namespaces type: behavior versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file23313/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Oct 4 22:41:19 2011 From: report at bugs.python.org (Xavier de Gaye) Date: Tue, 04 Oct 2011 20:41:19 +0000 Subject: [New-bugs-announce] [issue13103] copy of an asyncore dispatcher causes infinite recursion Message-ID: <1317760879.94.0.397539088986.issue13103@psf.upfronthosting.co.za> New submission from Xavier de Gaye : A regression occurs in python 3.2 when doing a copy of an asyncore dispatcher. $ python3.1 Python 3.1.2 (r312:79147, Apr 4 2010, 17:46:48) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import asyncore, copy >>> copy.copy(asyncore.dispatcher()) $ python3.2 Python 3.2 (r32:88445, Jun 18 2011, 20:30:18) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import asyncore, copy >>> copy.copy(asyncore.dispatcher()) Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.2/copy.py", line 97, in copy return _reconstruct(x, rv, 0) File "/usr/local/lib/python3.2/copy.py", line 291, in _reconstruct if hasattr(y, '__setstate__'): File "/usr/local/lib/python3.2/asyncore.py", line 410, in __getattr__ retattr = getattr(self.socket, attr) .... File "/usr/local/lib/python3.2/asyncore.py", line 410, in __getattr__ retattr = getattr(self.socket, attr) File "/usr/local/lib/python3.2/asyncore.py", line 410, in __getattr__ retattr = getattr(self.socket, attr) RuntimeError: maximum recursion depth exceeded while calling a Python object This occurs after the 'copy' module has created the new instance with __new__(). This new instance does not have the 'socket' attribute, hence the infinite recursion. Adding the following methods to the dispatcher class, fixes the infinite recursion: def __getstate__(self): state = self.__dict__.copy() return state def __setstate__(self, state): self.__dict__.update(state) But it does not explain why the recursion occurs in 3.2 and not in 3.1. ---------- components: Extension Modules messages: 144925 nosy: xdegaye priority: normal severity: normal status: open title: copy of an asyncore dispatcher causes infinite recursion type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Oct 5 01:02:51 2011 From: report at bugs.python.org (Deokhwan Kim) Date: Tue, 04 Oct 2011 23:02:51 +0000 Subject: [New-bugs-announce] [issue13104] urllib.request.thishost() returns a garbage value Message-ID: <1317769371.74.0.590194297783.issue13104@psf.upfronthosting.co.za> New submission from Deokhwan Kim : There is a minor typo in Lib/urllib/request.py:thishost(). Because of it, the thishost() function is returning a garbage value: >>> import urllib.request >>> urllib.request.thishost() ('XXXXXXX.XXXXX.XXX.com', ['X.XXXXX.XXX.com'], ['123.45.67.89']) It is expected to return the IP addresses of the current host, so the correct return value would be like: >>> urllib.request.thishost.__doc__ 'Return the IP addresses of the current host.' >>> urllib.request.thishost() ('127.0.0.1', '127.0.1.1') The attached patch will fix the mistake . ---------- components: Library (Lib) files: thishost.patch keywords: patch messages: 144929 nosy: dkim priority: normal severity: normal status: open title: urllib.request.thishost() returns a garbage value type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file23316/thishost.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Oct 5 01:24:16 2011 From: report at bugs.python.org (Larry Hastings) Date: Tue, 04 Oct 2011 23:24:16 +0000 Subject: [New-bugs-announce] [issue13105] Please elaborate on how 2.x and 3.x are different heads Message-ID: <1317770656.72.0.880626385137.issue13105@psf.upfronthosting.co.za> New submission from Larry Hastings : It wasn't clear to me after reading the "Forward Porting" section exactly what was going on. Nick Coghlan spelled it out for me in a private email, and suggested that maybe this stuff should be in the devguide proper. Here's some specific stuff that I didn't understand until Nick explained it to me with simple words: * 2.x and 3.x have separate heads in the same repository * Since they're totally divorced, the order you check in to 2.x and 3.x does not matter * DO NOT MERGE between 2.x and 3.x * Branches that are in security-fix-only mode (e.g. 3.1) don't get bugfixes or documentation fixes (surely mentioned elsewhere, but I personally would have been helped with a reminder) I suggest it'd be clearer to start with discussing "2.x and 3.x are separate heads", and *then* move on to "But when merging changes solely inside a major version" and talk about forward-porting. Would you be interested in a patch? ---------- components: Devguide messages: 144930 nosy: larry priority: normal severity: normal status: open title: Please elaborate on how 2.x and 3.x are different heads type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Oct 5 04:11:49 2011 From: report at bugs.python.org (Aaron Staley) Date: Wed, 05 Oct 2011 02:11:49 +0000 Subject: [New-bugs-announce] [issue13106] Incorrect pool.py distributed with Python 2.7 windows 32bit Message-ID: <1317780709.51.0.218213650028.issue13106@psf.upfronthosting.co.za> New submission from Aaron Staley : The multiprocess/pool.py distributed with the Python 2.7.2 Windows Installer is different from the one distributed with the 64 bit windows installer or source tarball - and is buggy. Specifically, see Pool._terminate_pool: def _terminate_pool(cls, taskqueue, inqueue, outqueue, pool, worker_handler, task_handler, result_handler, cache): # this is guaranteed to only be called once debug('finalizing pool') worker_handler._state = TERMINATE task_handler._state = TERMINATE taskqueue.put(None) # THIS LINE MISSING! Without that line, termination may deadlock during Pool._help_stuff_finish. The consequence to the user is the interpreter not shutting down. ---------- components: Windows messages: 144934 nosy: Aaron.Staley priority: normal severity: normal status: open title: Incorrect pool.py distributed with Python 2.7 windows 32bit versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Oct 5 13:08:23 2011 From: report at bugs.python.org (Adam Byrtek) Date: Wed, 05 Oct 2011 11:08:23 +0000 Subject: [New-bugs-announce] [issue13107] Text width in optparse.py can become negative Message-ID: <1317812903.38.0.572106699519.issue13107@psf.upfronthosting.co.za> New submission from Adam Byrtek : Code snippet from optparse.py: 344 self.help_position = min(max_len + 2, self.max_help_position) 345 self.help_width = self.width - self.help_position Where self.width is initialized with the COLUMNS environment variable. On narrow terminals it can happen that self.help_position < self.width, leading to an exception in textwrap.py: raise ValueError("invalid width %r (must be > 0)" % self.width) ValueError: invalid width -15 (must be > 0) A reasonable workaround would be to trim part of the help text instead of causing an exception. ---------- components: Library (Lib) messages: 144947 nosy: adambyrtek priority: normal severity: normal status: open title: Text width in optparse.py can become negative type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Oct 5 23:04:49 2011 From: report at bugs.python.org (Stefan Krah) Date: Wed, 05 Oct 2011 21:04:49 +0000 Subject: [New-bugs-announce] [issue13108] test_urllib: buildbot failure Message-ID: <1317848689.77.0.919610092444.issue13108@psf.upfronthosting.co.za> New submission from Stefan Krah : The FreeBSD-amd64 and Fedora buildbots are recently failing with: ====================================================================== ERROR: test_thishost (test.test_urllib.Utility_Tests) Test the urllib.request.thishost utility function returns a tuple ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.krah-fedora/build/Lib/test/test_urllib.py", line 1063, in test_thishost self.assertIsInstance(urllib.request.thishost(), tuple) File "/home/buildbot/buildarea/3.x.krah-fedora/build/Lib/urllib/request.py", line 2128, in thishost _thishost = tuple(socket.gethostbyname_ex(socket.gethostname())[2]) socket.gaierror: [Errno -2] Name or service not known ---------------------------------------------------------------------- ---------- components: Tests messages: 144971 nosy: skrah priority: normal severity: normal status: open title: test_urllib: buildbot failure versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Oct 5 23:08:09 2011 From: report at bugs.python.org (xy zzy) Date: Wed, 05 Oct 2011 21:08:09 +0000 Subject: [New-bugs-announce] [issue13109] telnetlib insensitive to connection loss Message-ID: <1317848889.2.0.2461830982.issue13109@psf.upfronthosting.co.za> New submission from xy zzy : Using python's telnetlib I can connect and communicate with a device. While the telnet session is active I can disconnect the network cable of the device. At this point, I would expect read_until() with a timeout to throw a socket.error, EOFError or perhaps an IOError, but what I actually get is a null string. Because I'm reading in a loop, when the cable is reconnected the device will resume communicating, and the program will continue. My best guess ts that read_until() or perhaps everything except open() is insensitive to the loss of a connection. ---------- components: IO messages: 144972 nosy: xy.zzy priority: normal severity: normal status: open title: telnetlib insensitive to connection loss type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Oct 5 23:51:15 2011 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 05 Oct 2011 21:51:15 +0000 Subject: [New-bugs-announce] [issue13110] test_socket.py failures on ARM Message-ID: <1317851475.03.0.915061914039.issue13110@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : Initial results from warsaw-ubuntu-arm buildbot indicates two failures in test_socket.py ====================================================================== ERROR: test_create_connection_timeout (test.test_socket.NetworkConnectionNoServer) ---------------------------------------------------------------------- Traceback (most recent call last): File "/var/lib/buildbot/buildarea/2.7.warsaw-ubuntu-arm/build/Lib/test/test_socket.py", line 1198, in test_create_connection_timeout socket.create_connection((HOST, 1234)) File "/var/lib/buildbot/buildarea/2.7.warsaw-ubuntu-arm/build/Lib/socket.py", line 571, in create_connection raise err error: [Errno 97] Address family not supported by protocol ====================================================================== FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer) ---------------------------------------------------------------------- Traceback (most recent call last): File "/var/lib/buildbot/buildarea/2.7.warsaw-ubuntu-arm/build/Lib/test/test_socket.py", line 1191, in test_create_connection self.assertEqual(cm.exception.errno, errno.ECONNREFUSED) AssertionError: 97 != 111 ---------------------------------------------------------------------- I'm still investigating, but wanted to file the bug now so there's an issue number to reference. ---------- components: Tests messages: 144974 nosy: barry priority: normal severity: normal status: open title: test_socket.py failures on ARM versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 6 00:55:27 2011 From: report at bugs.python.org (MA S) Date: Wed, 05 Oct 2011 22:55:27 +0000 Subject: [New-bugs-announce] [issue13111] Error 2203 when installing Python/Perl? Message-ID: <1317855327.52.0.585487977144.issue13111@psf.upfronthosting.co.za> New submission from MA S : I can't install Python or Strawberry Perl on the Windows 8 Developer Preview :( I keep getting installer error 2203; the log file's attached. I really don't know what's wrong... ---------- components: Windows files: python.log messages: 144975 nosy: MA.S priority: normal severity: normal status: open title: Error 2203 when installing Python/Perl? type: crash versions: Python 2.7 Added file: http://bugs.python.org/file23320/python.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 6 01:31:34 2011 From: report at bugs.python.org (yoch) Date: Wed, 05 Oct 2011 23:31:34 +0000 Subject: [New-bugs-announce] [issue13112] backreferences in comprehensions Message-ID: <1317857494.55.0.915280284739.issue13112@psf.upfronthosting.co.za> New submission from yoch : Hi, I would like to use backreferences in list comprehensions (or other comprehensions), such as : [[elt for elt in lst if elt] for lst in matrix if \{1}] # \{1} is back reference to [elt for elt in lst if elt] # to filter the result of the first comprehension It would be possible to do this ? Thanks ---------- messages: 144976 nosy: yoch.melka priority: normal severity: normal status: open title: backreferences in comprehensions type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 6 13:55:00 2011 From: report at bugs.python.org (telmich) Date: Thu, 06 Oct 2011 11:55:00 +0000 Subject: [New-bugs-announce] [issue13113] Wrong error message on class instance, when giving too little positional arguments Message-ID: <1317902100.22.0.844321043638.issue13113@psf.upfronthosting.co.za> New submission from telmich : I've this class: class Path: """Class that handles path related configurations""" def __init__(self, target_host, remote_user, remote_prefix, initial_manifest=False, base_dir=None, debug=False): That is falsely instantiated from a different class with these arguments: self.path = cdist.path.Path(self.target_host, initial_manifest=initial_manifest, base_dir=home, debug=debug) Which results in the following traceback: [13:40] kr:cdist% ./bin/cdist config -d localhost Traceback (most recent call last): File "./bin/cdist", line 119, in commandline() File "./bin/cdist", line 102, in commandline args.func(args) File "/home/users/nico/oeffentlich/rechner/projekte/cdist/lib/cdist/config.py", line 296, in config c = Config(host, initial_manifest=args.manifest, home=args.cdist_home, debug=args.debug) File "/home/users/nico/oeffentlich/rechner/projekte/cdist/lib/cdist/config.py", line 52, in __init__ debug=debug) TypeError: __init__() takes at least 4 arguments (5 given) Problem: - there are 5 arguments, so an error message indicating there are at least 4 needed is not helpful Proposal (pseudocode): Change to "Only %d of %d required positional arguments given" required_positional, giving_positional ---------- components: Interpreter Core messages: 145002 nosy: telmich priority: normal severity: normal status: open title: Wrong error message on class instance, when giving too little positional arguments type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 6 15:22:42 2011 From: report at bugs.python.org (=?utf-8?b?0JrQuNGA0LjQu9C7INCa0YPQt9GM0LzQuNC90YvRhQ==?=) Date: Thu, 06 Oct 2011 13:22:42 +0000 Subject: [New-bugs-announce] [issue13114] UnicodeDecodeError in command `register` due to using not ASCII chars in long_description Message-ID: <1317907362.37.0.133459111826.issue13114@psf.upfronthosting.co.za> New submission from ?????? ????????? : Command `register` (and `check -r` too) raises the exception UnicodeDecodeError if the long_description (stored as unicode) contains not ASCII chars. This is because the Docutils, called from Distutils, accepts only ASCII or Unicode. But Distutils passes to Docutils text as a `str` (ASCII or UTF-8). PS: sorry for my English ---------- assignee: tarek components: Distutils files: trace.log messages: 145007 nosy: Cykooz, eric.araujo, tarek priority: normal severity: normal status: open title: UnicodeDecodeError in command `register` due to using not ASCII chars in long_description type: crash versions: Python 2.7 Added file: http://bugs.python.org/file23327/trace.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 6 16:10:26 2011 From: report at bugs.python.org (Andrew Wilkins) Date: Thu, 06 Oct 2011 14:10:26 +0000 Subject: [New-bugs-announce] [issue13115] tp_as_{number, sequence, mapping} can't be set using PyType_FromSpec Message-ID: <1317910226.56.0.365091018544.issue13115@psf.upfronthosting.co.za> New submission from Andrew Wilkins : I've written an extension using Py_LIMITED_API, and I've created a type using PyType_FromSpec with the slot "Py_sq_length" defined. The slot is not being picked up, i.e. len(MyType()) fails. I can see that tp_as_sequence has not been set, which explains why. All is well if I set it manually (without Py_LIMITED_API defined), like so: MyType->tp_as_sequence = &((PyHeapTypeObject*)MyType)->as_sequence; As far as I can see (docs are lacking), there's no way of setting tp_as_number, tp_as_sequence or tp_as_mapping in types created with PyType_FromSpec. I would expect the presence of any Py_sq_* slots to set tp_as_sequence (likewise for number and mapping). ---------- components: Interpreter Core messages: 145013 nosy: awilkins priority: normal severity: normal status: open title: tp_as_{number,sequence,mapping} can't be set using PyType_FromSpec versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 6 17:42:42 2011 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 06 Oct 2011 15:42:42 +0000 Subject: [New-bugs-announce] [issue13116] setup.cfg in [sb]dists should be static Message-ID: <1317915762.54.0.969795427533.issue13116@psf.upfronthosting.co.za> New submission from ?ric Araujo : Some people (hi Ronny :) want to use a setup hook to get the version from the VCS, but the setup.cfg file in sdists and bdists should be fully static, because getting the VCS info is not possible and maybe for other reasons too (not requiring development dependencies for example, the same argument that makes people include generated HTML docs in sdists). The way to handle that seems simple: sdist runs setup hooks and writes back the modified config object to the setup.cfg file that?s included in sdists and bdists. Command hooks are unaffected, as are post/pre install/remove hooks (to be added in #12416). Another idea would be to split global hooks into two kinds. The code would run the volatile hooks, write the modified config as setup.cfg for *dists, and then run regular hooks. Users installing a *dist will execute the regular hooks. ---------- assignee: tarek components: Distutils2 messages: 145021 nosy: alexis, eric.araujo, tarek priority: normal severity: normal status: open title: setup.cfg in [sb]dists should be static versions: 3rd party, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 6 20:32:39 2011 From: report at bugs.python.org (=?utf-8?q?Francisco_Mart=C3=ADn_Brugu=C3=A9?=) Date: Thu, 06 Oct 2011 18:32:39 +0000 Subject: [New-bugs-announce] =?utf-8?q?=5Bissue13117=5D_Broken_links_in_th?= =?utf-8?b?ZSDigJxjb21waWxlcuKAnSBwYWdlLCBzZWN0aW9uIOKAnHJlZmVyZW5jZXM=?= =?utf-8?q?=E2=80=9D_from_the_devguide=2E?= Message-ID: <1317925959.0.0.308627128494.issue13117@psf.upfronthosting.co.za> New submission from Francisco Mart?n Brugu? : Hi, In the page http://docs.python.org/devguide/compiler.html the links in the references [1] (http://www.foretec.com/python/workshops/1998-11/proceedings/papers/montanaro/montanaro.html) and in [Wang97] (http://www.cs.princeton.edu/%7Edanwang/Papers/dsl97/dsl97.html) are broken. Cheers, francis ---------- components: Devguide messages: 145030 nosy: francismb priority: normal severity: normal status: open title: Broken links in the ?compiler? page, section ?references? from the devguide. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 6 20:35:25 2011 From: report at bugs.python.org (=?utf-8?q?F=C3=A9lix-Antoine_Fortin?=) Date: Thu, 06 Oct 2011 18:35:25 +0000 Subject: [New-bugs-announce] [issue13118] Py_BuildValue format f incorrect description. Message-ID: <1317926125.15.0.437576148609.issue13118@psf.upfronthosting.co.za> New submission from F?lix-Antoine Fortin : Python/C API Reference Manual, section Utilities, Parsing arguments and building values, function Py_BuildValue. The description for the format unit "f" is incorrect. It reads "Same as d.", as it should be "Convert a C float to a Python floating point number." since "f" is not the same as "d" when converting double to Python float. This was corrected in the documentation of Python 3, from which the proposed description comes. ---------- assignee: docs at python components: Documentation messages: 145031 nosy: docs at python, felixantoinefortin priority: normal severity: normal status: open title: Py_BuildValue format f incorrect description. versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 6 22:59:48 2011 From: report at bugs.python.org (M. Zilmer) Date: Thu, 06 Oct 2011 20:59:48 +0000 Subject: [New-bugs-announce] [issue13119] Newline for print() is \n on Windows, and not \r\n as expected Message-ID: <1317934788.08.0.425265217585.issue13119@psf.upfronthosting.co.za> New submission from M. Zilmer : In 3.2.2 the newline for print() is \n on Windows, and not \r\n as expected. In 3.1.4 the newline is \r\n. OS is Win 7, and tried on both 32 and 64 bit. Small example with output is attached. ---------- components: Windows files: newline.py messages: 145039 nosy: M..Z. priority: normal severity: normal status: open title: Newline for print() is \n on Windows, and not \r\n as expected type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file23330/newline.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 6 23:17:28 2011 From: report at bugs.python.org (Ben Bass) Date: Thu, 06 Oct 2011 21:17:28 +0000 Subject: [New-bugs-announce] [issue13120] Default nosigint optionto pdb.Pdb() prevents use in non-main thread Message-ID: <1317935848.16.0.589862913408.issue13120@psf.upfronthosting.co.za> New submission from Ben Bass : The new SIGINT behaviour of pdb.Pdb prevents use of pdb within a non-main thread without explicitly setting nosigint=True. Specifically the 'continue' command causes a traceback as follows: {{{ ... File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/pdb.py", line 959, in do_continue signal.signal(signal.SIGINT, self.sigint_handler) ValueError: signal only works in main thread }}} Since the new behaviour seems to be to gain an enhancement rather than anything fundamentally necessary to pdb, wouldn't it be better if the default was reversed, so the same code would work identically on Python 3.1 (and potentially earlier, i.e. Python2) and Python 3.2? At the moment in my codebase (rpcpdb) I'm using inspect.getargspec sniffing for nosigint on pdb.Pdb.__init__ to determine whether to include a nosigint=True parameter, which clearly isn't ideal! ---------- components: Library (Lib) messages: 145040 nosy: bpb priority: normal severity: normal status: open title: Default nosigint optionto pdb.Pdb() prevents use in non-main thread type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 7 10:50:34 2011 From: report at bugs.python.org (Lars Buitinck) Date: Fri, 07 Oct 2011 08:50:34 +0000 Subject: [New-bugs-announce] [issue13121] collections.Counter's += copies the entire object Message-ID: <1317977434.46.0.626100406816.issue13121@psf.upfronthosting.co.za> New submission from Lars Buitinck : I've found some counterintuitive behavior in collections.Counter while hacking on the scikit-learn project [1]. I wanted to use a bunch of Counters to do some simple term counting in a set of documents, roughly as follows: count_total = Counter() for doc in documents: count_current = Counter(analyze(doc)) count_total += count_current count_per_doc.append(count_current) Performance was horrible. After some digging, I found out that Counter [2] does not have __iadd__ and += copies the entire left-hand side in __add__. I've attached a patch that fixes the issue (for += only, and I've not patched the testsuite.) [1] https://github.com/scikit-learn/scikit-learn/commit/de6e93094499e4d81b8e3b15fc66b6b9252945af ---------- components: Library (Lib) files: cpython-counter-iadd.diff keywords: patch messages: 145063 nosy: larsmans priority: normal severity: normal status: open title: collections.Counter's += copies the entire object type: behavior versions: Python 3.4 Added file: http://bugs.python.org/file23336/cpython-counter-iadd.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 7 17:02:20 2011 From: report at bugs.python.org (Sven Marnach) Date: Fri, 07 Oct 2011 15:02:20 +0000 Subject: [New-bugs-announce] [issue13122] Out of date links in the sidebar of the documentation index of versions 3.1 and 3.2 Message-ID: <1317999740.46.0.922190010194.issue13122@psf.upfronthosting.co.za> New submission from Sven Marnach : The sidebar on http://docs.python.org/release/3.1.3/ names 3.2 as the development version of Python, while the link points to 3.3. The sidebar on http://docs.python.org/py3k/ links to 3.1 as the "stable version" -- obviously a relict from the time when 3.2 was in development. (This could be fixed in Doc/tools/sphinxext/indexsidebar.html of the respective branches.) ---------- assignee: docs at python components: Documentation messages: 145084 nosy: docs at python, smarnach priority: normal severity: normal status: open title: Out of date links in the sidebar of the documentation index of versions 3.1 and 3.2 versions: Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 7 17:22:40 2011 From: report at bugs.python.org (Paul Moore) Date: Fri, 07 Oct 2011 15:22:40 +0000 Subject: [New-bugs-announce] [issue13123] bdist_wininst uninstaller does not remove pycache directories Message-ID: <1318000960.21.0.140069466315.issue13123@psf.upfronthosting.co.za> New submission from Paul Moore : When uninstalling a package installed using a bdist_wininst installer, the uninstall reports "XXX files and directories could not be removed". The problem appears to be the __pycache__ directories introduced in Python 3.2, which are not removed properly. ---------- assignee: tarek components: Distutils, Windows messages: 145090 nosy: eric.araujo, pmoore, tarek priority: normal severity: normal status: open title: bdist_wininst uninstaller does not remove pycache directories type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 7 20:18:37 2011 From: report at bugs.python.org (Eric Snow) Date: Fri, 07 Oct 2011 18:18:37 +0000 Subject: [New-bugs-announce] [issue13124] Add "Running a Build Slave" page to the devguide Message-ID: <1318011517.56.0.343886781977.issue13124@psf.upfronthosting.co.za> New submission from Eric Snow : Here's a patch to add a page to the devguide on running a build slave. I copied pretty liberally from the wiki (http://wiki.python.org/moin/BuildBot). That page may or may not be up to date (I don't know), so the bulk of this new page may also be out of date... The current devguide buildbots page is oriented toward the use of buildbots in the dev process. In contrast, this new page is all about running one. I figured it is yet another easy way that people can contribute to Python. I didn't stick in the windows-specific buildbot info (http://wiki.python.org/moin/BuildbotOnWindows), but did link to the wiki page. I did include the info, as far as I understood it, from a recent python-dev thread (http://mail.python.org/pipermail/python-dev/2011-October/113935.html). I added a link to the devguide index page, but it may need to be shifted to the right spot (maybe right after "Running & Writing Tests"). I also renamed buildbots.rst to continuous_integration.rst (and updated reference accordingly). I want to be sure attribution is appropriate, regarding the text pulled from the wiki page and from the python-dev thread. Is linking to the thread sufficient? This is a rough stab (especially with the inclusion of the still-ongoing python-dev thread); but hopefully this gets a ball rolling and doesn't take much work to polish. :) ---------- assignee: docs at python components: Devguide, Documentation files: buildslaves.diff keywords: patch messages: 145120 nosy: brett.cannon, docs at python, eric.snow priority: normal severity: normal status: open title: Add "Running a Build Slave" page to the devguide type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file23338/buildslaves.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 7 20:38:13 2011 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 07 Oct 2011 18:38:13 +0000 Subject: [New-bugs-announce] [issue13125] test_all_project_files() expected failure Message-ID: <1318012693.65.0.29583104397.issue13125@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : In working on issue 11250, I noticed that lib2to3's test_parser.py tests were not enabled. Fixing that was easy enough, but then test_all_project_files() in TestParserIdempotency began failing. I've shaved enough yaks for the day so I am going to leave test_parser enabled but mark test_all_project_files() with @expectedFailure. Note that there are a number of failures here. There are two ParseErrors, one in main.py and one in pytree_idempotency.py. These both seem to fail on print(..., file=foo). After that, bom.py fails idempotency because the BOM does not show up in the converted file. ---------- components: Tests messages: 145122 nosy: barry, benjamin.peterson priority: normal severity: normal status: open title: test_all_project_files() expected failure versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 7 21:46:36 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 07 Oct 2011 19:46:36 +0000 Subject: [New-bugs-announce] [issue13126] find() slower than rfind() Message-ID: <1318016796.03.0.16031959225.issue13126@psf.upfronthosting.co.za> New submission from Antoine Pitrou : With some gcc versions, str.find() is slower than str.rfind(): - 11.22 0.0 s="ABC"*33; ((s+"D")*500+s+"E").find(s+"E") (*100) - 4.56 0.0 s="ABC"*33; ((s+"D")*500+"E"+s).find("E"+s) (*100) - 6.71 0.0 s="ABC"*33; (s+"E") in ((s+"D")*300+s+"E") (*100) - 11.22 0.0 s="ABC"*33; ((s+"D")*500+s+"E").index(s+"E") (*100) - 11.52 0.0 s="ABC"*33; ((s+"D")*500+s+"E").partition(s+"E") (*100) - 8.79 0.0 s="ABC"*33; ("E"+s+("D"+s)*500).rfind("E"+s) (*100) - 3.86 0.0 s="ABC"*33; (s+"E"+("D"+s)*500).rfind(s+"E") (*100) - 8.80 0.0 s="ABC"*33; ("E"+s+("D"+s)*500).rindex("E"+s) (*100) - 9.80 0.0 s="ABC"*33; ("E"+s+("D"+s)*500).rpartition("E"+s) (*100) - 9.83 0.0 s="ABC"*33; ("E"+s+("D"+s)*500).rsplit("E"+s, 1) (*100) - 11.56 0.0 s="ABC"*33; ((s+"D")*500+s+"E").split(s+"E", 1) (*100) Attached patch seems to fix it. ---------- components: Interpreter Core files: findperf.patch keywords: patch messages: 145136 nosy: haypo, pitrou priority: low severity: normal status: open title: find() slower than rfind() type: performance versions: Python 3.3 Added file: http://bugs.python.org/file23339/findperf.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 8 06:18:12 2011 From: report at bugs.python.org (Dillon Amburgey) Date: Sat, 08 Oct 2011 04:18:12 +0000 Subject: [New-bugs-announce] [issue13127] xml.dom.Attr.name is not labeled as read-only Message-ID: <1318047492.07.0.217686953928.issue13127@psf.upfronthosting.co.za> New submission from Dillon Amburgey : http://docs.python.org/library/xml.dom.html#dom-attr-objects does not label the name attribute as read-only (like localName) even though it is. ---------- assignee: docs at python components: Documentation messages: 145155 nosy: dillona, docs at python priority: normal severity: normal status: open title: xml.dom.Attr.name is not labeled as read-only _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 8 07:11:44 2011 From: report at bugs.python.org (Matt Spear) Date: Sat, 08 Oct 2011 05:11:44 +0000 Subject: [New-bugs-announce] [issue13128] httplib debuglevel on CONNECT doesn't print response headers Message-ID: <1318050704.97.0.551622649018.issue13128@psf.upfronthosting.co.za> New submission from Matt Spear : httplib with a debuglevel prints out the response headers, but does not do so with CONNECT requests (when set_tunnel is used). Attached is a small patch to print the reply when the CONNECT request returns something other than 200 OK. I'm not sure if it is worth printing the headers when a 200 OK is given. If it seems useful I can update the patch. Thanks!!! ---------- components: Library (Lib) files: httplib.py.patch keywords: patch messages: 145157 nosy: Matt.Spear priority: normal severity: normal status: open title: httplib debuglevel on CONNECT doesn't print response headers type: feature request versions: Python 2.7 Added file: http://bugs.python.org/file23342/httplib.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 8 07:15:48 2011 From: report at bugs.python.org (rmtew) Date: Sat, 08 Oct 2011 05:15:48 +0000 Subject: [New-bugs-announce] [issue13129] bad argument exceptions observed in AST Message-ID: <1318050948.4.0.561383872922.issue13129@psf.upfronthosting.co.za> New submission from rmtew : Platform Windows 7. hg id: a3f2dba93743+ (3.2) I do not know any reproduction steps for this bug outside as a side-effect within an incomplete and problematic Stackless merge. This bug also seems to exist in cpython, and is not in Stackless specific code. It seems to be bad exception handling, but maybe I do not understand all cases where this code is used. 1. ast_error_finish is called. 2. It calls PyErr_Fetch(&type, &value, &tback); 3. It them proceeds to treat 'value' as a tuple which results in PyErr_BadInternalCall being called and then being used in place of the original exception. Reproduction steps: 1. Sync http://hg.python.org/stackless. 2. Update to 3.2-slp branch. 3. Merge in changes from v3.2.1 to v3.2.2. 4. Compile and run regression tests. 5. Several exceptions will happen along the lines of bad argument where ast exceptions have happened and hit the problem above. ---------- files: ast.diff keywords: patch messages: 145158 nosy: rmtew priority: normal severity: normal status: open title: bad argument exceptions observed in AST versions: Python 3.2 Added file: http://bugs.python.org/file23343/ast.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 8 08:54:37 2011 From: report at bugs.python.org (Stefan Krah) Date: Sat, 08 Oct 2011 06:54:37 +0000 Subject: [New-bugs-announce] [issue13130] test_gdb: attempt to dereference a generic pointer Message-ID: <1318056877.65.0.853767349869.issue13130@psf.upfronthosting.co.za> New submission from Stefan Krah : The Fedora bot fails since yesterday: Breakpoint 1, builtin_id (self=, v=Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.krah-fedora/build/python-gdb.py", line 1329, in to_string return pyop.get_truncated_repr(MAX_OUTPUT_LEN) File "/home/buildbot/buildarea/3.x.krah-fedora/build/python-gdb.py", line 213, in get_truncated_repr self.write_repr(out, set()) File "/home/buildbot/buildarea/3.x.krah-fedora/build/python-gdb.py", line 1199, in write_repr proxy = self.proxyval(visited) File "/home/buildbot/buildarea/3.x.krah-fedora/build/python-gdb.py", line 1166, in proxyval Py_UNICODEs = [int(field_str[i]) for i in safe_range(field_length)] RuntimeError: Attempt to dereference a generic pointer. ) at Python/bltinmodule.c:927 927 return PyLong_FromVoidPtr(v); #0 builtin_id (self=, v=Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.krah-fedora/build/python-gdb.py", line 1329, in to_string return pyop.get_truncated_repr(MAX_OUTPUT_LEN) File "/home/buildbot/buildarea/3.x.krah-fedora/build/python-gdb.py", line 213, in get_truncated_repr self.write_repr(out, set()) File "/home/buildbot/buildarea/3.x.krah-fedora/build/python-gdb.py", line 1199, in write_repr proxy = self.proxyval(visited) File "/home/buildbot/buildarea/3.x.krah-fedora/build/python-gdb.py", line 1166, in proxyval Py_UNICODEs = [int(field_str[i]) for i in safe_range(field_length)] RuntimeError: Attempt to dereference a generic pointer. ) at Python/bltinmodule.c:927 #1 0x00000000004b667f in call_function (pp_stack=0x7fffffffd6e8, oparg=1) at Python/ceval.c:3988 #2 0x00000000004b0787 in PyEval_EvalFrameEx (f=Frame 0x7ffff7f409c0, for file , line 1, in (), throwflag=0) at Python/ceval.c:2625 #3 0x00000000004b44ca in PyEval_EvalCodeEx (_co=, globals={'__builtins__': , '__name__': '__main__', '__doc__': None, '__package__': None}, locals={'__builtins__': , '__name__': '__main__', '__doc__': None, '__package__': None}, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3375 #4 0x00000000004a4668 in PyEval_EvalCode (co=, globals={'__builtins__': , '__name__': '__main__', '__doc__': None, '__package__': None}, locals={'__builtins__': , '__name__': '__main__', '__doc__': None, '__package__': None}) at Python/ceval.c:770 #5 0x00000000004edc20 in run_mod (mod=0x9b0560, filename=0x619622 "", globals={'__builtins__': , '__name__': '__main__', '__doc__': None, '__package__': None}, locals={'__builtins__': , '__name__': '__main__', '__doc__': None, '__package__': None}, flags=0x7fffffffe3c0, arena=0x92e070) at Python/pythonrun.c:1795 #6 0x00000000004ed91e in PyRun_StringFlags (str=0x7ffff10e1418 "id('\\U0001d121')\n", start=257, globals={'__builtins__': , '__name__': '__main__', '__doc__': None, '__package__': None}, locals={'__builtins__': , '__name__': '__main__', '__doc__': None, '__package__': None}, flags=0x7fffffffe3c0) at Python/pythonrun.c:1729 #7 0x00000000004ebfb6 in PyRun_SimpleStringFlags (command=0x7ffff10e1418 "id('\\U0001d121')\n", flags=0x7fffffffe3c0) at Python/pythonrun.c:1302 #8 0x000000000050b41f in run_command (command=0x8e0500 L"id('\\U0001d121')\n", cf=0x7fffffffe3c0) at Modules/main.c:260 #9 0x000000000050bf70 in Py_Main (argc=4, argv=0x7ffff7faf040) at Modules/main.c:634 #10 0x0000000000416e97 in main (argc=4, argv=0x7fffffffe5a8) at ./Modules/python.c:59 ---------- components: Tests messages: 145161 nosy: haypo, loewis, skrah priority: normal severity: normal stage: needs patch status: open title: test_gdb: attempt to dereference a generic pointer type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 8 14:25:53 2011 From: report at bugs.python.org (Valery Khamenya) Date: Sat, 08 Oct 2011 12:25:53 +0000 Subject: [New-bugs-announce] [issue13131] FD leak in urllib2 Message-ID: <1318076753.32.0.0530567720617.issue13131@psf.upfronthosting.co.za> New submission from Valery Khamenya : Explanation from dablitz's comment at https://bugs.pypy.org/issue867 : urllib2 in the stdlib leaks fd's if an exception is raised while opening a connection. The issue occurs due to a socket being opened then an exception being raised before an object with the socket is returned, leaving no way to explicitly close the object. On cpython this would not be an issue as the object would lose all references almost immediately however it lingers around with a proper GC causing FD's to build up if the same condition happens repeatedly (eg a loop/web crawling) The file enclosed is a script to generate the leakage, to run invok it as follows leak.py pypy should start leaking FD's and can be see in /proc//fd Related issues: http://bugs.python.org/issue3066 http://bugs.python.org/issue1208304 http://bugs.python.org/issue1601399 ---------- components: IO, Library (Lib) files: leak.py messages: 145166 nosy: Valery.Khamenya priority: normal severity: normal status: open title: FD leak in urllib2 type: resource usage versions: Python 2.7 Added file: http://bugs.python.org/file23344/leak.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 8 16:56:28 2011 From: report at bugs.python.org (Mitchell Hashimoto) Date: Sat, 08 Oct 2011 14:56:28 +0000 Subject: [New-bugs-announce] [issue13132] distutils sends non-RFC compliant HTTP request Message-ID: <1318085788.89.0.459164084672.issue13132@psf.upfronthosting.co.za> New submission from Mitchell Hashimoto : In ``Lib/distutils/command/register.py`` as well as ``upload.py``, the following code exists to build the HTTP request body to send to the cheese shop server: body.write('\nContent-Disposition: form-data; name="%s"'%key) body.write("\n\n") RFC2616 page 31 (http://tools.ietf.org/html/rfc2616#page-31) states that headers must be separated by CRLF. Specifically, the above "\n\n" for the header separator is causing issues with some minimal RFC-compliant web servers. ---------- assignee: tarek components: Distutils messages: 145171 nosy: eric.araujo, mitchellh, tarek priority: normal severity: normal status: open title: distutils sends non-RFC compliant HTTP request versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 8 20:48:55 2011 From: report at bugs.python.org (Valery Khamenya) Date: Sat, 08 Oct 2011 18:48:55 +0000 Subject: [New-bugs-announce] [issue13133] FD leaks in ZipFile.read(), ZipFile.extract() and also using explicit arc_member.close() Message-ID: <1318099735.4.0.121973105523.issue13133@psf.upfronthosting.co.za> New submission from Valery Khamenya : The attached file reproduces 3 types of FD leaks and leads to the error like: IOError: [Errno 24] Too many open files: '/tmp/1019' For example if executed with pypy. ---------- components: IO, Library (Lib) files: zipfiletest.py messages: 145182 nosy: Valery.Khamenya priority: normal severity: normal status: open title: FD leaks in ZipFile.read(), ZipFile.extract() and also using explicit arc_member.close() type: resource usage versions: Python 2.7 Added file: http://bugs.python.org/file23347/zipfiletest.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 8 22:29:04 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 08 Oct 2011 20:29:04 +0000 Subject: [New-bugs-announce] [issue13134] speed up finding of one-character strings Message-ID: <1318105744.0.0.664183527644.issue13134@psf.upfronthosting.co.za> New submission from Antoine Pitrou : In stringlib/fastsearch, instead of using our own loops, we can use memchr() (and, if available, memrchr()) when looking for one-character strings. memchr() is generally quite optimized; on this Linux/glibc machine, I get speedups of 5x-10x: ./python -m timeit -s "large='a'*10000+'b'" "large.find('b')" -> before: 10.5 usec per loop -> after: 0.889 usec per loop ./python -m timeit -s "large='b'+'a'*10000" "large.rfind('b')" -> before: 7.06 usec per loop -> after: 1.94 usec per loop ---------- components: Interpreter Core messages: 145186 nosy: haypo, loewis, pitrou priority: normal severity: normal status: open title: speed up finding of one-character strings type: performance versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 8 23:53:38 2011 From: report at bugs.python.org (Marty Alchin) Date: Sat, 08 Oct 2011 21:53:38 +0000 Subject: [New-bugs-announce] [issue13135] Using type() as a constructor doesn't support new class keyword arguments Message-ID: <1318110818.93.0.631665925826.issue13135@psf.upfronthosting.co.za> New submission from Marty Alchin : PEP 3115 introduced keyword arguments to class definitions and changed metaclasses to use them instead. Unfortunately, `type()` doesn't seem to have been updated to accept those keyword arguments as well. What this amounts to is that using `type()` as a constructor can no longer fully replicate the behavior of a class definition. Therefore, classes that use keyword arguments can't be created dynamically. I would attempt a patch, but I don't have a development environment capable of compiling Python, so I wouldn't have any chance to test it. ---------- messages: 145190 nosy: gulopine priority: normal severity: normal status: open title: Using type() as a constructor doesn't support new class keyword arguments type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 9 00:18:31 2011 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 08 Oct 2011 22:18:31 +0000 Subject: [New-bugs-announce] [issue13136] speed-up conversion between unicode widths Message-ID: <1318112311.49.0.66949742663.issue13136@psf.upfronthosting.co.za> New submission from Antoine Pitrou : This patch speeds up _PyUnicode_CONVERT_BYTES by unrolling its loop. Example micro-benchmark: ./python -m timeit -s "a='x'*10000;b='\u0102'*1000;c='\U00100000'" "a+b+c" -> before: 100000 loops, best of 3: 14.9 usec per loop -> after: 100000 loops, best of 3: 9.19 usec per loop ---------- components: Interpreter Core files: unroll_convert_bytes.patch keywords: patch messages: 145192 nosy: pitrou priority: normal severity: normal stage: patch review status: open title: speed-up conversion between unicode widths type: performance versions: Python 3.3 Added file: http://bugs.python.org/file23351/unroll_convert_bytes.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 9 00:58:37 2011 From: report at bugs.python.org (Blair) Date: Sat, 08 Oct 2011 22:58:37 +0000 Subject: [New-bugs-announce] [issue13137] from __future__ import division breaks ad hoc numeric types Message-ID: <1318114717.45.0.0615506676272.issue13137@psf.upfronthosting.co.za> New submission from Blair : I believe that the use of __future__.division may have unintended consequences with user types that define division. The following fails: from __future__ import division class NumericType(object): def __init__(self,x): self.x = x def __div__(self,rhs): return self.x/rhs print NumericType(3.0) / 2.0 with the error message File "C:\proj_py\learning\future_bug\future.py", line 10, in print NumericType(3.0) / 2.0 TypeError: unsupported operand type(s) for /: 'NumericType' and 'float' Remove the line `from __future__ import division` and everything works fine. I am using Python 2.7.2 ---------- components: None messages: 145195 nosy: gumtree priority: normal severity: normal status: open title: from __future__ import division breaks ad hoc numeric types type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 9 02:49:32 2011 From: report at bugs.python.org (=?utf-8?q?Andreas_St=C3=BChrk?=) Date: Sun, 09 Oct 2011 00:49:32 +0000 Subject: [New-bugs-announce] [issue13138] ElementTree's Element.iter() lacks versionadded Message-ID: <1318121372.98.0.459756814836.issue13138@psf.upfronthosting.co.za> New submission from Andreas St?hrk : See http://docs.python.org/whatsnew/2.7.html#updated-module-elementtree-1-3 ---------- assignee: docs at python components: Documentation files: Element_iter_versionadded.patch keywords: patch messages: 145199 nosy: Trundle, docs at python priority: normal severity: normal status: open title: ElementTree's Element.iter() lacks versionadded versions: Python 2.7 Added file: http://bugs.python.org/file23352/Element_iter_versionadded.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 9 04:05:47 2011 From: report at bugs.python.org (Daniel Wagner-Hall) Date: Sun, 09 Oct 2011 02:05:47 +0000 Subject: [New-bugs-announce] [issue13139] multiprocessing.map skips finally blocks Message-ID: <1318125947.15.0.13973515193.issue13139@psf.upfronthosting.co.za> New submission from Daniel Wagner-Hall : import random from multiprocessing import Pool from time import sleep def Process(x): try: print x sleep(random.random()) raise Exception('Exception: ' + x) finally: print 'Finally: ' + x Pool(3).map(Process, ['1','2','3']) Expect all three Finally blocks to be called (or at least, one Finally per x printed by line 8) Actually, only one (occasionally two) are printed. Same behaviour exhibited on dual-core Mac running OSX 10.6 with Python 2.7, and single core Ubuntu running Python 2.6. ---------- components: None messages: 145201 nosy: illicitonion priority: normal severity: normal status: open title: multiprocessing.map skips finally blocks type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 9 22:18:45 2011 From: report at bugs.python.org (Florent Xicluna) Date: Sun, 09 Oct 2011 20:18:45 +0000 Subject: [New-bugs-announce] [issue13140] ThreadingMixIn.daemon_threads is not honored when parent is daemon Message-ID: <1318191525.3.0.322601594247.issue13140@psf.upfronthosting.co.za> New submission from Florent Xicluna : I use the socketserver.ThreadingMixIn to create a TCPServer. I set the server thread as daemon (t.daemon=True). But I want the client threads to run as non-daemon. According to the documentation, the "daemon_threads" class attribute should do the trick. But it fails: if server is daemon, the clients are daemon too, even if daemon_threads=False. Demo attached. ---------- components: Library (Lib) files: test_socketserver.py messages: 145273 nosy: flox priority: normal severity: normal stage: needs patch status: open title: ThreadingMixIn.daemon_threads is not honored when parent is daemon type: behavior versions: Python 2.6, Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file23361/test_socketserver.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 9 22:37:07 2011 From: report at bugs.python.org (Florent Xicluna) Date: Sun, 09 Oct 2011 20:37:07 +0000 Subject: [New-bugs-announce] [issue13141] get rid of old threading API in the examples Message-ID: <1318192627.46.0.311858462486.issue13141@psf.upfronthosting.co.za> New submission from Florent Xicluna : http://docs.python.org/dev/library/socketserver.html#asynchronous-mixins Still there's getName or setDaemon in some example. ---------- assignee: docs at python components: Documentation messages: 145274 nosy: docs at python, flox priority: low severity: normal stage: needs patch status: open title: get rid of old threading API in the examples type: behavior versions: Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 10 00:26:17 2011 From: report at bugs.python.org (Patrick Westerhoff) Date: Sun, 09 Oct 2011 22:26:17 +0000 Subject: [New-bugs-announce] [issue13142] Add support for other HTTP methods in urllib.request Message-ID: <1318199177.09.0.985752068879.issue13142@psf.upfronthosting.co.za> New submission from Patrick Westerhoff : Hey, I would like to request the support of other HTTP methods (other than GET and POST) in urllib.request. While it?s actually simple enough to override the Request class to add such a possibility, I think it is far too simple to leave it out of the standard library. I?ve attached a patch that adds the functionality with a simple `method` property. The `get_method` function then simply looks if a custom method was entered, and otherwise falls back to the default behaviour. Thanks a lot! Patrick Westerhoff Btw. Being a Git user, I hope the patch is actually useful ;) ---------- components: Library (Lib) files: urllib.patch keywords: patch messages: 145283 nosy: poke priority: normal severity: normal status: open title: Add support for other HTTP methods in urllib.request type: feature request versions: Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file23362/urllib.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 10 06:35:03 2011 From: report at bugs.python.org (Garen) Date: Mon, 10 Oct 2011 04:35:03 +0000 Subject: [New-bugs-announce] [issue13143] os.path.islink documentation is ambiguous Message-ID: <1318221303.29.0.86938915547.issue13143@psf.upfronthosting.co.za> New submission from Garen : The documentation for os.path.islink says: "Return True if path refers to a directory entry that is a symbolic link. Always False if symbolic links are not supported." But what does "supported" mean? "Supported" by what? Supported by the OS, or supported by the Python runtime? Because clearly there is a difference, which surprised me: PythonWin 2.7.2 (default, Jun 24 2011, 12:21:10) [MSC v.1500 32 bit (Intel)] on win32. Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information. >>> import os >>> os.path.islink(r"C:\Users\Garen\dev\pypy.exe") False >>> os.path.islink(r"C:\Users\Garen\dev\abspypy.exe") False Whereas if I use 3.2.x, I get the right answers: ActivePython 3.2.2.3 (ActiveState Software Inc.) based on Python 3.2.2 (default, Sep 8 2011, 10:56:38) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> import os >>> os.path.islink(r"C:\Users\Garen\dev\pypy.exe") True >>> os.path.islink(r"C:\Users\Garen\dev\abspypy.exe") True An additional surprise is that in other places of the Python runtime, if functionality is not implemented for Windows, an exception of type NotImplementedError is raised--but not in this case with os.path.islink(). This all makes it a hairy mess to properly detect symlinks--from the client code perspective, now one has to check for specific versions of python, specific versions of Windows, and possibly which file-system is being used (FAT vs NTFS) just to be able to determine if islink() is silently failing or not. After which the client side will want to add clarifying comments to compensate for what's missing from the official docs (as opposed to posting a link to the docs in a comment). As a user from the client side, I would only expect os.path.islink() to return False if the underlying OS/filesystem didn't support symlinks; if the underlying OS/filesystem did suport symlinks but support was missing, I'd expect to see a NoteImplementedError raised. In any case, where behavior for os.path.islink() (and related routines) deviates from the above pattern, I'd expect documentation that indicates what those deviations are--in this case, that False means unsupported by the Python runtime regardless of whether the OS/filesystem provides that functionality. ---------- messages: 145290 nosy: Garen priority: normal severity: normal status: open title: os.path.islink documentation is ambiguous versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 10 14:16:08 2011 From: report at bugs.python.org (Graeme Glass) Date: Mon, 10 Oct 2011 12:16:08 +0000 Subject: [New-bugs-announce] [issue13144] Global Module Index link in the offline documentation is incorrect Message-ID: <1318248968.6.0.0439422849007.issue13144@psf.upfronthosting.co.za> New submission from Graeme Glass : On my machine (Ubuntu 11.04) the link to "Python Module Index" from the index page is incorrect in the "Indices and tables" section (it links to modindex.html instead of py-modindex.html). It links to the correct place in the navigation bar at the top right of the page. Navigation (Correct):
  • modules |
  • In the body (Incorrect):

    Indices and tables:

    ...
    The rain
    in Spain
    ''' is passed to the feed method, div, b, a, br, and span should all be passed to the handle_starttag method. Actual behavior The handle_data method receives the values
    ,,,
    , in addition to the regular text. This can be fixed by changing this (inside the parse_starttag method): m = hparse.attrfind_tolerant.search(rawdata, k) to m = hparse.attrfind_tolerant.match(rawdata, k) ---------- components: Library (Lib) messages: 146479 nosy: Christopher.Allen-Poole priority: normal severity: normal status: open title: HTMLParser improperly handling open tags when strict is False type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 27 10:50:25 2011 From: report at bugs.python.org (Ronny Pfannschmidt) Date: Thu, 27 Oct 2011 08:50:25 +0000 Subject: [New-bugs-announce] [issue13274] heapq pure python version uses islice without guarding for negative counts Message-ID: <1319705425.2.0.678284473913.issue13274@psf.upfronthosting.co.za> New submission from Ronny Pfannschmidt : the problem manifests when calling with negative counts when the c versions are used, a empty list is returned, however if the pure python version is called islice errors out ---------- components: Library (Lib) messages: 146483 nosy: Ronny.Pfannschmidt priority: normal severity: normal status: open title: heapq pure python version uses islice without guarding for negative counts type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 27 12:05:59 2011 From: report at bugs.python.org (Alexey Shamrin) Date: Thu, 27 Oct 2011 10:05:59 +0000 Subject: [New-bugs-announce] [issue13275] Recommend xml.etree for XML processing Message-ID: <1319709959.84.0.984784684468.issue13275@psf.upfronthosting.co.za> New submission from Alexey Shamrin : There are many libraries in Python stdlib [1] xml.dom xml.dom.minidom xml.dom.pulldom xml.sax xml.etree Tutorial mentions xml.dom and xml.sax. [2] In my experience xml.etree is the best library to quickly load some xml and mess with it. It would be nice to recommend people xml.etree in the tutorial [2] and in the beginning of section 19, "Structured Markup Processing Tools". [1] [1]: http://docs.python.org/library/markup.html [2]: http://docs.python.org/tutorial/stdlib.html#batteries-included ---------- assignee: docs at python components: Documentation messages: 146484 nosy: ash, docs at python priority: normal severity: normal status: open title: Recommend xml.etree for XML processing _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 27 17:30:55 2011 From: report at bugs.python.org (francisco) Date: Thu, 27 Oct 2011 15:30:55 +0000 Subject: [New-bugs-announce] [issue13276] distutils bdist_wininst created installer does not run the postinstallation script on uninstalling Message-ID: <1319729455.78.0.312367178712.issue13276@psf.upfronthosting.co.za> New submission from francisco : The bug can be reproduced by running the following command to create a Windows installer for the attached module: python setup.py bdist_wininst --install-script pis.py I include also the installer that I have created in the dist folder. The installer installs everything correctly and it runs the pis.py script, which simply creates a file in the USERPROFILE directory with the "Installing" string. However, when uninstalling the program from the Windows Control Panel the script is not called, what can be verified by checking that the "Uninstalling" string is not appended to the file. I am experiencing this problem in Windows 7 64 bits, but it may be present in other platforms. ---------- assignee: tarek components: Distutils files: foo.zip messages: 146492 nosy: eric.araujo, francisco, tarek priority: normal severity: normal status: open title: distutils bdist_wininst created installer does not run the postinstallation script on uninstalling versions: Python 2.7 Added file: http://bugs.python.org/file23536/foo.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 27 18:40:07 2011 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 27 Oct 2011 16:40:07 +0000 Subject: [New-bugs-announce] [issue13277] tzinfo subclasses information Message-ID: <1319733607.49.0.8093265907.issue13277@psf.upfronthosting.co.za> New submission from Senthil Kumaran : This was in the docs mailing list, not translated to bug report Paul Koning wrote: Section 8.1.6 of the library manual talks about utcoffset(dt)-dst(dt) as the "standard offset" and says that this should not depend on the date or +time but only on the location. This is not true as there cases were certain locations changed the time offsets as per their convenience. It is either a doc fix to remove that sentence if the datetime.astimezone does not depend upon utcoffset(dt)-dst(dt), or if it does, then it is a code fix. ---------- assignee: docs at python messages: 146501 nosy: docs at python, orsenthil priority: normal severity: normal stage: needs patch status: open title: tzinfo subclasses information type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 27 18:58:16 2011 From: report at bugs.python.org (Jeffrey Finkelstein) Date: Thu, 27 Oct 2011 16:58:16 +0000 Subject: [New-bugs-announce] [issue13278] Typo in documentation for sched module Message-ID: <1319734696.41.0.842696728904.issue13278@psf.upfronthosting.co.za> New submission from Jeffrey Finkelstein : In the documentation for the sched.scheduler.enter() function, change the phrase "Other then the relative time" to "Other than the relative time" (i.e. change "then" to "than"). ---------- assignee: docs at python components: Documentation messages: 146506 nosy: docs at python, jfinkels priority: normal severity: normal status: open title: Typo in documentation for sched module versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 27 19:52:41 2011 From: report at bugs.python.org (Richard Saunders) Date: Thu, 27 Oct 2011 17:52:41 +0000 Subject: [New-bugs-announce] [issue13279] Add memcmp into unicode_compare for optimizing compares Message-ID: <1319737961.76.0.990787408068.issue13279@psf.upfronthosting.co.za> New submission from Richard Saunders : In discussions of memcmp performance, (http://www.picklingtools.com/study.pdf) it was noted how well Python 2.7 can take advantage of faster memcmps (indeed, the rich comparisons are all memcmp calls). There have been some discussion on python-dev at python.org as well. With unicode and Python 3.3 (and anyPython 3.x) there are a few places we could call memcmp to make string comparisons faster, but they are not completely trivial. Basically, if the unicode strings are "1 byte kind", then memcmp can be used almost as is. If the unicode strings are the same kind, they can at least use memcmp to compare for equality or inequality. There is also a minor optimization laying in unicode_compare: if you are comparing two strings for equality/inequality, there is no reason to look at the entire string if the lengths are different. These 3 minor optimizations can make unicode_compare faster. ---------- components: Interpreter Core messages: 146508 nosy: RichIsMyName, asmodai, loewis, pitrou, scoder priority: normal severity: normal status: open title: Add memcmp into unicode_compare for optimizing compares type: performance versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 27 22:19:11 2011 From: report at bugs.python.org (Patrick Westerhoff) Date: Thu, 27 Oct 2011 20:19:11 +0000 Subject: [New-bugs-announce] [issue13280] argparse should use the new Formatter class Message-ID: <1319746751.8.0.206945992721.issue13280@psf.upfronthosting.co.za> New submission from Patrick Westerhoff : Hey, according to PEP 3101, the new string.Formatter class is supposed to replace the old string formatting with %. At least that is what I was always thinking. Given that argparse is a Python 3.2+ exclusive module, I think it should make use of that new formatting method. Is there any special reason why that is not the case and the old %-formatting is used? It feels a bit weird to have Python 3 code using only string.Formatter and then have a short section where the old formatter is used ? especially when that module was introduced with Python 3.2. ---------- components: Library (Lib) messages: 146516 nosy: poke priority: normal severity: normal status: open title: argparse should use the new Formatter class type: behavior versions: Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 27 22:30:44 2011 From: report at bugs.python.org (Brian Bernstein) Date: Thu, 27 Oct 2011 20:30:44 +0000 Subject: [New-bugs-announce] [issue13281] robotparser.RobotFileParser ignores rules preceeded by a blank line Message-ID: <1319747444.2.0.491041533825.issue13281@psf.upfronthosting.co.za> New submission from Brian Bernstein : When attempting to parse a robots.txt file which has a blank line between allow/disallow rules, all rules after the blank line are ignored. If a blank line occurs between the user-agent and its rules, all of the rules for that user-agent are ignored. I am not sure if having a blank line between rules is allowed in the spec, but I am seeing this behavior in a number of sites, for instance: http://www.whitehouse.gov/robots.txt has a blank line between the disallow rules all other lines, including the associated user-agent line, resulting in the python RobotFileParser to ignore all rules. http://www.last.fm/robots.txt appears to separate their rules with arbitrary blank lines between them. The python RobotFileParser only sees the first two rule between the user-agent and the next newline. If the parser is changed to simply ignore all blank lines, would it have any adverse affect on parsing robots.txt files? I am including a simple patch which ignores all blank lines and appears to find all rules from these robots.txt files. ---------- files: robotparser.py.patch keywords: patch messages: 146518 nosy: bernie9998 priority: normal severity: normal status: open title: robotparser.RobotFileParser ignores rules preceeded by a blank line type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file23538/robotparser.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 28 12:08:26 2011 From: report at bugs.python.org (wrobell) Date: Fri, 28 Oct 2011 10:08:26 +0000 Subject: [New-bugs-announce] [issue13282] the table of contents in epub file is too long Message-ID: <1319796506.79.0.347343158897.issue13282@psf.upfronthosting.co.za> New submission from wrobell : the table of contents in python documentation epub file is very very long. it takes several long minutes to jump from first page to a part containing language reference toc. imho it would be great if first page of epub file contained pointers to tutorial, lang ref, mod ref without detailed table of contents as it is at docs.python.org. ---------- assignee: docs at python components: Documentation messages: 146548 nosy: docs at python, wrobell priority: normal severity: normal status: open title: the table of contents in epub file is too long versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 28 12:14:23 2011 From: report at bugs.python.org (=?utf-8?q?Nicolas_=C3=89vrard?=) Date: Fri, 28 Oct 2011 10:14:23 +0000 Subject: [New-bugs-announce] [issue13283] removal of two unused variable in locale.py Message-ID: <1319796863.15.0.791142726242.issue13283@psf.upfronthosting.co.za> New submission from Nicolas ?vrard : While using pyflake on some of my file I noticed in a copied version of _group two unused variables. The attached patch fixed that very little annoyance. ---------- components: Library (Lib) files: locale.diff keywords: patch messages: 146549 nosy: nicoe priority: normal severity: normal status: open title: removal of two unused variable in locale.py type: resource usage versions: Python 2.7 Added file: http://bugs.python.org/file23540/locale.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 28 12:26:04 2011 From: report at bugs.python.org (Burak Arslan) Date: Fri, 28 Oct 2011 10:26:04 +0000 Subject: [New-bugs-announce] [issue13284] email.utils.formatdate function does not handle timezones correctly. Message-ID: <1319797564.66.0.629117270841.issue13284@psf.upfronthosting.co.za> New submission from Burak Arslan : There's an issue with email.utils.formatdate function, illustrated here: https://gist.github.com/1321994 for reference i'm on Europe/Istanbul timezone, which is +03:00 because of DST at the time of this writing. I'm on stable Python 2.7.2 on gentoo linux. When I run the attached script, I get: Fri, 28 Oct 2011 07:56:14 -0000 datetime.datetime(2011, 10, 28, 9, 56, 14, 945831, tzinfo=) when the local time is 12:56. so the second line is correct and first one is not. let me know if you need any more information. thanks for your attention. ---------- components: Library (Lib) files: test_formatdate.py messages: 146551 nosy: burak.arslan priority: normal severity: normal status: open title: email.utils.formatdate function does not handle timezones correctly. versions: Python 2.7 Added file: http://bugs.python.org/file23541/test_formatdate.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 28 13:27:58 2011 From: report at bugs.python.org (Vilya Harvey) Date: Fri, 28 Oct 2011 11:27:58 +0000 Subject: [New-bugs-announce] [issue13285] signal module in ignores external signal changes Message-ID: <1319801278.56.0.946220269602.issue13285@psf.upfronthosting.co.za> New submission from Vilya Harvey : The signal module is oblivious to any changes to the set of installed signal handlers which occur outside of the module. This can happen when a native module changes a signal handler, or when the python interpreter is embedded in another program which installs its own signal handlers. In this case, saving and restoring a signal handler through python doesn't work correctly. For example, if the SIGINT handler is set externally after the signal module is initialised, the following code will replace the external signal handler with python's default_int_handler: handler = signal.getsignal(signal.SIGINT) signal.signal(signal.SIGINT, handler) So it's impossible to reliably save and restore signal handlers through python when they can also be changed outside the python interpreter. Also, if there's a signal handler installed before the module is initialised, signal.getsignal() will return None for it - making it impossible to restore the correct handler after disabling it. The reason is that the signal module only checks for existing handlers when it's initialised. The results get stored in the Handlers array, which is then used by all subsequent calls to signal.getsignal(). There are no further checks to see whether the native signal handlers have changed. ---------- messages: 146553 nosy: vilya priority: normal severity: normal status: open title: signal module in ignores external signal changes type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 28 16:18:50 2011 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Oct 2011 14:18:50 +0000 Subject: [New-bugs-announce] [issue13286] PEP 3151 breaks backward compatibility: it should be documented Message-ID: <1319811530.69.0.689775391155.issue13286@psf.upfronthosting.co.za> New submission from STINNER Victor : The following example works on Python 2.7 and 3.2, but fails on Python 3.3: ----------- import errno import os try: os.rmdir("testdir") except: pass os.mkdir("testdir") try: try: os.mkdir("testdir") except IOError as exc: # If can't get proper access, then just forget about writing # the data. if exc.errno == errno.EACCES: pass else: raise except OSError as exc: # Probably another Python process already created the dir. if exc.errno == errno.EEXIST: pass else: raise except Exception: print("PEP 3151 broke backward compatibility on such pattern!") ----------- I noticed the problem while reading the changeset e4d44c2e8e81. ---------- assignee: docs at python components: Documentation messages: 146562 nosy: docs at python, flox, haypo, pitrou priority: normal severity: normal status: open title: PEP 3151 breaks backward compatibility: it should be documented versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 28 17:01:15 2011 From: report at bugs.python.org (Florent Xicluna) Date: Fri, 28 Oct 2011 15:01:15 +0000 Subject: [New-bugs-announce] [issue13287] urllib.request exposes too many names Message-ID: <1319814075.5.0.569025067527.issue13287@psf.upfronthosting.co.za> New submission from Florent Xicluna : >>> len(dir()) 4 >>> import urllib.request import * >>> len(dir()) 88 In this list we find 14 modules: ['base64', 'collections', 'ssl', 'bisect', 'http', 're', 'email', 'socket', 'os', 'posixpath', 'hashlib', 'io', 'time', 'sys'] And many non-documented functions: - ftperrors - getproxies_environment - getproxies_macosx_sysconf - localhost - noheaders - parse_http_list - parse_keqv_list - proxy_bypass - proxy_bypass_environment - proxy_bypass_macosx_sysconf - quote - randombytes - request_host - urlunparse - splitattr - splithost - splitpasswd - splitport - splitquery - splittag - splittype - splituser - splitvalue - thishost - to_bytes - unquote - unwrap - urljoin - urlparse - urlsplit It may be good to define __all__ for this module, and to preprend "_" on some of these names. ---------- components: Library (Lib) messages: 146568 nosy: flox priority: normal severity: normal stage: needs patch status: open title: urllib.request exposes too many names type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 28 23:12:22 2011 From: report at bugs.python.org (John Nagle) Date: Fri, 28 Oct 2011 21:12:22 +0000 Subject: [New-bugs-announce] [issue13288] SSL module doesn't allow access to cert issuer information Message-ID: <1319836342.01.0.0498331341848.issue13288@psf.upfronthosting.co.za> New submission from John Nagle : The SSL module still doesn't return much information from the certificate. SSLSocket.getpeercert only returns a few basic items about the certificate subject. You can't retrieve issuer information, and you can't get the extensions needed to check if a cert is an EV cert. With the latest flaps about phony cert issuers, (another CA compromise hit the news today) it's worth having issuer info available. It was available in the old M2Crypto module, but not in the current Python SSL module. John Nagle ---------- components: Library (Lib) messages: 146579 nosy: nagle priority: normal severity: normal status: open title: SSL module doesn't allow access to cert issuer information versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 29 05:50:23 2011 From: report at bugs.python.org (args wu) Date: Sat, 29 Oct 2011 03:50:23 +0000 Subject: [New-bugs-announce] =?utf-8?q?=5Bissue13289=5D_a_spell_error_in_s?= =?utf-8?q?tandard_lib_SocketServer=E2=80=98s_comment?= Message-ID: <1319860223.7.0.549256662259.issue13289@psf.upfronthosting.co.za> New submission from args wu : In line 85, the reqd should be read. I also checked in python3.2's lib, the error still be there? ---------- components: Library (Lib) messages: 146597 nosy: args.wu priority: normal severity: normal status: open title: a spell error in standard lib SocketServer?s comment versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 29 09:04:10 2011 From: report at bugs.python.org (=?utf-8?q?Jo=C3=A3o_Bernardo?=) Date: Sat, 29 Oct 2011 07:04:10 +0000 Subject: [New-bugs-announce] [issue13290] get vars for object with __slots__ Message-ID: <1319871850.77.0.869546838833.issue13290@psf.upfronthosting.co.za> New submission from Jo?o Bernardo : I just realized the builtin function `vars` can't handle custom objects without the __dict__ attribute. It would be nice if it worked with objects that have __slots__ to make them look more like normal objects and to make debugging easier. I changed the source of "Python/bltinmodule.c" to accept this new case, but, as I'm fairly new to the C API, it may not be much good. I'm attaching the whole file to this Issue and the `builtin_vars` function was modified (lines 1859 to 1921) to work with: __slots__ = ('a', 'b', 'c') __slots__ = 'single_name' __slots__ = {'some': 'mapping'} The output is a dict (just like in the __dict__ case). #Example >>> class C: __slots__ = ['x', 'y'] >>> c = C() >>> c.x = 123 >>> vars(c) {'x': 123} ---------- components: Interpreter Core files: bltinmodule.c messages: 146598 nosy: JBernardo priority: normal severity: normal status: open title: get vars for object with __slots__ type: feature request versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file23546/bltinmodule.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 30 00:51:23 2011 From: report at bugs.python.org (Florent Xicluna) Date: Sat, 29 Oct 2011 22:51:23 +0000 Subject: [New-bugs-announce] [issue13291] latent NameError in xmlrpc package Message-ID: <1319928683.07.0.326015714252.issue13291@psf.upfronthosting.co.za> New submission from Florent Xicluna : There's two names which should be fixed in "xmlrpc" package: --- a/Lib/xmlrpc/client.py - elif isinstance(other, (str, unicode)): --- a/Lib/xmlrpc/server.py - response = xmlrpclib.dumps( - xmlrpclib.Fault(1, "%s:%s" % (exc_type, exc_value)), We may extend test coverage too. ---------- components: Library (Lib), XML messages: 146622 nosy: flox priority: normal severity: normal stage: test needed status: open title: latent NameError in xmlrpc package type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 30 12:52:13 2011 From: report at bugs.python.org (Florent Xicluna) Date: Sun, 30 Oct 2011 11:52:13 +0000 Subject: [New-bugs-announce] [issue13292] missing versionadded for bytearray Message-ID: <1319975533.88.0.431386848219.issue13292@psf.upfronthosting.co.za> New submission from Florent Xicluna : versionadded is missing here: http://docs.python.org/library/functions.html#bytearray ---------- assignee: docs at python components: Documentation messages: 146633 nosy: docs at python, flox priority: normal severity: normal stage: needs patch status: open title: missing versionadded for bytearray type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 30 13:55:55 2011 From: report at bugs.python.org (luchenue) Date: Sun, 30 Oct 2011 12:55:55 +0000 Subject: [New-bugs-announce] [issue13293] xmlrpc.client encode error Message-ID: <1319979355.49.0.42965800698.issue13293@psf.upfronthosting.co.za> New submission from luchenue : import xmlrpc.client server = xmlrpc.client.Server('XXX') print(server.login(b'bHVjaGVudWU=',b'bHVjaGVudWU=')) => xmlrpc.client def dump_string write(escape(value)) dispatch[bytes] = dump_string => def escape(s): s = s.replace("&", "&") bytes can't replace ---------- messages: 146637 nosy: luchenue priority: normal severity: normal status: open title: xmlrpc.client encode error type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 30 15:40:42 2011 From: report at bugs.python.org (karl) Date: Sun, 30 Oct 2011 14:40:42 +0000 Subject: [New-bugs-announce] [issue13294] http.server - HEAD request when no resource is defined. Message-ID: <1319985642.06.0.787750282348.issue13294@psf.upfronthosting.co.za> New submission from karl : A very simple HTTP server #!/usr/bin/python3 import http.server from os import chdir # CONFIG ROOTPATH = '/Your/path/' PORT = 8000 # CODE def run(server_class=http.server.HTTPServer, server_handler=http.server.SimpleHTTPRequestHandler): server_address = ('', PORT) httpd = server_class(server_address, server_handler) httpd.serve_forever() class MyRequestHandler(http.server.SimpleHTTPRequestHandler): def do_GET(self): pass if __name__ == '__main__': chdir(ROOTPATH) print("server started on PORT:?"+str(PORT)) run(server_handler=MyRequestHandler) Let's start the server. % python3 serveur1.py server started on PORT:?8000 And let's do a GET request with curl. % curl -v http://localhost:8000/ * About to connect() to localhost port 8000 (#0) * Trying ::1... Connection refused * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 8000 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 > Host: localhost:8000 > Accept: */* > * Empty reply from server * Connection #0 to host localhost left intact curl: (52) Empty reply from server * Closing connection #0 The server sends nothing because GET is not defined and I haven't defined anything in case of errors. So far so good. Now let's do a HEAD request on the same resource. % curl -vsI http://localhost:8000/ * About to connect() to localhost port 8000 (#0) * Trying ::1... Connection refused * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 8000 (#0) > HEAD / HTTP/1.1 > User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 > Host: localhost:8000 > Accept: */* > * HTTP 1.0, assume close after body < HTTP/1.0 200 OK HTTP/1.0 200 OK < Server: SimpleHTTP/0.6 Python/3.1.2 Server: SimpleHTTP/0.6 Python/3.1.2 < Date: Sun, 30 Oct 2011 14:19:00 GMT Date: Sun, 30 Oct 2011 14:19:00 GMT < Content-type: text/html; charset=utf-8 Content-type: text/html; charset=utf-8 < Content-Length: 346 Content-Length: 346 < * Closing connection #0 The server shows in the log the request localhost - - [30/Oct/2011 10:19:00] "HEAD / HTTP/1.1" 200 - And is answering. I would suggest that the default behavior is to have something similar to the one for the GET aka nothing. Or to modify the library code that for any resources not yet defined. The server answers a code 403 Forbidden. I could submit a patch in the next few days. ---------- components: Library (Lib) messages: 146639 nosy: karlcow, orsenthil priority: normal severity: normal status: open title: http.server - HEAD request when no resource is defined. type: feature request versions: Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 30 16:07:25 2011 From: report at bugs.python.org (karl) Date: Sun, 30 Oct 2011 15:07:25 +0000 Subject: [New-bugs-announce] [issue13295] html5 template for Lib/http/server.py Message-ID: <1319987245.42.0.28884085529.issue13295@psf.upfronthosting.co.za> New submission from karl : The code has a set of old HTML templates. Here is a patch to change it to very simple html5 templates. ---------- components: Library (Lib) files: server-html5.patch keywords: patch messages: 146641 nosy: karlcow, orsenthil priority: normal severity: normal status: open title: html5 template for Lib/http/server.py type: feature request versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file23554/server-html5.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 30 18:24:51 2011 From: report at bugs.python.org (Roger Serwy) Date: Sun, 30 Oct 2011 17:24:51 +0000 Subject: [New-bugs-announce] [issue13296] IDLE: __future__ flags don't clear on shell restart Message-ID: <1319995491.95.0.0388029066665.issue13296@psf.upfronthosting.co.za> New submission from Roger Serwy : The interactive interpreter in IDLE does not reset its compiler __future__ flags when you restart the shell. To verify this, type into the shell: >>> from __future__ import barry_as_FLUFL >>> 1 != 2 You'll get a syntax error. Restart the shell and type >>> 1 != 2 A syntax error still occurs. The ModifiedInterpreter class in PyShell.py ultimately relies on codeop to mimic the interactive prompt. The codeop module was created specifically for remembering __future__ flags for subsequent commands. The provided patch stores the flags of the interpreter when it first initializes, and then restores them in "restart_subprocess". It's a patch against 3.2.2. ---------- components: IDLE files: patch_future.diff keywords: patch messages: 146646 nosy: ezio.melotti, serwy priority: normal severity: normal status: open title: IDLE: __future__ flags don't clear on shell restart type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file23557/patch_future.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 31 00:41:40 2011 From: report at bugs.python.org (Florent Xicluna) Date: Sun, 30 Oct 2011 23:41:40 +0000 Subject: [New-bugs-announce] [issue13297] xmlrpc.client could accept bytes for input and output Message-ID: <1320018100.14.0.184941596185.issue13297@psf.upfronthosting.co.za> New submission from Florent Xicluna : Since Python 3 makes clear the distinction between bytes and string, there is no more reason to use the xmlrpc.client.Binary wrapper for binary objects. The xmlrpc library may deal with bytes and bytearray normally. To support backward compatibility, the ServerProxy will have a keyword argument "use_bytes" similar to the "use_datetime" from issue #1120353. ---------- components: Library (Lib), XML messages: 146666 nosy: flox priority: normal severity: normal status: open title: xmlrpc.client could accept bytes for input and output type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 31 01:14:37 2011 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 31 Oct 2011 00:14:37 +0000 Subject: [New-bugs-announce] [issue13298] Result type depends on order of operands for bytes and bytearray Message-ID: <1320020077.78.0.866789839878.issue13298@psf.upfronthosting.co.za> New submission from Nick Coghlan : In a recent python-ideas discussion of the differences between concatenation and augmented assignment on lists, I pointed out the general guiding principle behind Python's binary operation semantics was that the type of a binary operation should not depend on the order of the operands. That is "X op Y" and "Y op X" should either consistently create results of the same type ("1 + 1.1", "1.1 + 1") or else throw an exception ("[] + ()", "() + []"). This principle is why list concatenation normally only works with other lists, but will accept arbitrary iterables for augmented assignment. collections.deque exhibits similar behaviour (i.e. strict on the binary operation, permissive on augmented assignment). However, bytes and bytearray don't follow this principle - they accept anything that implements the buffer interface even in the binary operation, leading to the following asymmetries: >>> b'' + bytearray() b'' >>> b'' + memoryview(b'') b'' >>> bytearray() + b'' bytearray(b'') >>> bytearray() + memoryview(b'') bytearray(b'') >>> memoryview(b'') + b'' Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for +: 'memoryview' and 'bytes' >>> memoryview(b'') + bytearray(b'') Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for +: 'memoryview' and 'bytearray' Now, the latter two cases are due to a known problem where returning NotImplemented from sq_concat or sq_repeat doesn't work properly (so none of the relevant method implementations in the stdlib even try), but the bytes and bytearray interaction is exactly the kind of type asymmetry the operand order independence guideline is intended to prevent. My question is - do we care enough to try to change this? If we do, then it's necessary to decide on more appropriate semantics: 1. The "list" solution, permitting only the same type in binary operations (high risk of breaking quite a lot of code) 2. Don't allow arbitrary buffers, but do allow bytes/bytearray interoperability 2a. always return bytes from mixed operations 2b. always return bytearray from mixed operations 2c. return the type of the first operand (ala set.__or__) Or just accept that this really is more of a guideline than a rule and adjust the documentation accordingly. ---------- components: Interpreter Core messages: 146669 nosy: ncoghlan priority: normal severity: normal status: open title: Result type depends on order of operands for bytes and bytearray type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 31 01:32:25 2011 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 31 Oct 2011 00:32:25 +0000 Subject: [New-bugs-announce] [issue13299] namedtuple row factory for sqlite3 Message-ID: <1320021145.59.0.53370875256.issue13299@psf.upfronthosting.co.za> New submission from Nick Coghlan : Currently, sqlite3 allows rows to be easily returned as ordinary tuples (default) or sqlite3.Row objects (which allow dict-style access). collections.namedtuple provides a much nicer interface than sqlite3.Row for accessing ordered data which uses valid Python identifiers for field names, and can also tolerate field names which are *not* valid identifiers. It would be convenient if sqlite3 provided a row factory along the lines of the one posted here: http://peter-hoffmann.com/2010/python-sqlite-namedtuple-factory.html (except with smarter caching on the named tuples) ---------- messages: 146670 nosy: ncoghlan priority: normal severity: normal stage: needs patch status: open title: namedtuple row factory for sqlite3 type: feature request versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 31 03:06:39 2011 From: report at bugs.python.org (Ned Deily) Date: Mon, 31 Oct 2011 02:06:39 +0000 Subject: [New-bugs-announce] [issue13300] IDLE 3.3 Restart Shell command fails Message-ID: <1320026799.26.0.540984948832.issue13300@psf.upfronthosting.co.za> New submission from Ned Deily : Currently in the default (pre-3.3) branch, IDLE fails if its Restart Shell command is attempted: Exception in Tkinter callback Traceback (most recent call last): File "Lib/tkinter/__init__.py", line 1397, in __call__ return self.func(*args) File "Lib/idlelib/PyShell.py", line 1180, in restart_shell self.interp.restart_subprocess() File "Lib/idlelib/PyShell.py", line 429, in restart_subprocess self.rpcclt.accept() File "Lib/idlelib/rpc.py", line 525, in accept working_sock, address = self.listening_sock.accept() File "Lib/socket.py", line 134, in accept fd, addr = self._accept() OSError: [Errno 9] Bad file descriptor IDLE Subprocess: socket error: Connection refused, retrying.... IDLE Subprocess: socket error: Connection refused, retrying.... Warning (from warnings module): File "Lib/idlelib/run.py", line 127 socket_error = err ResourceWarning: unclosed IDLE Subprocess: socket error: Connection refused, retrying.... The culprit is recent changeset 3a5a0943b201 which attempted to prevent some debug ResourceWarnings during IDLE shutdown. Adding the close override to the RPCClient class causes the listening socket to be closed when the shell is restarted but then a new listening socket is not opened. The listening socket should only be closed when IDLE terminates, not when the subprocess is restarted. ---------- assignee: ned.deily components: IDLE messages: 146672 nosy: amaury.forgeotdarc, ned.deily priority: normal severity: normal stage: needs patch status: open title: IDLE 3.3 Restart Shell command fails type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 31 10:18:16 2011 From: report at bugs.python.org (David Jean Louis) Date: Mon, 31 Oct 2011 09:18:16 +0000 Subject: [New-bugs-announce] [issue13301] the script Tools/i18n/msgfmt.py allows arbitrary code execution via po files Message-ID: <1320052696.17.0.926291745102.issue13301@psf.upfronthosting.co.za> New submission from David Jean Louis : Hi, I'm the author of the polib python module, incidentally (after a bug report in polib: https://bitbucket.org/izi/polib/issue/27/polib-doesnt-check-unescaped-quote) I've found that the eval() in Tools/i18n/msgfmt.py allows arbitrary code execution, someone could create a malicious po entry like this: msgid "owned!" msgstr "" or __import__("os").popen("rm -rf /") As this is an "internal tool" used by developers, maybe it is not very important, but given that people may reuse this script for generating mo files, I think this needs to be fixed, I'm adding a patch for this issue. Regards, -- David ---------- components: Demos and Tools files: msgfmt.py.diff keywords: patch messages: 146678 nosy: izi priority: normal severity: normal status: open title: the script Tools/i18n/msgfmt.py allows arbitrary code execution via po files type: security 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/file23566/msgfmt.py.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 31 11:42:43 2011 From: report at bugs.python.org (Sandro Tosi) Date: Mon, 31 Oct 2011 10:42:43 +0000 Subject: [New-bugs-announce] [issue13302] Clarification needed in C API arg parsing Message-ID: <1320057763.71.0.58387430149.issue13302@psf.upfronthosting.co.za> New submission from Sandro Tosi : Hello, given I can't fully comprehend the user request (sent on docs@ as of http://mail.python.org/pipermail/docs/2011-September/005791.html), I'm just echoing it : >>> recently I embedded Python into one of my applications, which included some string parsing. In my opinion the doc page about parsing arguments (http://docs.python.org/c-api/arg.html) is missing the information, that you must not free the returned const char *, like e.g. said here (http://docs.python.org/c-api/string.html#PyString_AsString). It was quite confusing for my first, so I would suggest adding this tiny bit of information. <<< ---------- assignee: docs at python components: Documentation messages: 146687 nosy: docs at python, sandro.tosi priority: normal severity: normal stage: needs patch status: open title: Clarification needed in C API arg parsing versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 31 12:01:11 2011 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 Oct 2011 11:01:11 +0000 Subject: [New-bugs-announce] [issue13303] Sporadic importlib failures: FileNotFoundError on os.rename() Message-ID: <1320058871.09.0.581986884521.issue13303@psf.upfronthosting.co.za> New submission from STINNER Victor : Traceback (most recent call last): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/regrtest.py", line 1186, in runtest_inner indirect_test() File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/test_ttk_textonly.py", line 11, in test_main *runtktests.get_tests(gui=False, packages=['test_ttk'])) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/tkinter/test/runtktests.py", line 65, in get_tests for module in get_tests_modules(gui=gui, packages=packages): File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/tkinter/test/runtktests.py", line 50, in get_tests_modules "tkinter.test") File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/importlib/__init__.py", line 123, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/importlib/_bootstrap.py", line 834, in _gcd_import loader.load_module(name) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/importlib/_bootstrap.py", line 460, in load_module return self._load_module(fullname) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/importlib/_bootstrap.py", line 164, in decorated return fxn(self, module, *args, **kwargs) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/importlib/_bootstrap.py", line 365, in _load_module exec(code_object, module.__dict__) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/tkinter/test/test_ttk/test_style.py", line 6, in import tkinter.test.support as support File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/importlib/_bootstrap.py", line 460, in load_module return self._load_module(fullname) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/importlib/_bootstrap.py", line 164, in decorated return fxn(self, module, *args, **kwargs) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/importlib/_bootstrap.py", line 353, in _load_module code_object = self.get_code(name) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/importlib/_bootstrap.py", line 447, in get_code self.set_data(bytecode_path, data) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/importlib/_bootstrap.py", line 514, in set_data _write_atomic(path, data) File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/importlib/_bootstrap.py", line 94, in _write_atomic _os.rename(path_tmp, path) FileNotFoundError: [Errno 2] No such file or directory ---------- components: Library (Lib) messages: 146691 nosy: brett.cannon, haypo, pitrou priority: normal severity: normal status: open title: Sporadic importlib failures: FileNotFoundError on os.rename() versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 31 19:31:08 2011 From: report at bugs.python.org (Carl Meyer) Date: Mon, 31 Oct 2011 18:31:08 +0000 Subject: [New-bugs-announce] [issue13304] test_site assumes that site.ENABLE_USER_SITE is True Message-ID: <1320085868.02.0.130211137087.issue13304@psf.upfronthosting.co.za> New submission from Carl Meyer : If the test suite is run with PYTHONNOUSERSITE=true, the test_s_option test in test_site fails, because it implicitly assumes that site.ENABLE_USER_SITE is True and that site.USER_SITE should unconditionally be in sys.path. This is a practical problem in the reference implementation for PEP 404, as the tests should pass when run from within a virtual environment, but a system-isolated virtual environment disables user-site (i.e. has the same effect as PYTHONNOUSERSITE). I think the correct fix here is to conditionally skip that test if site.ENABLE_USER_SITE is not True. I also think the module-level conditional check at the top of the file, which, if site.USER_SITE does not exist, creates site.USER_SITE and calls site.addsitedir() on it, should only run if site.ENABLE_USER_SITE is True. ---------- components: Tests messages: 146722 nosy: carljm priority: normal severity: normal status: open title: test_site assumes that site.ENABLE_USER_SITE is True _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 31 21:12:37 2011 From: report at bugs.python.org (Florent Xicluna) Date: Mon, 31 Oct 2011 20:12:37 +0000 Subject: [New-bugs-announce] [issue13305] datetime.strftime("%Y") not consistent for years < 1000 Message-ID: <1320091957.61.0.759691422668.issue13305@psf.upfronthosting.co.za> New submission from Florent Xicluna : See msg146725 on issue 13291. on linux >>> datetime(1, 2, 10, 11, 41, 23).strftime("%Y") '1' on osx >>> datetime(1, 2, 10, 11, 41, 23).strftime("%Y") '0001' >>> datetime.strptime('0001', '%Y') datetime.datetime(1, 1, 1, 0, 0) >>> datetime.strptime('1', '%Y') ValueError: time data '1' does not match format '%Y' ---------- components: Library (Lib) messages: 146740 nosy: flox priority: normal severity: normal stage: test needed status: open title: datetime.strftime("%Y") not consistent for years < 1000 type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 31 23:07:00 2011 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 31 Oct 2011 22:07:00 +0000 Subject: [New-bugs-announce] [issue13306] Add diagnostic tools to importlib? Message-ID: <1320098820.25.0.925823454462.issue13306@psf.upfronthosting.co.za> New submission from Nick Coghlan : In discussing the module aliasing PEP on python-ideas, it occurred to me that we could potentially add some useful "sanity check" utilities to an "importlib.diagnostics" subpackage. For example: - scan sys.path looking for entries that are inside packages - scan sys.modules looking for entries with duplicate __file__ attributes - scan for shadowed modules (i.e. like find module, but don't stop when we get a hit, and report *all* modules found) Thoughts? ---------- messages: 146746 nosy: brett.cannon, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Add diagnostic tools to importlib? type: feature request _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 31 23:38:37 2011 From: report at bugs.python.org (Stefan Krah) Date: Mon, 31 Oct 2011 22:38:37 +0000 Subject: [New-bugs-announce] [issue13307] test_bdist_rpm: INSTALLED_FILES does not use __pycache__ Message-ID: <1320100717.66.0.765161985418.issue13307@psf.upfronthosting.co.za> New submission from Stefan Krah : The failures seen on the Fedora buildbot are caused by the fact that INSTALLED_FILES does not use __pycache__: [stefan at fedora-14-i386 foo]$ cat build/bdist.linux-i686/rpm/BUILD/foo-0.1/INSTALLED_FILES /usr/local/lib/python3.3/site-packages/foo.py /usr/local/lib/python3.3/site-packages/foo.pyc /usr/local/lib/python3.3/site-packages/foo.pyo /usr/local/lib/python3.3/site-packages/foo-0.1-py3.3.egg-info I'm not familiar with rpm, so I've no clue at which point this file is generated. ---------- components: Tests messages: 146748 nosy: eric.araujo, skrah priority: normal severity: normal status: open title: test_bdist_rpm: INSTALLED_FILES does not use __pycache__ type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________