From report at bugs.python.org Mon Jul 1 03:12:18 2013 From: report at bugs.python.org (Nikolaus Rath) Date: Mon, 01 Jul 2013 01:12:18 +0000 Subject: [New-bugs-announce] [issue18334] type(name, bases, dict) does not call metaclass' __prepare__ attribute Message-ID: <1372641138.46.0.644775856541.issue18334@psf.upfronthosting.co.za> New submission from Nikolaus Rath: When using the three parameter form of type to create a new class, and any of the base classes has a metaclass with a __prepare__ function, the __prepare__ function is not executed: >>> class CustomMetaclass(type): ... @classmethod ... def __prepare__(cls, name, bases): ... return { 'prepared_for': name } ... >>> class ParentClass(metaclass=CustomMetaclass): ... pass ... >>> class ClassOne(ParentClass): ... pass ... >>> ClassTwo = type('ClassTwo', (ParentClass,), {}) >>> ClassOne.prepared_for 'ClassOne' >>> ClassTwo.prepared_for 'ParentClass' >>> 'prepared_for' in ClassOne.__dict__ True >>> 'prepared_for' in ClassTwo.__dict__ False I am not sure if that is intended behavior or not. I am attaching a doc patch for the case that this is intended. ---------- components: Interpreter Core files: type_doc_patch.diff keywords: patch messages: 192099 nosy: Nikratio priority: normal severity: normal status: open title: type(name, bases, dict) does not call metaclass' __prepare__ attribute type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file30737/type_doc_patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 1 07:33:49 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 01 Jul 2013 05:33:49 +0000 Subject: [New-bugs-announce] [issue18335] Add textwrap.dedent, .indent, as str methods. Message-ID: <1372656829.33.0.351971247179.issue18335@psf.upfronthosting.co.za> New submission from Terry J. Reedy: To end proposals for new syntax to do what they do for triple-quoted strings. Nick Coghlan gave reasons as follows: run time cost small, can be optimized away, would be used more than some other string methods. http://mail.python.org/pipermail/python-ideas/2013-July/021717.html In response, Guido said "That's a compelling argument. Let's do it." http://mail.python.org/pipermail/python-ideas/2013-July/021718.html ---------- messages: 192109 nosy: ncoghlan, terry.reedy priority: normal severity: normal stage: test needed status: open title: Add textwrap.dedent, .indent, as str methods. type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 1 09:19:51 2013 From: report at bugs.python.org (Thomas Guettler) Date: Mon, 01 Jul 2013 07:19:51 +0000 Subject: [New-bugs-announce] [issue18336] codecs: Link to readline module (history) instead of fd.readline() Message-ID: <1372663191.71.0.440770388569.issue18336@psf.upfronthosting.co.za> New submission from Thomas Guettler: The documentation of codecs.readline() has a link to the readline module. That the same word with a total different meaning! http://docs.python.org/2/library/codecs.html?highlight=readline#codecs.StreamReader.readline The GNU readline module is about the history like bash or interactive python. ---------- assignee: docs at python components: Documentation messages: 192111 nosy: docs at python, guettli priority: normal severity: normal status: open title: codecs: Link to readline module (history) instead of fd.readline() versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 1 09:30:57 2013 From: report at bugs.python.org (Thomas Guettler) Date: Mon, 01 Jul 2013 07:30:57 +0000 Subject: [New-bugs-announce] [issue18337] codecs: StremReader readline() breaks on undocumented characters Message-ID: <1372663857.57.0.575592634078.issue18337@psf.upfronthosting.co.za> New submission from Thomas Guettler: The stream reader of codecs.open() breaks on undocumented characters: http://docs.python.org/2/library/codecs.html?highlight=codecs%20readline#codecs.StreamReader.readline import tempfile temp=tempfile.mktemp() fd=open(temp, 'wb') fd.write('abc\ndef\x85ghi') fd.close() import codecs fd=codecs.open(temp, 'rb', 'latin1') while True: line=fd.readline() if not line: break print repr(line) Result: u'abc\n' u'def\x85' u'ghi' Related: http://stackoverflow.com/questions/16227114/utf-8-files-read-in-python-will-line-break-at-character-x85 ---------- assignee: docs at python components: Documentation messages: 192112 nosy: docs at python, guettli priority: normal severity: normal status: open title: codecs: StremReader readline() breaks on undocumented characters versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 1 13:01:27 2013 From: report at bugs.python.org (Jari Aalto) Date: Mon, 01 Jul 2013 11:01:27 +0000 Subject: [New-bugs-announce] [issue18338] option --version should send output to STDOUT Message-ID: <1372676487.3.0.302989276182.issue18338@psf.upfronthosting.co.za> New submission from Jari Aalto: C.f. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=603851 When user is calling program with options, it is not an error condition to run: python --version The output is now sent to stderr. Please change to send to stdout as in other *nix utilities, in order to collect in shell scrips: version=$(python --version) ---------- components: Interpreter Core messages: 192119 nosy: jaalto priority: normal severity: normal status: open title: option --version should send output to STDOUT versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 1 14:12:33 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 01 Jul 2013 12:12:33 +0000 Subject: [New-bugs-announce] [issue18339] Segfault in Unpickler_set_memo() Message-ID: <1372680753.86.0.0895011260211.issue18339@psf.upfronthosting.co.za> New submission from Christian Heimes: Unpickler_set_memo() crashes when the unpickler's memo attribute is set to a dict with negative numbers. The descriptor uses _Unpickler_MemoPut() which uses the dict key as index to a C array. Python 3.3.0 (v3.3.0:bd8afb90ebf2, Feb 8 2013, 00:38:29) [GCC 4.7.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys, pickle >>> p = pickle.Unpickler(sys.stdin) >>> p.memo = {-1: None} segfault The issue was found be Coverity Scan: CID 486776 (#1 of 1): Improper use of negative value (NEGATIVE_RETURNS) negative_returns: Passing variable "idx" to a parameter that cannot be negative. 5955 if (_Unpickler_MemoPut(self, idx, value) < 0) ---------- files: memo.patch keywords: patch messages: 192124 nosy: christian.heimes priority: normal severity: normal stage: needs patch status: open title: Segfault in Unpickler_set_memo() type: crash versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30739/memo.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 1 17:51:04 2013 From: report at bugs.python.org (V.E.O) Date: Mon, 01 Jul 2013 15:51:04 +0000 Subject: [New-bugs-announce] [issue18340] float related test has problem with Denormal Flush to Zero compiler options Message-ID: <1372693864.33.0.227282156373.issue18340@psf.upfronthosting.co.za> New submission from V.E.O: With Intel Compiler's default options or GCC with -mfpmath=sse, the built Python failed at float related test. For failures in test_strtod: Traceback (most recent call last): File ".\test_strtod.py", line 190, in test_boundaries self.check_strtod(s) File ".\test_strtod.py", line 104, in check_strtod "expected {}, got {}".format(s, expected, got)) AssertionError: '0x0.fffffffffffffp-1022' != '0x0.0p+0' - 0x0.fffffffffffffp-1022 + 0x0.0p+0 : Incorrectly rounded str->float conversion for 22250738585072008690e-327: expected 0x0.fffffffffffffp-1022, got 0x0.0p+0 22250738585072008690e-327 is less than positive normalize float 2250738585072014e-308 in sys.float_info, that is denormal float With SSE optimization opened on current compilers, Denormal Flush to Zero feature will flush all denormal float to 0 to avoid hardware unsupport and increase performance. The tests here better be skipped on DFZ opened binaries. http://bugs.python.org/issue1672332 is related to this problem. Reference: http://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/GUID-3A5C3E47-250D-4178-A0D4-6C4ACDDA5EB8.htm ---------- components: Tests messages: 192134 nosy: V.E.O, mark.dickinson priority: normal severity: normal status: open title: float related test has problem with Denormal Flush to Zero compiler options type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 1 17:52:42 2013 From: report at bugs.python.org (Jim Carroll) Date: Mon, 01 Jul 2013 15:52:42 +0000 Subject: [New-bugs-announce] [issue18341] enhancements zlib.compress/decompress to accept Py_buffer Message-ID: <1372693962.8.0.934834831388.issue18341@psf.upfronthosting.co.za> New submission from Jim Carroll: We were looking to squeak maximum performance out of zlib.compress. We noticed in py3k, zlib.compress already accepts Py_buffer?s, but in 2.x, compress required strings. We?ve modified the compress (and decompress for orthogonal completeness), see the attached patch. ---------- components: Extension Modules files: zlibmodule.c.patch keywords: patch messages: 192135 nosy: jamercee priority: normal severity: normal status: open title: enhancements zlib.compress/decompress to accept Py_buffer type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file30742/zlibmodule.c.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 1 18:33:50 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 01 Jul 2013 16:33:50 +0000 Subject: [New-bugs-announce] [issue18342] Use the repr of a module name for ModuleNotFoundError in ceval.c Message-ID: <1372696430.42.0.571776913898.issue18342@psf.upfronthosting.co.za> New submission from Brett Cannon: >>> from re import bogus Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: cannot import name bogus Should have 'bogus' using the repr to match the other cases of ModuleNotFoundError ---------- assignee: brett.cannon components: Interpreter Core keywords: easy messages: 192138 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: Use the repr of a module name for ModuleNotFoundError in ceval.c versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 2 00:04:41 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 01 Jul 2013 22:04:41 +0000 Subject: [New-bugs-announce] [issue18343] faulthandler_register_py() may use _Py_sighandler_t previous with initialization Message-ID: <1372716281.26.0.896390159494.issue18343@psf.upfronthosting.co.za> New submission from Christian Heimes: faulthandler_register_py() may use the variable previous uninitialized if user->enabled is set. Excerpt from Coverity log: var_decl: Declaring variable "previous" without initializer. 711 _Py_sighandler_t previous; 8. Condition "!user->enabled", taking false branch 738 if (!user->enabled) { CID 984060 (#1 of 1): Uninitialized scalar variable (UNINIT) 12. uninit_use: Using uninitialized value "previous": field "previous"."sa_restorer" is uninitialized. 752 user->previous = previous; ---------- assignee: haypo messages: 192154 nosy: christian.heimes, haypo priority: normal severity: normal stage: needs patch status: open title: faulthandler_register_py() may use _Py_sighandler_t previous with initialization type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 2 01:11:04 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 01 Jul 2013 23:11:04 +0000 Subject: [New-bugs-announce] [issue18344] _bufferedreader_read_all() may leak reference to data Message-ID: <1372720264.13.0.315058042183.issue18344@psf.upfronthosting.co.za> New submission from Christian Heimes: Modules/_io/bufferedio.c:_bufferedreader_read_all() doesn't call Py_XDECREF(data) multiple times and may leak a reference in an error case. For example the ref leak occurs when current_size > 0 and PyObject_CallMethodObjArgs(self->raw, _PyIO_str_readall, NULL) fails orbuffered_flush_and_rewind_unlocked(self) fails. There are a few more places where data isn't decrefed on return, too. CID 715364 (#2 of 2): Resource leak (RESOURCE_LEAK) leaked_storage: Variable "data" going out of scope leaks the storage it points to. ---------- components: Extension Modules messages: 192160 nosy: christian.heimes priority: normal severity: normal stage: needs patch status: open title: _bufferedreader_read_all() may leak reference to data type: resource usage versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 2 10:41:06 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 02 Jul 2013 08:41:06 +0000 Subject: [New-bugs-announce] [issue18345] logging: file creation options with FileHandler and friends Message-ID: <1372754466.44.0.0217730014706.issue18345@psf.upfronthosting.co.za> New submission from Antoine Pitrou: When starting a service as root, you may want your log files to be created as another user (the service may drop privileges later). It would be nice to have a "chown" option to FileHander. For example it could take either a "username" string, or a ("username", "groupname") tuple. (a similar request may be made for chmod, but umask helps a lot there) This is quite low-priority :) ---------- components: Library (Lib) messages: 192181 nosy: pitrou, vinay.sajip priority: low severity: normal status: open title: logging: file creation options with FileHandler and friends type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 2 12:09:41 2013 From: report at bugs.python.org (me21) Date: Tue, 02 Jul 2013 10:09:41 +0000 Subject: [New-bugs-announce] [issue18346] Backporting of issue 8828 to Python 2.7 Message-ID: <1372759781.12.0.359437374117.issue18346@psf.upfronthosting.co.za> New submission from me21: It would be nice to backport http://bugs.python.org/issue8828 to Python 2.7. For example, Django depends on atomic renames with its file-based sessions, and it still supports Python 2.x. There was a bug in Django because of this (https://code.djangoproject.com/ticket/9084), and they ended up with non-atomic workaround. Some other third-party libraries could be affected as well. ---------- components: Library (Lib), Windows messages: 192186 nosy: me21 priority: normal severity: normal status: open title: Backporting of issue 8828 to Python 2.7 type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 2 19:31:39 2013 From: report at bugs.python.org (Adam Urban) Date: Tue, 02 Jul 2013 17:31:39 +0000 Subject: [New-bugs-announce] [issue18347] ElementTree corrupts cAse of closing tags when html method is specified Message-ID: <1372786299.24.0.986452564327.issue18347@psf.upfronthosting.co.za> New submission from Adam Urban: import xml.etree.ElementTree as ET tree = ET.parse("myinput.xml") tree.write("myoutput.xml", encoding="utf-16le", xml_declaration=False, default_namespace=None, method="html") If the source XML has a tag like this: someData ElementTree will output it like this when html is specified as the "method": someData ---------- components: XML messages: 192212 nosy: Adam.Urban, eli.bendersky, serhiy.storchaka priority: normal severity: normal status: open title: ElementTree corrupts cAse of closing tags when html method is specified type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 2 19:47:11 2013 From: report at bugs.python.org (roskakori) Date: Tue, 02 Jul 2013 17:47:11 +0000 Subject: [New-bugs-announce] [issue18348] Additional code pages for EBCDIC Message-ID: <1372787231.53.0.326876214252.issue18348@psf.upfronthosting.co.za> New submission from roskakori: Currently Python includes a codec for EBCDIC international (cp500) but seems to be missing any further EBCDIC codecs. These encodings are widly used on mainframe platforms, popular in finance and insurance. Descriptions of these codepages are available from IBM: . These descriptions also include mapping files although not in a format that can readily be processed by gencodec.py. So instead I used the codecs included with Java 1.7 to generate mappings for gencodec.py. You can find them in the attached ZIP archive. As Java also runs on mainframe platforms, IBM should be interested in the Java codecs to be correct and complete. The converter is available from . To build the cp*.txt for EBCDIC, simply run: $ git clone https://github.com/roskakori/CodecMapper.git $ cd CodecMapper $ ant ebcdic IBM lists a large number of EBCDIC codepages, I only attached the ones listed in the German Wikipedia: . This also includes cp500 for comparison with your current cp500. And it lacks EDF03DRV because even Java does not support it. Currently Java 1.7 supports 43 variants. To get a list of them, use: $ ant list | grep -i ' ibm' This would also fix issue 1097797: Encoding for Code Page 273 used by EBCDIC Germany Austria. ---------- components: Unicode files: cp_ebcdic.zip messages: 192214 nosy: ezio.melotti, lemburg, roskakori priority: normal severity: normal status: open title: Additional code pages for EBCDIC type: enhancement Added file: http://bugs.python.org/file30751/cp_ebcdic.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 3 08:16:51 2013 From: report at bugs.python.org (paul j3) Date: Wed, 03 Jul 2013 06:16:51 +0000 Subject: [New-bugs-announce] [issue18349] argparse usage should preserve () in metavars such as range(20) Message-ID: <1372832211.16.0.544648995095.issue18349@psf.upfronthosting.co.za> New submission from paul j3: As discussed in issue 16468, a metavar may be used to provide an alternative representation of a choices option. However if a metvar like 'range(20)' is used, usage formatter strips off the '()'. >>> parser.add_argument('foo', type=int, choices=range(20), metavar='range(0,20)') >>> parser.format_usage() # expect: 'usage: PROG [-h] range(0,20)\n' # actual: 'usage: PROG [-h] range0,20\n' This is done by a line in the help formater that removes excess mutually exclusive group notation: HelpFormatter._format_actions_usage ... text = _re.sub(r'\(([^|]*)\)', r'\1', text) A solution is to change this line to distinguish between a case like ' (...)' and 'range(...)' text = _re.sub(r'( )\(([^|]*)\)', r'\1\2', text) ---------- files: metaparen.patch keywords: patch messages: 192222 nosy: paul.j3 priority: normal severity: normal status: open title: argparse usage should preserve () in metavars such as range(20) Added file: http://bugs.python.org/file30754/metaparen.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 3 12:29:43 2013 From: report at bugs.python.org (=?utf-8?q?Bo=C5=A1tjan_Mejak?=) Date: Wed, 03 Jul 2013 10:29:43 +0000 Subject: [New-bugs-announce] [issue18350] Python 3 unittest framework broken? Message-ID: <1372847383.07.0.708601555612.issue18350@psf.upfronthosting.co.za> New submission from Bo?tjan Mejak: I fired up the test suite runtests.py of wxPython Phoenix and I get this: File "C:\Program Files\Python 3.3.2\lib\unittest\runner.py", line 63, in addSuccess self.stream.write('.') TypeError: 'str' does not support the buffer interface Can you confirm whether this is a bug in the unittest framework on the Python side or in the wxPython Phoenix source code side? ---------- components: Tests messages: 192226 nosy: bostjan.mejak priority: normal severity: normal status: open title: Python 3 unittest framework broken? type: crash versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 3 15:11:12 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 03 Jul 2013 13:11:12 +0000 Subject: [New-bugs-announce] [issue18351] Incorrect variable name in importlib._bootstrap._get_sourcefile Message-ID: <1372857072.23.0.433996899216.issue18351@psf.upfronthosting.co.za> New submission from Brett Cannon: http://hg.python.org/cpython/file/8e838598eed1/Lib/importlib/_bootstrap.py#l455 : source_stats does not exist and instead should be source_path. ---------- assignee: brett.cannon components: IO messages: 192237 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: Incorrect variable name in importlib._bootstrap._get_sourcefile type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 3 16:43:25 2013 From: report at bugs.python.org (Olivier Gagnon) Date: Wed, 03 Jul 2013 14:43:25 +0000 Subject: [New-bugs-announce] [issue18352] collections.Counter with added attributes are not deepcopied properly. Message-ID: <1372862605.72.0.11799816843.issue18352@psf.upfronthosting.co.za> New submission from Olivier Gagnon: The following code shows that the Counter is not deepcopied properly. The same code with an user defined class or a dict is copied with the "b" attribute. import collections import copy count = collections.Counter() count.b = 3 print(count.b) # prints 3 count_copy = copy.deepcopy(count) print(count_copy.b) # raise AttributeError: 'Counter' object has no attribute 'b' ---------- components: Library (Lib) messages: 192239 nosy: Olivier.Gagnon priority: normal severity: normal status: open title: collections.Counter with added attributes are not deepcopied properly. type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 3 19:43:07 2013 From: report at bugs.python.org (Wolf Ihlenfeldt) Date: Wed, 03 Jul 2013 17:43:07 +0000 Subject: [New-bugs-announce] [issue18353] PyUnicode_WRITE_CHAR macro definition missing Message-ID: <1372873387.67.0.379053408423.issue18353@psf.upfronthosting.co.za> New submission from Wolf Ihlenfeldt: Above macro is mentioned in the documentation (3.3.2), but does not appear in the header files. Associated function PyUnicode_WriteChar() is present and works as expected. ---------- assignee: docs at python components: Documentation, Unicode messages: 192247 nosy: Wolf.Ihlenfeldt, docs at python, ezio.melotti priority: normal severity: normal status: open title: PyUnicode_WRITE_CHAR macro definition missing type: compile error versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 3 20:47:14 2013 From: report at bugs.python.org (Daniel Holth) Date: Wed, 03 Jul 2013 18:47:14 +0000 Subject: [New-bugs-announce] [issue18354] http://www.python.org/doc/ has outdated note Message-ID: <1372877234.32.0.505544665385.issue18354@psf.upfronthosting.co.za> New submission from Daniel Holth: Please remove the note. Note A new documentation project, which will be merged into the Python documentation soon, covers creating, installing and distributing Python packages: The Hitchhiker's Guide to Packaging (creating and distributing Python packages) ---------- assignee: docs at python components: Documentation messages: 192251 nosy: dholth, docs at python priority: normal severity: normal status: open title: http://www.python.org/doc/ has outdated note type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 4 03:26:40 2013 From: report at bugs.python.org (Russkel) Date: Thu, 04 Jul 2013 01:26:40 +0000 Subject: [New-bugs-announce] [issue18355] Merge super() guide into documentation Message-ID: <1372901200.41.0.725969821731.issue18355@psf.upfronthosting.co.za> New submission from Russkel: When looking for documentation on the correct usage on super (http://docs.python.org/2/library/functions.html?highlight=super#super), the documentation links to this rather will written blog post http://rhettinger.wordpress.com/2011/05/26/super-considered-super/ by Mr. Hettinger. I think there is value in merging that blog post into a HOWTO and including in the official documentation. I'm more than willing to create a patch if this is considered a good idea. ---------- assignee: docs at python components: Documentation messages: 192262 nosy: Russkel, docs at python, rhettinger priority: normal severity: normal status: open title: Merge super() guide into documentation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 4 09:55:20 2013 From: report at bugs.python.org (Michelle Arzul) Date: Thu, 04 Jul 2013 07:55:20 +0000 Subject: [New-bugs-announce] [issue18356] help(numpy) causes segfault on exit Message-ID: <1372924520.77.0.111539946992.issue18356@psf.upfronthosting.co.za> New submission from Michelle Arzul: As far as we could tell this bug is only consistently reproducible on Ubuntu 13.04. A line in pydoc.py causes a segfault when help(numpy) (no other libraries that I know of) exits. The offending method is pipepager(). For a full trackdown and workaround of the problem see http://stackoverflow.com/questions/17344974/python-helpnumpy-causes-segfault-on-exit ---------- assignee: docs at python components: Documentation messages: 192276 nosy: Leeward, docs at python priority: normal severity: normal status: open title: help(numpy) causes segfault on exit type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 4 13:33:28 2013 From: report at bugs.python.org (Fraser Tweedale) Date: Thu, 04 Jul 2013 11:33:28 +0000 Subject: [New-bugs-announce] [issue18357] add tests for dictview set difference operations Message-ID: <1372937608.11.0.328710498036.issue18357@psf.upfronthosting.co.za> New submission from Fraser Tweedale: The Python documentation states that set-like dictionary view objects support set difference (-), however, this behaviour is untested. Add some tests for this behaviour. (This issue was discovered because PyPy doesn't support (-) for dictviews, yet they claimed to pass the test suite. Well, they did pass it ^_^ ---------- components: Tests files: dictview-set-sub-test.patch keywords: patch messages: 192285 nosy: frasertweedale priority: normal severity: normal status: open title: add tests for dictview set difference operations type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file30771/dictview-set-sub-test.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 4 13:43:26 2013 From: report at bugs.python.org (Russkel) Date: Thu, 04 Jul 2013 11:43:26 +0000 Subject: [New-bugs-announce] [issue18358] update links to Apple Style Guide Message-ID: <1372938206.65.0.563534327842.issue18358@psf.upfronthosting.co.za> New submission from Russkel: Apple has relocated and renamed their style guide. This patch reflects those changes and provides links to both PDF and online version. ---------- components: Devguide files: style-guide-fixes.patch keywords: patch messages: 192286 nosy: Russkel, ezio.melotti priority: normal severity: normal status: open title: update links to Apple Style Guide Added file: http://bugs.python.org/file30772/style-guide-fixes.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 4 16:03:55 2013 From: report at bugs.python.org (yoch) Date: Thu, 04 Jul 2013 14:03:55 +0000 Subject: [New-bugs-announce] [issue18359] pickle fail to handle some class with __new__ Message-ID: <1372946635.32.0.0668424170567.issue18359@psf.upfronthosting.co.za> New submission from yoch: Hi, If some class objects have extra arguments in the __new__ constructor , pickle fail to serialize it. Here the output of provided test-case : Traceback (most recent call last): File "/home/yoch/bug.py", line 19, in y = pickle.load(fp) TypeError: __new__() missing 1 required positional argument: 'arg' Best regards ---------- components: Library (Lib) files: bug.py messages: 192290 nosy: yoch.melka priority: normal severity: normal status: open title: pickle fail to handle some class with __new__ versions: Python 3.3 Added file: http://bugs.python.org/file30774/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 4 17:01:24 2013 From: report at bugs.python.org (Dale Smith) Date: Thu, 04 Jul 2013 15:01:24 +0000 Subject: [New-bugs-announce] [issue18360] Won't install. Keeps telling me DLL is missing. Message-ID: <1372950084.82.0.921928840895.issue18360@psf.upfronthosting.co.za> New submission from Dale Smith: When I click install -> run, it tells me a DLL is missing and to contact my vendor (Windows 7 Home Premium). This is the only installation that does this. I cannot find an answer anywhere and all other installations work fine. What could be causing this? Which DLL is specific only to this installation that Microsoft does not have an answer to? Thank you. ---------- components: Installation messages: 192294 nosy: daleastar priority: normal severity: normal status: open title: Won't install. Keeps telling me DLL is missing. type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 4 21:41:37 2013 From: report at bugs.python.org (Brett Cannon) Date: Thu, 04 Jul 2013 19:41:37 +0000 Subject: [New-bugs-announce] [issue18361] Move dev-in-a-box to os.cpu_count() Message-ID: <1372966897.43.0.367551920438.issue18361@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: brett.cannon keywords: easy nosy: brett.cannon priority: low severity: normal stage: needs patch status: open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 4 21:45:56 2013 From: report at bugs.python.org (Brett Cannon) Date: Thu, 04 Jul 2013 19:45:56 +0000 Subject: [New-bugs-announce] [issue18362] Make build_cpython.py from dev-in-a-box work outside of a box Message-ID: <1372967156.42.0.772403047151.issue18362@psf.upfronthosting.co.za> New submission from Brett Cannon: No reason why it can't be generalized to accept a directory argument so that it can be used by anyone to build a checkout of CPython whether it is in a box or not. Would also help maintain the code as me (and one else who cared to) could then just always use the script to build CPython. ---------- messages: 192310 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: Make build_cpython.py from dev-in-a-box work outside of a box _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 4 21:49:43 2013 From: report at bugs.python.org (Brett Cannon) Date: Thu, 04 Jul 2013 19:49:43 +0000 Subject: [New-bugs-announce] [issue18363] Change use of acronym tag in devinabox index.html to abbr Message-ID: <1372967383.82.0.0641112883991.issue18363@psf.upfronthosting.co.za> New submission from Brett Cannon: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/abbr ---------- assignee: brett.cannon keywords: easy messages: 192311 nosy: brett.cannon priority: low severity: normal status: open title: Change use of acronym tag in devinabox index.html to abbr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 5 00:54:36 2013 From: report at bugs.python.org (Brett Cannon) Date: Thu, 04 Jul 2013 22:54:36 +0000 Subject: [New-bugs-announce] [issue18364] Remove _not_found hack from importlib Message-ID: <1372978476.87.0.491893318984.issue18364@psf.upfronthosting.co.za> New submission from Brett Cannon: Having a private attribute has already caused one bug report. I want to try and come up with something that doesn't leak outside of importlib. ---------- assignee: brett.cannon components: Library (Lib) messages: 192322 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: Remove _not_found hack from importlib versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 5 08:49:06 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 05 Jul 2013 06:49:06 +0000 Subject: [New-bugs-announce] [issue18365] Idle: mock Text class and test thereof Message-ID: <1373006946.99.0.696971871982.issue18365@psf.upfronthosting.co.za> New submission from Terry J. Reedy: test_rstrip2.patch contain a Text class to be added to mock_tk.py. The purpose of a mock class is to imitate another class with respect to certain behaviors. The way to verify that is does that is to run the same set of tests for those behaviors with both. This is similar in idea and will be the same in execution as running the same set of tests with a Python-coded module and a c-coded accelerator version of at least some functions of the module. The trick is to do this without code duplication is write a mixin class with the tests and derive two testcase classes using the mixin. ---------- assignee: terry.reedy components: IDLE messages: 192327 nosy: Todd.Rovito, philwebster, terry.reedy priority: normal severity: normal stage: test needed status: open title: Idle: mock Text class and test thereof type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 5 20:55:45 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 05 Jul 2013 18:55:45 +0000 Subject: [New-bugs-announce] [issue18366] Look into using setuptools 0.8 with devinabox Message-ID: <1373050545.72.0.913004970997.issue18366@psf.upfronthosting.co.za> New submission from Brett Cannon: Setuptools 0.8 uses a Python 2/3 compatible codebase so it should simplify the instructions for running coverage.py. ---------- assignee: brett.cannon messages: 192343 nosy: brett.cannon priority: normal severity: normal status: open title: Look into using setuptools 0.8 with devinabox _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 5 21:15:39 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 05 Jul 2013 19:15:39 +0000 Subject: [New-bugs-announce] [issue18367] See if a venv setup can be used for devinabox for coverage Message-ID: <1373051739.1.0.739747420449.issue18367@psf.upfronthosting.co.za> New submission from Brett Cannon: Right now there is a bunch of contorting with setuptools and coverage.py's checkout to get things in reasonable places, etc. Might be easiest to create a venv from the built checkout and then install both setuptools and the coverage.py checkout into the venv for easier setup/cleanup. Might even be lucky enough that the venv can be left in place and simply have users do ``../cpython/python Tools/scripts/pyvenv --upgrade`` to have it start using their own built version so that the basic setup for at least setuptools works and then they only need to build coverage.py themselves (which is already scripted). ---------- messages: 192349 nosy: brett.cannon priority: normal severity: normal status: open title: See if a venv setup can be used for devinabox for coverage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 5 22:02:43 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 05 Jul 2013 20:02:43 +0000 Subject: [New-bugs-announce] [issue18368] PyOS_StdioReadline() leaks memory when realloc() fails Message-ID: <1373054563.49.0.685653845765.issue18368@psf.upfronthosting.co.za> New submission from Christian Heimes: PyOS_StdioReadline() contains code such as: p = (char *)PyMem_REALLOC(p, n + incr); The code looses its pointer to p when realloc fails and has no chance to free the memory in p. Also the code sets PyExc_OverflowError when incr > INT_MAX but it doesn't return NULL to signal the error. ---------- components: Interpreter Core files: osreadline.patch keywords: patch messages: 192352 nosy: christian.heimes priority: normal severity: normal stage: patch review status: open title: PyOS_StdioReadline() leaks memory when realloc() fails type: resource usage versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30782/osreadline.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 5 22:10:37 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 05 Jul 2013 20:10:37 +0000 Subject: [New-bugs-announce] [issue18369] X509 cert class for ssl module Message-ID: <1373055037.38.0.259814019718.issue18369@psf.upfronthosting.co.za> New submission from Christian Heimes: I'm working on a X509 certificate class for the SSL module. Eventually methods like getpeercert() are going to return X509 instances and the Python interface can decide if it should return a dict, DER bytes or whatever. IMHO it's a mandatory requirement for OCSP support, too. The patch contains a very real proof of concept. ---------- components: Extension Modules files: ssl_pyx509cert.patch keywords: patch messages: 192353 nosy: christian.heimes, pitrou priority: normal severity: normal status: open title: X509 cert class for ssl module type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30783/ssl_pyx509cert.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 5 22:24:05 2013 From: report at bugs.python.org (Aivar Annamaa) Date: Fri, 05 Jul 2013 20:24:05 +0000 Subject: [New-bugs-announce] [issue18370] ast.parse produces -1 as col_offset for triple-quoted strings Message-ID: <1373055845.95.0.233623279769.issue18370@psf.upfronthosting.co.za> New submission from Aivar Annamaa: AST nodes for triple-quoted strings have -1 in col_offset field, as presented in the attached file. ---------- components: Interpreter Core files: col_offset_bug.py messages: 192355 nosy: Aivar.Annamaa priority: normal severity: normal status: open title: ast.parse produces -1 as col_offset for triple-quoted strings type: behavior versions: Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file30784/col_offset_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 5 22:55:29 2013 From: report at bugs.python.org (YS) Date: Fri, 05 Jul 2013 20:55:29 +0000 Subject: [New-bugs-announce] [issue18371] Should be able to specify SSL version for smtplib Message-ID: <1373057729.16.0.874642993886.issue18371@psf.upfronthosting.co.za> New submission from YS: Currently, smtplib is not able to connect to hotmail, giving an SSL version error (at least on some platfroms). See http://stackoverflow.com/q/17434143/429850 and http://stackoverflow.com/q/17011816/429850. Perhaps there should be an option like smtplib.SMTP(ssl_version=SSLV3)? ---------- components: Library (Lib) messages: 192358 nosy: yasaharu priority: normal severity: normal status: open title: Should be able to specify SSL version for smtplib type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 00:53:10 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 05 Jul 2013 22:53:10 +0000 Subject: [New-bugs-announce] [issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self) Message-ID: <1373064790.68.0.920175606727.issue18372@psf.upfronthosting.co.za> New submission from Christian Heimes: In _Pickler_New() PicklerObject is allocated with self = PyObject_GC_New(PicklerObject, &Pickler_Type); but PyObject_GC_Track(self) is never called, same for _Unpickler_New(). I think it's a bug. ---------- components: Extension Modules messages: 192369 nosy: christian.heimes priority: normal severity: normal stage: needs patch status: open title: _Pickler_New() doesn't call PyObject_GC_Track(self) type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 00:58:44 2013 From: report at bugs.python.org (Daniel Holth) Date: Fri, 05 Jul 2013 22:58:44 +0000 Subject: [New-bugs-announce] [issue18373] implement sys.get/setbyteswarningflag() Message-ID: <1373065124.82.0.249288626652.issue18373@psf.upfronthosting.co.za> New submission from Daniel Holth: This patch lets the user get/set the byteswarningflag() to control whether warnings are emitted at runtime (pursuant to the configuration of the warnings module, of course). The idea is that a user who is concerned with interacting with bytes correctly would use a context manager to set str(bytes) to raise exceptions during a critical serialization. TODO the hypothetical context manager would also have to push/pop the warnings state to work correctly. Maybe str(bytes) can raise a regular exception if byteswarningflag() is high enough? TODO don't know if this plays nicely when there are no threads ---------- files: byteswarningflag.patch keywords: patch messages: 192372 nosy: dholth priority: normal severity: normal status: open title: implement sys.get/setbyteswarningflag() versions: Python 3.4 Added file: http://bugs.python.org/file30787/byteswarningflag.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 11:35:02 2013 From: report at bugs.python.org (Aivar Annamaa) Date: Sat, 06 Jul 2013 09:35:02 +0000 Subject: [New-bugs-announce] [issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s Message-ID: <1373103302.65.0.774257874247.issue18374@psf.upfronthosting.co.za> New submission from Aivar Annamaa: When parsing following program: 1+2-3 ast.parse gives col_offset=3 to outermost BinOp (as shown by the attached test script). Correct col_offset would be 0 for both BinOp-s ---------- components: Interpreter Core files: binop_bug.py messages: 192394 nosy: Aivar.Annamaa priority: normal severity: normal status: open title: ast.parse gives wrong position (col_offset) for some BinOp-s versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file30793/binop_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 12:09:46 2013 From: report at bugs.python.org (Florent Xicluna) Date: Sat, 06 Jul 2013 10:09:46 +0000 Subject: [New-bugs-announce] [issue18375] python -m test --randseed 1234 does not randomize tests Message-ID: <1373105386.95.0.445511556966.issue18375@psf.upfronthosting.co.za> New submission from Florent Xicluna: I noticed a minor issue with regrtest. IMHO it should assume --randomize when you pass --randseed. ---------- assignee: flox components: Tests messages: 192401 nosy: flox priority: normal severity: normal stage: needs patch status: open title: python -m test --randseed 1234 does not randomize tests type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 12:42:17 2013 From: report at bugs.python.org (Florent Xicluna) Date: Sat, 06 Jul 2013 10:42:17 +0000 Subject: [New-bugs-announce] [issue18376] show the effective count of process when running the testsuite Message-ID: <1373107337.89.0.95411987573.issue18376@psf.upfronthosting.co.za> New submission from Florent Xicluna: It would be useful to display the number of processes used to run the test suite. (some buildbots have multiple -j on the command line, and it is unclear which one is effective) Proposal (on the third line): == CPython 3.4.0a0 (default:6d278f426417, Jul 6 2013, 10:20:02) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] == Darwin-10.8.0-x86_64-i386-64bit little-endian == /Volumes/DATA/pydev/cpython/build/test_python_56822 (1 process) Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=1, verbose=0, bytes_warning=2, quiet=0, hash_randomization=1) Using random seed 9023960 [ 1/375] test_epoll [ 2/375] test_tokenize ... == CPython 3.4.0a0 (default:6d278f426417, Jul 6 2013, 10:20:02) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] == Darwin-10.8.0-x86_64-i386-64bit little-endian == /Volumes/DATA/pydev/cpython/build/test_python_56826 (4 processes) Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=1, verbose=0, bytes_warning=2, quiet=0, hash_randomization=1) Using random seed 9023960 [ 1/375] test_epoll [ 2/375] test_tokenize ... ---------- components: Tests messages: 192408 nosy: flox priority: normal severity: normal stage: needs patch status: open title: show the effective count of process when running the testsuite type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 13:45:03 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Sat, 06 Jul 2013 11:45:03 +0000 Subject: [New-bugs-announce] [issue18377] Python Launcher code cleanup Message-ID: <1373111103.05.0.405737364522.issue18377@psf.upfronthosting.co.za> New submission from Ronald Oussoren: While working on a Python Launcher issue (#12990) I noticed some compiler warnings for Python Launcher. The attached patch removes those warnings, and cleans up some indentation issues. Ned: do you have an opinion on applying this to the 3.3 and 2.7 branches? I'd prefer to backport to keep the code base the same (especially because there are no functional changes) ---------- assignee: ronaldoussoren files: cleanup-pythonlauncher-full.txt keywords: patch messages: 192417 nosy: ned.deily, ronaldoussoren priority: normal severity: normal stage: commit review status: open title: Python Launcher code cleanup type: compile error versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30802/cleanup-pythonlauncher-full.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 14:19:03 2013 From: report at bugs.python.org (Dmitry Jemerov) Date: Sat, 06 Jul 2013 12:19:03 +0000 Subject: [New-bugs-announce] [issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English Message-ID: <1373113143.69.0.513997485887.issue18378@psf.upfronthosting.co.za> New submission from Dmitry Jemerov: On Mac OS X 10.8 with the default language set to English (System Preferences | Language and Text), the default terminal application sets the LC_CTYPE environment variable to "UTF-8". If you run Python from the terminal and try to use locale.getdefaultlocate(), you get the following error: > python Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.getdefaultlocale() Traceback (most recent call last): File "", line 1, in File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 496, in getdefaultlocale return _parse_localename(localename) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 428, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8 (The stacktrace is from Python 2.7 but Python 3.3 suffers from the same problem.) There are numerous workarounds for this problem (turning off the "Set locale environment variables on startup" option in the terminal settings, or adding "export LC_CTYPE=en_US.UTF8" to .bash_profile, selecting a language other than English in the Language & Text settings), but these require additional configuration from the user's side. I think that the more useful behavior is for Python to handle this behavior of the system and not crash, even though it doesn't strictly comply to the POSIX standard. The attached patch (against current Python 3.4 master branch) is one possible fix. ---------- components: Library (Lib) files: getdefaultlocale.patch keywords: patch messages: 192422 nosy: Dmitry.Jemerov priority: normal severity: normal status: open title: locale.getdefaultlocale() fails on Mac OS X with default language set to English versions: Python 2.7, Python 3.4 Added file: http://bugs.python.org/file30807/getdefaultlocale.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 14:30:20 2013 From: report at bugs.python.org (Christian Heimes) Date: Sat, 06 Jul 2013 12:30:20 +0000 Subject: [New-bugs-announce] [issue18379] SSLSocket.getpeercert(): OCSP and CRL DP URIs Message-ID: <1373113820.69.0.993582296308.issue18379@psf.upfronthosting.co.za> New submission from Christian Heimes: The patch implements OCSP and CRL distribution point access for getpeercert(). I'll add tests and doc updates later. Output for https://info.pca.dfn.de/ {'OCSP': ('http://ocsp.pca.dfn.de/OCSP-Server/OCSP',), 'crlDistributionPoints': ('http://cdp1.pca.dfn.de/global-services-ca/pub/crl/cacrl.crl', 'http://cdp2.pca.dfn.de/global-services-ca/pub/crl/cacrl.crl'), 'issuer': ((('countryName', 'DE'),), (('organizationName', 'DFN-Verein'),), (('organizationalUnitName', 'DFN-PKI'),), (('commonName', 'DFN-Verein CA Services'),)), 'notAfter': 'Oct 18 09:07:09 2014 GMT', 'notBefore': 'Oct 19 09:07:09 2009 GMT', 'serialNumber': '0EFBA9CC', 'subject': ((('countryName', 'DE'),), (('organizationName', 'DFN-Verein'),), (('organizationalUnitName', 'DFN-PKI'),), (('commonName', 'info.pca.dfn.de'),)), 'version': 3} ---------- components: Extension Modules files: ssl_ocsp_crldp.patch keywords: patch messages: 192426 nosy: christian.heimes, pitrou priority: normal severity: normal stage: patch review status: open title: SSLSocket.getpeercert(): OCSP and CRL DP URIs type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30810/ssl_ocsp_crldp.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 14:32:48 2013 From: report at bugs.python.org (Valentina Mukhamedzhanova) Date: Sat, 06 Jul 2013 12:32:48 +0000 Subject: [New-bugs-announce] [issue18380] email/quoprimime.py doesn't use re.sub correctly Message-ID: <1373113968.45.0.531032610205.issue18380@psf.upfronthosting.co.za> New submission from Valentina Mukhamedzhanova: header_decode function in the standard library email/quoprimime.py module calls re.sub with a positional argument for flags in the wrong position. My patch fixes it to use a keyword argument. ---------- components: Library (Lib), Regular Expressions, email files: patch_quoprimime messages: 192428 nosy: barry, ezio.melotti, mrabarnett, r.david.murray, umi priority: normal severity: normal status: open title: email/quoprimime.py doesn't use re.sub correctly type: behavior versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30811/patch_quoprimime _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 14:37:39 2013 From: report at bugs.python.org (Giampaolo Rodola') Date: Sat, 06 Jul 2013 12:37:39 +0000 Subject: [New-bugs-announce] [issue18381] unittest warnings counter Message-ID: <1373114259.86.0.274298241842.issue18381@psf.upfronthosting.co.za> New submission from Giampaolo Rodola': ...as per my original proposal on python-ideas: http://mail.python.org/pipermail/python-ideas/2013-June/021450.html Patch is in attachment. ---------- components: Library (Lib) files: unittest.patch keywords: needs review, patch messages: 192430 nosy: ezio.melotti, giampaolo.rodola, michael.foord priority: normal severity: normal status: open title: unittest warnings counter versions: Python 3.4 Added file: http://bugs.python.org/file30812/unittest.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 14:45:37 2013 From: report at bugs.python.org (Walter Prins) Date: Sat, 06 Jul 2013 12:45:37 +0000 Subject: [New-bugs-announce] [issue18382] multiprocessing's overlapped PipeConnection issues on Windows 8 Message-ID: <1373114737.55.0.0779572840335.issue18382@psf.upfronthosting.co.za> New submission from Walter Prins: It appears that Windows 8 (Version 6.2.9200 x64) has introduced changes in behaviour that causes the multiprocessing module's use of overlapped PipeConnection to fail (Python 3.4 32bit and release 3.3.2 32bit). This issue previously existed (see issue #12328 point 1) and was fixed but the fixes for #12328 do not appear to work on Windows 8. Specifically the test test_multiprocessing._TestPoll.test_empty_string fails with message: FAIL: test_empty_string (Lib.test.test_multiprocessing.WithProcessesTestPoll) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Users\Walter\Documents\src\cpython\Lib\test\test_multiprocessing.py", line 2416, in test_empty_string self.assertEqual(a.poll(), True) AssertionError: False != True Additionally, there appears to be no buildbot for Windows 8 currently, would it be possible to have one set up? ---------- components: Extension Modules messages: 192431 nosy: wprins priority: normal severity: normal status: open title: multiprocessing's overlapped PipeConnection issues on Windows 8 type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 15:36:14 2013 From: report at bugs.python.org (Florent Xicluna) Date: Sat, 06 Jul 2013 13:36:14 +0000 Subject: [New-bugs-announce] [issue18383] test_warnings modifies warnings.filters when running with "-W default" Message-ID: <1373117774.47.0.846306714059.issue18383@psf.upfronthosting.co.za> New submission from Florent Xicluna: Running the test suite with -Wd, we got the warning: [247/375] test_warnings Warning -- warnings.filters was modified by test_warnings This is how to reproduce: ./python -Wd import warnings from test import support saved = warnings.filters.copy() c_warnings = support.import_fresh_module('warnings', fresh=['_warnings']) saved == warnings.filters # --> False ---------- components: Tests messages: 192441 nosy: flox priority: low severity: normal stage: needs patch status: open title: test_warnings modifies warnings.filters when running with "-W default" type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 18:07:52 2013 From: report at bugs.python.org (Balthazar Rouberol) Date: Sat, 06 Jul 2013 16:07:52 +0000 Subject: [New-bugs-announce] [issue18384] Add devhelp build instructions to the documentation makefile Message-ID: <1373126872.99.0.196855788769.issue18384@psf.upfronthosting.co.za> New submission from Balthazar Rouberol: The documentation makefile is missing support for Devhelp. The supplied patch fixes this for the Python 3 branch. It also edits the ouput of the sphinx build to change the name of the devhelp project. This is needed to be able to have both versions of documentation (py2 & py3) displayed in Devhelp. This is useful if developers need to access documentation for both versions, such as both maintaining a Python2 project and starting a new project in Python3. This has been patched in some distributions downstream, but would be nice to have patched upstream. See: https://bugs.launchpad.net/ubuntu/+source/devhelp/+bug/787039 ---------- assignee: docs at python components: Documentation files: devhelp-build-py3.patch keywords: patch messages: 192457 nosy: brouberol, docs at python priority: normal severity: normal status: open title: Add devhelp build instructions to the documentation makefile type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file30823/devhelp-build-py3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 18:14:41 2013 From: report at bugs.python.org (Balthazar Rouberol) Date: Sat, 06 Jul 2013 16:14:41 +0000 Subject: [New-bugs-announce] [issue18385] Add devhelp build instructions to the documentation makefile (Python2) Message-ID: <1373127281.72.0.44183394667.issue18385@psf.upfronthosting.co.za> New submission from Balthazar Rouberol: The documentation makefile is missing support for Devhelp. The supplied patch fixes this for the Python 2 branch. ---------- assignee: docs at python components: Documentation files: devhelp-build-py2.patch keywords: patch messages: 192458 nosy: brouberol, docs at python priority: normal severity: normal status: open title: Add devhelp build instructions to the documentation makefile (Python2) type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file30825/devhelp-build-py2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 19:20:12 2013 From: report at bugs.python.org (James Lu) Date: Sat, 06 Jul 2013 17:20:12 +0000 Subject: [New-bugs-announce] [issue18386] Better random number generator Message-ID: <1373131212.93.0.315136368245.issue18386@psf.upfronthosting.co.za> New submission from James Lu: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/index.html#dSFMT You might want to use a better algorithm ---------- components: Library (Lib) files: dSFMT-src-2.2.1.zip messages: 192469 nosy: James.Lu priority: normal severity: normal status: open title: Better random number generator versions: Python 3.3 Added file: http://bugs.python.org/file30830/dSFMT-src-2.2.1.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 19:28:15 2013 From: report at bugs.python.org (Ron Adam) Date: Sat, 06 Jul 2013 17:28:15 +0000 Subject: [New-bugs-announce] [issue18387] Add 'symbols' link to html menu bar. Message-ID: <1373131695.63.0.960870867634.issue18387@psf.upfronthosting.co.za> New submission from Ron Adam: This patch adds a 'symbols' link after the 'topics' and 'keywords' links in the html browser menu bar. help('symbols') worked, but there was no way to get to it in the html browser. This also adds unquote_plus() to the url handler to unquote the html input form fields. This is needed to allow entering the symbols. ---------- components: Library (Lib) files: pdoc_symbols.diff keywords: patch messages: 192471 nosy: ron_adam priority: normal severity: normal status: open title: Add 'symbols' link to html menu bar. versions: Python 3.4 Added file: http://bugs.python.org/file30831/pdoc_symbols.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 19:42:41 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 06 Jul 2013 17:42:41 +0000 Subject: [New-bugs-announce] [issue18388] Link to the contributor agreement from devinabox Message-ID: <1373132561.94.0.680861467418.issue18388@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: brett.cannon keywords: easy nosy: brett.cannon priority: low severity: normal status: open title: Link to the contributor agreement from devinabox _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 6 22:14:32 2013 From: report at bugs.python.org (Jonathan Eldridge) Date: Sat, 06 Jul 2013 20:14:32 +0000 Subject: [New-bugs-announce] [issue18389] os.path.relpath gives incorrect results if start parameters is not a directory Message-ID: <1373141672.93.0.461698296017.issue18389@psf.upfronthosting.co.za> New submission from Jonathan Eldridge: With the following directory structure: computer$ ls foo/ computer$ ls foo/ bar/ foo_file.txt computer$ ls foo/bar/ bar_file.txt Running: os.path.relpath('foo/bar/bar_file.txt', 'foo/foo_file.txt') Returns: '../bar/bar_file.txt' But should return: 'bar/bar_file.txt' ---------- components: Library (Lib) messages: 192484 nosy: jveldridge priority: normal severity: normal status: open title: os.path.relpath gives incorrect results if start parameters is not a directory versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 7 00:22:01 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 06 Jul 2013 22:22:01 +0000 Subject: [New-bugs-announce] [issue18390] Better documenting of ``hg revert -r`` when merging with another branch Message-ID: <1373149321.88.0.209488556232.issue18390@psf.upfronthosting.co.za> New submission from Brett Cannon: While the dev FAQ mentions it under null merges (http://docs.python.org/devguide/faq.html#how-do-i-make-a-null-merge), it probably should mention it under the merging section of http://docs.python.org/devguide/committing.html#merging-between-different-branches-within-the-same-major-version. ---------- assignee: brett.cannon components: Devguide keywords: easy messages: 192494 nosy: brett.cannon, ezio.melotti priority: normal severity: normal stage: needs patch status: open title: Better documenting of ``hg revert -r`` when merging with another branch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 7 01:33:52 2013 From: report at bugs.python.org (Chris Siebenmann) Date: Sat, 06 Jul 2013 23:33:52 +0000 Subject: [New-bugs-announce] [issue18391] socket.fromfd()'s API is difficult or impossible to use correctly in general Message-ID: <1373153632.08.0.45299629619.issue18391@psf.upfronthosting.co.za> New submission from Chris Siebenmann: socket.fromfd() requires you to supply at least the family and type of the file descriptor that you are turning into a Python socket object. However the socket module provides no documented way to determine what these actually are and there are any number of situations where you may get handed file descriptors with an indeterminate type. Nor does providing incorrect family and type values raise an exception from fromfd(), although if you get the wrong values you may get exceptions from calling methods on the returned socket (you can also get garbled and nonsensical results from some methods). (For instance, in Python 3 calling .getsockname() may raise UnicodeDecodeError under some circumstances.) Suggested resolution: socket.fromfd() should always determine the family and type itself and the arguments for them should become optional. If they are supplied and they do not match the determined family and type, fromfd() should probably raise an exception (although that will break some existing code). Less appealing resolution: the socket module should provide officially documented and supported methods for determining the family and type of a (socket) file descriptor. I think that a new module function to do this would be the cleanest approach. ---------- components: Library (Lib) messages: 192500 nosy: cks priority: normal severity: normal status: open title: socket.fromfd()'s API is difficult or impossible to use correctly in general type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 7 02:26:56 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 07 Jul 2013 00:26:56 +0000 Subject: [New-bugs-announce] [issue18392] Doc: PyObject_Malloc() is not documented Message-ID: <1373156816.39.0.0842066311974.issue18392@psf.upfronthosting.co.za> New submission from STINNER Victor: The implementation of the PEP 445 documents new memory allocator functions. But the old good PyObject_Malloc() is still not documentated!? ---------- assignee: docs at python components: Documentation messages: 192505 nosy: docs at python, haypo priority: normal severity: normal status: open title: Doc: PyObject_Malloc() is not documented versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 7 11:11:17 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 07 Jul 2013 09:11:17 +0000 Subject: [New-bugs-announce] [issue18393] Gestalt() is deprecated on OSX 10.8, remove support? Message-ID: <1373188277.85.0.140879649909.issue18393@psf.upfronthosting.co.za> New submission from Ronald Oussoren: In OSX 10.8 the Gestalt() funtion in CoreServices is deprecated. This function is used in the _gestalt extension and exported to Python code. The only in-tree user of this (private) extension is the platform module, it uses gestalt as one of the alternatives to get the OSX release; and a fallback at that. A stackoverflow user has done some sleuthing and discovered that the gestalt function uses the same XML file to determine the OSX release as is used by the primary alternative used by the platform module (see ). The gestalt alternative will therefore likely be useful at all (it is only used when the file it reads is not available in the first place). The easiest solution to avoid this deprecated API is therefore to drop the _gestalt extension and remove its use in platform.mac_ver() ---------- assignee: ronaldoussoren components: Macintosh keywords: easy messages: 192526 nosy: ned.deily, ronaldoussoren priority: normal severity: normal stage: test needed status: open title: Gestalt() is deprecated on OSX 10.8, remove support? type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 7 11:50:01 2013 From: report at bugs.python.org (Florent Xicluna) Date: Sun, 07 Jul 2013 09:50:01 +0000 Subject: [New-bugs-announce] [issue18394] cgi.FieldStorage triggers ResourceWarning sometimes Message-ID: <1373190601.25.0.575768158618.issue18394@psf.upfronthosting.co.za> New submission from Florent Xicluna: It happens when POSTing a file for example. When running the test suite: ./python.exe -m test test_cgi Or with the script attached: $ ./python test_fieldstorage.py test_fieldstorage.py:28: ResourceWarning: unclosed file <_io.BufferedRandom name=3> check('x' * 1010) # ResourceWarning test_fieldstorage.py:29: ResourceWarning: unclosed file <_io.BufferedRandom name=3> check('x' * (maxline - 1)) # ResourceWarning ---------- components: Library (Lib) files: test_fieldstorage.py messages: 192530 nosy: flox, orsenthil, serhiy.storchaka priority: normal severity: normal status: open title: cgi.FieldStorage triggers ResourceWarning sometimes type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30837/test_fieldstorage.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 7 16:00:36 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 07 Jul 2013 14:00:36 +0000 Subject: [New-bugs-announce] [issue18395] Make _Py_char2wchar() and _Py_wchar2char() public Message-ID: <1373205636.55.0.562779126658.issue18395@psf.upfronthosting.co.za> New submission from STINNER Victor: The Python C API has two very useful functions: _Py_char2wchar() and _Py_wchar2char(). They must be used to handle correctly undecodable byte sequences. _Py_char2wchar() and _Py_wchar2char() use the surrogateescape error handler (PEP 383). _Py_char2wchar() forces also the ASCII encoding on FreeBSD and Solaris when the LC_CTYPE locale is C. Py_Main() expects an array of wide character strings (wchar_t*) for the command line argument, whereas main() gets an array or byte strings (char*). _Py_char2wchar() must be used to be able to call Py_Main(). I propose the following names: wchar_t* Py_DecodeLocale(const char* arg, size_t *size); char* Py_EncodeLocale(const wchar_t *text, size_t *error_pos); See Python/fileutils.c for more information about these functions. Python 3.3 has already higher level functions (calling _Py_char2_wchar() and _Py_wchar2char()): PyObject* PyUnicode_DecodeLocale(const char *str, const char *errors); PyObject* PyUnicode_EncodeLocale(PyObject *unicode, const char *errors); But these functions cannot be used before Python is initialized. ---------- messages: 192557 nosy: haypo priority: normal severity: normal status: open title: Make _Py_char2wchar() and _Py_wchar2char() public versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 7 16:42:50 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 07 Jul 2013 14:42:50 +0000 Subject: [New-bugs-announce] [issue18396] test_signal.test_issue9324() fails on buildbot AMD64 Windows7 SP1 3.x Message-ID: <1373208170.43.0.508048091983.issue18396@psf.upfronthosting.co.za> New submission from STINNER Victor: ERROR: test_issue9324 (test.test_signal.WindowsSignalTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_signal.py", line 213, in test_issue9324 signal.signal(sig, signal.signal(sig, handler)) TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object Related issue: #9324 (closed 3 years ago). ---------- components: Windows messages: 192566 nosy: haypo priority: normal severity: normal status: open title: test_signal.test_issue9324() fails on buildbot AMD64 Windows7 SP1 3.x versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 7 22:02:53 2013 From: report at bugs.python.org (Friedrich Spee von Langenfeld) Date: Sun, 07 Jul 2013 20:02:53 +0000 Subject: [New-bugs-announce] [issue18397] Python with MinGW Message-ID: <1373227373.99.0.371478249642.issue18397@psf.upfronthosting.co.za> New submission from Friedrich Spee von Langenfeld: I think, there are some users which are going to compile Python, but disagree with the restriction of Visual Studio (use only with account after 90 days). Should we provide makefiles to compile Python with MinGW (this could be easily done with the "Export" function of Visual Studio, see http://oldwiki.mingw.org/index.php/ConvertVisualStudioWorkspace for Details)? Or should we provide a CMakeList.txt to give the user the ability to make his own makefiles? ---------- components: Build messages: 192585 nosy: Friedrich.Spee.von.Langenfeld priority: normal severity: normal status: open title: Python with MinGW _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 7 22:21:31 2013 From: report at bugs.python.org (Ned Deily) Date: Sun, 07 Jul 2013 20:21:31 +0000 Subject: [New-bugs-announce] [issue18398] Debug Python build fails on OS X with current clang: Fatal Python error: bad ID: Allocated using API 'm', verified using API 'r' Message-ID: <1373228491.66.0.661773601913.issue18398@psf.upfronthosting.co.za> New submission from Ned Deily: ... /usr/bin/clang -Wl,-stack_size,1000000 -framework CoreFoundation -o python Modules/python.o libpython3.4dm.a -ldl -framework CoreFoundation ./python -E -S -m sysconfig --generate-posix-vars Debug memory block at address p=0x7f9fba414160: API 'm' 948 bytes originally requested The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected. The 8 pad bytes at tail=0x7f9fba414514 are FORBIDDENBYTE, as expected. The block was made by call #5440 to debug malloc/realloc. Data at p: 2f 00 00 00 55 00 00 00 ... 73 00 00 00 00 00 00 00 Fatal Python error: bad ID: Allocated using API 'm', verified using API 'r' Current thread 0x00007fff74872180: make: *** [pybuilddir.txt] Abort trap: 6 ---------- components: Build messages: 192587 nosy: haypo, ned.deily priority: critical severity: normal status: open title: Debug Python build fails on OS X with current clang: Fatal Python error: bad ID: Allocated using API 'm', verified using API 'r' versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 8 03:43:44 2013 From: report at bugs.python.org (Andrew Rowe) Date: Mon, 08 Jul 2013 01:43:44 +0000 Subject: [New-bugs-announce] [issue18399] Fix grammar in comment in python.c Message-ID: <1373247824.08.0.574543056464.issue18399@psf.upfronthosting.co.za> New submission from Andrew Rowe: diff -r 65f2c92ed079 Modules/python.c --- a/Modules/python.c Sun Jul 07 23:30:24 2013 +0200 +++ b/Modules/python.c Mon Jul 08 10:46:30 2013 +1000 @@ -19,7 +19,7 @@ main(int argc, char **argv) { wchar_t **argv_copy; - /* We need a second copies, as Python might modify the first one. */ + /* We need a second copy, as Python might modify the first one. */ wchar_t **argv_copy2; int i, res; char *oldloc; ---------- components: Interpreter Core files: patch1.txt messages: 192606 nosy: Andrew.Rowe priority: normal severity: normal status: open title: Fix grammar in comment in python.c versions: Python 3.4 Added file: http://bugs.python.org/file30849/patch1.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 8 07:04:38 2013 From: report at bugs.python.org (David Sackett) Date: Mon, 08 Jul 2013 05:04:38 +0000 Subject: [New-bugs-announce] [issue18400] Minor increase to Pickle test coverage Message-ID: <1373259878.07.0.171161881505.issue18400@psf.upfronthosting.co.za> New submission from David Sackett: Tests to provide unit test coverage of _Pickler.__init__ protocol version checks. ---------- components: Tests files: mywork.patch keywords: patch messages: 192613 nosy: davidsackett priority: normal severity: normal status: open title: Minor increase to Pickle test coverage versions: Python 3.4 Added file: http://bugs.python.org/file30854/mywork.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 8 07:35:46 2013 From: report at bugs.python.org (Stephen Tonkin) Date: Mon, 08 Jul 2013 05:35:46 +0000 Subject: [New-bugs-announce] [issue18401] Tests for pdb import ~/.pdbrc Message-ID: <1373261746.39.0.598108958249.issue18401@psf.upfronthosting.co.za> New submission from Stephen Tonkin: After a clean check out and a successful build of Python 3.4, doctests were failing when running test_pdb. Specifically, doctests were failing because they were getting a "*** NameError: name 'execfile' is not defined" when running. It turns out that my ~/.pdbrc file contained a call to execfile(). While removing this line from my ~/.pdbrc file remedied the issue for me, test_pdb probably shouldn't be reading from global configuration when testing the pdb module. ---------- assignee: ronaldoussoren components: Macintosh, Tests messages: 192614 nosy: ncoghlan, ronaldoussoren, sptonkin priority: normal severity: normal status: open title: Tests for pdb import ~/.pdbrc type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 8 07:37:53 2013 From: report at bugs.python.org (Michael Dorman) Date: Mon, 08 Jul 2013 05:37:53 +0000 Subject: [New-bugs-announce] [issue18402] Finding perl64 Message-ID: <1373261873.64.0.61453379281.issue18402@psf.upfronthosting.co.za> New submission from Michael Dorman: Perl64 installs into C:\perl64\bin Can we include this path in the search list? ---------- components: Build files: build_ssl_with_perl64.patch keywords: patch messages: 192615 nosy: brian.curtin, mjdorma priority: normal severity: normal status: open title: Finding perl64 type: compile error versions: Python 3.4 Added file: http://bugs.python.org/file30855/build_ssl_with_perl64.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 8 12:36:52 2013 From: report at bugs.python.org (Xue Fuqiao) Date: Mon, 08 Jul 2013 10:36:52 +0000 Subject: [New-bugs-announce] [issue18403] Minor bug in The Python Tutorial Message-ID: <1373279812.84.0.20851379601.issue18403@psf.upfronthosting.co.za> New submission from Xue Fuqiao: In http://docs.python.org/3.3/tutorial/introduction.html#strings: In addition to indexing, slicing is also supported. While indexing is used to obtain individual characters, slicing allows you to obtain substring: >>> word[0:2] # characters from position 0 (included) to 2 (excluded) 'Py' >>> word[2:5] # characters from position 2 (included) to 4 (excluded) 'tho' I think the second comment should be "from position 2 to 5", not "to 4". I'm a Python newbie, sorry if it's not a bug. ---------- assignee: docs at python components: Documentation messages: 192632 nosy: docs at python, xfq priority: normal severity: normal status: open title: Minor bug in The Python Tutorial versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 8 14:57:13 2013 From: report at bugs.python.org (Bohuslav "Slavek" Kabrda) Date: Mon, 08 Jul 2013 12:57:13 +0000 Subject: [New-bugs-announce] [issue18404] Memory leak in gdbmmodule Message-ID: <1373288233.43.0.746729936071.issue18404@psf.upfronthosting.co.za> New submission from Bohuslav "Slavek" Kabrda: Function dbm_length from Modules/_gdbmmodule.c seems to be leaking memory. A simple reproducer: import dbm d = dbm.open('spam', 'c') d['x'] = '1' print(len(d)) The interesting part of valgrind output with --leak-check=full: ==3312== 1 bytes in 1 blocks are definitely lost in loss record 1 of 3,622 ==3312== at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==3312== by 0x3A31A0349D: get_next_key (gdbmseq.c:72) ==3312== by 0x3A31A03595: gdbm_nextkey (gdbmseq.c:126) ==3312== by 0xDD74192: dbm_length (_gdbmmodule.c:104) ==3312== by 0x3A2473F50B: builtin_len (bltinmodule.c:1293) ==3312== by 0x3A247510D1: PyEval_EvalFrameEx (ceval.c:4080) ==3312== by 0x3A24753758: PyEval_EvalCodeEx (ceval.c:3462) ==3312== by 0x3A2475390A: PyEval_EvalCode (ceval.c:791) ==3312== by 0x3A24773893: run_mod (pythonrun.c:1989) ==3312== by 0x3A24775EE7: PyRun_FileExFlags (pythonrun.c:1945) ==3312== by 0x3A24777000: PyRun_SimpleFileExFlags (pythonrun.c:1455) ==3312== by 0x3A2478F72B: Py_Main (main.c:306) It seems that the problem is in the loop here [1] - specifically, the last okey.dptr seems not to be freed (the loop is terminated when key.dptr is NULL, but okey.dptr is still pointing to something). I'm attaching a supersimple patch that should fix this (unless I'm totally wrong about everything...) [1] http://hg.python.org/cpython/file/65f2c92ed079/Modules/_gdbmmodule.c#l102 ---------- components: Extension Modules files: gdbm-len-leak-fix.patch keywords: patch messages: 192647 nosy: bkabrda priority: normal severity: normal status: open title: Memory leak in gdbmmodule versions: Python 3.3 Added file: http://bugs.python.org/file30862/gdbm-len-leak-fix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 8 19:57:20 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 08 Jul 2013 17:57:20 +0000 Subject: [New-bugs-announce] [issue18405] crypt.mksalt() result has unnecessarily low entropy Message-ID: <1373306240.23.0.797149936972.issue18405@psf.upfronthosting.co.za> New submission from Christian Heimes: crypt.mksalt() creates a salt with a lower entropy than possible. It uses random.SystemRandom().sample() to generate a salt string from the set of 64 chars (string.ascii_letters + string.digits + './'). SystemRandom() uses a CPRNG (good) but sample() returns n UNIQUE members of the set (very bad). sample() reduces the set possible chars by one for each salt char. Suggested fix: salt = base64.b64encode(os.urandom(salt_chars * 3 // 4), b"./").decode("ascii") ---------- assignee: christian.heimes components: Library (Lib) messages: 192683 nosy: christian.heimes, gregory.p.smith priority: critical severity: normal stage: patch review status: open title: crypt.mksalt() result has unnecessarily low entropy type: security versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 8 20:25:45 2013 From: report at bugs.python.org (David P. Kendal) Date: Mon, 08 Jul 2013 18:25:45 +0000 Subject: [New-bugs-announce] [issue18406] unicodedata.itergraphemes / str.itergraphemes / str.graphemes Message-ID: <1373307945.33.0.806287270916.issue18406@psf.upfronthosting.co.za> New submission from David P. Kendal: On python-ideas I proposed the addition of a way to iterate over the graphemes of a string, either as part of the unicodedata library or as a method on the built-in str type. I provided a sample implementation, but "MRAB" pointed out that my definition of a grapheme is slightly wrong; it's a little more complex than just "character followed by combiners". M.-A. Lenburg asked me to open this issue. ---------- messages: 192684 nosy: dpk priority: normal severity: normal status: open title: unicodedata.itergraphemes / str.itergraphemes / str.graphemes type: enhancement versions: Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 8 21:09:35 2013 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 08 Jul 2013 19:09:35 +0000 Subject: [New-bugs-announce] [issue18407] Fix compiler warnings in pythoncore for Win64 Message-ID: <1373310575.24.0.067873985204.issue18407@psf.upfronthosting.co.za> New submission from Jeremy Kloth: The attached patch fixes compiler warnings for the pythoncore project when building on 64-bit Windows. Fixes for built-in modules are not included, however. ---------- files: issue18407.diff keywords: patch messages: 192686 nosy: brian.curtin, christian.heimes, haypo, jeremy.kloth, jkloth, loewis, tim.golden priority: normal severity: normal status: open title: Fix compiler warnings in pythoncore for Win64 Added file: http://bugs.python.org/file30864/issue18407.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 8 22:10:43 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Jul 2013 20:10:43 +0000 Subject: [New-bugs-announce] [issue18408] Fixes crashes found by pyfailmalloc Message-ID: <1373314243.02.0.649080681154.issue18408@psf.upfronthosting.co.za> New submission from STINNER Victor: I created a first toy based on the PEP 445 to test of Python handles MemoryError: in short, Python handles them badly... Home page of the project: https://pypi.python.org/pypi/pyfailmalloc I will use this issue to track crashes found by this tool. ---------- messages: 192691 nosy: haypo priority: normal severity: normal status: open title: Fixes crashes found by pyfailmalloc type: crash versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 9 04:33:51 2013 From: report at bugs.python.org (Phil Webster) Date: Tue, 09 Jul 2013 02:33:51 +0000 Subject: [New-bugs-announce] [issue18409] IDLE Improvements: Unit test for AutoComplete.py Message-ID: <1373337231.6.0.320085332655.issue18409@psf.upfronthosting.co.za> New submission from Phil Webster: I've started writing this test which depends on #18365. ---------- components: IDLE messages: 192711 nosy: JayKrish, Todd.Rovito, philwebster, terry.reedy priority: normal severity: normal status: open title: IDLE Improvements: Unit test for AutoComplete.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 9 05:00:07 2013 From: report at bugs.python.org (Phil Webster) Date: Tue, 09 Jul 2013 03:00:07 +0000 Subject: [New-bugs-announce] [issue18410] IDLE Improvements: Unit test for SearchDialog.py Message-ID: <1373338807.5.0.870375456877.issue18410@psf.upfronthosting.co.za> New submission from Phil Webster: Continuing the IDLE unittest framework from #15392. Depends on #18365. ---------- components: IDLE messages: 192713 nosy: JayKrish, Todd.Rovito, philwebster, terry.reedy priority: normal severity: normal status: open title: IDLE Improvements: Unit test for SearchDialog.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 9 08:32:31 2013 From: report at bugs.python.org (guo tie) Date: Tue, 09 Jul 2013 06:32:31 +0000 Subject: [New-bugs-announce] [issue18411] signal.SIGINT in windows cause process exit directly. Message-ID: <1373351551.46.0.691420854499.issue18411@psf.upfronthosting.co.za> New submission from guo tie: I wrote those test python code as following: import signal import time import os def handler(signum, frame): print "do whatever, like call thread.interrupt_main()" return signal.signal(signal.SIGINT, handler) while 1: try: time.sleep(10) except: os.kill(int(os.getpid()), signal.SIGINT) pass when i excute this test code on windows, the process print "do whatever, like call thread.interrupt_main()", then exit; on linux, it works correctly. why on windows it not work? ---------- components: Windows messages: 192722 nosy: guo.tie priority: normal severity: normal status: open title: signal.SIGINT in windows cause process exit directly. type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 9 12:45:13 2013 From: report at bugs.python.org (Xue Fuqiao) Date: Tue, 09 Jul 2013 10:45:13 +0000 Subject: [New-bugs-announce] [issue18412] Minor problem in PEP 8 Message-ID: <1373366713.85.0.45952908225.issue18412@psf.upfronthosting.co.za> New submission from Xue Fuqiao: PEP 8 says: ----------------------------------------------------------------------- |The closing brace/bracket/parenthesis on multi-line constructs may |either line up under the last item of the list, as in: | |my_list = [ | 1, 2, 3, | 4, 5, 6, | ] |result = some_function_that_takes_arguments( | 'a', 'b', 'c', | 'd', 'e', 'f', | ) ----------------------------------------------------------------------- I think the code isn't consistent with the description. See: http://article.gmane.org/gmane.comp.python.general/737558 ---------- messages: 192737 nosy: xfq priority: normal severity: normal status: open title: Minor problem in PEP 8 type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 9 14:42:45 2013 From: report at bugs.python.org (=?utf-8?b?0JDRgNGC0LXQvCDQnNC10LbQtdC90LjQvQ==?=) Date: Tue, 09 Jul 2013 12:42:45 +0000 Subject: [New-bugs-announce] [issue18413] logging.error('asdf', extra={'msg':123}) raise KeyError exception Message-ID: <1373373765.43.0.0479978783535.issue18413@psf.upfronthosting.co.za> New submission from ????? ???????: Hello. I noticed strange behavior of logging module, when debugging my code: $ python Python 2.7.3 (default, Aug 1 2012, 05:14:39) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import logging >>> logging.error('asdf') ERROR:root:asdf >>> logging.error('asdf', extra={'msg':123}) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/logging/__init__.py", line 1575, in error root.error(msg, *args, **kwargs) File "/usr/lib/python2.7/logging/__init__.py", line 1166, in error self._log(ERROR, msg, args, **kwargs) File "/usr/lib/python2.7/logging/__init__.py", line 1257, in _log record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra) File "/usr/lib/python2.7/logging/__init__.py", line 1235, in makeRecord raise KeyError("Attempt to overwrite %r in LogRecord" % key) KeyError: "Attempt to overwrite 'msg' in LogRecord" Originally code was extra=locals() and 'msg' was local variable, but it doesn't matter. ---------- messages: 192744 nosy: amezhenin priority: normal severity: normal status: open title: logging.error('asdf', extra={'msg':123}) raise KeyError exception _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 9 15:11:25 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 09 Jul 2013 13:11:25 +0000 Subject: [New-bugs-announce] [issue18414] random.choices(seq, k) Message-ID: <1373375485.67.0.76143166278.issue18414@psf.upfronthosting.co.za> New submission from Christian Heimes: The random module has no method to obvious way to select k elements from a sequence without enforcing unique values in the result set. It's a rather useful feature for salts, randomly generated passwords and other applications. See #18405 The patch implements random.choices(seq, k) -> list ---------- components: Library (Lib) files: random_choices.patch keywords: patch messages: 192747 nosy: christian.heimes, mark.dickinson, rhettinger priority: normal severity: normal stage: patch review status: open title: random.choices(seq, k) type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30877/random_choices.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 9 21:32:29 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 09 Jul 2013 19:32:29 +0000 Subject: [New-bugs-announce] [issue18415] Normalize single/double quote usage in importlib Message-ID: <1373398349.2.0.544906164055.issue18415@psf.upfronthosting.co.za> New submission from Brett Cannon: Importlib has ended up with a mixed use of single and double quotes. Should clean it up to be consistent. ---------- assignee: brett.cannon components: Library (Lib) keywords: easy messages: 192771 nosy: brett.cannon priority: low severity: normal stage: needs patch status: open title: Normalize single/double quote usage in importlib type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 9 22:01:47 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 09 Jul 2013 20:01:47 +0000 Subject: [New-bugs-announce] [issue18416] Move to absolute file paths for module.__file__ Message-ID: <1373400107.5.0.285657244525.issue18416@psf.upfronthosting.co.za> New submission from Brett Cannon: $ touch blah.py; ./python -c "import blah; print(blah.__file__)" ./blah.py Should really change that to be an absolute path since the file's location is not accurate if you call os.chdir(). ---------- components: Interpreter Core messages: 192772 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: Move to absolute file paths for module.__file__ type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 9 22:11:09 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 09 Jul 2013 20:11:09 +0000 Subject: [New-bugs-announce] [issue18417] urlopen() has a hidden default for its timeout argument Message-ID: <1373400669.07.0.823647394418.issue18417@psf.upfronthosting.co.za> New submission from Barry A. Warsaw: urllib.request.urlopen() takes a `timeout` argument with a default value, but the default value is "hidden" and undocumented. As implemented, the value is socket._GLOBAL_DEFAULT_TIMEOUT, but even this isn't really correct or useful. The problem comes if you are passing a set of arguments to urlopen() and want to pass in a timeout that is the same as default. Because its undocumented, you have to UTSL to figure out what the value is, and then you have to use a non-public attribute of the socket module. It would be better if urlopen() was documented to default `timeout=None` meaning "use the default timeout". The implementation should then use socket.getdefaulttimeout() when timeout=None. The documentation should also be updated. Now if you want to call urlopen() with the default values, it would just be `urlopen(..., timeout=None, ...)` ---------- messages: 192773 nosy: barry priority: normal severity: normal status: open title: urlopen() has a hidden default for its timeout argument versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 10 00:13:50 2013 From: report at bugs.python.org (A. Jesse Jiryu Davis) Date: Tue, 09 Jul 2013 22:13:50 +0000 Subject: [New-bugs-announce] [issue18418] Thread.isAlive() sometimes True after fork Message-ID: <1373408030.66.0.77258289483.issue18418@psf.upfronthosting.co.za> New submission from A. Jesse Jiryu Davis: In threading.Thread.__bootstrap_inner(), the thread sets self.__started before adding itself to the _active collection. If a different thread forks between these two operations, we're left with a thread that believes it's alive although it isn't. _after_fork() doesn't call __stop() on this thread because the thread isn't in _active. In the attached patch, Thread adds itself to _active before setting self.__started. This way, if it's interrupted by a fork, it may end up stopped without being started, rather than the reverse. In this case isAlive() correctly returns False. One concern about the patch: my new test in test_threading.py only reveals the bug in Python 2.7.5 very occasionally. I don't know how to force the test to fail more frequently. Looking at the threading.py on the 3.3 branch, it appears to have the same bug, but I can't reproduce it there, only on the 2.7 branch. ---------- components: Library (Lib) files: fix_is_alive_and_fork.patch keywords: patch messages: 192780 nosy: emptysquare priority: normal severity: normal status: open title: Thread.isAlive() sometimes True after fork versions: Python 2.7 Added file: http://bugs.python.org/file30880/fix_is_alive_and_fork.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 10 01:17:19 2013 From: report at bugs.python.org (Georgiy Treyvus) Date: Tue, 09 Jul 2013 23:17:19 +0000 Subject: [New-bugs-announce] [issue18419] For reasons I can't explain Python in some cases says that getstatusoutput is not an attribute of the commands module but it is and should be Message-ID: <1373411839.5.0.624696172952.issue18419@psf.upfronthosting.co.za> New submission from Georgiy Treyvus: Basically in a lot of situations in recent times I've had to make sure a bunch of files are all the same. Now diff is great but it only lets me pass two files. diff3 and sdiff also aren't what I'm looking for. So I decided to write my own little script that does that. I was doing a few crude preliminary tests on an early version of the utility and that's when shit hit the fan. For reasons I can't explain Python 2.7.5 in some circumstances said that getstatusoutput wasn't an attribute of the commands module. The program executed fine though under Python 3.3.2. Anyway here's some shell output which will leave you folks scratching your head as much as I am. I have several times checked the syntax and I just simply don't think I'm doing anything wrong. What are your thoughts? =======SHELL OUTPUT======= [georgiy at PANTHER mess]$ python Python 2.7.5 (default, May 16 2013, 13:44:12) [GCC 4.8.0 20130412 (Red Hat 4.8.0-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import commands as run >>> run.getstatusoutput >>> [georgiy at PANTHER mess]$ python3 Python 3.3.2 (default, May 20 2013, 12:05:55) [GCC 4.8.0 20130412 (Red Hat 4.8.0-2)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess as run >>> run.getstatusoutput >>> [georgiy at PANTHER mess]$ cat allthesame.py import sys if sys.version_info==2: import commands as run else: import subprocess as run baseCommand='diff --recursive '+sys.argv[1]+' ' for item in sys.argv[2:]: if run.getstatusoutput(baseCommand+item)[0]!=0: print('not all the same') exit(1) print('all the same') exit(0) [georgiy at PANTHER mess]$ cat a test [georgiy at PANTHER mess]$ cat b test [georgiy at PANTHER mess]$ python allthesame.py a b Traceback (most recent call last): File "allthesame.py", line 8, in if run.getstatusoutput(baseCommand+item)[0]!=0: AttributeError: 'module' object has no attribute 'getstatusoutput' [georgiy at PANTHER mess]$ python3 allthesame.py a b all the same ---------- messages: 192782 nosy: wfatp priority: normal severity: normal status: open title: For reasons I can't explain Python in some cases says that getstatusoutput is not an attribute of the commands module but it is and should be versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 10 01:19:54 2013 From: report at bugs.python.org (Dun Peal) Date: Tue, 09 Jul 2013 23:19:54 +0000 Subject: [New-bugs-announce] [issue18420] os.rename FileNotFound complaining about dst, but it is src which is missing Message-ID: <1373411994.05.0.758918475108.issue18420@psf.upfronthosting.co.za> New submission from Dun Peal: # The following reproduction is running on Ubuntu 13.04, Python 3.3.1: $ ls bar $ python3 -c "import os; os.rename('foo', 'bar')" Traceback (most recent call last): File "", line 1, in FileNotFoundError: [Errno 2] No such file or directory: 'bar' ---------- components: Library (Lib) messages: 192783 nosy: Dun.Peal priority: normal severity: normal status: open title: os.rename FileNotFound complaining about dst, but it is src which is missing versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 10 13:45:56 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Jul 2013 11:45:56 +0000 Subject: [New-bugs-announce] [issue18421] Refactor call_with_frame() function of pyexpat.c Message-ID: <1373456756.74.0.870039145452.issue18421@psf.upfronthosting.co.za> New submission from STINNER Victor: Modules/pyexpat.c contains a call_with_frame() function which uses many low-level attributes like tstate->c_profilefunc. I don't think that pyexpat.c is the best place for such function, it should be moved to Python/ceval.c. Except the call to XML_StopParser(self->itself, XML_FALSE); on failure, the code doesn't look to be specific to (py)expat. ---------- components: XML messages: 192796 nosy: christian.heimes, fdrake, haypo priority: normal severity: normal status: open title: Refactor call_with_frame() function of pyexpat.c versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 10 14:36:24 2013 From: report at bugs.python.org (andrew cooke) Date: Wed, 10 Jul 2013 12:36:24 +0000 Subject: [New-bugs-announce] [issue18422] is_package missing so can't use -m Message-ID: <1373459784.39.0.18734737033.issue18422@psf.upfronthosting.co.za> New submission from andrew cooke: Using python 3.3, if I try to run __main__ I see this error: Traceback (most recent call last): File "/usr/local/lib/python3.3/runpy.py", line 140, in _run_module_as_main mod_name, loader, code, fname = _get_module_details(mod_name) File "/usr/local/lib/python3.3/runpy.py", line 105, in _get_module_details if loader.is_package(mod_name): AttributeError: 'NamespaceLoader' object has no attribute 'is_package' My directory structure is: > tree . . ??? README.md ??? src ??? ??? simplessl ??? ??? ca.py ??? ??? __main__.py ??? ??? req.py ??? ??? utils.py ??? ssl.iml i assume this is related to http://bugs.python.org/issue18058 but don't understand why this is not a bugfix that can be back-ported. this appears to be a bug to me... ---------- components: Installation messages: 192799 nosy: acooke priority: normal severity: normal status: open title: is_package missing so can't use -m versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 10 14:58:32 2013 From: report at bugs.python.org (andrew cooke) Date: Wed, 10 Jul 2013 12:58:32 +0000 Subject: [New-bugs-announce] [issue18423] Document limitations on -m Message-ID: <1373461112.24.0.280779659137.issue18423@psf.upfronthosting.co.za> New submission from andrew cooke: Apparently the limited support for -m is standard behaviour - see http://bugs.python.org/issue18422 - but it's not documented at http://docs.python.org/3/using/cmdline.html#cmdoption-m That should say, somewhere, that it only applies to leaf modules and packages. ---------- assignee: docs at python components: Documentation messages: 192804 nosy: acooke, docs at python priority: normal severity: normal status: open title: Document limitations on -m _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 10 15:11:34 2013 From: report at bugs.python.org (Marco Buttu) Date: Wed, 10 Jul 2013 13:11:34 +0000 Subject: [New-bugs-announce] [issue18424] sum() does not return only the sum of a sequence of numbers + PEP8 reccomandation Message-ID: <1373461894.57.0.746181395812.issue18424@psf.upfronthosting.co.za> New submission from Marco Buttu: The documentaion of sum(): Returns the sum of a sequence of numbers (NOT strings) plus the value of parameter 'start' (which defaults to 0). When the sequence is empty, returns start. A. According to the PEP-8 it should be: "Return the sum...", and "When the sequence is empty, return start.", like the other docs. For instance: >>> print(len.__doc__) len(object) -> integer Return the number of items of a sequence or mapping. B. When the second argument is a tuple or a list, you can add sequences of sequences: >>> sum([['a', 'b', 'c'], [4]], []) ['a', 'b', 'c', 4] >>> sum(((1, 2, 3), (1,)), (1,)) (1, 1, 2, 3, 1) C. sum() takes not just sequences: >>> sum({1: 'one', 2: 'two'}) 3 Maybe it is not a good idea to give a complete description of sum() in the docstring, but perhaps something "good enough". In any case, I think the lack of the PEP-8 recommendation should be fixed. ---------- assignee: docs at python components: Documentation messages: 192805 nosy: docs at python, marco.buttu priority: normal severity: normal status: open title: sum() does not return only the sum of a sequence of numbers + PEP8 reccomandation versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 11 00:03:58 2013 From: report at bugs.python.org (R. Jayakrishnan) Date: Wed, 10 Jul 2013 22:03:58 +0000 Subject: [New-bugs-announce] [issue18425] IDLE Unit test for IdleHistory.py Message-ID: <1373493838.59.0.876568806243.issue18425@psf.upfronthosting.co.za> New submission from R. Jayakrishnan: Continuing the IDLE unittest framework #15392, unit test for IdleHistory.py. This test depends on mockText and uses the patch by Terry at issue #18365. Because the mockText is still about to commit, first patch http://bugs.python.org/file30865/mock_text2.diff and then use test_idlehistory.patch to run test_idlehistory. Once the mock Text get committed I will improve the patch according to. ---------- components: IDLE files: test_idlehistory.patch keywords: patch messages: 192840 nosy: JayKrish, terry.reedy priority: normal severity: normal status: open title: IDLE Unit test for IdleHistory.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30885/test_idlehistory.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 11 08:36:51 2013 From: report at bugs.python.org (Ivan Johansen) Date: Thu, 11 Jul 2013 06:36:51 +0000 Subject: [New-bugs-announce] [issue18426] Crash when extension does not use PyModule_Create() Message-ID: <1373524611.25.0.726657058884.issue18426@psf.upfronthosting.co.za> New submission from Ivan Johansen: In Python/importdl.c around line 99 in the function _PyImport_LoadDynamicModule() you can find the code: def = PyModule_GetDef(m); def->m_base.m_init = p; If the module m, which is returned from a newly imported extension, is not created by PyModule_Create() but in some other way then PyModule_GetDef(m) will return NULL. The next line will then dereference a NULL pointer and crash. I suggest a check for this is added: def = PyModule_GetDef(m); if(def != NULL) def->m_base.m_init = p; ---------- messages: 192845 nosy: Padowan priority: normal severity: normal status: open title: Crash when extension does not use PyModule_Create() type: crash versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 11 11:40:39 2013 From: report at bugs.python.org (Tobias Marschall) Date: Thu, 11 Jul 2013 09:40:39 +0000 Subject: [New-bugs-announce] [issue18427] str.replace causes segfault for long strings Message-ID: <1373535639.26.0.108709359025.issue18427@psf.upfronthosting.co.za> New submission from Tobias Marschall: Running the following two lines of code causes a segfault: s = 'A' * 3142044943 t = s.replace('\n','') My setup: Python 2.7.5 (default, Jul 11 2013, 11:17:50) [GCC 4.6.3] on linux2 Linux 3.2.0-45-generic #70-Ubuntu SMP Wed May 29 20:12:06 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux I could reproduce this behavior on Python 2.6.8 and 2.5.6. Please let me know if I can provide additional information. ---------- components: Interpreter Core messages: 192855 nosy: tobiasmarschall priority: normal severity: normal status: open title: str.replace causes segfault for long strings type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 11 13:53:10 2013 From: report at bugs.python.org (Mike) Date: Thu, 11 Jul 2013 11:53:10 +0000 Subject: [New-bugs-announce] [issue18428] IDLE startup error Message-ID: <1373543590.93.0.69905828801.issue18428@psf.upfronthosting.co.za> New submission from Mike: Python used to run smoothly on my macbook, but since I opened the debugger yesterday, the IDLE window cannot be opened anymore. It shows an error message "IDLE's subprocess didn't make connection". I tried to uninstall everything and download it again from the website, but the problem is unsolved. I am using the latest OS X Mountain Lion, and installed Python 3.3.2 and the latest Tcl/Tk. Please advice me how to fix the problem. ---------- components: IDLE messages: 192868 nosy: mwei11 priority: normal severity: normal status: open title: IDLE startup error type: crash versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 11 19:56:12 2013 From: report at bugs.python.org (Todd Rovito) Date: Thu, 11 Jul 2013 17:56:12 +0000 Subject: [New-bugs-announce] [issue18429] IDLE: Format Paragraph doesn't function with comment blocks Message-ID: <1373565372.76.0.397397850212.issue18429@psf.upfronthosting.co.za> New submission from Todd Rovito: While working on a test case for Format Paragraph (http://bugs.python.org/issue18226) I noted that format paragraph doesn't work with comment blocks when a comment block is selected. The fix is very simple by changing one line: if first and last: data = text.get(first, last) comment_header = get_comment_header(data) else: The comment_header line was changed from comment_header = ''. This forces the format paragraph extension to always do "just a normal text format". Attached is a patch but I would like to explore the bug in more detail and make sure all cases are covered. ---------- messages: 192883 nosy: Todd.Rovito priority: normal severity: normal status: open title: IDLE: Format Paragraph doesn't function with comment blocks type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 11 21:34:01 2013 From: report at bugs.python.org (Nick Bargnesi) Date: Thu, 11 Jul 2013 19:34:01 +0000 Subject: [New-bugs-announce] [issue18430] gzip, bz2, lzma: peek advances file position of existing file object Message-ID: <1373571241.88.0.314815867736.issue18430@psf.upfronthosting.co.za> New submission from Nick Bargnesi: Using existing file objects as arguments to the open functions in the gzip, bz2, and lzma libraries can cause the underlying fileobj position to get changed - and not quite in ways one would expect. Calling peek against the returned file objects -- gzip.GzipFile, bz2.BZ2File, and lzma.LZMAFile will in one scenario advance the position of the supplied file object: >>> import bz2 >>> fileobj = open('test.bz2', mode='rb') >>> bzfile = bz2.open(fileobj) >>> >>> # file positions at 0 >>> assert fileobj.tell() == 0, bzfile.tell() == 0 >>> >>> bzfile.peek() b'Test file.\n' >>> fileobj.tell() 52 If after the initial peek, we rewind the underlying fileobj and peek again, the behavior changes: >>> fileobj.seek(0) 0 >>> bzfile.peek() b'Test file.\n' >>> fileobj.tell() 0 The second scenario serves to complicate things a bit with the change in behavior. I would be less surprised if the module documentation simply stated the affect on file position of the file object being used. Though it would be beautiful if the underlying file object didn't change at all. The latter seems possible since the three modules know whether the file object is seekable. The gzip and lzma modules exhibit similar behavior - gzip for example: >>> import gzip >>> fileobj = open('test.gz', mode='rb') >>> gzfile = gzip.open(fileobj) >>> >>> # file positions at 0 >>> assert fileobj.tell() == 0 and gzfile.tell() == 0 >>> >>> gzfile.peek(1) b'Test file.\n' >>> fileobj.tell() 36 >>> >>> # rewind, and do it again >>> fileobj.seek(0) >>> >>> gzfile.peek(1) b'Test file.\n' >>> fileobj.tell() 0 ---------- components: Library (Lib) messages: 192890 nosy: nbargnesi priority: normal severity: normal status: open title: gzip, bz2, lzma: peek advances file position of existing file object type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 11 22:10:18 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 11 Jul 2013 20:10:18 +0000 Subject: [New-bugs-announce] [issue18431] Encoded words in structured headers are not decoded by the new parser. Message-ID: <1373573418.36.0.0145558554695.issue18431@psf.upfronthosting.co.za> New submission from R. David Murray: The subject says it all, but here is an example (from issue 18044): >>> msg = message_from_string('To: =?utf-8?q?Eric?= \n\n', policy=default) >>> msg['To'] '=?utf-8?q?Eric?= ' ---------- components: email messages: 192897 nosy: Tim.Rawlinson, barry, r.david.murray priority: normal severity: normal stage: needs patch status: open title: Encoded words in structured headers are not decoded by the new parser. type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 12 09:31:21 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 12 Jul 2013 07:31:21 +0000 Subject: [New-bugs-announce] [issue18432] sched modules queue property should return a list, not an iterator Message-ID: <1373614281.57.0.554958596911.issue18432@psf.upfronthosting.co.za> New submission from Raymond Hettinger: In Python 2, the queue attribute was a list and it is still documented that way in Python 3: http://docs.python.org/3/library/sched.html#sched.scheduler.queue This appears to be a mistake made during the 2-to-3 conversion. ---------- components: Library (Lib) files: sched.diff keywords: patch messages: 192927 nosy: rhettinger priority: normal severity: normal stage: patch review status: open title: sched modules queue property should return a list, not an iterator type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30900/sched.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 12 15:02:08 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 12 Jul 2013 13:02:08 +0000 Subject: [New-bugs-announce] [issue18433] Clarify venv docs about which methods check for pre-existing paths Message-ID: <1373634128.21.0.571216700722.issue18433@psf.upfronthosting.co.za> New submission from Brett Cannon: E.g. setup_python and create_directories both check that the paths they will create pre-exist, but the docs don't mention this. ---------- assignee: docs at python components: Documentation messages: 192938 nosy: brett.cannon, carljm, docs at python priority: normal severity: normal status: open title: Clarify venv docs about which methods check for pre-existing paths versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 12 15:03:54 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 12 Jul 2013 13:03:54 +0000 Subject: [New-bugs-announce] [issue18434] Update venv example to use setuptools Message-ID: <1373634234.22.0.916403882512.issue18434@psf.upfronthosting.co.za> New submission from Brett Cannon: Now that Distribute is just a shell for setuptools 0.8, the example in the venv docs for installing pip and setuptools in a venv should be updated to use setuptools (in case anyone uses that code as a script themselves). ---------- assignee: docs at python components: Documentation messages: 192939 nosy: brett.cannon, carljm, docs at python priority: normal severity: normal status: open title: Update venv example to use setuptools versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 12 20:33:14 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 12 Jul 2013 18:33:14 +0000 Subject: [New-bugs-announce] [issue18435] Move venv from a custom Context class to types.SimpleNamespace Message-ID: <1373653994.06.0.195210973118.issue18435@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- components: Library (Lib) nosy: brett.cannon, carljm, eric.snow priority: normal severity: normal stage: needs patch status: open title: Move venv from a custom Context class to types.SimpleNamespace versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 12 22:46:46 2013 From: report at bugs.python.org (Zachary Ware) Date: Fri, 12 Jul 2013 20:46:46 +0000 Subject: [New-bugs-announce] [issue18436] Add mapping of symbol to function to operator module Message-ID: <1373662006.12.0.760343850871.issue18436@psf.upfronthosting.co.za> New submission from Zachary Ware: In a thread on python-ideas[1], Nick mentioned the idea of ``operator.by_symbol['+=']`` which would be an alternative method of getting the operator.iadd function. The idea struck my fancy, so I implemented it (regardless of the very real possibility of being rejected anyway, judging by the current split vote in the thread :)). I also implemented Brett's suggestion of supporting '.attribute' and '[item]' as well. Here's the (still a bit rough) patch. [1] http://mail.python.org/pipermail/python-ideas/2013-July/022078.html ---------- components: Library (Lib) files: operator-symbol-map.diff keywords: patch messages: 192970 nosy: barry, belopolsky, brett.cannon, ncoghlan, serhiy.storchaka, zach.ware priority: normal severity: normal status: open title: Add mapping of symbol to function to operator module type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30906/operator-symbol-map.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 13 04:52:12 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Sat, 13 Jul 2013 02:52:12 +0000 Subject: [New-bugs-announce] [issue18437] Typo in comment inside class Charset about output_charset Message-ID: <1373683932.23.0.900604303434.issue18437@psf.upfronthosting.co.za> New submission from Vajrasky Kok: Python 3.4, line 197: output_charset: Some character sets must be converted before the can be It is supposed to be: output_charset: Some character sets must be converted before they can be ---------- assignee: docs at python components: Documentation files: fix_typo_charset.txt messages: 192990 nosy: docs at python, r.david.murray, vajrasky priority: normal severity: normal status: open title: Typo in comment inside class Charset about output_charset versions: Python 3.4 Added file: http://bugs.python.org/file30908/fix_typo_charset.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 13 05:41:51 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Sat, 13 Jul 2013 03:41:51 +0000 Subject: [New-bugs-announce] [issue18438] Obsolete url in comment inside decimal module Message-ID: <1373686911.48.0.750703855786.issue18438@psf.upfronthosting.co.za> New submission from Vajrasky Kok: Python 3.4, file Lib/decimal.py, line 24: www.cs.berkeley.edu/~ejr/projects/754/private/drafts/854-1987/dir.html If you go to the website, you'll encounter this error: The server has encountered a problem because the resource was not found. I could not find the replacement. The only thing that I could find is the paid material found here: http://ieeexplore.ieee.org/xpl/mostRecentIssue.jsp?punumber=2502 That's not good. ---------- assignee: docs at python components: Documentation messages: 192994 nosy: docs at python, rhettinger, vajrasky priority: normal severity: normal status: open title: Obsolete url in comment inside decimal module versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 13 08:10:19 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 13 Jul 2013 06:10:19 +0000 Subject: [New-bugs-announce] [issue18439] Patchcheck for ACKS, NEWS does not work on Windows. Message-ID: <1373695819.6.0.661777672646.issue18439@psf.upfronthosting.co.za> New submission from Terry J. Reedy: My current list of changed_files() (command from the code) % hg status --added --modified --no-status Lib\idlelib\RstripExtension.py Misc\ACKS Misc\NEWS Lib\idlelib\idle_test\mock_idle.py Lib\idlelib\idle_test\test_rstrip.py but F:\Python\dev\py33>pcbuild\python_d tools/scripts/patchcheck.py ... Misc/ACKS updated ... NO Misc/NEWS updated ... NO The problem is that 'Misc/ACKs' is not in the list, even though 'Misc\ACKS' is ;-(. One possible fix is to conditionally change '\' to '/' in the file list, or maybe just in special_files, as that seems to be the only category affected. Another is to change line 156 (3.3) from special_files = {'Misc/ACKS', 'Misc/NEWS'} & set(file_paths) to special_files = {'Misc/ACKS', 'Misc/NEWS', 'Misc\ACKS', Misc\NEWS'} & set(file_paths). A third is to check for both versions in credit_given() (125) and reported_news() (131). I don't know if there is an issue with Macs or not. ---------- components: Demos and Tools, Windows messages: 193001 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: Patchcheck for ACKS, NEWS does not work on Windows. type: behavior versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 13 20:34:45 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Sat, 13 Jul 2013 18:34:45 +0000 Subject: [New-bugs-announce] [issue18440] hash() and __hash__() do not document their size constraints Message-ID: <1373740485.69.0.943591579445.issue18440@psf.upfronthosting.co.za> New submission from Barry A. Warsaw: If you have a custom object that implements __hash__() and it returns a value wider than Py_ssize_t, built-in hash() on the object will truncate information. This is because hash() takes the value returned by obj.__hash__() and coerces it through PyLong_FromSsize_t(). This can cause object hashes to have different values on 64bit and 32bit machines, e.g. on 64bit Linux where Py_ssize_t is 8 bytes wide vs. 32bit Linux where it is 4 bytes wide. This may be perfectly reasonable from an implementation point of (ref: issue9778) but it is surprising since it is not documented. This size constraint on object hashes should be documented. from ctypes import * class Foo: def __hash__(self): return 0x1332a6000000000 print(hash(Foo()), sizeof(c_ssize_t)) ---64bit Ubuntu 13.10--- $ python3.3 hashex.py 86459409655398400 8 ---32bit Ubuntu 13.10--- $ python3 hashex.py 40260800 4 ---------- assignee: docs at python components: Documentation messages: 193014 nosy: barry, docs at python priority: normal severity: normal status: open title: hash() and __hash__() do not document their size constraints type: behavior versions: Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 14 00:34:07 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 13 Jul 2013 22:34:07 +0000 Subject: [New-bugs-announce] [issue18441] Idle: Make test.support.requires('gui') skip when it should. Message-ID: <1373754847.55.0.0641648695763.issue18441@psf.upfronthosting.co.za> New submission from Terry J. Reedy: This is a continuation of #18365, where it was discovered after the first set of pushes that test.support.requires('gui') is currently insufficient (on non-Windows systems) for skipping gui tests on buildbots when they should be skipped, because the attempt to create a Tk root widget will raise TclError when there is no display available. This bug appears to arise from the confluence of two bugs: 1. It appears that on some buildbots, support.use_resources contains 'gui' when it should not. The could be either from -ugui or -uall without '.-gui' or ???. 2. test.support.requires starts with if resource == 'gui' and not _is_gui_available(): On windows, _is_gui_available() uses ctypes to determine that there really is a graphics screen (or something like that). On other systems, it just returns True, even when it should return False. The problem was fixed for #18365 by wrapping the tkinter.Tk call with try:...except: TclErrror: raise SkipTest. Rather than put something like that workaround in every idle_test/test_xxx file, I would like to do the test once in test/test_idle and if it does not work, remove 'gui' from use_resources so requires('gui') will work properly. See patch. test/test_ttkguionly does not use requires() (and therefore does not do the special Windows check). It first tries to import _tkinter, as does test_idle. It then calls tkinter.test.support.check_tk_availability. That either does a 'darwin'-ctypes check similar to the one for Windows in _is_gui_available or it tries to create a tk widget and looks for a TclError. test_ttkguionly then repeats the widget creation test. This checking is ok for one file, but not for gui tests sprinkled throughout idle's test_xxx files. Perhaps requires('gui') not being dependable is why there is a separate test_ttkguionly file *and* a custom discovery function, tkinter.test.runtests.get_tests, to get only gui tests. test/test_tk does the same except that is does not repeat the widget creation test. Both add 'gui' to use_resources when the file is run as main, though in a more convoluted manner than in test_idle. I am sure that removing 'gui' in test_idle cannot hurt since test_tk/ttk_gui-only skip anyway on a similar TclError. There is no test_turtle.py. The check should really be done in regrtest, but I am not familiar with its code or the policy on patching it. Then tkinter tests could also dispense with their extra checks and more easily be converted to use unittest discovery. But that is not my concern here. ---------- assignee: terry.reedy files: delete_gui.diff keywords: patch messages: 193015 nosy: r.david.murray, terry.reedy priority: high severity: normal stage: commit review status: open title: Idle: Make test.support.requires('gui') skip when it should. type: behavior versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30909/delete_gui.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 14 04:17:10 2013 From: report at bugs.python.org (=?utf-8?q?F=C3=A9vry_Thibault?=) Date: Sun, 14 Jul 2013 02:17:10 +0000 Subject: [New-bugs-announce] [issue18442] Typo in developers.rst line 27 Message-ID: <1373768230.84.0.132672962181.issue18442@psf.upfronthosting.co.za> New submission from F?vry Thibault: 'prush' -> 'push' ---------- components: Devguide messages: 193018 nosy: ezio.melotti, iwontbecreative priority: normal severity: normal status: open title: Typo in developers.rst line 27 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 14 06:16:06 2013 From: report at bugs.python.org (=?utf-8?q?F=C3=A9vry_Thibault?=) Date: Sun, 14 Jul 2013 04:16:06 +0000 Subject: [New-bugs-announce] [issue18443] Misc/Readme still documents TextMate Message-ID: <1373775366.01.0.177392157148.issue18443@psf.upfronthosting.co.za> New submission from F?vry Thibault: changeset: 80448:901002834a68 user: Brett Cannon date: Thu Nov 15 16:12:19 2012 -0500 summary: Remove the TextMate bundle. -> Misc/Readme has not been updated accordingly. The line documenting TextMate should be removed. (Likewise, since it's the same kind of topic, I would like to bring attention to http://bugs.python.org/issue9893#msg193020 ) [Sorry, I did not know which component was appropriate to report against] ---------- messages: 193024 nosy: iwontbecreative priority: normal severity: normal status: open title: Misc/Readme still documents TextMate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 14 06:44:10 2013 From: report at bugs.python.org (Todd Rovito) Date: Sun, 14 Jul 2013 04:44:10 +0000 Subject: [New-bugs-announce] [issue18444] IDLE: Mac OS X pressing ctrl-A in Python shell moved cursor before the prompt, which then makes the keyboard unresponsive. Message-ID: <1373777050.16.0.963661085579.issue18444@psf.upfronthosting.co.za> New submission from Todd Rovito: covers point 1.1) "Pressing the Home key moves the cursor before the >>> prompt, which then makes the keyboard unresponsive." This issues was fixed on Windows XP and Linux here http://bugs.python.org/issue3851 On Mac OS X the "home" key is control-A or function left arrow both have the same effect of moving the cursor left of prompt, which them makes the keyboard unresponsive. I tested this with Python 3.4 and Python 2.7 on Mac OS X 10.8.4. ---------- components: IDLE messages: 193025 nosy: Todd.Rovito, roger.serwy, terry.reedy priority: normal severity: normal status: open title: IDLE: Mac OS X pressing ctrl-A in Python shell moved cursor before the prompt, which then makes the keyboard unresponsive. versions: Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 14 08:17:00 2013 From: report at bugs.python.org (=?utf-8?q?F=C3=A9vry_Thibault?=) Date: Sun, 14 Jul 2013 06:17:00 +0000 Subject: [New-bugs-announce] [issue18445] Tools/Script/Readme is outdated Message-ID: <1373782620.19.0.347266346086.issue18445@psf.upfronthosting.co.za> New submission from F?vry Thibault: Several issues : - abitype.py, analyze_dxp.py, get-remote-certificate.py, import_diagnostics.py, parse_html5_entities.py are not documented. - README mentions redemo.py which was moved to Tools/Demo. - README says all python scripts are executables, but some need chmod +x - The script list in readme would benefit from being sorted in alphabetical order ---------- messages: 193028 nosy: iwontbecreative priority: normal severity: normal status: open title: Tools/Script/Readme is outdated _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 14 08:50:42 2013 From: report at bugs.python.org (=?utf-8?q?F=C3=A9vry_Thibault?=) Date: Sun, 14 Jul 2013 06:50:42 +0000 Subject: [New-bugs-announce] [issue18446] Dead link in documenting.rst Message-ID: <1373784642.89.0.500058513809.issue18446@psf.upfronthosting.co.za> New submission from F?vry Thibault: The following link is dead : Apple Publications Style Guide: http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2009.pdf and redirects to another page. ---------- components: Devguide messages: 193029 nosy: ezio.melotti, iwontbecreative priority: normal severity: normal status: open title: Dead link in documenting.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 14 10:04:20 2013 From: report at bugs.python.org (Torim) Date: Sun, 14 Jul 2013 08:04:20 +0000 Subject: [New-bugs-announce] [issue18447] Pydoc crashes on large contents Message-ID: <1373789060.19.0.670360908323.issue18447@psf.upfronthosting.co.za> New submission from Torim: If invoking pydoc either from a system shell or as a help() method in an interactive Python interpreter, it crashes with SIGSEGV signal at exit. It crashes only with larger documentation contents, smaller do work as expected. Example with numpy module docs: 1. launch Python interactive interpreter with `python' 2. type `import numpy' 3. type `help(numpy)' # large help, displayed by PAGER environment variable or `more' if missing 4. press `q' to quit the help 5. SIGSEGV "Segmentation fault" received, python interpreter crashes Note: if you move in a documentation at the end (last line), you can then escape (quit) anywhere without a crash ---------- components: Library (Lib) messages: 193037 nosy: torim priority: normal severity: normal status: open title: Pydoc crashes on large contents type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 14 10:26:36 2013 From: report at bugs.python.org (=?utf-8?q?F=C3=A9vry_Thibault?=) Date: Sun, 14 Jul 2013 08:26:36 +0000 Subject: [New-bugs-announce] [issue18448] Tools/demo/eiffel.py fails to run tests. Message-ID: <1373790396.51.0.890728705996.issue18448@psf.upfronthosting.co.za> New submission from F?vry Thibault: Using trunk. .Tools/demo/eiffel.py -v testEiffelMetaClass1 (__main__.Tests) ... FAIL testEiffelMetaClass2 (__main__.Tests) ... FAIL ====================================================================== FAIL: testEiffelMetaClass1 (__main__.Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "./eiffel.py", line 102, in testEiffelMetaClass1 self._test(EiffelMetaClass1) File "./eiffel.py", line 137, in _test self.assertRaises(AssertionError, t.m2, 0) AssertionError: AssertionError not raised by m2 ====================================================================== FAIL: testEiffelMetaClass2 (__main__.Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "./eiffel.py", line 105, in testEiffelMetaClass2 self._test(EiffelMetaClass2) File "./eiffel.py", line 137, in _test self.assertRaises(AssertionError, t.m2, 0) AssertionError: AssertionError not raised by m2 ---------------------------------------------------------------------- Ran 2 tests in 0.001s FAILED (failures=2) ---------- components: Demos and Tools messages: 193038 nosy: iwontbecreative priority: normal severity: normal status: open title: Tools/demo/eiffel.py fails to run tests. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 14 12:05:17 2013 From: report at bugs.python.org (=?utf-8?q?F=C3=A9vry_Thibault?=) Date: Sun, 14 Jul 2013 10:05:17 +0000 Subject: [New-bugs-announce] [issue18449] Demo 'ss1.py' crash in python3 Message-ID: <1373796317.72.0.604365443273.issue18449@psf.upfronthosting.co.za> New submission from F?vry Thibault: Run the demo. Click one of the columns or the rows. It does not select the colum/row accordingly and outputs an error log to command line. ---------- components: Demos and Tools files: python_3_change.patch keywords: patch messages: 193045 nosy: iwontbecreative priority: normal severity: normal status: open title: Demo 'ss1.py' crash in python3 type: crash Added file: http://bugs.python.org/file30914/python_3_change.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 14 17:01:33 2013 From: report at bugs.python.org (=?utf-8?q?F=C3=A9vry_Thibault?=) Date: Sun, 14 Jul 2013 15:01:33 +0000 Subject: [New-bugs-announce] [issue18450] Typos in developers.rst Message-ID: <1373814093.51.0.30447893809.issue18450@psf.upfronthosting.co.za> New submission from F?vry Thibault: 'Mathemathics' -> 'Mathematics' 'Recommandation' (I also love French :) ) -> 'Recommendation' ---------- components: Devguide files: typos.patch keywords: patch messages: 193053 nosy: ezio.melotti, iwontbecreative priority: normal severity: normal status: open title: Typos in developers.rst type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30918/typos.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 14 17:19:29 2013 From: report at bugs.python.org (Brett Cannon) Date: Sun, 14 Jul 2013 15:19:29 +0000 Subject: [New-bugs-announce] [issue18451] Omit test files in devinabox coverage run Message-ID: <1373815169.93.0.694766443004.issue18451@psf.upfronthosting.co.za> New submission from Brett Cannon: Devinabox's full_coverage.py run should omit test files. Probably need to put the path in quotes for proper escaping (same for report). ---------- assignee: brett.cannon keywords: easy messages: 193056 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: Omit test files in devinabox coverage run type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 14 17:43:07 2013 From: report at bugs.python.org (=?utf-8?q?F=C3=A9vry_Thibault?=) Date: Sun, 14 Jul 2013 15:43:07 +0000 Subject: [New-bugs-announce] [issue18452] Typo in Doc/howto/argparse.rst Message-ID: <1373816587.08.0.142397091694.issue18452@psf.upfronthosting.co.za> New submission from F?vry Thibault: 'occurences' -> 'occurrences' ---------- assignee: docs at python components: Documentation messages: 193057 nosy: docs at python, iwontbecreative priority: normal severity: normal status: open title: Typo in Doc/howto/argparse.rst type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 14 17:58:59 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Sun, 14 Jul 2013 15:58:59 +0000 Subject: [New-bugs-announce] [issue18453] There are unused variables inside DateTimeTestCase class in test_xmlrpc.py Message-ID: <1373817539.24.0.0142880431752.issue18453@psf.upfronthosting.co.za> New submission from Vajrasky Kok: Attached the menial fix to unit test in test_xmlrpc.py. ---------- components: Tests files: fix_DateTimeTestCase.txt messages: 193059 nosy: vajrasky priority: normal severity: normal status: open title: There are unused variables inside DateTimeTestCase class in test_xmlrpc.py versions: Python 3.4 Added file: http://bugs.python.org/file30919/fix_DateTimeTestCase.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 14 19:24:48 2013 From: report at bugs.python.org (Jan-Philip Gehrcke) Date: Sun, 14 Jul 2013 17:24:48 +0000 Subject: [New-bugs-announce] [issue18454] distutils crashes when uploading to PyPI having only the username (no pw) defined Message-ID: <1373822688.67.0.938925989206.issue18454@psf.upfronthosting.co.za> New submission from Jan-Philip Gehrcke: When updating an existing project on PyPI via distutils using the upload command, I observe erroneous behavior regarding the credentials when I do not want to store my password in clear text in the pypirc file: (1) When running python setup.py sdist upload without having the pypirc file in place, I get the error Upload failed (401): You must be identified to edit package information (2) When running the same command as above with the pypirc file in place but without having the 'password' option in the 'pypi' section defined, I get a TypeError exception. In both cases and at least in the second case I expect to be prompted for my credentials. This is what the 2.7.5 docs are saying about the contents of the pypirc file (http://docs.python.org/2.7/distutils/packageindex.html#the-pypirc-file): "password, that will be used to authenticate. If omitted the user will be prompt to type it when needed." I have seen http://bugs.python.org/issue5187 saying "distutils is feature frozen" but the current situation is buggy. Either there is a documentation mistake (it clearly says that the user is prompted for the password) or there is an error in the code (*, see below), or both. * Regarding the TypeError mentioned above: In distutils/command/upload.py, finalize_options(), the configuration dictionary is retrieved from _read_pypirc() (distutils/config.py). There, the value for the password key in the config dictionary is set to None if not defined in the pypirc configuration file. The password value is not modified/updated in finalize_options() if self.distribution.password is not set. I think the latter is only set when the 'register' command is used. Hence, when the user for example simply runs python setup.py sdist upload and did not set the password in the pypirc file, the password value stays None. Nevertheless, in distutils/command/upload.py, upload_file(), password is treated as string: auth = "Basic " + standard_b64encode(self.username + ":" + self.password) This obviously leads to TypeError: cannot concatenate 'str' and 'NoneType' objects I would be happy to work on a patch if we agree on what the proper behavior should be. Me, as a user of PyPI, would vote for being prompted in both cases outlined above. I do not like to store my PyPI password in clear text in the file system. And after specifying how distutils should behave in case (2) I think we all agree that distutils/tests/test_upload.py should provide a test for this case. An example configuration file with username but without password is already defined via PYPIRC_NOPASSWORD. Currently, this config is only tested within an edge-case in test_saved_password() with dist.password = 'xxx', simulating the simultaneous usage of 'register' with 'upload' if I understood correctly. Register probably is used less frequently than upload alone. Looking forward to your input, Jan-Philip ---------- assignee: eric.araujo components: Distutils messages: 193062 nosy: eric.araujo, jason.coombs, jgehrcke, loewis, tarek, techtonik priority: normal severity: normal status: open title: distutils crashes when uploading to PyPI having only the username (no pw) defined type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 15 01:24:20 2013 From: report at bugs.python.org (Michael Ballantyne) Date: Sun, 14 Jul 2013 23:24:20 +0000 Subject: [New-bugs-announce] [issue18455] Multiprocessing connection SocketClient retries connection on socket Message-ID: <1373844260.31.0.599002604646.issue18455@psf.upfronthosting.co.za> New submission from Michael Ballantyne: from multiprocessing/connection.py: while 1: try: s.connect(address) except socket.error, e: if e.args[0] != errno.ECONNREFUSED or _check_timeout(t): debug('failed to connect to address %s', address) raise time.sleep(0.01) else: break else: raise According to the POSIX spec http://pubs.opengroup.org/onlinepubs/9699919799/ "If connect() fails, the state of the socket is unspecified. Conforming applications should close the file descriptor and create a new socket before attempting to reconnect." On Mac OS X and other BSDs (but not Linux), attempting to connect() again throws EINVAL. As a result, the multiprocessing.connection.Client does not successfully retry, and instead throws socket.error: [Errno 22] Invalid argument after the first refused connection. I found that error message pretty confusing, and didn't realize that it effectively meant the connection was refused. The change for issue #13215 removes the retry behavior entirely, so this bug does not appear in 3.3 and up. ---------- assignee: ronaldoussoren components: Library (Lib), Macintosh messages: 193069 nosy: Michael.Ballantyne, ronaldoussoren priority: normal severity: normal status: open title: Multiprocessing connection SocketClient retries connection on socket type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 15 04:11:12 2013 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 15 Jul 2013 02:11:12 +0000 Subject: [New-bugs-announce] [issue18456] Documentation for PyDict_Update is incorrect Message-ID: <1373854272.6.0.0142348360978.issue18456@psf.upfronthosting.co.za> New submission from Nick Coghlan: The docs from PyDict_Update (http://docs.python.org/3/c-api/dict.html#PyDict_Update) claim it is equivalent to the Python level dict.update (http://docs.python.org/3/library/stdtypes#dict.update) This isn't accurate - unlike dict.update, PyDict_Update doesn't fall back to the iterating over a sequence of key value pairs if the second argument has no "keys" attribute. ---------- assignee: docs at python components: Documentation messages: 193070 nosy: docs at python, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Documentation for PyDict_Update is incorrect type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 15 14:07:21 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 15 Jul 2013 12:07:21 +0000 Subject: [New-bugs-announce] [issue18457] Fix and cleanup the ss1.py demo Message-ID: <1373890041.01.0.998276597574.issue18457@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Here is a patch which fixes some bugs in Tools/demo/ss1.py: * Saving formulas containing & and < symbols. * Saving complex numbers. Also it a little cleanups the code: * Using xml.sax.saxutils.escape instead of html.escape. * Using the with statement for file I/O. * Removed out-of-dated and redundant code. On Python 2 the ss1.py demo is totally broken due to using out-of-dated rexec module. ---------- assignee: serhiy.storchaka components: Demos and Tools files: demo_ss1.patch keywords: patch messages: 193089 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Fix and cleanup the ss1.py demo type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30925/demo_ss1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 15 14:24:20 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 15 Jul 2013 12:24:20 +0000 Subject: [New-bugs-announce] [issue18458] libedit history offset workaround Message-ID: <1373891060.78.0.881069869114.issue18458@psf.upfronthosting.co.za> New submission from Ronald Oussoren: Modules/readline.c contains a workaround for a bug in the readline emulation of libedit: that emulation uses a different starting offset for the history than the real readline. In more recent versions of libedit (such as the one you can now download from ) the bug has been fixed and the workaround causes problems. The attached patch dynamicly detects if the workaround is necessary. NOTE: Actually using the trysoee.dk libedit requires a patch to setup.py, that version of libedit does not install libreadline.dylib, only libedit.dylib. ---------- assignee: ronaldoussoren files: dynamic_editline_workaround_detection.txt messages: 193090 nosy: ned.deily, ronaldoussoren priority: normal severity: normal status: open title: libedit history offset workaround versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30926/dynamic_editline_workaround_detection.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 15 14:37:00 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 15 Jul 2013 12:37:00 +0000 Subject: [New-bugs-announce] [issue18459] readline: libedit support on non-apple platforms Message-ID: <1373891820.19.0.984276620623.issue18459@psf.upfronthosting.co.za> New submission from Ronald Oussoren: Modules/readline.c contains some code that improves interop with the readline emulation in libedit. That interop code is currently guarded by '#ifdef __APPLE__' preprocessor tests. This should be replaced by '#if HAVE_LIBEDIT' to make it possible to use the same interop code on other platforms with libedit (such as BSD systems). A patch should have two parts: 1) Detect in either configure or setup.py if libedit's readline emulation will/should be used. 2) Change the __APPLE__ guards by HAVE_LIBEDIT guards. ---------- messages: 193092 nosy: ronaldoussoren priority: normal severity: normal stage: needs patch status: open title: readline: libedit support on non-apple platforms type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 15 15:07:11 2013 From: report at bugs.python.org (=?utf-8?q?F=C3=A9vry_Thibault?=) Date: Mon, 15 Jul 2013 13:07:11 +0000 Subject: [New-bugs-announce] [issue18460] .chm documentation files advertised in download.html but not there. Message-ID: <1373893631.43.0.158733965695.issue18460@psf.upfronthosting.co.za> New submission from F?vry Thibault: Just like it happenned with 2.7.3, the .chm help files are not present in the download pages. The download page (e.g : http://docs.python.org/3/download.html) advertises the presence of .chm files but they are not there. I am unsure whether or not these files are still built, but as this as happend for all 3.* versions and there is no previous bug report, it might be worth looking at simply removing support for these files. ---------- assignee: docs at python components: Documentation messages: 193096 nosy: docs at python, iwontbecreative priority: normal severity: normal status: open title: .chm documentation files advertised in download.html but not there. type: enhancement versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 15 15:38:20 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 15 Jul 2013 13:38:20 +0000 Subject: [New-bugs-announce] [issue18461] X Error in tkinter Message-ID: <1373895500.91.0.409503402666.issue18461@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: When run Tools/demo/ss1.py under Linux and enter the formula "='0'*0x1000", the application will crash with the following message: X Error of failed request: BadAlloc (insufficient resources for operation) Major opcode of failed request: 53 (X_CreatePixmap) Serial number of failed request: 1025 Current serial number in output stream: 1100 Any multiplier between 0x1000 and 0x1fff crashes. With multipliers >= 0x2000 only the number of zeros over 0x2000 is displayed. Multiplier between 0x3000 and 0x3fff crashes again. Hint: The width of '0' in the used font is 8 pixels. 0x2000 * 8 = 2**16. If the width of cell is a 16-bit signed integer, it is negative for the number of zeros between 0x1000 and 0x1fff and wrapped after 0x2000 zeros. It may be a bug either in Tkinter, in Tk, or in X Window. ---------- components: Tkinter messages: 193097 nosy: gpolo, serhiy.storchaka priority: normal severity: normal status: open title: X Error in tkinter type: crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 15 15:50:07 2013 From: report at bugs.python.org (=?utf-8?q?F=C3=A9vry_Thibault?=) Date: Mon, 15 Jul 2013 13:50:07 +0000 Subject: [New-bugs-announce] [issue18462] Download > Other documentation page contains a link to a french poker site Message-ID: <1373896207.45.0.720927599345.issue18462@psf.upfronthosting.co.za> New submission from F?vry Thibault: The python for PSP (http://python-psp.net/trac) now redirects to python-psp.net which is a poker site. ---------- assignee: docs at python components: Documentation messages: 193101 nosy: docs at python, iwontbecreative priority: normal severity: normal status: open title: Download > Other documentation page contains a link to a french poker site type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 15 15:58:48 2013 From: report at bugs.python.org (=?utf-8?q?F=C3=A9vry_Thibault?=) Date: Mon, 15 Jul 2013 13:58:48 +0000 Subject: [New-bugs-announce] [issue18463] Download > Other documentation page outdated/dead links Message-ID: <1373896728.41.0.823494848316.issue18463@psf.upfronthosting.co.za> New submission from F?vry Thibault: See issue 18462 and The link to the series-60 nokia page directs to an empty page : http://www.developer.nokia.com/Community/Wiki/Nokia_Open_Source/ with comments in history : 09:15, 24 April 2013 hamishwillee (Talk | contribs) deleted page Nokia Open Source/ (Stop creating htis page or you will be banned.) 04:20, 12 March 2013 hamishwillee (Talk | contribs) deleted page Nokia Open Source/ (There is no point to this topic. No content) 05:37, 4 March 2013 hamishwillee (Talk | contribs) deleted page Nokia Open Source/ (Appears to have been created by accident) - The download are leak for python for VMS is dead : http://www.pi-net.dyndns.org/anonymous/kits/ ---------- assignee: docs at python components: Documentation messages: 193102 nosy: docs at python, iwontbecreative priority: normal severity: normal status: open title: Download > Other documentation page outdated/dead links type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 15 17:30:39 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Mon, 15 Jul 2013 15:30:39 +0000 Subject: [New-bugs-announce] [issue18464] Typo in the name of function in test__encoded_words.py Message-ID: <1373902239.54.0.238971281643.issue18464@psf.upfronthosting.co.za> New submission from Vajrasky Kok: There is a typo in the name of function in test__encoded_words.py. Python 3.4, Lib/test/test_email/test__encoded_words.py, line 78: def test_q_escpaed_bytes_preserved(self): It is supposed to be (I guess): def test_q_escaped_bytes_preserved(self): ---------- components: Tests messages: 193111 nosy: r.david.murray, vajrasky priority: normal severity: normal status: open title: Typo in the name of function in test__encoded_words.py versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 15 18:00:18 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Mon, 15 Jul 2013 16:00:18 +0000 Subject: [New-bugs-announce] [issue18465] There are unused variables and unused import in Lib/test/test_minidom.py Message-ID: <1373904018.67.0.333776446798.issue18465@psf.upfronthosting.co.za> New submission from Vajrasky Kok: The unit test file imports verbose from test.support, but it never used it. The child2 variable inside testRemoveAttributeNode is not used. The doc variable inside testHasChildNodes is not used. Attached the menial fix for this unit test. ---------- components: Tests files: fix_for_unused_variables_and_unused_import_in_test_minidom.txt messages: 193113 nosy: vajrasky priority: normal severity: normal status: open title: There are unused variables and unused import in Lib/test/test_minidom.py versions: Python 3.4 Added file: http://bugs.python.org/file30929/fix_for_unused_variables_and_unused_import_in_test_minidom.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 15 19:32:51 2013 From: report at bugs.python.org (=?utf-8?q?F=C3=A9vry_Thibault?=) Date: Mon, 15 Jul 2013 17:32:51 +0000 Subject: [New-bugs-announce] [issue18466] Spelling mistakes in various code comments. Message-ID: <1373909571.44.0.949892598858.issue18466@psf.upfronthosting.co.za> New submission from F?vry Thibault: The attached patch fixes spelling mistakes found on various comments, mainly in /Lib/. I choose not to correct things like 'everytime' since the main goal was to improve readability and not turn useful technical comments into English litterature. I hope this is fine. [These were found using a script, if anyone wants I could post it somewhere after I polish it]. ---------- files: spelling.patch keywords: patch messages: 193120 nosy: iwontbecreative priority: normal severity: normal status: open title: Spelling mistakes in various code comments. type: enhancement Added file: http://bugs.python.org/file30930/spelling.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 16 00:33:10 2013 From: report at bugs.python.org (=?utf-8?b?TWF0xJtqIFTDvcSN?=) Date: Mon, 15 Jul 2013 22:33:10 +0000 Subject: [New-bugs-announce] [issue18467] argparse - problematic 'default' behavior Message-ID: <1373927590.26.0.302211166373.issue18467@psf.upfronthosting.co.za> New submission from Mat?j T??: I have an issue with passing default values to arguments. Basically, I would like to have a 'choices' argument (indicating something using capital letters) and perform custom action (adding boolean values to the args namespace). See the bottom of this post for rationale. According to the documentation ( http://docs.python.org/2.7/library/argparse.html#default ), ... If the default value is a string, the parser parses the value as if it were a command-line argument. ... If this was true, I could implement a custom action. However, even if the default value is a string (as the documentation suggests), the action is bypassed. My goal is simple - I want to allow short choice-type argument (such as something.py --algorithm Q, the help would say --algorithhm Q|S, Q is quick, S is slow). Since the implementation shouldn't know about the mean one is communicating with the user, I would like to have the 'args' namespace either like (type='Q', quick=True, slow=False) or (type='quick') without giving up usage of the 'choices' pattern. If I change my mind and add a 'type' function that would expand capital letters abbreviations to full names, I will be OK with default values. However, if I pass the argument on the command-line, the type() call is performed first and the query whether the result is in the choices list fails. I consider the current behavior as a bug, IMO the action shouldn't be bypassed if the "default" is string. ---------- components: Library (Lib) messages: 193135 nosy: matej.tyc priority: normal severity: normal status: open title: argparse - problematic 'default' behavior type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 16 01:37:12 2013 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 15 Jul 2013 23:37:12 +0000 Subject: [New-bugs-announce] [issue18468] re.group() should never return a bytearray Message-ID: <1373931432.85.0.594082146564.issue18468@psf.upfronthosting.co.za> New submission from Guido van Rossum: I discovered that the Python 3 version of the re module's Match object behaves subtly different from the Python 2 version when the target string (i.e. the haystack, not the needle) is a buffer object. In Python 2, the type of the return value of group() is always either a Unicode string or an 8-bit string, and the type is determined by looking at the target string -- if the target is unicode, group() returns a unicode string, otherwise, group() returns an 8-bit string. In particular, if the target is a buffer object, group() returns an 8-bit string. I think this is the appropriate behavior: otherwise using regular expression matching to extract a small substring from a large target string would unnecessarily keep the large target string alive as long as the substring is alive. But in Python 3, the behavior of group() has changed so that its return type always matches that of the target string. I think this is bad -- apart from the lifetime concern, it means that if your target happens to be a bytearray, the return value isn't even hashable! Proper behavior should be that .group() returned a bytes object if the input was binary data and a str object if the input was unicode data (str) regardless of specific types containing the input target data. Probably not much, if anything, would be depending on getting a bytearray out of that. Fix this in 3.4? 3.3 and earlier users are stuck with an extra bytes() call and data copy in these cases. [Further discussion at http://mail.python.org/pipermail/python-dev/2013-July/127332.html] ---------- components: Library (Lib) messages: 193136 nosy: gvanrossum priority: normal severity: normal stage: needs patch status: open title: re.group() should never return a bytearray type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 16 02:32:30 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Jul 2013 00:32:30 +0000 Subject: [New-bugs-announce] [issue18469] PyStructSequence does not handle exceptions correctly Message-ID: <1373934750.38.0.634861561736.issue18469@psf.upfronthosting.co.za> New submission from STINNER Victor: Using pyfailmalloc (*) (see issue #18408), I found bugs in the PyStructSequence API. The following macros in Objects/structseq.c does not check for exceptions: #define VISIBLE_SIZE(op) Py_SIZE(op) #define VISIBLE_SIZE_TP(tp) PyLong_AsLong( \ PyDict_GetItemString((tp)->tp_dict, visible_length_key)) #define REAL_SIZE_TP(tp) PyLong_AsLong( \ PyDict_GetItemString((tp)->tp_dict, real_length_key)) #define REAL_SIZE(op) REAL_SIZE_TP(Py_TYPE(op)) #define UNNAMED_FIELDS_TP(tp) PyLong_AsLong( \ PyDict_GetItemString((tp)->tp_dict, unnamed_fields_key)) #define UNNAMED_FIELDS(op) UNNAMED_FIELDS_TP(Py_TYPE(op)) Exceptions in PyDict_GetItemString() and PyLong_AsLong() are "unlikely" (the request key always exist, except in a newly developed module, which is not the case here), but become very likely using pyfailmalloc: PyDict_GetItemString() allocates a temporary string, and the memory allocation can fail. In my opinion, the PyStructSequence structure should store the number of visible, real and unnamed fields. The problem is that it would require a design of the structure: data cannot be added between tuple items and the tuple header. PyStructSequence is currently defined as: typedef PyTupleObject PyStructSequence; Another option is to detect and handle correctly exceptions where these macros are used. But how should we handle exceptions in structseq_dealloc() ??? static void structseq_dealloc(PyStructSequence *obj) { Py_ssize_t i, size; size = REAL_SIZE(obj); for (i = 0; i < size; ++i) { Py_XDECREF(obj->ob_item[i]); } PyObject_GC_Del(obj); } By the way, structseq_dealloc() might restore the original size ("Py_SIZE(obj) = REAL_SIZE(obj);") before calling the tuple destructor (even if tupledealloc() only keeps real tuple in its free list). (*) https://pypi.python.org/pypi/pyfailmalloc ---------- messages: 193139 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: PyStructSequence does not handle exceptions correctly versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 16 03:32:23 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Jul 2013 01:32:23 +0000 Subject: [New-bugs-announce] [issue18470] tokenizer.c does not handle new_string() failure Message-ID: <1373938343.57.0.731932507548.issue18470@psf.upfronthosting.co.za> New submission from STINNER Victor: Callers of the new_string() function do not check if the function succeed or not. Python does crash if the function failed, for example in get_coding_spec(): char* r = new_string(begin, t - begin); char* q = get_normal_name(r); Using pytracemalloc tool, it's easy to tricker this issue (ex: using test_future or test_parser): see issue #18408. ---------- messages: 193143 nosy: haypo priority: normal severity: normal status: open title: tokenizer.c does not handle new_string() failure versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 16 03:52:16 2013 From: report at bugs.python.org (=?utf-8?q?Fran=C3=A7ois_Pinard?=) Date: Tue, 16 Jul 2013 01:52:16 +0000 Subject: [New-bugs-announce] [issue18471] Typo in heapq documentation Message-ID: <1373939536.64.0.4181851186.issue18471@psf.upfronthosting.co.za> New submission from Fran?ois Pinard: Within http://docs.python.org/3/library/heapq.html#theory, a sentence begins with "When an event schedule" while it should be spelled "When an event schedules". The same may be observed in Python 2 documentation. ---------- assignee: docs at python components: Documentation messages: 193145 nosy: docs at python, icule priority: normal severity: normal status: open title: Typo in heapq documentation versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 16 13:18:48 2013 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 16 Jul 2013 11:18:48 +0000 Subject: [New-bugs-announce] [issue18472] PEP 8 updates - internal interfaces and import * Message-ID: <1373973528.84.0.159091610788.issue18472@psf.upfronthosting.co.za> New submission from Nick Coghlan: A home for a couple of proposed PEP 8 updates (as per the thread starting at http://mail.python.org/pipermail/python-dev/2013-July/127284.html) ---------- messages: 193159 nosy: ncoghlan priority: normal severity: normal status: open title: PEP 8 updates - internal interfaces and import * type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 16 13:22:47 2013 From: report at bugs.python.org (Mikhail Korobov) Date: Tue, 16 Jul 2013 11:22:47 +0000 Subject: [New-bugs-announce] [issue18473] some objects pickled by Python 3.x are not unpicklable in Python 2.x because of incorrect REVERSE_IMPORT_MAPPING Message-ID: <1373973767.04.0.0542870445433.issue18473@psf.upfronthosting.co.za> New submission from Mikhail Korobov: I think REVERSE_IMPORT_MAPPING is wrong (see http://hg.python.org/cpython/file/7272ef213b7c/Lib/_compat_pickle.py#l80 ). It relies on dictionary items order and maps 'collections' module to either UserString or UserList. This makes it impossible to unpickle collections module classes pickled by Python 3.x when using Python 2.x. >>> import collections >>> dct = collections.defaultdict() >>> pickle.dumps(dct, protocol=1) b'cUserString\ndefaultdict\nq\x00)Rq\x01.' >>> pickle.dumps(dct, protocol=2, fix_imports=False) b'ccollections\ndefaultdict\nq\x00)Rq\x01.' I think pickling of instances of classes from other modules could also suffer. I don't think it is a good idea to map io to cStringIO or StringIO, or to map http.server to either BaseHTTPServer, SimpleHTTPServer or CGIHTTPServer. Originally found this issue here: https://github.com/nltk/nltk/pull/441/files#L2R67 ---------- components: Library (Lib) messages: 193160 nosy: kmike priority: normal severity: normal status: open title: some objects pickled by Python 3.x are not unpicklable in Python 2.x because of incorrect REVERSE_IMPORT_MAPPING versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 16 16:20:54 2013 From: report at bugs.python.org (James Lu) Date: Tue, 16 Jul 2013 14:20:54 +0000 Subject: [New-bugs-announce] [issue18474] Lambda assigned to object does not automatically get self Message-ID: <1373984454.04.0.881865417632.issue18474@psf.upfronthosting.co.za> New submission from James Lu: if you assign a lambda to a object and call it,you get this: Traceback (most recent call last): File "", line 1, in n.__div__(3) TypeError: () takes exactly 2 arguments (1 given) The full test is here: >>> n = num() >>> n.__div__ at 0x040B2DF0> >>> n/3 Traceback (most recent call last): File "", line 1, in n/3 TypeError: unsupported operand type(s) for /: 'num' and 'int' >>> n.__div__(3) Traceback (most recent call last): File "", line 1, in n.__div__(3) TypeError: () takes exactly 2 arguments (1 given) ---------- messages: 193166 nosy: James.Lu priority: normal severity: normal status: open title: Lambda assigned to object does not automatically get self _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 16 16:23:30 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Tue, 16 Jul 2013 14:23:30 +0000 Subject: [New-bugs-announce] [issue18475] No unittest.main in Lib/test/test_email/test_inversion.py Message-ID: <1373984610.72.0.308801369568.issue18475@psf.upfronthosting.co.za> New submission from Vajrasky Kok: There is no unittest.main in Lib/test/test_email/test_inversion.py. In other word, you can not execute the test by doing something like this: [abcdef at localhost cpython]$ ./python Lib/test/test_email/test_inversion.py Attached the menial fix. ---------- components: Tests files: add_unittest_main_to_test_inversion.txt messages: 193168 nosy: r.david.murray, vajrasky priority: normal severity: normal status: open title: No unittest.main in Lib/test/test_email/test_inversion.py versions: Python 3.4 Added file: http://bugs.python.org/file30939/add_unittest_main_to_test_inversion.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 16 16:46:16 2013 From: report at bugs.python.org (Piotr Dobrogost) Date: Tue, 16 Jul 2013 14:46:16 +0000 Subject: [New-bugs-announce] [issue18476] No way to pass custom arguments for loggers and formatters. Message-ID: <1373985976.45.0.145483904171.issue18476@psf.upfronthosting.co.za> New submission from Piotr Dobrogost: It seems there's no way to pass custom arguments for loggers (http://hg.python.org/cpython/file/d9893d13c628/Lib/logging/__init__.py#l1111) and formatters (http://hg.python.org/cpython/file/d9893d13c628/Lib/logging/config.py#l117) the same way they are being passed to handlers (http://hg.python.org/cpython/file/d9893d13c628/Lib/logging/config.py#l139). The problem came out when we tried to create base formatter which would read prefix from configuration of formatter to be prepended to all subsequent lines of every multi line message. ---------- components: Library (Lib) messages: 193172 nosy: piotr.dobrogost, vinay.sajip priority: normal severity: normal status: open title: No way to pass custom arguments for loggers and formatters. type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 16 23:10:50 2013 From: report at bugs.python.org (ProgVal) Date: Tue, 16 Jul 2013 21:10:50 +0000 Subject: [New-bugs-announce] [issue18477] fix_import (2to3 fixer) is not case-sensitive Message-ID: <1374009050.19.0.500947498255.issue18477@psf.upfronthosting.co.za> New submission from ProgVal: In a project, I have a package with a module named Socket.py, and the __init__.py imports the "socket" module (from the standard Python lib). However, when fix_import went over it _on Windows_, it converted "import socket" to "from . import Socket". I also had this issue from a package containing a subpackage named "Math", and a __init__.py importing "math" (from the standard Python lib). This issue is caused by using os.path.exists(), which is case-insensitive on Windows. However, PEP 235 says imports are case-sensitive. I'm including a patch I have wrote for this. ---------- components: 2to3 (2.x to 3.x conversion tool), Windows files: fix_case-sensitivity_of_fix-import.patch keywords: patch messages: 193193 nosy: Valentin.Lorentz priority: normal severity: normal status: open title: fix_import (2to3 fixer) is not case-sensitive type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file30942/fix_case-sensitivity_of_fix-import.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 17 01:39:14 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 16 Jul 2013 23:39:14 +0000 Subject: [New-bugs-announce] [issue18478] Class bodies: when does a name become local? Message-ID: <1374017954.45.0.193690883208.issue18478@psf.upfronthosting.co.za> New submission from Terry J. Reedy: http://docs.python.org/3/reference/executionmodel.html#naming-and-binding says "The following are blocks: ... a class definition." and "If a name binding operation occurs anywhere within a code block, all uses of the name within the block are treated as references to the current block. This can lead to errors when a name is used within a block before it is bound. ..." This is definitely true for functions, but not for classes: foo = 'bar' class C: foo = foo print(C().foo) # bar This is the same for 3.3 and 2.7 with and without '(object)' added. Unless the code is considered to be buggy (probably since forever), the doc should be modified to change 'code block' to 'function code block' or maybe 'module or function code block'. (At near as I can think, the statement is true for modules, but only because globals() == locals(), so that part of the issue does not arise.) ---------- assignee: docs at python components: Documentation messages: 193205 nosy: docs at python, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Class bodies: when does a name become local? type: behavior versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 17 12:11:08 2013 From: report at bugs.python.org (Paul Moore) Date: Wed, 17 Jul 2013 10:11:08 +0000 Subject: [New-bugs-announce] [issue18479] Improvements to Powershell activate script for venv Message-ID: <1374055868.56.0.0556139473307.issue18479@psf.upfronthosting.co.za> New submission from Paul Moore: Some small improvements to the powershell "Activate" script for venvs: 1. Can be run as a command, rather than needing to be dot sourced. This matches the behaviour of bat files, and of virtualenv's "activate" script, and avoids a source of user error. 2. Makes the "deactivate" command a function, so that a separate script is not needed, and deactivate can still be run after the environment has been deleted (a common error I make is to remove a temporary venv having forgotten to deactivate it first). 3. Corrects the prompt to have a prefix (name) rather than [(name) ]. This is likely a bug in venv itself, as __VENV_NAME__ is documented as being just the name, not the prompt string. But changing that could be a backward compatibility issue, so I'd prefer to put that in a separate patch if it's needed. These modifications are based on the virtualenv activate.ps1 script, which has been in use for some time, so they should be relatively well tested. ---------- assignee: vinay.sajip components: Library (Lib) files: venv.diff keywords: patch messages: 193217 nosy: pmoore, vinay.sajip priority: normal severity: normal stage: patch review status: open title: Improvements to Powershell activate script for venv type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30946/venv.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 17 14:54:58 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 17 Jul 2013 12:54:58 +0000 Subject: [New-bugs-announce] [issue18480] _elementtree: missing PyType_Ready call Message-ID: <1374065698.77.0.654171815801.issue18480@psf.upfronthosting.co.za> New submission from Ronald Oussoren: The _elementtree extension calls PyType_Ready for most, but not all, types defined in the extension. The attached patch calls PyType_Ready for the ElementIter_Type. ---------- components: Extension Modules, XML files: elementtree-missing-type-ready.txt messages: 193226 nosy: ronaldoussoren priority: normal severity: normal stage: patch review status: open title: _elementtree: missing PyType_Ready call type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30948/elementtree-missing-type-ready.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 17 16:40:36 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 17 Jul 2013 14:40:36 +0000 Subject: [New-bugs-announce] [issue18481] lcov report Message-ID: <1374072036.39.0.598411326766.issue18481@psf.upfronthosting.co.za> New submission from Christian Heimes: The patch adds a couple of ignores and three Makefile targets for gcov and lcov reports. lcov [1] is a project that can create html reports from gcov output for C files. make coverage-report first cleans up the source tree, then recompiles Python with gcov, runs the unit test and finally creates a HTML report. I have a sample output on my box. Do we have a server where I can host about 55 MB? [1] http://ltp.sourceforge.net/coverage/lcov.php ---------- files: lcov.patch keywords: patch messages: 193230 nosy: christian.heimes priority: low severity: normal stage: patch review status: open title: lcov report type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30950/lcov.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 17 17:26:08 2013 From: report at bugs.python.org (James Lu) Date: Wed, 17 Jul 2013 15:26:08 +0000 Subject: [New-bugs-announce] [issue18482] dis.dis fails on one letter strings. Message-ID: <1374074768.26.0.424583146631.issue18482@psf.upfronthosting.co.za> New submission from James Lu: dis.dis fails on one letter strings. dis.dis("t") Traceback (most recent call last): File "", line 1, in dis.dis("t") File "C:\python 25\lib\dis.py", line 44, in dis disassemble_string(x) File "C:\python 25\lib\dis.py", line 111, in disassemble_string labels = findlabels(code) File "C:\python 25\lib\dis.py", line 165, in findlabels oparg = ord(code[i]) + ord(code[i+1])*256 IndexError: string index out of range ---------- components: Library (Lib) messages: 193233 nosy: James.Lu priority: normal severity: normal status: open title: dis.dis fails on one letter strings. type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 17 17:50:34 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Wed, 17 Jul 2013 15:50:34 +0000 Subject: [New-bugs-announce] [issue18483] Add hour-24 type of time to test_http2time_formats in test_http_cookiejar.py Message-ID: <1374076234.14.0.497135423695.issue18483@psf.upfronthosting.co.za> New submission from Vajrasky Kok: In test_http2time_formats test function, they test many type of date & time format, such as: ... 'Thu, 03 Feb 1994 00:00:00 GMT', # proposed new HTTP format 'Thursday, 03-Feb-94 00:00:00 GMT', # old rfc850 HTTP format 'Thursday, 03-Feb-1994 00:00:00 GMT', # broken rfc850 HTTP format '03 Feb 1994 00:00:00 GMT', # HTTP format (no weekday) ... I think it would be a good idea to add hour-24 to this list. See the patch file. ---------- components: Tests files: add_hour_24_in_test_http2time_format.txt messages: 193236 nosy: vajrasky priority: normal severity: normal status: open title: Add hour-24 type of time to test_http2time_formats in test_http_cookiejar.py versions: Python 3.4 Added file: http://bugs.python.org/file30953/add_hour_24_in_test_http2time_format.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 17 18:37:57 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Wed, 17 Jul 2013 16:37:57 +0000 Subject: [New-bugs-announce] [issue18484] No unit test for iso2time function from http.cookiejar module Message-ID: <1374079077.48.0.0605853512742.issue18484@psf.upfronthosting.co.za> New submission from Vajrasky Kok: >From http.cookiejar module, we have http2time and iso2time functions. We have unit test for http2time, but not for iso2time. That's not fair. Attached the extended coverage test for iso2time function. ---------- components: Tests files: add_iso2time_test.txt messages: 193241 nosy: vajrasky priority: normal severity: normal status: open title: No unit test for iso2time function from http.cookiejar module versions: Python 3.4 Added file: http://bugs.python.org/file30954/add_iso2time_test.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 17 22:21:32 2013 From: report at bugs.python.org (Roumen Petrov) Date: Wed, 17 Jul 2013 20:21:32 +0000 Subject: [New-bugs-announce] [issue18485] mingw: configure for shared build Message-ID: <1374092492.69.0.0184006927142.issue18485@psf.upfronthosting.co.za> New submission from Roumen Petrov: Split of issue3871 - part for build of core modules. ---------- components: Build files: 0004-MINGW-configure-for-shared-build.patch keywords: patch messages: 193246 nosy: rpetrov priority: normal severity: normal status: open title: mingw: configure for shared build type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30956/0004-MINGW-configure-for-shared-build.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 17 22:31:51 2013 From: report at bugs.python.org (Roumen Petrov) Date: Wed, 17 Jul 2013 20:31:51 +0000 Subject: [New-bugs-announce] [issue18486] mingw: dynamic loading support Message-ID: <1374093111.95.0.0778484284701.issue18486@psf.upfronthosting.co.za> New submission from Roumen Petrov: Split of issue3871 - part for build of core modules. ---------- components: Build files: 0005-MINGW-dynamic-loading-support.patch keywords: patch messages: 193249 nosy: rpetrov priority: normal severity: normal status: open title: mingw: dynamic loading support type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30958/0005-MINGW-dynamic-loading-support.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 17 22:41:45 2013 From: report at bugs.python.org (Roumen Petrov) Date: Wed, 17 Jul 2013 20:41:45 +0000 Subject: [New-bugs-announce] [issue18487] mingw implement exec prefix Message-ID: <1374093705.74.0.166827931169.issue18487@psf.upfronthosting.co.za> New submission from Roumen Petrov: Enhancement of issue3871 - part for build of core modules. Patch in scope of 3871 is designed for compatibility with specific for MSC build installation scheme. Users don't like this. Updated patch is part of support 'posix' build and installation scheme for windows hosts. For now functionality is activated only for GNU C compiler. ---------- components: Build files: 0006-MINGW-implement-exec-prefix.patch keywords: patch messages: 193251 nosy: rpetrov priority: normal severity: normal status: open title: mingw implement exec prefix type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30959/0006-MINGW-implement-exec-prefix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 18 01:39:52 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Jul 2013 23:39:52 +0000 Subject: [New-bugs-announce] [issue18488] sqlite: finalize() method of user function may be called with an exception set if a call to step() method failed Message-ID: <1374104392.89.0.672278845185.issue18488@psf.upfronthosting.co.za> New submission from STINNER Victor: In Modules/_sqlite/connection.c, _pysqlite_final_callback() calls the finalize() method of the user function. Calling this method may clear the current exception, whereas test_sqlite excepts that exceptions of step() are reported. ---------- messages: 193257 nosy: haypo priority: normal severity: normal status: open title: sqlite: finalize() method of user function may be called with an exception set if a call to step() method failed versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 18 05:30:19 2013 From: report at bugs.python.org (Phil Webster) Date: Thu, 18 Jul 2013 03:30:19 +0000 Subject: [New-bugs-announce] [issue18489] IDLE Unit test for SearchEngine.py Message-ID: <1374118219.91.0.797974191988.issue18489@psf.upfronthosting.co.za> New submission from Phil Webster: This test uses the mock text widget to search forwards and backwards, with and without wrapping. It also tests for empty matches with the 'ok' flag set in search_text(). The patch relies on the mock text tag_add function implemented in #18226. ---------- components: IDLE files: test_searchengine.patch keywords: patch messages: 193266 nosy: JayKrish, Todd.Rovito, philwebster, terry.reedy priority: normal severity: normal status: open title: IDLE Unit test for SearchEngine.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30961/test_searchengine.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 18 12:33:56 2013 From: report at bugs.python.org (abdulet) Date: Thu, 18 Jul 2013 10:33:56 +0000 Subject: [New-bugs-announce] [issue18490] Error embedding datetime in C++ Message-ID: <1374143636.97.0.424755315923.issue18490@psf.upfronthosting.co.za> New submission from abdulet: Hi all, I'm ebedding a python program into C++ ecap library. Everything works fine until I'v try to import sqlite3. When I try to import it I give the following exception: Traceback (most recent call last): ', ' File "/usr/local/squid/bin/putAdds.py", line 4, in import sqlite3 ', ' File "/usr/lib/python2.7/sqlite3/__init__.py", line 24, in from dbapi2 import * ', ' File "/usr/lib/python2.7/sqlite3/dbapi2.py", line 24, in import datetime ', 'ImportError: /usr/lib/python2.7/lib-dynload/datetime.i386-linux-gnu.so: undefined symbol: PyExc_SystemError So it seems that is a problem in datetime module. How can i solve that? Thanks and regards Abdul ---------- components: Extension Modules messages: 193280 nosy: abduelt priority: normal severity: normal status: open title: Error embedding datetime in C++ versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 18 16:46:05 2013 From: report at bugs.python.org (Paul Moore) Date: Thu, 18 Jul 2013 14:46:05 +0000 Subject: [New-bugs-announce] [issue18491] Add "exe wrapper" functionality to Windows launcher Message-ID: <1374158765.31.0.00467890617544.issue18491@psf.upfronthosting.co.za> New submission from Paul Moore: Adds "exe wrapper" functionality to the Windows launcher. This is a preliminary patch, for comments - the code is there and works, but I need to add documentation (and maybe tests - are there any existing tests for the launcher?) Also to be considered: should the launcher be bundled somewhere accessible to Python code (locating where the launcher has been installed is a non-trivial task) and supplementing that, should there be some sort of wrapper creation API in the standard library. The script wrapper functionality in distlib may be a good model for this, but may be too complex. I'd rather see this patch accepted without support code than see it deferred due to concerns about the quality/design of additional support code. ---------- assignee: vinay.sajip components: Windows messages: 193300 nosy: pmoore, vinay.sajip priority: normal severity: normal stage: patch review status: open title: Add "exe wrapper" functionality to Windows launcher type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 18 17:38:20 2013 From: report at bugs.python.org (Zachary Ware) Date: Thu, 18 Jul 2013 15:38:20 +0000 Subject: [New-bugs-announce] [issue18492] Add test.support.regrtest_run flag, simplify support.requires Message-ID: <1374161900.43.0.881425486921.issue18492@psf.upfronthosting.co.za> New submission from Zachary Ware: Here's a patch to implement the idea I posted in issue18258, msg193242. The patch also removes usage of "support.use_resources = ['']" from the test package since it is no longer needed. (No test_main -> unittest.main conversions are done in this patch; the modules changed that still us. test_main are either covered by another issue or are more complex than a simple remove-and-replace conversion, and so I didn't want to lump them into this patch) ---------- components: Tests files: regrtest_run.diff keywords: patch messages: 193310 nosy: ezio.melotti, r.david.murray, serhiy.storchaka, zach.ware priority: normal severity: normal status: open title: Add test.support.regrtest_run flag, simplify support.requires type: enhancement versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30968/regrtest_run.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 18 19:47:37 2013 From: report at bugs.python.org (Claudio Freire) Date: Thu, 18 Jul 2013 17:47:37 +0000 Subject: [New-bugs-announce] [issue18493] make profile-opt fails with pre-existing python2.7 in path Message-ID: <1374169657.94.0.400718605789.issue18493@psf.upfronthosting.co.za> New submission from Claudio Freire: When building with --enable-shared in an environment that already has a python2.7 (and I'd expect the same to happen to 3.x), make profile-opt fails because it attempts to load the existing libpython instead of the just-built one. run_profile_task should use RUNSHARED. In fact, it builds fine if $(RUNSHARED) is added to that line. Patch inline below, for 2.7.5: --- Makefile.pre.in.bk 2013-07-18 17:46:28.671773378 +0000 +++ Makefile.pre.in 2013-07-18 17:46:47.759806100 +0000 @@ -420,7 +420,7 @@ run_profile_task: : # FIXME: can't run for a cross build - ./$(BUILDPYTHON) $(PROFILE_TASK) + $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) build_all_use_profile: $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use" ---------- components: Build messages: 193313 nosy: Claudio.Freire priority: normal severity: normal status: open title: make profile-opt fails with pre-existing python2.7 in path versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 18 21:10:54 2013 From: report at bugs.python.org (Wolf Ihlenfeldt) Date: Thu, 18 Jul 2013 19:10:54 +0000 Subject: [New-bugs-announce] [issue18494] PyType_GenericSet/GetDict functions misnamed in docs? Message-ID: <1374174654.87.0.00339141994483.issue18494@psf.upfronthosting.co.za> New submission from Wolf Ihlenfeldt: Are the names of functions PyType_GenericSetDict and -GetDict correctly documented (for 3.3.2), or should they be documented as PyObject_GenericGet/SetDict instead? The PyType-prefixed names are out of place in the section, and functions of these names not in the source. The PyObject_-variants are present. ---------- assignee: docs at python components: Documentation messages: 193315 nosy: Wolf.Ihlenfeldt, docs at python priority: normal severity: normal status: open title: PyType_GenericSet/GetDict functions misnamed in docs? versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 18 22:10:20 2013 From: report at bugs.python.org (Roumen Petrov) Date: Thu, 18 Jul 2013 20:10:20 +0000 Subject: [New-bugs-announce] [issue18495] mingw: ignore main program for frozen scripts Message-ID: <1374178220.38.0.0504340051034.issue18495@psf.upfronthosting.co.za> New submission from Roumen Petrov: Split of issue3871 - part for build of core modules. ---------- components: Build files: 0007-MINGW-ignore-main-program-for-frozen-scripts.patch keywords: patch messages: 193318 nosy: rpetrov priority: normal severity: normal status: open title: mingw: ignore main program for frozen scripts type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30970/0007-MINGW-ignore-main-program-for-frozen-scripts.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 18 22:11:57 2013 From: report at bugs.python.org (Roumen Petrov) Date: Thu, 18 Jul 2013 20:11:57 +0000 Subject: [New-bugs-announce] [issue18496] mingw: setup exclude termios module Message-ID: <1374178317.83.0.753467697868.issue18496@psf.upfronthosting.co.za> New submission from Roumen Petrov: Split of issue3871 - part for build of core modules. ---------- components: Build files: 0008-MINGW-setup-exclude-termios-module.patch keywords: patch messages: 193319 nosy: rpetrov priority: normal severity: normal status: open title: mingw: setup exclude termios module type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30971/0008-MINGW-setup-exclude-termios-module.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 18 22:14:20 2013 From: report at bugs.python.org (Roumen Petrov) Date: Thu, 18 Jul 2013 20:14:20 +0000 Subject: [New-bugs-announce] [issue18497] mingw: setup _multiprocessing module Message-ID: <1374178460.6.0.189052379472.issue18497@psf.upfronthosting.co.za> New submission from Roumen Petrov: Split of issue3871 - build core modules. ---------- components: Build files: 0009-MINGW-setup-_multiprocessing-module.patch keywords: patch messages: 193320 nosy: rpetrov priority: normal severity: normal status: open title: mingw: setup _multiprocessing module type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30972/0009-MINGW-setup-_multiprocessing-module.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 18 22:16:26 2013 From: report at bugs.python.org (Roumen Petrov) Date: Thu, 18 Jul 2013 20:16:26 +0000 Subject: [New-bugs-announce] [issue18498] mingw: setup select module Message-ID: <1374178586.07.0.280642289771.issue18498@psf.upfronthosting.co.za> New submission from Roumen Petrov: Split of issue3871 - build core modules. ---------- components: Build files: 0010-MINGW-setup-select-module.patch keywords: patch messages: 193321 nosy: rpetrov priority: normal severity: normal status: open title: mingw: setup select module type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30973/0010-MINGW-setup-select-module.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 18 22:27:39 2013 From: report at bugs.python.org (Roumen Petrov) Date: Thu, 18 Jul 2013 20:27:39 +0000 Subject: [New-bugs-announce] [issue18499] mingw: setup _ctypes module with system libffi Message-ID: <1374179259.91.0.757433514975.issue18499@psf.upfronthosting.co.za> New submission from Roumen Petrov: enhancement of issue3871 ( build core modules ). Part of issue 3871 is python libffi source for gnu assembler on 32 windows platform. The functionality is same as inlined assembled for MSC. Note python specific libffi customization is not in mainstream libffi source. This patch adds build with system libffi. You you like to use customized libffi then please extract from previous 'all in one' patch. ---------- components: Build files: 0011-MINGW-setup-_ctypes-module-with-system-libffi.patch keywords: patch messages: 193322 nosy: rpetrov priority: normal severity: normal status: open title: mingw: setup _ctypes module with system libffi type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30974/0011-MINGW-setup-_ctypes-module-with-system-libffi.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 18 22:34:29 2013 From: report at bugs.python.org (Roumen Petrov) Date: Thu, 18 Jul 2013 20:34:29 +0000 Subject: [New-bugs-announce] [issue18500] mingw: defect winsock2 and setup _socket module Message-ID: <1374179669.42.0.252427857289.issue18500@psf.upfronthosting.co.za> New submission from Roumen Petrov: Split of issue3871 (build core modules) - improved winsock detection. Requires NT 5.1+ (wxp). Note if you like python winsock for w2k then please extract from old 'all in one' patch. ---------- components: Build files: 0012-MINGW-defect-winsock2-and-setup-_socket-module.patch keywords: patch messages: 193323 nosy: rpetrov priority: normal severity: normal status: open title: mingw: defect winsock2 and setup _socket module type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30975/0012-MINGW-defect-winsock2-and-setup-_socket-module.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 18 23:01:01 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Jul 2013 21:01:01 +0000 Subject: [New-bugs-announce] [issue18501] _elementtree.c calls Python callbacks while a Python exception is set Message-ID: <1374181261.54.0.8148762893.issue18501@psf.upfronthosting.co.za> New submission from STINNER Victor: The ElementTree module allows to write a XML parser using Python callbacks. The module relies on the expat library which is implemented in C. Expat calls these Python callbacks, but ElementTree does not check if a Python exception was raised or not. Example 1: ------------------- import unittest from xml.etree import ElementTree as ET class Target(object): def start(self, tag, attrib): print("start") raise ValueError("raise start") def end(self, tag): print("end") raise ValueError("raise end") def close(self): print("close") raise ValueError("raise close") parser = ET.XMLParser(target=Target()) parser.feed("") ------------------- Output with Python 3.3: ------------------- start startendendTraceback (most recent call last): File "x.py", line 18, in parser.feed("") File "x.py", line 10, in end print("end") File "x.py", line 10, in end print("end") File "x.py", line 6, in start print("start") File "x.py", line 7, in start raise ValueError("raise start") ValueError: raise start ------------------- start() was called twice, as end() method, even if the first start() method raised an exception. The traceback is strange: it looks like end() was called by start(), which is wrong. Example 2: ------------------- import unittest from xml.etree import ElementTree as ET class Target(object): def start(self, tag, attrib): raise ValueError("raise start") def end(self, tag): raise ValueError("raise end") def close(self): raise ValueError("raise close") parser = ET.XMLParser(target=Target()) parser.feed("") ------------------- Output with Python 3.3: ------------------- Traceback (most recent call last): File "x.py", line 15, in parser.feed("") File "x.py", line 9, in end raise ValueError("raise end") ValueError: raise end ------------------- end() was called even if start() already failed. The exception which was set by start has been replaced by end() exception. In my opinion, it's not a good thing to call PyEval_EvalFrameEx() and similar functions when a Python exception is set, because it behaves badly (ex: print("end") in Example 1 raises an exception... which is wrong, the traceback is also corrupted) and may replaces the old exception with a new exception (ex: "end" replaces "started"). ---------- messages: 193325 nosy: haypo priority: normal severity: normal status: open title: _elementtree.c calls Python callbacks while a Python exception is set versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 19 00:11:22 2013 From: report at bugs.python.org (Steven Johnson) Date: Thu, 18 Jul 2013 22:11:22 +0000 Subject: [New-bugs-announce] [issue18502] CDLL does not use same paths as util.find_library Message-ID: <1374185482.63.0.0818947870098.issue18502@psf.upfronthosting.co.za> New submission from Steven Johnson: CDLL does not use the same paths as find_library and thus you can *find* a library, but you can't necessarily use it. In my case, I had SDL2 in /usr/local/lib. find_library correctly gets the name, but does not return the path. CDLL apparently does not search /usr/local/lib and fails. Python 3.4.0a0 (default:5a6cdc0d7de1, Jul 18 2013, 17:55:27) [GCC 4.7.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes import * >>> import ctypes.util >>> ctypes.util.find_library("SDL2") 'libSDL2-2.0.so.0' >>> CDLL(_) Traceback (most recent call last): File "", line 1, in File "/home/steven/Programming/cpython/Lib/ctypes/__init__.py", line 351, in __init__ self._handle = _dlopen(self._name, mode) OSError: libSDL2-2.0.so.0: cannot open shared object file: No such file or directory >>> CDLL("/usr/local/lib/libSDL2.so") ---------- components: ctypes messages: 193332 nosy: shjohnson.pi priority: normal severity: normal status: open title: CDLL does not use same paths as util.find_library type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 19 13:10:17 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Fri, 19 Jul 2013 11:10:17 +0000 Subject: [New-bugs-announce] [issue18503] No assertion in test_del_param_on_nonexistent_header function Message-ID: <1374232217.26.0.713438373749.issue18503@psf.upfronthosting.co.za> New submission from Vajrasky Kok: In Lib/test/test_email/test_email.py, line 389, there is a unit test function: def test_del_param_on_nonexistent_header(self): msg = Message() msg.del_param('filename', 'content-disposition') There is no assertion here, unlike other unit test functions, such as: def test_del_param_on_other_header(self): msg = Message() msg.add_header('Content-Disposition', 'attachment', filename='bud.gif') msg.del_param('filename', 'content-disposition') self.assertEqual(msg['content-disposition'], 'attachment') ---------- components: Tests files: add_assert_equal_on_test_del_param_on_nonexistent_header.txt messages: 193356 nosy: r.david.murray, vajrasky priority: normal severity: normal status: open title: No assertion in test_del_param_on_nonexistent_header function versions: Python 3.4 Added file: http://bugs.python.org/file30977/add_assert_equal_on_test_del_param_on_nonexistent_header.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 19 15:00:52 2013 From: report at bugs.python.org (R. Jayakrishnan) Date: Fri, 19 Jul 2013 13:00:52 +0000 Subject: [New-bugs-announce] [issue18504] IDLE:Improvements- Improving Mock_Text Message-ID: <1374238852.66.0.963662486602.issue18504@psf.upfronthosting.co.za> New submission from R. Jayakrishnan: Following the Idle: mock Text class and test thereof created #18365 I am trying to improve the _decode function because most of the Idletests needs the mock text and requires some more features to handle indexes. Started improving the mockText _decode method while writing unit test for AutoExpand.py at #18292. For now I want the mock text to decode following indexes: line.char, insert, end, +-#c/chars, lineend, linestart, wordstart, wordend For this I am trying to write regular expressions to extract the parts of index. The submitted decodeTest.py is a sample script to show how my regular expression starts manipulating the decoding of indexes. I have attached a checklist of several indexes. So you can easily run them and get an understanding of my approach. ---------- files: decodeTest.py messages: 193358 nosy: JayKrish priority: normal severity: normal status: open title: IDLE:Improvements- Improving Mock_Text Added file: http://bugs.python.org/file30978/decodeTest.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 19 18:22:41 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Fri, 19 Jul 2013 16:22:41 +0000 Subject: [New-bugs-announce] [issue18505] Duplicate function names in test_email.py Message-ID: <1374250961.33.0.0492824952219.issue18505@psf.upfronthosting.co.za> New submission from Vajrasky Kok: In Lib/test/test_email/test_email.py, Part 1: line 4210 and 4217 have same function name, which is test_encode_one_long_line. In fact, they have same function body! def test_encode_one_long_line(self): self._test_encode('x' * 100 + '\n', 'x' * 75 + '=\n' + 'x' * 25 + '\n') One of them can be removed. Part 2: line 928 and 1009 have same function name, which is test_splitter_split_on_punctuation_only_if_fws. This time, they have different function body and one of them (line 928) is overshadowed (not being executed by unit test) by the other. So we must rename one of them. ---------- components: Tests files: fix_duplicate_function_names.txt messages: 193366 nosy: r.david.murray, vajrasky priority: normal severity: normal status: open title: Duplicate function names in test_email.py versions: Python 3.4 Added file: http://bugs.python.org/file30981/fix_duplicate_function_names.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 19 20:43:11 2013 From: report at bugs.python.org (Kaushik Ghose) Date: Fri, 19 Jul 2013 18:43:11 +0000 Subject: [New-bugs-announce] [issue18506] DISABLEd Tkinter.Listbox still fires <> for mouse click Message-ID: <1374259391.68.0.438429255276.issue18506@psf.upfronthosting.co.za> New submission from Kaushik Ghose: Run the script below. Clicking on the window will fire off <> events even though the widget is disabled. Keyboard actions do not fire this event. #-- Test file -- import Tkinter as tki def selection_changed(event): print 'Selection changed' root = tki.Tk() listbox = tki.Listbox(root, selectmode=tki.BROWSE) listbox.pack(side='left', fill='both', expand=True) listbox.bind('<>', selection_changed) listbox.config(state=tki.DISABLED) root.mainloop() ---------- components: Tkinter messages: 193368 nosy: kghose priority: normal severity: normal status: open title: DISABLEd Tkinter.Listbox still fires <> for mouse click type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 19 23:39:11 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 19 Jul 2013 21:39:11 +0000 Subject: [New-bugs-announce] [issue18507] import_init() should not use Py_FatalError() but return an error Message-ID: <1374269951.83.0.221076121181.issue18507@psf.upfronthosting.co.za> New submission from STINNER Victor: The import_init() function calls Py_FatalError() at any error. This is not kind for Py_NewInterpreter() which calls import_init(): Py_NewInterpreter() exits Python with a fatal error, instead of returning NULL, on import_init() failure. The pyfailmalloc tool can be used to easily inject faults (memory allocation failure) to test this issue: see issue #18408. import_init() should return an error instead of using Py_FatalError(). ---------- messages: 193377 nosy: brett.cannon, haypo, ncoghlan priority: normal severity: normal status: open title: import_init() should not use Py_FatalError() but return an error type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 19 23:51:39 2013 From: report at bugs.python.org (Chris Lambacher) Date: Fri, 19 Jul 2013 21:51:39 +0000 Subject: [New-bugs-announce] [issue18508] enum.Enum population of _value2member_map does not match fallback search Message-ID: <1374270699.59.0.0195577431177.issue18508@psf.upfronthosting.co.za> New submission from Chris Lambacher: When an Enum is being created, the _value2member_map class property is defined to speed lookup of Enum values later on. If the value does not exist then it falls back to a linear search through the _member_map.values() looking for member.value == value. This differs from population of the _value2member_map dictionary since population happens like this: enum_class._value2member_map[value] = enum_member This differs because "value" is the value of the property in the definition, not the _value property of enum_member. In most cases this does not matter, but for instances where a __new__ or __init__ is doing something funky with the values (like auto-numbering) then the _value2member_map dict won't have the right information. ---------- messages: 193379 nosy: lambacck priority: normal severity: normal status: open title: enum.Enum population of _value2member_map does not match fallback search type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 20 00:00:47 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 19 Jul 2013 22:00:47 +0000 Subject: [New-bugs-announce] [issue18509] CJK decoders should return MBERR_EXCEPTION on PyUnicodeWriter error Message-ID: <1374271247.45.0.0168623931287.issue18509@psf.upfronthosting.co.za> New submission from STINNER Victor: I modified CJK codecs to reuse the new PyUnicodeWriter API (to use the PEP 393 instead of Py_UNICODE*). The problem is that PyUnicodeWriter error is not handled correctly: the decoder should return MBERR_EXCEPTION, whereas the error is not handled at all currently. I found this issue while working on issue #18408, using the pyfailmalloc tool to inject faults (memory allocation error). ---------- messages: 193381 nosy: haypo priority: normal severity: normal status: open title: CJK decoders should return MBERR_EXCEPTION on PyUnicodeWriter error versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 20 01:43:58 2013 From: report at bugs.python.org (Ethan Furman) Date: Fri, 19 Jul 2013 23:43:58 +0000 Subject: [New-bugs-announce] [issue18510] if Enum member value is not hashable an exception is raised Message-ID: <1374277438.72.0.885233823426.issue18510@psf.upfronthosting.co.za> New submission from Ethan Furman: While working on issue #18508 I stumbled across this: Traceback (most recent call last): ... File "/usr/local/lib/python3.4/enum.py", line 417, in __new__ if value in cls._value2member_map: TypeError: unhashable type: 'list' I'll wrap it in a try-except block, but I must admit I was surprised the answer wasn't False. ---------- assignee: ethan.furman messages: 193384 nosy: ethan.furman priority: normal severity: normal status: open title: if Enum member value is not hashable an exception is raised type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 20 02:34:04 2013 From: report at bugs.python.org (Wes Turner) Date: Sat, 20 Jul 2013 00:34:04 +0000 Subject: [New-bugs-announce] [issue18511] random.shuffle could be faster Message-ID: <1374280444.52.0.0757493000076.issue18511@psf.upfronthosting.co.za> New submission from Wes Turner: random.shuffle [1][2] could be faster. ``xrange(10,1,-1)`` is faster than ``reversed(xrange(1,10))``. [1] http://hg.python.org/cpython/file/v3.3.2/Lib/random.py#l254 [2] http://hg.python.org/cpython/file/v2.7.5/Lib/random.py#l276 ---------- components: Library (Lib) files: random-shuffle_v2.7.5_timeit.py messages: 193388 nosy: westurner priority: normal severity: normal status: open title: random.shuffle could be faster type: performance versions: 3rd party, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file30983/random-shuffle_v2.7.5_timeit.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 20 04:31:21 2013 From: report at bugs.python.org (=?utf-8?q?Juan_Luis_Boya_Garc=C3=ADa?=) Date: Sat, 20 Jul 2013 02:31:21 +0000 Subject: [New-bugs-announce] [issue18512] sys.stdout.write does not allow bytes in Python 3.x Message-ID: <1374287481.36.0.643885131326.issue18512@psf.upfronthosting.co.za> New submission from Juan Luis Boya Garc?a: Sometimes developers need to write text to stdout, and it's nice to have on the fly Unicode to UTF-8 conversion (or what matches the platform), but sometimes they also need to output binary blobs, like text encoded in other codifications than the system default, binary files, etc. Python2 does the thing more-or-less right and allows writing both text and binary. I think Python3 should also accept both. ---------- components: Library (Lib) messages: 193394 nosy: ntrrgc priority: normal severity: normal status: open title: sys.stdout.write does not allow bytes in Python 3.x type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 20 10:22:09 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 20 Jul 2013 08:22:09 +0000 Subject: [New-bugs-announce] [issue18513] test.cmath fails on OS/X with gcc-4.8 in non-debug build Message-ID: <1374308529.32.0.533488651827.issue18513@psf.upfronthosting.co.za> New submission from Raymond Hettinger: ====================================================================== FAIL: test_specific_values (__main__.CMathTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/raymondhettinger/cpython/Lib/test/test_cmath.py", line 382, in test_specific_values msg=error_message) File "/Users/raymondhettinger/cpython/Lib/test/test_cmath.py", line 128, in rAssertAlmostEqual 'got {!r}'.format(a, b)) AssertionError: rect1017: rect(complex(0.0, -0.0)) Expected: complex(0.0, -0.0) Received: complex(0.0, 0.0) Received value insufficiently close to expected value. ---------- assignee: mark.dickinson components: Extension Modules messages: 193402 nosy: mark.dickinson, rhettinger priority: normal severity: normal status: open title: test.cmath fails on OS/X with gcc-4.8 in non-debug build type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 20 14:40:37 2013 From: report at bugs.python.org (Christian Heimes) Date: Sat, 20 Jul 2013 12:40:37 +0000 Subject: [New-bugs-announce] [issue18514] Unreachable Py_DECREF() in ctypes's PyCData_FromBaseObj() Message-ID: <1374324037.75.0.169548913827.issue18514@psf.upfronthosting.co.za> New submission from Christian Heimes: http://hg.python.org/cpython/file/a65856044ad4/Modules/_ctypes/_ctypes.c#l2673 Coverity analysis: 2672 } else { /* copy contents of adr */ 2673 if (-1 == PyCData_MallocBuffer(cmem, dict)) { 2674 return NULL; CID 715381: Structurally dead code (UNREACHABLE)unreachable: This code cannot be reached: "do { PyObject *_py_decref...". 2675 Py_DECREF(cmem); 2676 } ---------- components: Extension Modules files: frombaseobj.patch keywords: patch messages: 193406 nosy: christian.heimes priority: low severity: normal stage: needs patch status: open title: Unreachable Py_DECREF() in ctypes's PyCData_FromBaseObj() type: resource usage versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30989/frombaseobj.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 20 16:37:24 2013 From: report at bugs.python.org (Daniel Holth) Date: Sat, 20 Jul 2013 14:37:24 +0000 Subject: [New-bugs-announce] [issue18515] zipfile._ZipDecryptor generates wasteful crc32 table on import Message-ID: <1374331044.49.0.0628884037506.issue18515@psf.upfronthosting.co.za> New submission from Daniel Holth: http://hg.python.org/cpython/file/e7305517260b/Lib/zipfile.py#l460 I noticed this table taking up time on import. I'd guess that it pre-dates zlib.crc32 which is imported at the top of the file. I also suspect that most of the time this table isn't even used at all. ---------- files: zipfile-no-crc32.patch keywords: patch messages: 193408 nosy: dholth priority: normal severity: normal status: open title: zipfile._ZipDecryptor generates wasteful crc32 table on import versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30990/zipfile-no-crc32.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 21 04:57:33 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Sun, 21 Jul 2013 02:57:33 +0000 Subject: [New-bugs-announce] [issue18516] Typos in Lib/email/generator.py and Lib/email/architecture.rst Message-ID: <1374375453.94.0.44126763837.issue18516@psf.upfronthosting.co.za> New submission from Vajrasky Kok: [sky at localhost cpython]$ grep -n boudary Lib/email/generator.py 352: # _make_boudary = Generator._make_boundary [sky at localhost cpython]$ grep -n fuzy Lib/email/architecture.rst 27:This division is intentionally a bit fuzy; the API described by this documentation In addition to that, I found inconsistency in plural form of tuple. [sky at localhost cpython]$ grep -n "\-tuple" Lib/email/utils.py 79: """The inverse of parseaddr(), this takes a 2-tuple of the form 285: params is a sequence of 2-tuples containing (param name, string value). 291: # 3-tuple of the continuation number, the string value, and a flag But I think this issue is very very trivial and we can ignore it. ---------- assignee: docs at python components: Documentation messages: 193425 nosy: docs at python, r.david.murray, vajrasky priority: normal severity: normal status: open title: Typos in Lib/email/generator.py and Lib/email/architecture.rst versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 21 10:02:40 2013 From: report at bugs.python.org (Ned Deily) Date: Sun, 21 Jul 2013 08:02:40 +0000 Subject: [New-bugs-announce] [issue18517] "xxlimited" extension declared incorrectly in setup.py Message-ID: <1374393760.41.0.977042124577.issue18517@psf.upfronthosting.co.za> New submission from Ned Deily: In the top-level setup.py, the code to define the Extension instance for the "xxlimited" extension is currently incorrectly located near the end of detect_tkinter() rather than in its parent detect_modules(). This has the effect of skipping the build of "xxlimited" on OS X since detect_tkinter() shortcuts to detect_tkinter_darwin() there. The attached patch corrects that. However, it does raise the question of why "xxlimited" is built at all for normal installable builds, since "xxlimited" is a dummy template module. The definition for the somewhat similar "xx" is commented out by default. Perhaps "xxlimited" should be as well. Or perhaps both should only be built for --with-pydebug configs. Opinions? ---------- components: Build messages: 193428 nosy: loewis, ned.deily priority: low severity: normal stage: patch review status: open title: "xxlimited" extension declared incorrectly in setup.py versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 21 11:47:00 2013 From: report at bugs.python.org (icedream91) Date: Sun, 21 Jul 2013 09:47:00 +0000 Subject: [New-bugs-announce] [issue18518] timeit bug? Message-ID: <1374400020.0.0.45788018989.issue18518@psf.upfronthosting.co.za> New submission from icedream91: When I ran code below, it printed -1. The question is, the code in variable snippet, has wrong syntax, it can't be run. I think timeit should return only non-negative float type. from timeit import timeit snippet=""" for i in range(10): return -1 """ print(timeit(snippet)) Thanks. ---------- components: Library (Lib) messages: 193429 nosy: icedream91 priority: normal severity: normal status: open title: timeit bug? type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 21 11:57:50 2013 From: report at bugs.python.org (Ned Deily) Date: Sun, 21 Jul 2013 09:57:50 +0000 Subject: [New-bugs-announce] [issue18519] test_sqlite crashes on OS X tiger 3.x buildbot Message-ID: <1374400670.71.0.678852160853.issue18519@psf.upfronthosting.co.za> New submission from Ned Deily: See for instance: http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/6626 I was also able to reproduce and bisect on an OS X 10.5 (Leopard) PPC system: $ hg bisec -b The first bad revision is: changeset: 84704:48a869a39e2d user: Victor Stinner date: Thu Jul 18 01:41:08 2013 +0200 summary: Issue #18408: PyEval_EvalFrameEx() and PyEval_CallObjectWithKeywords() now fail Crash and gdb "where" with current tip: $ hg log -r tip changeset: 84749:5643e873f06e tag: tip parent: 84746:c5d128b201af parent: 84748:db6a22943a3f user: Ned Deily date: Sat Jul 20 15:08:22 2013 -0700 summary: Issue #17532: merge from 3.3 $ ./python -m test test_sqlite [1/1] test_sqlite Assertion failed: (!PyErr_Occurred()), function PyEval_EvalFrameEx, file Python/ceval.c, line 1210. Fatal Python error: Aborted Current thread 0xa0343820: File "/Volumes/cache/py/3x/unix/source/Lib/sqlite3/test/userfunctions.py", line 441 in authorizer_cb File "/Volumes/cache/py/3x/unix/source/Lib/sqlite3/test/userfunctions.py", line 406 in test_table_access File "/Volumes/cache/py/3x/unix/source/Lib/unittest/case.py", line 496 in run File "/Volumes/cache/py/3x/unix/source/Lib/unittest/case.py", line 535 in __call__ File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 105 in run File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 67 in __call__ File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 105 in run File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 67 in __call__ File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 105 in run File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 67 in __call__ File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 105 in run File "/Volumes/cache/py/3x/unix/source/Lib/unittest/suite.py", line 67 in __call__ File "/Volumes/cache/py/3x/unix/source/Lib/test/support.py", line 1480 in run File "/Volumes/cache/py/3x/unix/source/Lib/test/support.py", line 1581 in _run_suite File "/Volumes/cache/py/3x/unix/source/Lib/test/support.py", line 1615 in run_unittest File "/Volumes/cache/py/3x/unix/source/Lib/test/regrtest.py", line 1304 in File "/Volumes/cache/py/3x/unix/source/Lib/test/regrtest.py", line 1305 in runtest_inner File "/Volumes/cache/py/3x/unix/source/Lib/test/regrtest.py", line 1009 in runtest File "/Volumes/cache/py/3x/unix/source/Lib/test/regrtest.py", line 796 in main File "/Volumes/cache/py/3x/unix/source/Lib/test/regrtest.py", line 1590 in main_in_temp_cwd File "/Volumes/cache/py/3x/unix/source/Lib/test/__main__.py", line 3 in File "/Volumes/cache/py/3x/unix/source/Lib/runpy.py", line 73 in _run_code File "/Volumes/cache/py/3x/unix/source/Lib/runpy.py", line 160 in _run_module_as_main Abort trap $ gdb ./python GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:15:14 UTC 2009) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "powerpc-apple-darwin"...Reading symbols for shared libraries .... done (gdb) -m test -w -uall,-largefile test_sqlite Undefined command: "-m". Try "help". (gdb) r -m test -w -uall,-largefile test_sqlite Starting program: /Volumes/cache/py/3x/unix/source/python -m test -w -uall,-largefile test_sqlite Reading symbols for shared libraries +++..... done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries ... done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries .. done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries .. done Reading symbols for shared libraries . done Reading symbols for shared libraries . done [1/1] test_sqlite Reading symbols for shared libraries .. done Reading symbols for shared libraries . done Assertion failed: (!PyErr_Occurred()), function PyEval_EvalFrameEx, file Python/ceval.c, line 1210. Program received signal SIGABRT, Aborted. 0x918089f0 in __kill () (gdb) where #0 0x918089f0 in __kill () #1 0x918a3bfc in abort () #2 0x91896c0c in __assert_rtn () #3 0x001bb630 in PyEval_EvalFrameEx (f=0x15e04d0, throwflag=0) at Python/ceval.c:1210 #4 0x001cda1c in PyEval_EvalCodeEx (_co=0x1528df8, globals=0x14fe778, locals=0x0, args=0x12b9cf4, argcount=5, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #5 0x0006a07c in function_call (func=0x152fa58, arg=0x12b9ce0, kw=0x0) at Objects/funcobject.c:633 #6 0x00012918 in PyObject_Call (func=0x152fa58, arg=0x12b9ce0, kw=0x0) at Objects/abstract.c:2105 #7 0x00012b74 in call_function_tail (callable=0x152fa58, args=0x12b9ce0) at Objects/abstract.c:2142 #8 0x00012cc8 in PyObject_CallFunction (callable=0x152fa58, format=0x14eaa88 "issss") at Objects/abstract.c:2166 #9 0x014deaac in _authorizer_callback (user_arg=0x152fa58, action=20, arg1=0x5a2910 "t2", arg2=0x5a21b0 "c2", dbname=0x94145940 "main", access_attempt_source=0x0) at /Volumes/cache/py/3x/unix/source/Modules/_sqlite/connection.c:886 #10 0x940e6a60 in lookupName () #11 0x9412a2f0 in nameResolverStep () #12 0x940c62a8 in walkExprTree () #13 0x94129e40 in sqlite3SelectResolve () #14 0x9410c2f4 in sqlite3Select () #15 0x9411d848 in yy_reduce () #16 0x941213a4 in sqlite3Parser () #17 0x94121928 in sqlite3RunParser () #18 0x94123364 in sqlite3Prepare () #19 0x014e7c94 in pysqlite_statement_create (self=0x15e3290, connection=0x15dc7a8, sql=0x1529388) at /Volumes/cache/py/3x/unix/source/Modules/_sqlite/statement.c:73 #20 0x014dfaf4 in pysqlite_connection_call (self=0x15dc7a8, args=0x15e3150, kwargs=0x0) at /Volumes/cache/py/3x/unix/source/Modules/_sqlite/connection.c:1231 #21 0x00012918 in PyObject_Call (func=0x15dc7a8, arg=0x15e3150, kw=0x0) at Objects/abstract.c:2105 #22 0x00012b74 in call_function_tail (callable=0x15dc7a8, args=0x15e3150) at Objects/abstract.c:2142 #23 0x00012cc8 in PyObject_CallFunction (callable=0x15dc7a8, format=0x14ea730 "O") at Objects/abstract.c:2166 #24 0x014db6d8 in pysqlite_cache_get (self=0x15e3178, args=0x15e3150) at /Volumes/cache/py/3x/unix/source/Modules/_sqlite/cache.c:184 #25 0x014e38a0 in _pysqlite_query_execute (self=0x15cd080, multiple=0, args=0x15e3380) at /Volumes/cache/py/3x/unix/source/Modules/_sqlite/cursor.c:541 #26 0x014e47d4 in pysqlite_cursor_execute (self=0x15cd080, args=0x15e3380) at /Volumes/cache/py/3x/unix/source/Modules/_sqlite/cursor.c:752 #27 0x000a3c00 in PyCFunction_Call (func=0x1502eb8, arg=0x15e3380, kw=0x0) at Objects/methodobject.c:93 #28 0x00012918 in PyObject_Call (func=0x1502eb8, arg=0x15e3380, kw=0x0) at Objects/abstract.c:2105 #29 0x001d0110 in PyEval_CallObjectWithKeywords (func=0x1502eb8, arg=0x15e3380, kw=0x0) at Python/ceval.c:4089 #30 0x0001284c in PyObject_CallObject (o=0x1502eb8, a=0x15e3380) at Objects/abstract.c:2093 #31 0x014dff64 in pysqlite_connection_execute (self=0x15dc7a8, args=0x15e3380, kwargs=0x0) at /Volumes/cache/py/3x/unix/source/Modules/_sqlite/connection.c:1281 #32 0x000a3c00 in PyCFunction_Call (func=0x1502f78, arg=0x15e3380, kw=0x0) at Objects/methodobject.c:93 #33 0x001d0bfc in call_function (pp_stack=0xbffefb70, oparg=1) at Python/ceval.c:4213 #34 0x001c8954 in PyEval_EvalFrameEx (f=0x15e1038, throwflag=0) at Python/ceval.c:2818 #35 0x001d12fc in fast_function (func=0x152f8d8, pp_stack=0xbfff04f0, n=1, na=1, nk=0) at Python/ceval.c:4310 #36 0x001d0e44 in call_function (pp_stack=0xbfff04f0, oparg=0) at Python/ceval.c:4238 #37 0x001c8954 in PyEval_EvalFrameEx (f=0x944220, throwflag=0) at Python/ceval.c:2818 #38 0x001cda1c in PyEval_EvalCodeEx (_co=0x11e2e60, globals=0x11d50f8, locals=0x0, args=0x158558c, argcount=2, kws=0x42804c, kwcount=0, defs=0x121cb04, defcount=1, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #39 0x0006a07c in function_call (func=0x1223098, arg=0x1585578, kw=0x1585538) at Objects/funcobject.c:633 #40 0x00012918 in PyObject_Call (func=0x1223098, arg=0x1585578, kw=0x1585538) at Objects/abstract.c:2105 #41 0x001d2668 in ext_do_call (func=0x1223098, pp_stack=0xbfff0fe4, flags=3, na=1, nk=0) at Python/ceval.c:4537 #42 0x001c8d94 in PyEval_EvalFrameEx (f=0x158a038, throwflag=0) at Python/ceval.c:2858 #43 0x001cda1c in PyEval_EvalCodeEx (_co=0x11e2f30, globals=0x11d50f8, locals=0x0, args=0x158550c, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #44 0x0006a07c in function_call (func=0x1223158, arg=0x15854f8, kw=0x0) at Objects/funcobject.c:633 #45 0x00012918 in PyObject_Call (func=0x1223158, arg=0x15854f8, kw=0x0) at Objects/abstract.c:2105 #46 0x0003dec0 in method_call (func=0x1223158, arg=0x15854f8, kw=0x0) at Objects/classobject.c:323 #47 0x00012918 in PyObject_Call (func=0x11d8f78, arg=0x1589188, kw=0x0) at Objects/abstract.c:2105 #48 0x000e3c68 in slot_tp_call (self=0x157dcb0, args=0x1589188, kwds=0x0) at Objects/typeobject.c:5360 #49 0x00012918 in PyObject_Call (func=0x157dcb0, arg=0x1589188, kw=0x0) at Objects/abstract.c:2105 #50 0x001d1ed4 in do_call (func=0x157dcb0, pp_stack=0xbfff1d20, na=1, nk=0) at Python/ceval.c:4442 #51 0x001d0e64 in call_function (pp_stack=0xbfff1d20, oparg=1) at Python/ceval.c:4240 #52 0x001c8954 in PyEval_EvalFrameEx (f=0x15884e8, throwflag=0) at Python/ceval.c:2818 #53 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aab8, globals=0x11d5638, locals=0x0, args=0x15854cc, argcount=2, kws=0x42804c, kwcount=0, defs=0x122b27c, defcount=1, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #54 0x0006a07c in function_call (func=0x122d0f8, arg=0x15854b8, kw=0x1585478) at Objects/funcobject.c:633 #55 0x00012918 in PyObject_Call (func=0x122d0f8, arg=0x15854b8, kw=0x1585478) at Objects/abstract.c:2105 #56 0x001d2668 in ext_do_call (func=0x122d0f8, pp_stack=0xbfff2814, flags=3, na=1, nk=0) at Python/ceval.c:4537 #57 0x001c8d94 in PyEval_EvalFrameEx (f=0x1493ab8, throwflag=0) at Python/ceval.c:2858 #58 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aa50, globals=0x11d5638, locals=0x0, args=0x156ff0c, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #59 0x0006a07c in function_call (func=0x1226f98, arg=0x156fef8, kw=0x0) at Objects/funcobject.c:633 #60 0x00012918 in PyObject_Call (func=0x1226f98, arg=0x156fef8, kw=0x0) at Objects/abstract.c:2105 #61 0x0003dec0 in method_call (func=0x1226f98, arg=0x156fef8, kw=0x0) at Objects/classobject.c:323 #62 0x00012918 in PyObject_Call (func=0x1142a78, arg=0x15890e0, kw=0x0) at Objects/abstract.c:2105 #63 0x000e3c68 in slot_tp_call (self=0x157dc40, args=0x15890e0, kwds=0x0) at Objects/typeobject.c:5360 #64 0x00012918 in PyObject_Call (func=0x157dc40, arg=0x15890e0, kw=0x0) at Objects/abstract.c:2105 #65 0x001d1ed4 in do_call (func=0x157dc40, pp_stack=0xbfff3550, na=1, nk=0) at Python/ceval.c:4442 #66 0x001d0e64 in call_function (pp_stack=0xbfff3550, oparg=1) at Python/ceval.c:4240 #67 0x001c8954 in PyEval_EvalFrameEx (f=0x1588358, throwflag=0) at Python/ceval.c:2818 #68 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aab8, globals=0x11d5638, locals=0x0, args=0x156fe8c, argcount=2, kws=0x42804c, kwcount=0, defs=0x122b27c, defcount=1, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #69 0x0006a07c in function_call (func=0x122d0f8, arg=0x156fe78, kw=0x1585438) at Objects/funcobject.c:633 #70 0x00012918 in PyObject_Call (func=0x122d0f8, arg=0x156fe78, kw=0x1585438) at Objects/abstract.c:2105 #71 0x001d2668 in ext_do_call (func=0x122d0f8, pp_stack=0xbfff4044, flags=3, na=1, nk=0) at Python/ceval.c:4537 #72 0x001c8d94 in PyEval_EvalFrameEx (f=0x14937b8, throwflag=0) at Python/ceval.c:2858 #73 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aa50, globals=0x11d5638, locals=0x0, args=0x156fe4c, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #74 0x0006a07c in function_call (func=0x1226f98, arg=0x156fe38, kw=0x0) at Objects/funcobject.c:633 #75 0x00012918 in PyObject_Call (func=0x1226f98, arg=0x156fe38, kw=0x0) at Objects/abstract.c:2105 #76 0x0003dec0 in method_call (func=0x1226f98, arg=0x156fe38, kw=0x0) at Objects/classobject.c:323 #77 0x00012918 in PyObject_Call (func=0x12150b8, arg=0x1589038, kw=0x0) at Objects/abstract.c:2105 #78 0x000e3c68 in slot_tp_call (self=0x1485540, args=0x1589038, kwds=0x0) at Objects/typeobject.c:5360 #79 0x00012918 in PyObject_Call (func=0x1485540, arg=0x1589038, kw=0x0) at Objects/abstract.c:2105 #80 0x001d1ed4 in do_call (func=0x1485540, pp_stack=0xbfff4d80, na=1, nk=0) at Python/ceval.c:4442 #81 0x001d0e64 in call_function (pp_stack=0xbfff4d80, oparg=1) at Python/ceval.c:4240 #82 0x001c8954 in PyEval_EvalFrameEx (f=0x15881c8, throwflag=0) at Python/ceval.c:2818 #83 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aab8, globals=0x11d5638, locals=0x0, args=0x156f70c, argcount=2, kws=0x42804c, kwcount=0, defs=0x122b27c, defcount=1, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #84 0x0006a07c in function_call (func=0x122d0f8, arg=0x156f6f8, kw=0x15853f8) at Objects/funcobject.c:633 #85 0x00012918 in PyObject_Call (func=0x122d0f8, arg=0x156f6f8, kw=0x15853f8) at Objects/abstract.c:2105 #86 0x001d2668 in ext_do_call (func=0x122d0f8, pp_stack=0xbfff5874, flags=3, na=1, nk=0) at Python/ceval.c:4537 #87 0x001c8d94 in PyEval_EvalFrameEx (f=0x14931b8, throwflag=0) at Python/ceval.c:2858 #88 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aa50, globals=0x11d5638, locals=0x0, args=0x12f7dcc, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #89 0x0006a07c in function_call (func=0x1226f98, arg=0x12f7db8, kw=0x0) at Objects/funcobject.c:633 #90 0x00012918 in PyObject_Call (func=0x1226f98, arg=0x12f7db8, kw=0x0) at Objects/abstract.c:2105 #91 0x0003dec0 in method_call (func=0x1226f98, arg=0x12f7db8, kw=0x0) at Objects/classobject.c:323 #92 0x00012918 in PyObject_Call (func=0x1480878, arg=0x1575460, kw=0x0) at Objects/abstract.c:2105 #93 0x000e3c68 in slot_tp_call (self=0x1581f18, args=0x1575460, kwds=0x0) at Objects/typeobject.c:5360 #94 0x00012918 in PyObject_Call (func=0x1581f18, arg=0x1575460, kw=0x0) at Objects/abstract.c:2105 #95 0x001d1ed4 in do_call (func=0x1581f18, pp_stack=0xbfff65b0, na=1, nk=0) at Python/ceval.c:4442 #96 0x001d0e64 in call_function (pp_stack=0xbfff65b0, oparg=1) at Python/ceval.c:4240 #97 0x001c8954 in PyEval_EvalFrameEx (f=0x1588038, throwflag=0) at Python/ceval.c:2818 #98 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aab8, globals=0x11d5638, locals=0x0, args=0x12c440c, argcount=2, kws=0x42804c, kwcount=0, defs=0x122b27c, defcount=1, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #99 0x0006a07c in function_call (func=0x122d0f8, arg=0x12c43f8, kw=0x15853b8) at Objects/funcobject.c:633 #100 0x00012918 in PyObject_Call (func=0x122d0f8, arg=0x12c43f8, kw=0x15853b8) at Objects/abstract.c:2105 #101 0x001d2668 in ext_do_call (func=0x122d0f8, pp_stack=0xbfff70a4, flags=3, na=1, nk=0) at Python/ceval.c:4537 #102 0x001c8d94 in PyEval_EvalFrameEx (f=0x1493938, throwflag=0) at Python/ceval.c:2858 #103 0x001cda1c in PyEval_EvalCodeEx (_co=0x121aa50, globals=0x11d5638, locals=0x0, args=0x136124c, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #104 0x0006a07c in function_call (func=0x1226f98, arg=0x1361238, kw=0x0) at Objects/funcobject.c:633 #105 0x00012918 in PyObject_Call (func=0x1226f98, arg=0x1361238, kw=0x0) at Objects/abstract.c:2105 #106 0x0003dec0 in method_call (func=0x1226f98, arg=0x1361238, kw=0x0) at Objects/classobject.c:323 #107 0x00012918 in PyObject_Call (func=0x1215078, arg=0x12c11f8, kw=0x0) at Objects/abstract.c:2105 #108 0x000e3c68 in slot_tp_call (self=0x147da10, args=0x12c11f8, kwds=0x0) at Objects/typeobject.c:5360 #109 0x00012918 in PyObject_Call (func=0x147da10, arg=0x12c11f8, kw=0x0) at Objects/abstract.c:2105 #110 0x001d1ed4 in do_call (func=0x147da10, pp_stack=0xbfff7de0, na=1, nk=0) at Python/ceval.c:4442 #111 0x001d0e64 in call_function (pp_stack=0xbfff7de0, oparg=1) at Python/ceval.c:4240 #112 0x001c8954 in PyEval_EvalFrameEx (f=0x1484c78, throwflag=0) at Python/ceval.c:2818 #113 0x001d12fc in fast_function (func=0x14795d8, pp_stack=0xbfff8760, n=2, na=2, nk=0) at Python/ceval.c:4310 #114 0x001d0e44 in call_function (pp_stack=0xbfff8760, oparg=1) at Python/ceval.c:4238 #115 0x001c8954 in PyEval_EvalFrameEx (f=0x126ce48, throwflag=0) at Python/ceval.c:2818 #116 0x001d12fc in fast_function (func=0x1479938, pp_stack=0xbfff90e0, n=1, na=1, nk=0) at Python/ceval.c:4310 #117 0x001d0e44 in call_function (pp_stack=0xbfff90e0, oparg=1) at Python/ceval.c:4238 #118 0x001c8954 in PyEval_EvalFrameEx (f=0x126cb28, throwflag=0) at Python/ceval.c:2818 #119 0x001cda1c in PyEval_EvalCodeEx (_co=0x12f1f98, globals=0x129ccf8, locals=0x0, args=0x15862f0, argcount=1, kws=0x15862f4, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #120 0x001d1440 in fast_function (func=0x1479998, pp_stack=0xbfff9b90, n=1, na=1, nk=0) at Python/ceval.c:4320 #121 0x001d0e44 in call_function (pp_stack=0xbfff9b90, oparg=1) at Python/ceval.c:4238 #122 0x001c8954 in PyEval_EvalFrameEx (f=0x15861a8, throwflag=0) at Python/ceval.c:2818 #123 0x001cda1c in PyEval_EvalCodeEx (_co=0x7d9438, globals=0x101e6f8, locals=0x0, args=0x102bb6c, argcount=0, kws=0x102bb6c, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x100a6c8) at Python/ceval.c:3567 #124 0x001d1440 in fast_function (func=0x1331f98, pp_stack=0xbfffa640, n=0, na=0, nk=0) at Python/ceval.c:4320 #125 0x001d0e44 in call_function (pp_stack=0xbfffa640, oparg=0) at Python/ceval.c:4238 #126 0x001c8954 in PyEval_EvalFrameEx (f=0x102b9e8, throwflag=0) at Python/ceval.c:2818 #127 0x001cda1c in PyEval_EvalCodeEx (_co=0x7d94a0, globals=0x101e6f8, locals=0x0, args=0x662f84, argcount=5, kws=0x662f98, kwcount=1, defs=0x1278c0c, defcount=3, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #128 0x001d1440 in fast_function (func=0x147b5d8, pp_stack=0xbfffb0f0, n=7, na=5, nk=1) at Python/ceval.c:4320 #129 0x001d0e44 in call_function (pp_stack=0xbfffb0f0, oparg=261) at Python/ceval.c:4238 #130 0x001c8954 in PyEval_EvalFrameEx (f=0x662e00, throwflag=0) at Python/ceval.c:2818 #131 0x001cda1c in PyEval_EvalCodeEx (_co=0x10327e0, globals=0x101e6f8, locals=0x0, args=0x894af8, argcount=5, kws=0x894b0c, kwcount=4, defs=0x12ae6dc, defcount=7, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #132 0x001d1440 in fast_function (func=0x147b578, pp_stack=0xbfffbba0, n=13, na=5, nk=4) at Python/ceval.c:4320 #133 0x001d0e44 in call_function (pp_stack=0xbfffbba0, oparg=1029) at Python/ceval.c:4238 #134 0x001c8954 in PyEval_EvalFrameEx (f=0x894820, throwflag=0) at Python/ceval.c:2818 #135 0x001cda1c in PyEval_EvalCodeEx (_co=0x10323d0, globals=0x101e6f8, locals=0x0, args=0x4ba504, argcount=0, kws=0x4ba504, kwcount=0, defs=0x1314afc, defcount=23, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #136 0x001d1440 in fast_function (func=0x12c00f8, pp_stack=0xbfffc650, n=0, na=0, nk=0) at Python/ceval.c:4320 #137 0x001d0e44 in call_function (pp_stack=0xbfffc650, oparg=0) at Python/ceval.c:4238 #138 0x001c8954 in PyEval_EvalFrameEx (f=0x4ba3b8, throwflag=0) at Python/ceval.c:2818 #139 0x001d12fc in fast_function (func=0x1331cf8, pp_stack=0xbfffcfd0, n=0, na=0, nk=0) at Python/ceval.c:4310 #140 0x001d0e44 in call_function (pp_stack=0xbfffcfd0, oparg=0) at Python/ceval.c:4238 #141 0x001c8954 in PyEval_EvalFrameEx (f=0x63a1c8, throwflag=0) at Python/ceval.c:2818 #142 0x001cda1c in PyEval_EvalCodeEx (_co=0x1013298, globals=0x49fb38, locals=0x49fb38, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #143 0x001bb274 in PyEval_EvalCode (co=0x1013298, globals=0x49fb38, locals=0x49fb38) at Python/ceval.c:770 #144 0x001b2d84 in builtin_exec (self=0x454178, args=0x78c978) at Python/bltinmodule.c:859 #145 0x000a3c00 in PyCFunction_Call (func=0x4546f8, arg=0x78c978, kw=0x0) at Objects/methodobject.c:93 #146 0x001d0bfc in call_function (pp_stack=0xbfffdb40, oparg=2) at Python/ceval.c:4213 #147 0x001c8954 in PyEval_EvalFrameEx (f=0x6f4418, throwflag=0) at Python/ceval.c:2818 #148 0x001cda1c in PyEval_EvalCodeEx (_co=0x100e090, globals=0x7bfb38, locals=0x0, args=0x10381a4, argcount=7, kws=0x10381c0, kwcount=0, defs=0x101016c, defcount=5, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #149 0x001d1440 in fast_function (func=0x100b278, pp_stack=0xbfffe5f0, n=7, na=7, nk=0) at Python/ceval.c:4320 #150 0x001d0e44 in call_function (pp_stack=0xbfffe5f0, oparg=7) at Python/ceval.c:4238 #151 0x001c8954 in PyEval_EvalFrameEx (f=0x1038038, throwflag=0) at Python/ceval.c:2818 #152 0x001cda1c in PyEval_EvalCodeEx (_co=0x100e298, globals=0x7bfb38, locals=0x0, args=0x49f90c, argcount=2, kws=0x0, kwcount=0, defs=0x100aef4, defcount=1, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #153 0x0006a07c in function_call (func=0x1036578, arg=0x49f8f8, kw=0x0) at Objects/funcobject.c:633 #154 0x00012918 in PyObject_Call (func=0x1036578, arg=0x49f8f8, kw=0x0) at Objects/abstract.c:2105 #155 0x0024529c in RunModule (modname=0x501b28, set_argv0=1) at Modules/main.c:224 #156 0x00246b24 in Py_Main (argc=6, argv=0x501638) at Modules/main.c:714 #157 0x00001fd0 in main (argc=6, argv=0xbfffeb38) at python.c:64 (gdb) ---------- keywords: buildbot messages: 193431 nosy: haypo, ned.deily priority: high severity: normal status: open title: test_sqlite crashes on OS X tiger 3.x buildbot type: crash versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 21 13:22:44 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 21 Jul 2013 11:22:44 +0000 Subject: [New-bugs-announce] [issue18520] Fixes bugs found by pyfailmalloc during Python initialization Message-ID: <1374405764.28.0.138932329528.issue18520@psf.upfronthosting.co.za> New submission from STINNER Victor: I'm working on a version of pyfailmalloc integrated into CPython to inject memory allocation failures duging Python startup. As expected, I found new bugs. I create this issue to track these bugs and their fix, as I did with the issue #18408. Home page of the project: https://pypi.python.org/pypi/pyfailmalloc ---------- messages: 193439 nosy: haypo priority: normal severity: normal status: open title: Fixes bugs found by pyfailmalloc during Python initialization versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 21 14:14:08 2013 From: report at bugs.python.org (Julien Nabet) Date: Sun, 21 Jul 2013 12:14:08 +0000 Subject: [New-bugs-announce] [issue18521] [cppcheck] Full report Message-ID: <1374408848.64.0.369654911435.issue18521@psf.upfronthosting.co.za> New submission from Julien Nabet: Hello, I retrieved Cpython sources today and runned cppcheck ("git updated" today) on the whole sources with enable=all I attached the full report. There are certainly false positive but some reports may help, eg: [Python/getargs.c:379]: (style) Array index 'i' is used before limits check. Indeed, here is the code: 379 while (levels[i] > 0 && i < 32 && (int)(p-buf) < 220) { [Modules/md5module.c:345] -> [Modules/md5module.c:342]: (style) Found duplicate branches for 'if' and 'else' 342 if (Py_TYPE(self) == &MD5type) { 343 if ( (newobj = newMD5object())==NULL) 344 return NULL; 345 } else { 346 if ( (newobj = newMD5object())==NULL) 347 return NULL; 348 } [Objects/iterobject.c:87]: (error) Uninitialized variable: seqsize [Objects/setobject.c:549]: (error) Address of local auto-variable assigned to a function parameter etc. Hope it helps. Julien ---------- files: cppcheck_reports.txt messages: 193442 nosy: serval2412 priority: normal severity: normal status: open title: [cppcheck] Full report versions: Python 3.5 Added file: http://bugs.python.org/file30995/cppcheck_reports.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 21 20:54:41 2013 From: report at bugs.python.org (John Jefferies) Date: Sun, 21 Jul 2013 18:54:41 +0000 Subject: [New-bugs-announce] [issue18522] Error creating a raw string of r'\\?\' Message-ID: <1374432881.73.0.813388896506.issue18522@psf.upfronthosting.co.za> New submission from John Jefferies: I'm having trouble with a raw string of r'\\?\' as in the following session: ---------------- >>> a = r'\\?\' File "", line 1 a = r'\\?\' ^ SyntaxError: EOL while scanning string literal ---------------- which seems like a bug to me. I see the same behaviour in v3.3, v3.2, and v2.6. I have tried searching for such a bug but search engines don't work well with a string of non-alphanumerics. Why is this string important? It's because the Win32 API functions throw an error with path names longer than 260 chars unless the path names are prefixed with this string, e.g: shutil.copy2(r'\\?\C:\some\quite\long\path\name', dstname) shutil.copy2(r'\\?\' + r'C:\some\quite\long\path\name', dstname) where the first example throws an exception without the path name prefix; while the second example fails to compile. FTR. I can create the desired string in various other ways: ---------------- >>> a = '\\\\?\\' >>> a '\\\\?\\' >>> a = r'\\?\ '[0:4] >>> a '\\\\?\\' >>> ---------------- Thanks John ---------- components: Interpreter Core messages: 193462 nosy: John.Jefferies priority: normal severity: normal status: open title: Error creating a raw string of r'\\?\' type: compile error versions: Python 2.6, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 21 21:35:41 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 21 Jul 2013 19:35:41 +0000 Subject: [New-bugs-announce] [issue18523] test_signal failure under Windows Message-ID: <1374435341.35.0.309186886798.issue18523@psf.upfronthosting.co.za> New submission from Antoine Pitrou: c31bec42e4112a49c192a16f271faffd5a44b83d (by Victor) seems to be the culprit. See http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/2188 ====================================================================== ERROR: test_issue9324 (test.test_signal.WindowsSignalTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_signal.py", line 213, in test_issue9324 signal.signal(sig, signal.signal(sig, handler)) TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object ---------- assignee: haypo components: Tests, Windows messages: 193464 nosy: brian.curtin, haypo, larry, pitrou priority: release blocker severity: normal stage: needs patch status: open title: test_signal failure under Windows type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 22 06:56:15 2013 From: report at bugs.python.org (Nikolaus Rath) Date: Mon, 22 Jul 2013 04:56:15 +0000 Subject: [New-bugs-announce] [issue18524] BufferedReader.read1() documentation/implementation difference Message-ID: <1374468975.95.0.466613665533.issue18524@psf.upfronthosting.co.za> New submission from Nikolaus Rath: The read1() docstring says: "Reads up to n bytes, with at most one read() system call." However, in the implementation read1() calls peek() to refill the buffer if necessary, and then returns whatever is available in the buffer. This means that read1() will only return up to n bytes if n is smaller than the buffer size, otherwise it will return at most bytes. With the current implementation, running a loop that calls obj.read1(n) for large n is therefore much less performant than a loop that calls obj.raw.read(n). I think a call to read1(n) with empty buffer should always attempt to read n bytes from the raw stream, i.e. the implementation should be changed to match the documentation. ---------- components: IO messages: 193496 nosy: Nikratio priority: normal severity: normal status: open title: BufferedReader.read1() documentation/implementation difference versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 22 07:02:21 2013 From: report at bugs.python.org (Saurabh Gupta) Date: Mon, 22 Jul 2013 05:02:21 +0000 Subject: [New-bugs-announce] [issue18525] Shutil cannot import WindowsError on windows Message-ID: <1374469341.59.0.267425457032.issue18525@psf.upfronthosting.co.za> New submission from Saurabh Gupta: I've observed that shutil fails to import WindowsError on our windows 7 systems: from shutil import WindowsError File , line , in from shutil import WindowsError ImportError: cannot import name WindowsError The same statement works absolutely fine on linux. Has anyone else come across it too? Do you know how I could fix it? Python version: 2.6.7 Linux OS: Centos 6.3 Windows OS: Windows 7 Professional x64 ---------- components: Extension Modules, Library (Lib), Windows messages: 193497 nosy: saurabhgupta2u priority: normal severity: normal status: open title: Shutil cannot import WindowsError on windows type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 22 07:21:30 2013 From: report at bugs.python.org (Zachary Ware) Date: Mon, 22 Jul 2013 05:21:30 +0000 Subject: [New-bugs-announce] [issue18526] Add resource management/guarding to unittest Message-ID: <1374470490.47.0.980625465837.issue18526@psf.upfronthosting.co.za> New submission from Zachary Ware: Here is an initial attempt at adding resource management/guarding to unittest, a la test.support.requires. The patch adds 6 new names to unittest.__all__; one function called 'registerResource' which explains itself, one function and one decorator (require and requires, respectively--I'm open to better, more differentiable names) for requiring a resource, and three exceptions (ResourceError for an error and ResourceUnavailable and ResourceDenied for skipping for different reasons). All of these are implemented in a new unittest.resources module. Existing modules are changed as follows: - util.py defines class _BaseSkip(Exception), which ResourceUnavailable inherits from. ResourceDenied subclasses ResourceUnavailable. - case.py: SkipTest inherits from _BaseSkip, and _BaseSkip is checked for to mark a test as skipped in _Outcome.testPartExecutor. Also, TestCase.run is patched to do resource checking for test classes and methods that use the requires decorator. - loader.py checks for util._BaseSkip instead of case.SkipTest - main.py adds -u and --use command line options, and use= TestProgram constructor arg. Tests are added to test_program and a new test_resources. The doc page is updated appropriately. The idea behind the departures from the way test.support.requires works is that since this will be used by far more than just the stdlib tests, there will be more than just the resources we use that unittest will need to know about, so there has to be some way to tell it about them--hence 'registerResource'. Also, to alleviate issues like #18441, I have implemented an easy way to test whether the resource is usable, via the 'checker' argument to registerResource. Lastly, 'requires' is provided as a decorator for ease of use, though it does add the most complication to the implementation. I look forward to reviews :) Thanks, Zach ---------- components: Library (Lib) files: unittest_resources.diff keywords: patch messages: 193499 nosy: ezio.melotti, michael.foord, pitrou, r.david.murray, serhiy.storchaka, terry.reedy, zach.ware priority: normal severity: normal status: open title: Add resource management/guarding to unittest type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31001/unittest_resources.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 22 10:54:05 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 22 Jul 2013 08:54:05 +0000 Subject: [New-bugs-announce] [issue18527] Upgrade Modules/zlib to 1.2.8 Message-ID: <1374483245.68.0.946100267151.issue18527@psf.upfronthosting.co.za> New submission from Christian Heimes: According to http://hg.python.org/cpython/file/878dc9dfc565/Modules/zlib/ChangeLog our repository has zlib 1.2.5. zlib 1.2.8 is out for a while, http://zlib.net/ I'd like to update our copy of zlib to 1.2.8. ---------- assignee: christian.heimes components: Extension Modules messages: 193520 nosy: christian.heimes priority: normal severity: normal stage: needs patch status: open title: Upgrade Modules/zlib to 1.2.8 type: resource usage versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 22 14:34:56 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 22 Jul 2013 12:34:56 +0000 Subject: [New-bugs-announce] [issue18528] Possible fd leak in socketmodule Message-ID: <1374496496.68.0.51305379842.issue18528@psf.upfronthosting.co.za> New submission from Christian Heimes: Coverity claims that sock_accept() may leak a fd. I have been starring at the code for a while and I'm still not sure if Coverity is right. The macros make the code paths hard to follow. The attached patch is simple and should not be a performance issue. http://hg.python.org/cpython/file/01597384531f/Modules/socketmodule.c#l1965 6. open_fn: Returning handle opened by function "accept(int, __SOCKADDR_ARG, socklen_t * restrict)". 7. var_assign: Assigning: "newfd" = handle returned from "accept(s->sock_fd, __SOCKADDR_ARG({ .__sockaddr__ = &addrbuf.sa}), &addrlen)". CID 983312 (#1 of 1): Resource leak (RESOURCE_LEAK)14. overwrite_var: Overwriting handle "newfd" in "newfd = accept(s->sock_fd, __SOCKADDR_ARG({ .__sockaddr__ = &addrbuf.sa}), &addrlen)" leaks the handle. 1969 newfd = accept(s->sock_fd, SAS2SA(&addrbuf), &addrlen); ---------- components: Extension Modules files: closesock.patch keywords: needs review, patch messages: 193530 nosy: christian.heimes priority: normal severity: normal stage: patch review status: open title: Possible fd leak in socketmodule type: resource usage versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file31004/closesock.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 22 15:23:53 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 22 Jul 2013 13:23:53 +0000 Subject: [New-bugs-announce] [issue18529] Use long dash Message-ID: <1374499433.16.0.583158051605.issue18529@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Currently Python documentation uses four type of dashes for same meaning: 1. Hyphen with spaces. 2. En-dash with spaces. 3. Em-dash with spaces. 4. Em-dash without spaces. Definitely the first case is just wrong and other three cases should be unified. Here is a patch which replaces spaced hyphens, en-dashes and em-dashes to em-dashes without spaces. See also a discussion at Python-Dev: http://mail.python.org/pipermail/python-dev/2013-July/thread.html#127420 http://comments.gmane.org/gmane.comp.python.devel/140593 ---------- files: doc_mdashes_without_spaces.patch keywords: patch messages: 193532 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Use long dash Added file: http://bugs.python.org/file31005/doc_mdashes_without_spaces.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 22 17:07:40 2013 From: report at bugs.python.org (Alex Gaynor) Date: Mon, 22 Jul 2013 15:07:40 +0000 Subject: [New-bugs-announce] [issue18530] posixpath.ismount performs extra lstat calls Message-ID: <1374505660.8.0.757245061421.issue18530@psf.upfronthosting.co.za> New submission from Alex Gaynor: Right now it calls islink(), which does an lstat, and then does its own lstat on the same path. This can be optimized by inlining the body of islink and reusing the stat result. (This has been identified as an actual issue in openstack-swift https://review.openstack.org/#/c/37929/ ) ---------- messages: 193540 nosy: alex priority: normal severity: normal status: open title: posixpath.ismount performs extra lstat calls _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 22 20:51:43 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 22 Jul 2013 18:51:43 +0000 Subject: [New-bugs-announce] [issue18531] Undocumented different between METH_KEYWORDS and **kws Message-ID: <1374519103.74.0.277776306074.issue18531@psf.upfronthosting.co.za> New submission from Barry A. Warsaw: A colleague discovered an interesting implementation different between C-defined functions and Python-defined functions called with **kws arguments. He tried to do this: >>> from collections import defaultdict >>> '{foo}{bar}'.format(**defaultdict(str)) '' He wondered how this could work, especially given: >>> def what(**kws): ... print(type(kws), repr(kws)) ... >>> what(**defaultdict(str)) {} The Language Reference clearly states that when what() is called, a new dictionary is create, which is populated by keyword arguments not consumed by positional args. http://docs.python.org/3/reference/compound_stmts.html#function-definitions http://docs.python.org/3/reference/expressions.html#calls What isn't described is the behavior when the function is defined in C using METH_KEYWORDS. In that case, the object passed through the ** argument is passed unscathed to the underlying methodobject defined to take METH_KEYWORDS. str.format() is of the latter type so it gets the actual defaultdict. what() of course gets the defined behavior. It would be nice if the implementation details of the function did not leak into this behavior, but this is admittedly a corner case of the CPython implementation. I haven't checked any of the alternative implementations to see what they do. My guess is that CPython won't change for practical and backward compatibility reasons, thus I've opened this issue as a documentation bug. At the very least, an implementation note in the Language Reference should be added. ---------- assignee: docs at python components: Documentation messages: 193559 nosy: barry, docs at python priority: normal severity: normal status: open title: Undocumented different between METH_KEYWORDS and **kws versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 22 22:29:00 2013 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 22 Jul 2013 20:29:00 +0000 Subject: [New-bugs-announce] [issue18532] hashlib.HASH objects should officially expose the hash name Message-ID: <1374524940.42.0.582552143445.issue18532@psf.upfronthosting.co.za> New submission from Jason R. Coombs: In hashlib, the HASH objects currently supply a 'name' attribute, reflecting the name used to initialize the hash object, and they have since Python 2.5. However, this interface is not published so isn't honored by other platforms (namely pypy). I propose the '.name' attribute be formally added to the documentation to reflect the actual implementation. I suggest this change be considered as a bugfix release if the original intention was for the '.name' attribute to be public (as it's a bug in the documentation if the intended and implemented interface isn't fully documented). I plan to do some research to ascertain the intention of this attribute (as can be inferred from tests and the source). For now, I'll assume Python 3.4 only. Any comments or suggestions welcome. ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 193563 nosy: docs at python, jason.coombs priority: normal severity: normal status: open title: hashlib.HASH objects should officially expose the hash name versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 23 00:22:30 2013 From: report at bugs.python.org (Ben North) Date: Mon, 22 Jul 2013 22:22:30 +0000 Subject: [New-bugs-announce] [issue18533] Avoid error from repr() of recursive dictview Message-ID: <1374531750.42.0.70756948567.issue18533@psf.upfronthosting.co.za> New submission from Ben North: #18019 noted the following crash in earlier 2.7: >>> d={} >>> d[42]=d.viewvalues() >>> d This issue has been fixed; the behaviour now is that a RuntimeError is produced for a recursive dictionary view: >>> d={} >>> d[42]=d.viewvalues() >>> d # (output line-broken:) {42: Traceback (most recent call last): File "", line 1, in RuntimeError: maximum recursion depth exceeded while getting the repr of a list Before finding this, though, I'd investigated and made a patch which produces a similar "..." output to a recursive dictionary. Reworking against current 2.7, the behaviour would be: >>> x={} >>> x[42]=x >>> x # existing behaviour for dictionaries: {42: {...}} >>> d={} >>> d[42]=d.viewvalues() >>> d # new behaviour: {42: dict_values([...])} >>> d[43]=d.viewitems() >>> d # (output line-broken:) {42: dict_values([..., dict_items([(42, ...), (43, ...)])]), 43: dict_items([(42, dict_values([..., ...])), (43, ...)])} Attached is the patch, against current 2.7 branch. If there is interest in applying this, I will create a proper patch (changelog entry, fix to Lib/test/test_dictviews.py, etc.). On python-dev, Gregory Smith noted: Given that the RuntimeError fix has been released, your proposed ... behavior is arguably a new feature so I'd only expect this to make sense for consideration in 3.4, not 2.7. (if accepted at all) [http://mail.python.org/pipermail/python-dev/2013-July/127489.html] so I have marked for consideration for versions 2.7 and 3.4. ---------- components: Interpreter Core files: non-error-recursive-dictview.patch keywords: patch messages: 193570 nosy: bennorth priority: normal severity: normal status: open title: Avoid error from repr() of recursive dictview type: behavior versions: Python 2.7, Python 3.4 Added file: http://bugs.python.org/file31019/non-error-recursive-dictview.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 23 07:06:58 2013 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 23 Jul 2013 05:06:58 +0000 Subject: [New-bugs-announce] [issue18534] File "name" attribute should always be a text string Message-ID: <1374556018.34.0.468152457131.issue18534@psf.upfronthosting.co.za> New submission from Nick Coghlan: Currently, if a byte sequence is passed to open() as the file name, the resulting file will have that object as its name: >>> open(os.path.expanduser(b"~/.hgrc")) <_io.TextIOWrapper name=b'/home/ncoghlan/.hgrc' mode='r' encoding='UTF-8'> >>> open(os.path.expanduser("~/.hgrc")) <_io.TextIOWrapper name='/home/ncoghlan/.hgrc' mode='r' encoding='UTF-8'> As documented in a recent post from Armin Ronacher [1], this causes the "bytes" to leak out to the public API of the file, causing problems since user code can't assume that "f.name" is a string. When bytes are passed to open() as the filename, os.fsdecode should be used to convert them to a text string before storing them in the name attribute. [1] http://lucumr.pocoo.org/2013/7/2/the-updated-guide-to-unicode/ ---------- messages: 193585 nosy: haypo, ncoghlan priority: normal severity: normal status: open title: File "name" attribute should always be a text string _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 23 14:06:00 2013 From: report at bugs.python.org (anatoly techtonik) Date: Tue, 23 Jul 2013 12:06:00 +0000 Subject: [New-bugs-announce] [issue18535] termios.tcgetattr should return namedtuple Message-ID: <1374581160.31.0.0241171129689.issue18535@psf.upfronthosting.co.za> New submission from anatoly techtonik: Names of field for tuple returned by tcgetattr are already in documentation at http://docs.python.org/2/library/termios.html It would be nice to get them into code. ---------- components: Library (Lib) messages: 193595 nosy: techtonik priority: normal severity: normal status: open title: termios.tcgetattr should return namedtuple type: enhancement versions: Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 23 18:07:38 2013 From: report at bugs.python.org (James Lu) Date: Tue, 23 Jul 2013 16:07:38 +0000 Subject: [New-bugs-announce] [issue18537] bool.toggle() Message-ID: <1374595658.34.0.251413939428.issue18537@psf.upfronthosting.co.za> New submission from James Lu: the bool type should have a toggle() function ---------- messages: 193608 nosy: James.Lu priority: normal severity: normal status: open title: bool.toggle() type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 01:44:41 2013 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Tue, 23 Jul 2013 23:44:41 +0000 Subject: [New-bugs-announce] [issue18538] `python -m dis ` Message-ID: <1374623081.75.0.916984106328.issue18538@psf.upfronthosting.co.za> Changes by Michele Orr? : ---------- components: Library (Lib) nosy: maker priority: normal severity: normal status: open title: `python -m dis ` type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 11:02:55 2013 From: report at bugs.python.org (ariel brunner) Date: Wed, 24 Jul 2013 09:02:55 +0000 Subject: [New-bugs-announce] [issue18539] Arguments tooltip wrong if def contains fractional default value Message-ID: <1374656575.04.0.287997860195.issue18539@psf.upfronthosting.co.za> New submission from ariel brunner: When defining a function with factional default arguments, the text replaces the correct values in the tooltip. Here's an example - >>> def f(a=0.5): pass >>> f( tooltip shows - "(a=0)", i.e. replaces the ".5" with . This was found to happen on IDLE with python 2.7.3 and 2.7.5 (the latter was on 64 bit python installation on a windows 7 machine). The problem was discussed here - http://stackoverflow.com/questions/17053492/pythons-idle-behavior-while-defining-fractional-default-values-to-function-para and the problem was found to stem from the CallTips.py file (exact code lines in the link). I believe this is the result of a fix to issue791968. ---------- components: IDLE messages: 193631 nosy: ariel_bruner priority: normal severity: normal status: open title: Arguments tooltip wrong if def contains fractional default value type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 11:19:31 2013 From: report at bugs.python.org (=?utf-8?q?Mat=C4=9Bj_Stuchl=C3=ADk?=) Date: Wed, 24 Jul 2013 09:19:31 +0000 Subject: [New-bugs-announce] [issue18540] imaplib.IMAP4() ends with "Name or service not known" on Fedora 18 Message-ID: <1374657571.18.0.17831195671.issue18540@psf.upfronthosting.co.za> New submission from Mat?j Stuchl?k: Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python2.7/imaplib.py", line 163, in __init__ self.open(host, port) File "/usr/lib64/python2.7/imaplib.py", line 229, in open self.sock = socket.create_connection((host, port)) File "/usr/lib64/python2.7/socket.py", line 553, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): socket.gaierror: [Errno -2] Name or service not known Steps to Reproduce: 1. run python interpreter 2. import imaplib 3. imaplib.IMAP4() Expected behavior would be, as per documentation, for imaplib to try to connect to localhost. The root cause is, I believe, this: socket.py::create_connection states "An host of '' [...] tells the OS to use the default." and thus imaplib uses '' as the default value for host, however from getaddrinfo (to which function the host variable is passed) documentation and source it seems to me that it expect None, not '' as the default value. Substituting '' for None as the default value for host in imaplib.py seems to resolve this issue, I've included a tentative patch that does just that. In case this will need patching I'd be more than happy to work on a more complete patch! :) ---------- components: Library (Lib) files: imaplib.patch keywords: patch messages: 193632 nosy: sYnfo priority: normal severity: normal status: open title: imaplib.IMAP4() ends with "Name or service not known" on Fedora 18 type: behavior versions: Python 2.7, Python 3.5 Added file: http://bugs.python.org/file31027/imaplib.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 11:27:48 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 24 Jul 2013 09:27:48 +0000 Subject: [New-bugs-announce] [issue18541] LoggerAdapter example is counter-productive Message-ID: <1374658068.88.0.794389656378.issue18541@psf.upfronthosting.co.za> New submission from Antoine Pitrou: The idiomatic way to use a LoggerAdapter is to override the process() method. However, the example in the cookbook (*) is some gobbledegook code overriding __getitem__ and __iter__ on a separate class. It's a pity that users are directed to use an insane and impractical idiom while the sane way is simple and powerful. (*) http://docs.python.org/2/howto/logging-cookbook.html#context-info ---------- assignee: docs at python components: Documentation messages: 193633 nosy: docs at python, pitrou, vinay.sajip priority: normal severity: normal status: open title: LoggerAdapter example is counter-productive type: behavior versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 11:47:17 2013 From: report at bugs.python.org (Sumitinder) Date: Wed, 24 Jul 2013 09:47:17 +0000 Subject: [New-bugs-announce] [issue18542] httpd memory consuption increasing continously due to mod_python Message-ID: <1374659237.01.0.92417482468.issue18542@psf.upfronthosting.co.za> New submission from Sumitinder: Mod_python is used in our application and continous load of mod_python result in increase in httpd memory usage i.e upto 1.6 Gb. Packets used: mod_python-3.2.8-3.1 httpd-2.2.3-43.el5.centos Centos 5.5 OS Is there any memory leak in mod_python which is resulting in increase in memory ? ---------- messages: 193634 nosy: sumitinder priority: normal severity: normal status: open title: httpd memory consuption increasing continously due to mod_python type: performance versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 14:26:58 2013 From: report at bugs.python.org (Moritz Sichert) Date: Wed, 24 Jul 2013 12:26:58 +0000 Subject: [New-bugs-announce] [issue18543] urllib.parse.urlopen shouldn't ignore installed opener when called with any ca* argument Message-ID: <1374668818.72.0.697922032573.issue18543@psf.upfronthosting.co.za> New submission from Moritz Sichert: If you pass any of cafile, capath or cadefault to urllib.parse.urlopen it creates a new opener that contains the HTTPSHandler that was according to the ca* arguments. It then uses this new opener to execute the request. If you installed a custom opener with urllib.parse.install_opener it won't be used. urlopen should either add a HTTPSHandler to the installed opener or not accept any Handler specific arguments at all. ---------- components: Library (Lib) messages: 193640 nosy: moritzs priority: normal severity: normal status: open title: urllib.parse.urlopen shouldn't ignore installed opener when called with any ca* argument type: behavior versions: Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 16:00:00 2013 From: report at bugs.python.org (Robert O'Callahan) Date: Wed, 24 Jul 2013 14:00:00 +0000 Subject: [New-bugs-announce] [issue18544] subprocess.Popen support for redirection of arbitrary file descriptors Message-ID: <1374674400.76.0.00470955001934.issue18544@psf.upfronthosting.co.za> New submission from Robert O'Callahan: Popen() ought to support redirection to/from more file descriptors than 0, 1, and 2 when spawning processes. A clear use case is here: http://stackoverflow.com/questions/6050187/write-to-file-descriptor-3-of-a-python-subprocess-popen-object Instead of messing around with os.open() and os.close() calls, my proposed API for Popen would be to accept keyword arguments fdN that would take the same type of values as the stdin, stdout, stderr arguments. Conflicting fd0 and stdin arguments would throw an exception. So the smelly code in the above SO question would be changed to: cmd='gpg --passphrase-fd {fd} -c'.format(fd=fd) with open('passphrase.txt','r') as fd3_fh: with open('filename.txt','r') as stdin_fh: with open('filename.gpg','w') as stdout_fh: proc=subprocess.Popen(shlex.split(cmd), stdin=stdin_fh, stdout=stdout_fh, fd3=fd3_fh) proc.communicate() ---------- components: Library (Lib) messages: 193646 nosy: ropoctorix priority: normal severity: normal status: open title: subprocess.Popen support for redirection of arbitrary file descriptors type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 16:01:53 2013 From: report at bugs.python.org (Chris Lambacher) Date: Wed, 24 Jul 2013 14:01:53 +0000 Subject: [New-bugs-announce] [issue18545] enum always runs member_type when use_args is True Message-ID: <1374674513.33.0.493713574743.issue18545@psf.upfronthosting.co.za> New submission from Chris Lambacher: Starting at line 153 in enum.py there is: 153 if not use_args: 154 enum_member = __new__(enum_class) 155 original_value = value 156 else: 157 enum_member = __new__(enum_class, *args) 158 original_value = member_type(*args) 159 if not hasattr(enum_member, '_value_'): 160 enum_member._value_ = original_value When use_args is True, the member_type is always called with the arguments even if the return value from enum_member has a _value_ attr. If the __new__ function transforms the the *args then the call to member_type(*args) can fail even thought the value would not be used. I've attached a patch with a fix and a test to demonstrate the problem. The use case for the test in the attached patch is to populate Django ORM choices to a field. The first value in the tuple is the value used in the database (and as the Enum value) and the second value in the tuple is the label that Django shows in select boxes. ---------- files: enum_value_transform.patch keywords: patch messages: 193648 nosy: lambacck priority: normal severity: normal status: open title: enum always runs member_type when use_args is True type: behavior versions: Python 3.4 Added file: http://bugs.python.org/file31028/enum_value_transform.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 16:57:14 2013 From: report at bugs.python.org (Derek Wilson) Date: Wed, 24 Jul 2013 14:57:14 +0000 Subject: [New-bugs-announce] [issue18546] ssl.get_server_certificate like addition for cert chain Message-ID: <1374677834.03.0.406670886322.issue18546@psf.upfronthosting.co.za> New submission from Derek Wilson: the ssl.get_server_certificate function is very useful for just requesting a cert. It would also be very useful to have a parallel function, possibly ssl.get_server_cert_chain that does the same thing except but provides a tuple of PEM encoded certs comprising the chain provided by the peer. It would also be very useful, given that we have the ability to collect certs and cert chains without validating them, to have a separate convenience method for validation of certs given a cert (or chain) and the file/path to trusted CA root certs. This way we could collect a cert chain once and validate against different ca cert stores, or collect a set of cert chains and do batch validation. oh, and I'd love to see the _ssl._decode_certificate function exposed so that we can get easily get python data structure from certs. If any of this sounds useful I would be happy to submit patches. ---------- components: Extension Modules messages: 193654 nosy: underrun priority: normal severity: normal status: open title: ssl.get_server_certificate like addition for cert chain type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 18:31:59 2013 From: report at bugs.python.org (Jonas Eriksson) Date: Wed, 24 Jul 2013 16:31:59 +0000 Subject: [New-bugs-announce] [issue18547] os.path.dirname() does not behave as expected for path without /:es Message-ID: <1374683519.45.0.070204283565.issue18547@psf.upfronthosting.co.za> New submission from Jonas Eriksson: Only tested on marked python versions. Checked the code in hg (a5681f50bae2) and did not see anything related to this in the current development version. Essentially, what I see is this: >>> os.path.dirname("asdf") '' >>> os.path.dirname("./asdf") '.' >>> What I expect is the same output as from the unix command dirname: $ dirname asdf . $ dirname ./asdf . $ The change is quite straight forwards, Lib/posixpath.py needs something like if head = "": head = ".", and Lib/ntpath.py something similar. Now, this bug is a tricky one since it alters the behavior of dirname. However, I cannot see any case where "" would be useful and have seen at least one bug because of this behaviour because the return value "" is treated like an error. So I gracefully hand over the final decision to you :) ---------- components: Library (Lib) messages: 193662 nosy: Jonas.Eriksson priority: normal severity: normal status: open title: os.path.dirname() does not behave as expected for path without /:es type: behavior versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 20:48:41 2013 From: report at bugs.python.org (py.user) Date: Wed, 24 Jul 2013 18:48:41 +0000 Subject: [New-bugs-announce] [issue18548] In unittest doc change WidgetTestCase to SimpleWidgetTestCase in suite() Message-ID: <1374691721.34.0.862188774104.issue18548@psf.upfronthosting.co.za> New submission from py.user: http://docs.python.org/3/library/unittest.html#organizing-test-code """ def suite(): suite = unittest.TestSuite() suite.addTest(WidgetTestCase('test_default_size')) suite.addTest(WidgetTestCase('test_resize')) return suite """ ---------- assignee: docs at python components: Documentation files: issue.diff keywords: patch messages: 193667 nosy: docs at python, py.user priority: normal severity: normal status: open title: In unittest doc change WidgetTestCase to SimpleWidgetTestCase in suite() type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31029/issue.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 21:20:10 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 24 Jul 2013 19:20:10 +0000 Subject: [New-bugs-announce] [issue18549] Dead code in socket_ntohl() Message-ID: <1374693610.23.0.39221855821.issue18549@psf.upfronthosting.co.za> New submission from Christian Heimes: http://hg.python.org/cpython/file/96d817f41c4c/Modules/socketmodule.c#l4642 The code has two checks if (x == (unsigned long) -1 && PyErr_Occurred()). Coverity claims that the second time is dead code and I agree. It looks like an artifact from the time the function didn't check for integer overflow. CID 982369 ---------- messages: 193669 nosy: christian.heimes, haypo, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Dead code in socket_ntohl() type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 21:39:39 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 24 Jul 2013 19:39:39 +0000 Subject: [New-bugs-announce] [issue18550] internal_setblocking() doesn't check return value of fcntl() Message-ID: <1374694779.19.0.0902694218162.issue18550@psf.upfronthosting.co.za> New submission from Christian Heimes: http://hg.python.org/cpython/file/96d817f41c4c/Modules/socketmodule.c#l614 CID 715331 (#1 of 1): Unchecked return value from library (CHECKED_RETURN) 5. check_return: Calling function "fcntl(s->sock_fd, 4, delay_flag)" without checking return value. This library function may fail and return an error code. It's rather tedious to fix the issue. No function checks the return value of internal_setblocking()... ---------- messages: 193670 nosy: christian.heimes, haypo priority: low severity: normal stage: needs patch status: open title: internal_setblocking() doesn't check return value of fcntl() type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 21:45:38 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 24 Jul 2013 19:45:38 +0000 Subject: [New-bugs-announce] [issue18551] child_exec() doesn't check return value of fcntl() Message-ID: <1374695138.31.0.553729401393.issue18551@psf.upfronthosting.co.za> New submission from Christian Heimes: http://hg.python.org/cpython/file/96d817f41c4c/Modules/_posixsubprocess.c#l384 CID 715330 (#2 of 2): Unchecked return value from library (CHECKED_RETURN) 17. check_return: Calling function "fcntl(c2pwrite, 2, old & 0xfffffffffffffffe)" without checking return value. This library function may fail and return an error code. Could this cause any kind of trouble or shall I dismiss the issue as intentional? ---------- messages: 193672 nosy: christian.heimes, haypo priority: low severity: normal stage: needs patch status: open title: child_exec() doesn't check return value of fcntl() type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 24 23:22:19 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 24 Jul 2013 21:22:19 +0000 Subject: [New-bugs-announce] [issue18552] obj2ast_object() doesn't check return value of PyArena_AddPyObject() Message-ID: <1374700939.92.0.113667527223.issue18552@psf.upfronthosting.co.za> New submission from Christian Heimes: CID 1046712 (#1 of 1): Unchecked return value (CHECKED_RETURN) 3. check_return: Calling function "PyArena_AddPyObject(PyArena *, PyObject *)" without checking return value (as is done elsewhere 5 out of 6 times). 4. unchecked_value: No check of the return value of "PyArena_AddPyObject(arena, obj)". 708 PyArena_AddPyObject(arena, obj); ---------- files: asdl.patch keywords: patch messages: 193673 nosy: christian.heimes priority: normal severity: normal stage: patch review status: open title: obj2ast_object() doesn't check return value of PyArena_AddPyObject() type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file31031/asdl.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 25 13:46:19 2013 From: report at bugs.python.org (anatoly techtonik) Date: Thu, 25 Jul 2013 11:46:19 +0000 Subject: [New-bugs-announce] [issue18553] os.isatty() is not Unix only Message-ID: <1374752779.81.0.230915084667.issue18553@psf.upfronthosting.co.za> New submission from anatoly techtonik: It seems like os.isatty(0) works on Windows too. Documentation says Unix only: http://docs.python.org/2/library/os.html#os.isatty http://docs.python.org/3.4/library/os.html#os.isatty C:\>py -c "import os; print os.isatty(0)" True C:\>echo "x" | py -c "import os; print os.isatty(0)" False C:\>py -c "import os; print os.isatty(0)" | more True ---------- components: Library (Lib) messages: 193694 nosy: techtonik priority: normal severity: normal status: open title: os.isatty() is not Unix only versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 25 15:44:58 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 25 Jul 2013 13:44:58 +0000 Subject: [New-bugs-announce] [issue18554] os.__all__ is incomplete Message-ID: <1374759898.69.0.624700414808.issue18554@psf.upfronthosting.co.za> New submission from Ronald Oussoren: On Unix the __all__ of the os module doesn't list the names imported from the posix module. The attached patch ensures that exports from the posix module are added to __all__, just like they are for NT and for Python 2.7. ---------- components: Library (Lib) files: incomplete-os-all.txt keywords: needs review, patch messages: 193696 nosy: ronaldoussoren priority: normal severity: normal stage: patch review status: open title: os.__all__ is incomplete type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file31033/incomplete-os-all.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 25 18:50:40 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 25 Jul 2013 16:50:40 +0000 Subject: [New-bugs-announce] [issue18555] type_set_bases() doesn't check return value of PyArg_UnpackTuple() Message-ID: <1374771040.36.0.388473328266.issue18555@psf.upfronthosting.co.za> New submission from Christian Heimes: http://hg.python.org/cpython/file/be5f1f0bea09/Objects/typeobject.c#l554 CID 486265 (#1 of 1): Unchecked return value (CHECKED_RETURN) 19. check_return: Calling function "PyArg_UnpackTuple(PyObject *, char const *, Py_ssize_t, Py_ssize_t, ...)" without checking return value (as is done elsewhere 64 out of 65 times). PyArg_UnpackTuple(PyList_GET_ITEM(temp, i), "", 2, 2, &cls, &mro); ---------- components: Interpreter Core messages: 193702 nosy: christian.heimes priority: normal severity: normal stage: needs patch status: open title: type_set_bases() doesn't check return value of PyArg_UnpackTuple() type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 25 18:52:29 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 25 Jul 2013 16:52:29 +0000 Subject: [New-bugs-announce] [issue18556] ctypes' U_set() doesn't check return value of PyUnicode_AsWideChar() Message-ID: <1374771149.82.0.0818752850017.issue18556@psf.upfronthosting.co.za> New submission from Christian Heimes: http://hg.python.org/cpython/file/be5f1f0bea09/Modules/_ctypes/cfield.c#l1235 CID 486657 (#1 of 1): Unchecked return value (CHECKED_RETURN) 5. check_return: Calling function "PyUnicode_AsWideChar(PyObject *, wchar_t *, Py_ssize_t)" without checking return value (as is done elsewhere 7 out of 8 times). 1263 PyUnicode_AsWideChar(value, (wchar_t *)ptr, size); ---------- components: Extension Modules messages: 193703 nosy: christian.heimes priority: low severity: normal stage: needs patch status: open title: ctypes' U_set() doesn't check return value of PyUnicode_AsWideChar() type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 25 19:51:27 2013 From: report at bugs.python.org (Lukas Pirl) Date: Thu, 25 Jul 2013 17:51:27 +0000 Subject: [New-bugs-announce] [issue18557] email address parser desired Message-ID: <1374774687.14.0.323037279349.issue18557@psf.upfronthosting.co.za> New submission from Lukas Pirl: I am missing a non-hidden equivalent of email._parseaddr.AddressList. AddressList was retained from the former rfc822 module and is still used internally. Yes, there is email.utils but for what I know, with the provided functionality it is not possible to parse a comma separated list of email addresses (ex. "a at example.com, b at example.com"). Since RFC5322 allow commas in the local part [1], one cannot simply split a list of email addresses by comma and use email.utils.getaddresses. [1] http://tools.ietf.org/html/rfc5322#section-3.2.3 ---------- components: email messages: 193707 nosy: barry, lpirl, r.david.murray priority: normal severity: normal status: open title: email address parser desired type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 26 01:57:31 2013 From: report at bugs.python.org (Stephen Paul Chappell) Date: Thu, 25 Jul 2013 23:57:31 +0000 Subject: [New-bugs-announce] [issue18558] Iterables not detected correctly Message-ID: <1374796651.89.0.668716719647.issue18558@psf.upfronthosting.co.za> New submission from Stephen Paul Chappell: The following interactive session shows that iterables are not detected properly by the `collections.abc.Iterable` class. >>> class IsIterable: def __init__(self, data): self.data = data def __getitem__(self, key): return self.data[key] >>> is_iterable = IsIterable(range(5)) >>> for value in is_iterable: value 0 1 2 3 4 >>> from collections.abc import Iterable >>> isinstance(is_iterable, Iterable) False ---------- components: Library (Lib) messages: 193723 nosy: Zero priority: normal severity: normal status: open title: Iterables not detected correctly type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 26 15:45:57 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 26 Jul 2013 13:45:57 +0000 Subject: [New-bugs-announce] [issue18559] _pickle: NULL ptr dereference when PyLong_FromSsize_t() fails Message-ID: <1374846357.58.0.162298392786.issue18559@psf.upfronthosting.co.za> New submission from Christian Heimes: Two functions in _pickle Py_DECREF() a variable although it may be NULL. The patch corrects the error handling paths. CID 1058277 CID 1058278 ---------- components: Extension Modules files: pickle_pylong_null.patch keywords: patch messages: 193729 nosy: christian.heimes priority: normal severity: normal stage: patch review status: open title: _pickle: NULL ptr dereference when PyLong_FromSsize_t() fails type: crash versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file31037/pickle_pylong_null.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 26 16:52:26 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 26 Jul 2013 14:52:26 +0000 Subject: [New-bugs-announce] [issue18560] builtin_sum() doesn't check return value of PyLong_FromLong() Message-ID: <1374850346.2.0.318881980727.issue18560@psf.upfronthosting.co.za> New submission from Christian Heimes: 2032 result = PyLong_FromLong(i_result); CID 1058287 (#1 of 1): Dereference null return value (NULL_RETURNS) 34. dereference: Dereferencing a pointer that might be null "result" when calling "PyNumber_Add(PyObject *, PyObject *)". [show details] 2033 temp = PyNumber_Add(result, item); ---------- components: Interpreter Core files: builtin_sum.patch keywords: patch messages: 193730 nosy: christian.heimes priority: normal severity: normal stage: patch review status: open title: builtin_sum() doesn't check return value of PyLong_FromLong() type: crash versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file31038/builtin_sum.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 26 16:56:00 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 26 Jul 2013 14:56:00 +0000 Subject: [New-bugs-announce] [issue18561] ctypes _build_callargs() doesn't check name for NULL Message-ID: <1374850560.42.0.7834284106.issue18561@psf.upfronthosting.co.za> New submission from Christian Heimes: http://hg.python.org/cpython/file/40bec72df2a1/Modules/_ctypes/_ctypes.c#l3565 3565 case PARAMFLAG_FIN: 3566 /* 'in' parameter. Copy it from inargs. */ CID 486199 (#1 of 1): Explicit null dereferenced (FORWARD_NULL) 31. var_deref_model: Passing null pointer "name" to function "_get_arg(int *, PyObject *, PyObject *, PyObject *, PyObject *)", which dereferences it. [show details] 3567 ob =_get_arg(&inargs_index, name, defval, inargs, kwds); ---------- components: Extension Modules messages: 193731 nosy: christian.heimes priority: normal severity: normal stage: needs patch status: open title: ctypes _build_callargs() doesn't check name for NULL type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 26 18:07:35 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Fri, 26 Jul 2013 16:07:35 +0000 Subject: [New-bugs-announce] [issue18562] Regex howto: revision pass Message-ID: <1374854855.56.0.787824851556.issue18562@psf.upfronthosting.co.za> New submission from A.M. Kuchling: I read through the 3.3 regex howto and have made various edits in the attached patch. * describe how \w is different when used in bytes and Unicode patterns. * describe re.ASCII flag to change that behaviour. * remove a personal reference ('I generally prefer...') * some small edits and re-wording. ---------- assignee: docs at python components: Documentation files: regex.diff keywords: patch messages: 193733 nosy: akuchling, docs at python priority: normal severity: normal stage: patch review status: open title: Regex howto: revision pass versions: Python 3.3 Added file: http://bugs.python.org/file31039/regex.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 26 18:30:20 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Fri, 26 Jul 2013 16:30:20 +0000 Subject: [New-bugs-announce] [issue18563] No unit test for yiq to rgb and rgb to yiq converting functions Message-ID: <1374856220.88.0.555143792121.issue18563@psf.upfronthosting.co.za> New submission from Vajrasky Kok: Module colorsys has hsv_to_rgb, rgb_to_hsv, hls_to_rgb, rgb_to_hls, yiq_to_rgb, rgb_to_yig public API functions. But only hsv_to_rgb, rgb_to_hsv, hls_to_rgb, rgb_to_hls functions are being unit tested. Attached the patch for adding unit test to cover the yiq_to_rgb, rgb_to_yig functions as well. ---------- components: Tests files: unit_test_for_yiq.txt messages: 193734 nosy: vajrasky priority: normal severity: normal status: open title: No unit test for yiq to rgb and rgb to yiq converting functions versions: Python 3.4 Added file: http://bugs.python.org/file31040/unit_test_for_yiq.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 26 19:59:05 2013 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Fri, 26 Jul 2013 17:59:05 +0000 Subject: [New-bugs-announce] [issue18564] Integer overflow in socketmodule Message-ID: <1374861545.82.0.430674187566.issue18564@psf.upfronthosting.co.za> New submission from Michele Orr?: In Modules/socketmodule.c , the bluetooth address supplied is vulnerable to integer overflow. Attaching patch and a couple of tests, which should be considered as a step forward in #7687. ---------- components: Extension Modules files: btoverflow.patch keywords: patch messages: 193736 nosy: maker priority: normal severity: normal status: open title: Integer overflow in socketmodule type: behavior Added file: http://bugs.python.org/file31041/btoverflow.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 27 02:01:47 2013 From: report at bugs.python.org (Phil Connell) Date: Sat, 27 Jul 2013 00:01:47 +0000 Subject: [New-bugs-announce] [issue18565] Test for closing delegating generator with cleared frame (Issue17669) Message-ID: <1374883307.06.0.100928488796.issue18565@psf.upfronthosting.co.za> New submission from Phil Connell: This is a testcase for issue17669 - it passes against the latest default (and hits the same segfault under 3.3.0). I came up with this while tracking down a thorny generator finalisation crash that turned out to be a variant on 17669. The root cause was gen_close being called on a generator that's delegating to another, and whose frame has already had frame_clear called (so f_stacktop is NULL). It's reproduced by creating a reference cycle that's broken by clearing the delegating generator's frame. ---------- components: Interpreter Core files: gen_close_with_cleared_frame.diff keywords: patch messages: 193765 nosy: benjamin.peterson, isoschiz, pconnell priority: normal severity: normal status: open title: Test for closing delegating generator with cleared frame (Issue17669) type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31048/gen_close_with_cleared_frame.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 27 07:12:17 2013 From: report at bugs.python.org (py.user) Date: Sat, 27 Jul 2013 05:12:17 +0000 Subject: [New-bugs-announce] [issue18566] In unittest.TestCase docs for setUp() and tearDown() don't mention AssertionError Message-ID: <1374901937.1.0.747872580847.issue18566@psf.upfronthosting.co.za> New submission from py.user: http://docs.python.org/3/library/unittest.html#unittest.TestCase.setUp "any exception raised by this method will be considered an error rather than a test failure" http://docs.python.org/3/library/unittest.html#unittest.TestCase.tearDown "Any exception raised by this method will be considered an error rather than a test failure." utest.py #!/usr/bin/env python3 import unittest class Test(unittest.TestCase): def setUp(self): raise AssertionError def tearDown(self): raise AssertionError def test_nothing(self): pass [guest at localhost py]$ python3 -m unittest -v utest test_nothing (utest.Test) ... FAIL ====================================================================== FAIL: test_nothing (utest.Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "./utest.py", line 8, in setUp raise AssertionError AssertionError ---------------------------------------------------------------------- Ran 1 test in 0.000s FAILED (failures=1) [guest at localhost py]$ also raising unittest.SkipTest works properly ---------- assignee: docs at python components: Documentation messages: 193772 nosy: docs at python, py.user priority: normal severity: normal status: open title: In unittest.TestCase docs for setUp() and tearDown() don't mention AssertionError type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 27 07:27:55 2013 From: report at bugs.python.org (Denise Mauldin) Date: Sat, 27 Jul 2013 05:27:55 +0000 Subject: [New-bugs-announce] [issue18567] Python 2.7.5 CENTOS6 Error building dbm using bdb Message-ID: <1374902875.32.0.446892441408.issue18567@psf.upfronthosting.co.za> New submission from Denise Mauldin: CC='gcc -pthread' LDSHARED='gcc -pthread -shared -L/u5/tools/lib -L/u5/tools/lib64' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py $quiet build running build running build_ext building dbm using bdb building '_bsddb' extension gcc -pthread -fPIC -fno-strict-aliasing -fPIC -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include -I. -IInclude -I./Include -I/u5/tools/include -I/usr/include -I/usr/local/include -I/u5/src/Python-2.7.5/Include -I/u5/src/Python-2.7.5 -c /u5/src/Python-2.7.5/Modules/_bsddb.c -o build/temp.linux-x86_64-2.7/u5/src/Python-2.7.5/Modules/_bsddb.o /u5/src/Python-2.7.5/Modules/_bsddb.c: In function ?DB_set_bt_compare?: /u5/src/Python-2.7.5/Modules/_bsddb.c:2764: warning: passing argument 2 of ?self->db->set_bt_compare? from incompatible pointer type /u5/src/Python-2.7.5/Modules/_bsddb.c:2764: note: expected ?int (*)(struct DB *, const struct DBT *, const struct DBT *, size_t *)? but argument is of type ?int (*)(struct DB *, const struct DBT *, const struct DBT *)? /u5/src/Python-2.7.5/Modules/_bsddb.c: In function ?DB_set_dup_compare?: /u5/src/Python-2.7.5/Modules/_bsddb.c:2878: warning: passing argument 2 of ?self->db->set_dup_compare? from incompatible pointer type /u5/src/Python-2.7.5/Modules/_bsddb.c:2878: note: expected ?int (*)(struct DB *, const struct DBT *, const struct DBT *, size_t *)? but argument is of type ?int (*)(struct DB *, const struct DBT *, const struct DBT *)? /u5/src/Python-2.7.5/Modules/_bsddb.c: In function ?DBSequence_get_cachesize?: /u5/src/Python-2.7.5/Modules/_bsddb.c:8565: warning: pointer targets in passing argument 2 of ?self->sequence->get_cachesize? differ in signedness /u5/src/Python-2.7.5/Modules/_bsddb.c:8565: note: expected ?u_int32_t *? but argument is of type ?int *? gcc -pthread -shared -L/u5/tools/lib -L/u5/tools/lib64 -L/u5/tools/lib -L/u5/tools/lib64 -fPIC build/temp.linux-x86_64-2.7/u5/src/Python-2.7.5/Modules/_bsddb.o -L/usr/lib64 -L/u5/tools/lib -L/u5/tools/lib64 -L/lib -L/usr/lib -L/lib64 -L/usr/lib64 -L/usr/local/lib -Wl,-R/usr/lib64 -ldb-4.7 -o build/lib.linux-x86_64-2.7/_bsddb.so *** WARNING: renaming "_bsddb" since importing it failed: build/lib.linux-x86_64-2.7/_bsddb.so: undefined symbol: db_full_version Segmentation fault (core dumped) ---------- components: Build messages: 193773 nosy: Denise.Mauldin priority: normal severity: normal status: open title: Python 2.7.5 CENTOS6 Error building dbm using bdb type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 27 08:11:22 2013 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 27 Jul 2013 06:11:22 +0000 Subject: [New-bugs-announce] [issue18568] Support \e escape code in strings Message-ID: <1374905482.76.0.578530447098.issue18568@psf.upfronthosting.co.za> New submission from Steven D'Aprano: I'm adding this so there is a record in the bug tracker for posterity. No action is needed except to close it as a "Won't Fix". As per this discussion here: http://mail.python.org/pipermail/python-ideas/2013-June/021318.html using \e as an escape code for ASCII ESC character might be nice to have, but it fails backwards compatibility and therefore must be ruled out. (But perhaps could be re-visited in Python 4000?) ---------- components: Interpreter Core messages: 193776 nosy: stevenjd priority: normal severity: normal status: open title: Support \e escape code in strings _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 27 10:07:43 2013 From: report at bugs.python.org (Paul Moore) Date: Sat, 27 Jul 2013 08:07:43 +0000 Subject: [New-bugs-announce] [issue18569] Set PATHEXT in the Windows installer Message-ID: <1374912463.83.0.476685307572.issue18569@psf.upfronthosting.co.za> New submission from Paul Moore: Make the Windows Python installer set PATHEXT when "Register Python extensions" is set. This allows users to run a scripy by typing the name of the .py file at the command line without the .py extension. The patch needs review - I have not been able to build the MSI installer and so this patch is untested :-( ---------- assignee: loewis components: Installation, Windows files: pathext.patch keywords: needs review, patch messages: 193781 nosy: loewis, pmoore priority: normal severity: normal stage: patch review status: open title: Set PATHEXT in the Windows installer type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31051/pathext.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 27 13:31:25 2013 From: report at bugs.python.org (Marco Buttu) Date: Sat, 27 Jul 2013 11:31:25 +0000 Subject: [New-bugs-announce] [issue18570] OverflowError during division: wrong message Message-ID: <1374924685.41.0.945479313268.issue18570@psf.upfronthosting.co.za> New submission from Marco Buttu: When the integer division result is too large to converto to float, and the operands are inside the limits, the result is `inf` or `-inf`:: >>> 2**1023 / 2**-3 inf >>> 2**1022 / 2**-4 inf >>> 2**1023 / 2**-1074 inf When both the result and an operand are too large to converto to float, we raise an OverflowError:: >>> 2**1028 / 2**-2 Traceback (most recent call last): File "", line 1, in OverflowError: long int too large to convert to float The message says: "long int too large to convert to float". I think in Python 3 it should be "int too large to convert...". In any case, the most important thing is that in the same situation we get a different message [1]_:: >>> 2**1032 / 2**2 Traceback (most recent call last): File "", line 1, in OverflowError: integer division result too large for a float and I think is it muddleheaded, because it should be "long int too large to convert to float", as we got in the case `2**1028 / 2**-2`. I think we should never show "integer division result too large for a float", but just: * `inf` or `-inf` when the operands are inside the limits, but the result does not * `OverflowError: long int too large to convert to float` when the result, and at least one operand, are out of range. .. [1] In this situation, we get the message "OverflowError: integer division result too large for a float" only when the denominator exponent is positive. ---------- messages: 193783 nosy: marco.buttu priority: normal severity: normal status: open title: OverflowError during division: wrong message type: behavior versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 27 17:28:51 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 27 Jul 2013 15:28:51 +0000 Subject: [New-bugs-announce] [issue18571] Implementation of the PEP 446: non-inheriable file descriptors Message-ID: <1374938931.56.0.308173909507.issue18571@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: haypo priority: normal severity: normal status: open title: Implementation of the PEP 446: non-inheriable file descriptors type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 27 18:12:13 2013 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 27 Jul 2013 16:12:13 +0000 Subject: [New-bugs-announce] [issue18572] Remove redundant note about surrogates in string escape doc Message-ID: <1374941533.84.0.352957238503.issue18572@psf.upfronthosting.co.za> New submission from Steven D'Aprano: The documentation for string escapes suggests that \uxxxx escapes can be used to generate characters in the Supplementary Multilingual Planes by using surrogate pairs: "Individual code units which form parts of a surrogate pair can be encoded using this escape sequence." http://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals E.g. in Python 3.2: py> '\uD80C\uDC80' == '\U00013080' True but that is no longer the case in Python 3.3. I suggest the documentation should just remove that note. ---------- assignee: docs at python components: Documentation messages: 193787 nosy: docs at python, stevenjd priority: normal severity: normal status: open title: Remove redundant note about surrogates in string escape doc versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 27 20:20:02 2013 From: report at bugs.python.org (py.user) Date: Sat, 27 Jul 2013 18:20:02 +0000 Subject: [New-bugs-announce] [issue18573] In unittest.TestCase.assertWarns doc there is some text about assertRaises() Message-ID: <1374949202.48.0.718203936991.issue18573@psf.upfronthosting.co.za> New submission from py.user: http://docs.python.org/3/library/unittest.html#unittest.TestCase.assertWarns "When used as a context manager, assertRaises() accepts" "... is to perform additional checks on the exception raised" ---------- assignee: docs at python components: Documentation files: issue.diff keywords: patch messages: 193788 nosy: docs at python, py.user priority: normal severity: normal status: open title: In unittest.TestCase.assertWarns doc there is some text about assertRaises() type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31054/issue.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 28 02:36:27 2013 From: report at bugs.python.org (Nikolaus Rath) Date: Sun, 28 Jul 2013 00:36:27 +0000 Subject: [New-bugs-announce] [issue18574] BaseHTTPRequestHandler.handle_expect_100() sends invalid response Message-ID: <1374971787.85.0.837580893432.issue18574@psf.upfronthosting.co.za> New submission from Nikolaus Rath: The handle_expect_100() implementation in BaseHTTPRequestHandler currently calls send_response_only(100) followed by flush_headers(). However, even a 1xx response is always followed by a (potentially empty) set of response headers (cf. http://tools.ietf.org/html/rfc2616#section-9.9). Therefore, clients will block waiting for an additional '\r\n' before sending the buffer. The attached patch fixes the problem. ---------- components: Library (Lib) files: handle_expect.diff keywords: patch messages: 193800 nosy: Nikratio priority: normal severity: normal status: open title: BaseHTTPRequestHandler.handle_expect_100() sends invalid response versions: Python 3.3, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file31057/handle_expect.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 28 10:35:14 2013 From: report at bugs.python.org (Eduardo Robles Elvira) Date: Sun, 28 Jul 2013 08:35:14 +0000 Subject: [New-bugs-announce] [issue18575] Fixing tarfile._mode when using gzip via ":gz" Message-ID: <1375000514.51.0.865237758651.issue18575@psf.upfronthosting.co.za> New submission from Eduardo Robles Elvira: A TarFile object constructor accepts a fileobj argument. When this argument is set and it has a "mode" property, tarfile._mode is blindly copied from there. Otherwise, mode is set using the mode argument in the constructor. This usually works, but in the case where fileobj is a gzip.GzipFile, the "mode" property is not a string like "rb" or "wb" but an integer, which is not expected in TarFile. This has not been noticed before probably because the TarFile._mode property is usually unused internally, but in my case it's a problem when using it together with tarfile multivolume mode provided in issue #18321. ---------- components: Library (Lib) files: gzip.patch keywords: patch messages: 193812 nosy: edulix priority: normal severity: normal status: open title: Fixing tarfile._mode when using gzip via ":gz" versions: Python 3.4 Added file: http://bugs.python.org/file31061/gzip.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 28 14:32:44 2013 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 28 Jul 2013 12:32:44 +0000 Subject: [New-bugs-announce] [issue18576] Rename and document test.script_helper as test.support.script_helper Message-ID: <1375014764.64.0.152576599022.issue18576@psf.upfronthosting.co.za> New submission from Nick Coghlan: tests.script_helper provides various utilities for sensibly testing scripts in a subprocess. It isn't easy for CPython developers to discover, since it is isn't documented and the file is mixed in with actual tests in the main test directory. As discussed in #15494, it should be: 1. Moved from Lib/test/ to Lib/test/support (and imports in tests adjusted accordingly) 2. Documented in Doc/library/test.rst These changes should be made on both the 3.3 and default branches to avoid spurious merge conflicts. ---------- assignee: docs at python components: Documentation, Tests messages: 193819 nosy: docs at python, ncoghlan priority: normal severity: normal status: open title: Rename and document test.script_helper as test.support.script_helper type: enhancement versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 28 14:32:51 2013 From: report at bugs.python.org (Peter Santoro) Date: Sun, 28 Jul 2013 12:32:51 +0000 Subject: [New-bugs-announce] [issue18577] lru_cache enhancement: lru_timestamp helper function Message-ID: <1375014771.52.0.855210720887.issue18577@psf.upfronthosting.co.za> New submission from Peter Santoro: The attached proposed lru_timestamp function provides developers with more control over how often lru_cache entries are refreshed. Doc string follows: def lru_timestamp(refresh_interval=60): """ Return a timestamp string for @lru_cache decorated functions. The returned timestamp is used as the value of an extra parameter to @lru_cache decorated functions, allowing for more control over how often cache entries are refreshed. The lru_timestamp function should be called with the same refresh_interval value for a given lru_cache decorated function. Positional arguments: refresh_interval -- 1-1440 minutes (default 60) as int or float """ Rationale: Some functions have input parameters that rarely change, but yet return different results over time. It would be nice to have a ready-made solution to force lru_cache entries to be refreshed at specified time intervals. An common example is using a stable userid to read user information from a database. By itself, the lru_cache decorator can be used to cache the user information and prevent unnecessary i/o. However, if a given user's information is updated in the database, but the associated lru_cache entry has not yet been discarded, the application will be using stale data. The lru_timestamp function is a simple, ready-made helper function that gives the developer more control over the age of lru_cache entries in such situations. Sample usage: @functools.lru_cache() def user_info(userid, timestamp): # expensive database i/o, but value changes over time # the timestamp parameter is normally not used, it is # for the benefit of the @lru_cache decorator pass # read user info from database, if not in cache or # older than 120 minutes info = user_info('johndoe', functools.lru_timestamp(120)) ---------- components: Library (Lib) files: lru.py messages: 193820 nosy: peter at psantoro.net priority: normal severity: normal status: open title: lru_cache enhancement: lru_timestamp helper function type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file31063/lru.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 28 14:35:46 2013 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 28 Jul 2013 12:35:46 +0000 Subject: [New-bugs-announce] [issue18578] Rename and document test.bytecode_helper as test.support.bytecode_helper Message-ID: <1375014946.89.0.0130176350727.issue18578@psf.upfronthosting.co.za> New submission from Nick Coghlan: test.bytecode_helper provides various utilities for sensibly testing bytecode generation. It isn't easy for CPython developers to discover, since it isn't documented and the file is mixed in with actual tests in the main test directory. As discussed in #15494, it should be: 1. Moved from Lib/test/ to Lib/test/support (and imports in tests adjusted accordingly) 2. Documented in Doc/library/test.rst This change only affects the default branch (since test.bytecode_helper is new in 3.4) ---------- assignee: ncoghlan messages: 193821 nosy: ncoghlan priority: normal severity: normal status: open title: Rename and document test.bytecode_helper as test.support.bytecode_helper versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 28 15:20:05 2013 From: report at bugs.python.org (Christian Heimes) Date: Sun, 28 Jul 2013 13:20:05 +0000 Subject: [New-bugs-announce] [issue18579] Dereference after NULL check in listobject.c merge_hi() Message-ID: <1375017605.96.0.0484069196925.issue18579@psf.upfronthosting.co.za> New submission from Christian Heimes: Coverity Scan may have found an issue in listobject's merge code. I'm not familiar with the code so I don't know if ssb.value can be NULL here. 3. Condition "ssb.values != NULL", taking false branch 4. var_compare_op: Comparing "ssb.values" to null implies that "ssb.values" might be null. 1642 if (ssb.values != NULL) 1643 ssb.values = ms->a.values + nb - 1; [...] CID 715348 (#1 of 2): Dereference after null check (FORWARD_NULL) 18. var_deref_model: Passing "&ssb" to function "sortslice_copy_decr(sortslice *, sortslice *)", which dereferences null "ssb.values". 1711 sortslice_copy_decr(&dest, &ssb); http://hg.python.org/cpython/file/tip/Objects/listobject.c#l1711 ---------- components: Interpreter Core messages: 193825 nosy: christian.heimes, haypo, tim_one priority: normal severity: normal status: open title: Dereference after NULL check in listobject.c merge_hi() type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 28 16:18:25 2013 From: report at bugs.python.org (Alexey Borzenkov) Date: Sun, 28 Jul 2013 14:18:25 +0000 Subject: [New-bugs-announce] [issue18580] distutils compilers are unicode strings on OS X since Python 2.7.4 Message-ID: <1375021105.23.0.849162523275.issue18580@psf.upfronthosting.co.za> New submission from Alexey Borzenkov: A user reported getting a TypeError when building greenlet on OS X with Python 2.7.4 built with homebrew. The TypeError happens because we subclass build_ext so before building extensions we can change compiler's compiler_so. The problem is that instead of a list it's a unicode string. I couldn't reproduce the problem myself, but I traced it to the following: In Lib/distutils/ccompiler.py, method CCompiler.set_executable, type check is only for str. So if set_executable is called with a unicode string is would not be turned into a list. In Lib/_osx_support.py, function _read_output, the output is always decoded as utf-8 (why?). This function is used in _find_build_tool, which in turn is used in _find_appropriate_compiler, but only if it cannot find the compiler on the PATH (not sure when this could happen, when the user doesn't have Command Line Support installed?). Because of this compiler will be configured as a unicode string and this would probably mean no extensions can be built. I this either _osx_support should be fixed to not decode output as utf-8, or set_executable should be fixed to test for basestring instead of str. ---------- assignee: eric.araujo components: Distutils messages: 193826 nosy: Alexey.Borzenkov, eric.araujo, tarek priority: normal severity: normal status: open title: distutils compilers are unicode strings on OS X since Python 2.7.4 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 28 17:09:45 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Sun, 28 Jul 2013 15:09:45 +0000 Subject: [New-bugs-announce] [issue18581] Duplicate test and missing class test in test_abc.py Message-ID: <1375024185.25.0.955191764132.issue18581@psf.upfronthosting.co.za> New submission from Vajrasky Kok: There are two classes in Lib/test/test_abc.py, which are TestABC and TestLegacyAPI. Only TestABC is being unit tested. Beside that TestLegacyAPI class has one duplicate test, which is test_abstractmethod_integration with TestABC class. ---------- components: Tests files: legacy_api_unit_test.txt messages: 193831 nosy: vajrasky priority: normal severity: normal status: open title: Duplicate test and missing class test in test_abc.py versions: Python 3.4 Added file: http://bugs.python.org/file31065/legacy_api_unit_test.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 28 17:11:19 2013 From: report at bugs.python.org (Christian Heimes) Date: Sun, 28 Jul 2013 15:11:19 +0000 Subject: [New-bugs-announce] [issue18582] PBKDF2 support Message-ID: <1375024279.36.0.0953079533445.issue18582@psf.upfronthosting.co.za> New submission from Christian Heimes: The patch is a proof of concept for PBKDF2 support for the OpenSSL variant of hashlib. It's a thin wrapper around PKCS5_PBKDF2_HMAC() and is deliberately designed as low level API with bytes and input and output types. High level wrappers can do the conversation and choose sensible values for salt, iterations and key length. ---------- components: Extension Modules files: pbkdf2.patch keywords: patch messages: 193832 nosy: christian.heimes priority: normal severity: normal status: open title: PBKDF2 support type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31066/pbkdf2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 29 04:39:37 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 29 Jul 2013 02:39:37 +0000 Subject: [New-bugs-announce] [issue18583] Idle: enhance FormatParagraph Message-ID: <1375065577.4.0.851490009653.issue18583@psf.upfronthosting.co.za> New submission from Terry J. Reedy: Writing tests for FormatParagraph.py #18226 revealed that it could use some improvements. At minimum, some for format_paragraph should probably be replaced with textwrap.wrap (or the class) in order to handles double spacing after sentences. Find_paragraph should find the boundaries of triple-quoted strings. The current end-of-text behavior of find_paragraph should perhaps be changed. ---------- assignee: terry.reedy messages: 193848 nosy: terry.reedy priority: normal severity: normal stage: test needed status: open title: Idle: enhance FormatParagraph type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 29 08:27:08 2013 From: report at bugs.python.org (rurpy) Date: Mon, 29 Jul 2013 06:27:08 +0000 Subject: [New-bugs-announce] [issue18584] examples in email.policy doc are fu'd Message-ID: <1375079228.82.0.247789886969.issue18584@psf.upfronthosting.co.za> New submission from rurpy: In the first example in the documentation for library module email.policy (http://docs.python.org/3/library/email.policy.html#module-email.policy): >>> from email import msg_from_binary_file >>> from email.generator import BytesGenerator >>> from subprocess import Popen, PIPE >>> with open('mymsg.txt', 'b') as f: ... msg = msg_from_binary_file(f) line 1: The module is "message_from_binary_file", not "msg_from_binary_file" line 4: The mode must be "rb", not "b". line 5: Same module (mis-)name problem as line 1. Then in following example... >>> import os >>> with open('converted.txt', 'wb') as f: ... f.write(msg.as_string (policy=msg.policy.clone (linesep=os.linesep)) line 3: Ubnbalanced parens, .as_string() has no "policy" keyword arg. Please note I am trying to figure out how to use the email module for the first time and the above errors are glaring. There may be (probably are) other errors in the examples and in the text that I am unaware of -- I've made no attempt to find any others. I suggest that someone familiar with email module review this page more carefully. ---------- assignee: docs at python components: Documentation messages: 193852 nosy: docs at python, rurpy2 priority: normal severity: normal status: open title: examples in email.policy doc are fu'd versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 29 14:49:10 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 29 Jul 2013 12:49:10 +0000 Subject: [New-bugs-announce] [issue18585] Add a text truncation function Message-ID: <1375102150.65.0.445691594018.issue18585@psf.upfronthosting.co.za> New submission from Antoine Pitrou: Following patch proposed to add a function named textwrap.summarize(): >>> textwrap.summarize("Hello world!", width=12) 'Hello world!' >>> textwrap.summarize("Hello world!", width=11) 'Hello (...)' ---------- components: Library (Lib) files: summarize.patch keywords: patch messages: 193862 nosy: barry, georg.brandl, pitrou priority: normal severity: normal stage: patch review status: open title: Add a text truncation function type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31072/summarize.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 29 17:38:01 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 29 Jul 2013 15:38:01 +0000 Subject: [New-bugs-announce] [issue18586] Allow running benchmarks for Python 3 from same directory Message-ID: <1375112281.72.0.724142875294.issue18586@psf.upfronthosting.co.za> New submission from Brett Cannon: As of right now, to run the benchmark suite you need to use make_perf3.sh to generate a Python 3 compatible version of the benchmarks. That was fine when the benchmark suite didn't have much support for Python 3 and thus was just used for Python 3 very often. But now that a lot more benchmarks work it should be updated so that this extra step can be avoided. ---------- components: Benchmarks messages: 193875 nosy: brett.cannon, pitrou priority: normal severity: normal stage: needs patch status: open title: Allow running benchmarks for Python 3 from same directory type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 29 18:01:57 2013 From: report at bugs.python.org (Denis) Date: Mon, 29 Jul 2013 16:01:57 +0000 Subject: [New-bugs-announce] [issue18587] urllib raises exception with string in 'errno' attribute Message-ID: <1375113717.9.0.650830125901.issue18587@psf.upfronthosting.co.za> New submission from Denis: On 'connection refused' error urllib creates IOError with wrong arguents: args ('socket error', error(, 'Connection refused')) It results to dirty hacks in Python code like 'if e.errno == "socket error": ...' instead of traditional 'id e.errno == errno.ECONNREFUSED: ...' ---------- files: pyerror.py messages: 193878 nosy: denkoren priority: normal severity: normal status: open title: urllib raises exception with string in 'errno' attribute type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file31075/pyerror.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 29 19:17:37 2013 From: report at bugs.python.org (Clay McClure) Date: Mon, 29 Jul 2013 17:17:37 +0000 Subject: [New-bugs-announce] [issue18588] timeit examples should be consistent Message-ID: <1375118257.9.0.905991463553.issue18588@psf.upfronthosting.co.za> Changes by Clay McClure : ---------- assignee: docs at python components: Documentation nosy: claymation, docs at python priority: normal severity: normal status: open title: timeit examples should be consistent type: enhancement versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 29 20:22:04 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 29 Jul 2013 18:22:04 +0000 Subject: [New-bugs-announce] [issue18589] cross-referencing doesn't work between the extending guide and c-api Message-ID: <1375122124.66.0.67649436332.issue18589@psf.upfronthosting.co.za> New submission from Antoine Pitrou: It doesn't seem possible to make reference links to e.g. the definition for tp_clear. Both :attr:`tp_clear` and :attr:`PyTypeObject.tp_clear` do not make any link. The extending guide is littered with such broken references. ---------- assignee: docs at python components: Documentation messages: 193887 nosy: docs at python, eric.araujo, ezio.melotti, georg.brandl, pitrou priority: high severity: normal status: open title: cross-referencing doesn't work between the extending guide and c-api type: behavior versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 29 22:09:25 2013 From: report at bugs.python.org (Sarah) Date: Mon, 29 Jul 2013 20:09:25 +0000 Subject: [New-bugs-announce] [issue18590] 'Search' and 'Replace' dialogs don't work on quoted text in Windows Message-ID: <1375128565.7.0.113615028691.issue18590@psf.upfronthosting.co.za> New submission from Sarah: In Windows, the 'find' and 'replace' dialogs do not work properly on text that has been commented out using quotation marks. More specifically, the dialog *finds* the text in question, however, it does not *highlight* it. Without the highlighting, a user can't see which text has been found. Since the whole point of the find function is to show the user where the text is located, this is a bug. Credit for the fix goes to Roger Serwy, who suggested raising the hit tag. My patch uses the show_hit function from patch 17511*. I have included the show_hit function, but not the rest of patch 17511. Are there guidelines for submitting patches that utilize elements of other patches? *show_hit is originally from the ReplaceDialog. 17511 added it to SearchDialog ---------- components: IDLE, Windows files: SearchDialogPatch.patch keywords: patch messages: 193895 nosy: Sarah priority: normal severity: normal status: open title: 'Search' and 'Replace' dialogs don't work on quoted text in Windows type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file31077/SearchDialogPatch.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 29 22:34:10 2013 From: report at bugs.python.org (James Lu) Date: Mon, 29 Jul 2013 20:34:10 +0000 Subject: [New-bugs-announce] [issue18591] threading.Thread.run returning a result Message-ID: <1375130050.37.0.102071487502.issue18591@psf.upfronthosting.co.za> New submission from James Lu: I have attached a *possible* new version of threading.py that returns the value of the target. ---------- components: Library (Lib) files: threading.py messages: 193899 nosy: James.Lu priority: normal severity: normal status: open title: threading.Thread.run returning a result type: enhancement Added file: http://bugs.python.org/file31080/threading.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 30 03:12:50 2013 From: report at bugs.python.org (Phil Webster) Date: Tue, 30 Jul 2013 01:12:50 +0000 Subject: [New-bugs-announce] [issue18592] IDLE: Unit test for SearchDialogBase.py Message-ID: <1375146770.41.0.774627283078.issue18592@psf.upfronthosting.co.za> New submission from Phil Webster: This is a basic set of tests for SearchDialogBase. It mainly consists of gui code, so I was not completely sure of how/what to test. Before venturing any further, I thought I would make sure I'm heading in the right direction. ---------- components: IDLE messages: 193911 nosy: JayKrish, Todd.Rovito, philwebster, terry.reedy priority: normal severity: normal status: open title: IDLE: Unit test for SearchDialogBase.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 30 06:44:29 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Tue, 30 Jul 2013 04:44:29 +0000 Subject: [New-bugs-announce] [issue18593] Typo in Lib/multiprocessing/heap.py Message-ID: <1375159469.25.0.714853217909.issue18593@psf.upfronthosting.co.za> New submission from Vajrasky Kok: $ grep Inheirtable Lib/multiprocessing/* Lib/multiprocessing/heap.py:# Inheirtable class which wraps an mmap, and from which blocks can be allocated ---------- assignee: docs at python components: Documentation messages: 193913 nosy: docs at python, vajrasky priority: normal severity: normal status: open title: Typo in Lib/multiprocessing/heap.py versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 30 08:49:20 2013 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 30 Jul 2013 06:49:20 +0000 Subject: [New-bugs-announce] [issue18594] C accelerator for collections.Counter is slow Message-ID: <1375166960.42.0.521563124847.issue18594@psf.upfronthosting.co.za> New submission from Stefan Behnel: The C accelerator for the collections.Counter class (_count_elements() in _collections.c) is slower than the pure Python versions for data that has many unique entries. This is because the fast path for dicts is not taken (Counter is a subtype of dict) and the slower fallback path raises exceptions for each value that wasn't previously seen. This can apparently make it slower than calling get() on Python side. My suggestion is to drop the fallback path from the accelerator completely and to only call the C function when it's safe to use it, e.g. when "type(self) is Counter" and not a subclass. ---------- components: Library (Lib) messages: 193914 nosy: scoder, serhiy.storchaka priority: normal severity: normal status: open title: C accelerator for collections.Counter is slow type: performance versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 30 09:45:18 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 30 Jul 2013 07:45:18 +0000 Subject: [New-bugs-announce] [issue18595] zipfile: symlinks etc. Message-ID: <1375170318.76.0.496081120587.issue18595@psf.upfronthosting.co.za> New submission from Ronald Oussoren: The zipfile format (as described by .zip file format specification) allows for storing extra unix data, such as symlinks and device nodes in zipfile. Storing at least symlinks would be useful, and is supported by the infozip tools as well (the command-line zip and unzip commands on Linux systems). An implementation would use the "UNIX Extra Field (0x000d)" to store this information. ---------- components: Library (Lib) messages: 193915 nosy: ronaldoussoren priority: normal severity: normal stage: test needed status: open title: zipfile: symlinks etc. type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 30 10:52:39 2013 From: report at bugs.python.org (halfie) Date: Tue, 30 Jul 2013 08:52:39 +0000 Subject: [New-bugs-announce] [issue18596] enable usage of AddressSanitizer in CPython [PATCH] Message-ID: <1375174359.28.0.546907495292.issue18596@psf.upfronthosting.co.za> New submission from halfie: Hi, When trying to build CPython "tip" with AddressSanitizer enabled, I get the following crash, make Parser/pgen make[1]: Entering directory `/scratch/repos/cpython' make[1]: `Parser/pgen' is up to date. make[1]: Leaving directory `/scratch/repos/cpython' Parser/pgen ./Grammar/Grammar Include/graminit.h Python/graminit.c ================================================================= ==1375== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60380000f020 at pc 0x40b260 bp 0x7fff6e6cbbf0 sp 0x7fff6e6cbbe8 READ of size 4 at 0x60380000f020 thread T0 #0 0x40b25f in _PyObject_Realloc /scratch/repos/cpython/Objects/obmalloc.c:1551 #1 0x403048 in PyNode_AddChild /scratch/repos/cpython/Parser/node.c:98 #2 0x4037fe in push /scratch/repos/cpython/Parser/parser.c:126 #3 0x4121bd in parsetok /scratch/repos/cpython/Parser/parsetok.c:211 #4 0x413344 in PyParser_ParseFileFlags /scratch/repos/cpython/Parser/parsetok.c:86 #5 0x413422 in getgrammar /scratch/repos/cpython/Parser/pgenmain.c:92 #6 0x401860 in main /scratch/repos/cpython/Parser/pgenmain.c:55 #7 0x3cb2221b74 in ?? ??:0 #8 0x401994 in _start ??:? 0x60380000f020 is located 96 bytes to the left of 0-byte region [0x60380000f080,0x60380000f080) ==1375== AddressSanitizer CHECK failed: ../../../../libsanitizer/asan/asan_allocator2.cc:216 "((id)) != (0)" (0x0, 0x0) #0 0x3ab681237d in ?? ??:0 #1 0x3ab68191b3 in ?? ??:0 #2 0x3ab680563b in ?? ??:0 #3 0x3ab6816e8f in ?? ??:0 #4 0x3ab6817ff1 in ?? ??:0 #5 0x3ab6812763 in ?? ??:0 #6 0x40b25f in _PyObject_Realloc /scratch/repos/cpython/Objects/obmalloc.c:1551 #7 0x403048 in PyNode_AddChild /scratch/repos/cpython/Parser/node.c:98 #8 0x4037fe in push /scratch/repos/cpython/Parser/parser.c:126 #9 0x4121bd in parsetok /scratch/repos/cpython/Parser/parsetok.c:211 #10 0x413344 in PyParser_ParseFileFlags /scratch/repos/cpython/Parser/parsetok.c:86 #11 0x413422 in getgrammar /scratch/repos/cpython/Parser/pgenmain.c:92 #12 0x401860 in main /scratch/repos/cpython/Parser/pgenmain.c:55 #13 0x3cb2221b74 in ?? ??:0 #14 0x401994 in _start ??:? make: *** [Include/graminit.h] Error 1 ... AddressSanitizer is a fast memory error detector. See http://clang.llvm.org/docs/AddressSanitizer.html for details. Build options used ================== export CFLAGS="-fsanitize=address -g" export LDFLAGS="-fsanitize=address" ./configure --prefix=/opt/python --with-valgrind Software Versions ================== $ hg log changeset: 84902:6e1dd1ce95b8 branch: 2.7 tag: tip parent: 84893:1dbcb0299088 user: Terry Jan Reedy date: Tue Jul 30 01:37:36 2013 -0400 summary: Make all idle test case names end with 'Test'. $ gcc --version gcc (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1) $ cat /etc/redhat-release Fedora release 19 (Schr?dinger?s Cat) Fix / Work-around ================= See http://code.google.com/p/address-sanitizer/wiki/AddressSanitizer#Turning_off_instrumentation Turning off the instrumentation for _PyObject_Free and _PyObject_Realloc is required. Advantages ========== AddressSanitizer can *now* be used to test and debug CPython. AddressSanitizer has helped me find a large number of bugs in other softwares. ---------- components: Interpreter Core files: enable-ASAN-in-CPython.diff keywords: patch messages: 193917 nosy: halfie priority: normal severity: normal status: open title: enable usage of AddressSanitizer in CPython [PATCH] type: crash versions: Python 3.4 Added file: http://bugs.python.org/file31083/enable-ASAN-in-CPython.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 30 11:13:12 2013 From: report at bugs.python.org (Drekin) Date: Tue, 30 Jul 2013 09:13:12 +0000 Subject: [New-bugs-announce] [issue18597] On Windows sys.stdin.readline() doesn't handle Ctrl-C properly Message-ID: <1375175592.24.0.539816782076.issue18597@psf.upfronthosting.co.za> New submission from Drekin: When I run sys.stdin.readline() interactivelly (on Windows and Python 3.3.2) and hit Ctrl-C, sometimes it returns an empty string just before KeyboardInterrupt is raised. Sometimes it isn't even raised and instead after hitting Return some weird SyntaxtError: unknown decode error (on line 0) occurs. Seems like propagation of KeyboardInterrupt is somehow out of sync. sys.stdin.read(n) has the same issue. May be related to recently fixed http://bugs.python.org/issue17619 where was similar situation with input(). ---------- components: Windows messages: 193918 nosy: Drekin priority: normal severity: normal status: open title: On Windows sys.stdin.readline() doesn't handle Ctrl-C properly versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 30 12:30:44 2013 From: report at bugs.python.org (=?utf-8?b?THVrw6HFoSBOxJttZWM=?=) Date: Tue, 30 Jul 2013 10:30:44 +0000 Subject: [New-bugs-announce] [issue18598] Importlib, more verbosity please Message-ID: <1375180244.43.0.821767780261.issue18598@psf.upfronthosting.co.za> New submission from Luk?? N?mec: Hello, recently I filed this bugreport to Django, but they clarified this by pointing me to commits for new version of Django that uses python builtin importlib (import_module) But since most of their import_module code is done like [import_module(x) for y if blahblah], it is very difficult for me to debug code where Django tries to import some package, and all I get back is message "relative imports require the 'package' argument" This message tells me exactly nothing :), just that something somewhere, even 3rd party app tried to do relative imports ... what did it import, with what parameters? I edited this locally for debugging, and changed it to this: "relative imports require the 'package' argument, package: %s" % name This simple change of the message allowed me to find the problem in a few seconds.. Would you please consider adding something similar to importlib for better debugging? Thank you :) ---------- components: Library (Lib) messages: 193922 nosy: Luk??.N?mec priority: normal severity: normal status: open title: Importlib, more verbosity please type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 30 15:05:12 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 30 Jul 2013 13:05:12 +0000 Subject: [New-bugs-announce] [issue18599] _sha1module report "SHA" as its name Message-ID: <1375189512.2.0.0677739604762.issue18599@psf.upfronthosting.co.za> New submission from Christian Heimes: I found the issue while I was working on unit tests. It looks like a honest mistake ... :) PyUnicode_FromStringAndSize("SHA1", 3); ---------- files: sha1name.patch keywords: patch messages: 193930 nosy: christian.heimes, gregory.p.smith, pitrou priority: normal severity: normal stage: needs patch status: open title: _sha1module report "SHA" as its name type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file31086/sha1name.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 30 17:19:20 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 30 Jul 2013 15:19:20 +0000 Subject: [New-bugs-announce] [issue18600] email.policy doc example passes 'policy' to as_string, but that doesn't work Message-ID: <1375197560.98.0.336881142306.issue18600@psf.upfronthosting.co.za> New submission from R. David Murray: When I wrote those docs I intended to add a policy argument to as_string, but did not do it by the time 3.3 was released. The docs for 3.3 need to be corrected, and I need to decide if I do want to add that keyword to as_string in 3.4 (the answer is probably yes, but I may check with the email-sig first). ---------- assignee: docs at python components: Documentation, email messages: 193937 nosy: barry, docs at python, r.david.murray priority: normal severity: normal stage: needs patch status: open title: email.policy doc example passes 'policy' to as_string, but that doesn't work type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 30 21:07:26 2013 From: report at bugs.python.org (Stephen Paul Chappell) Date: Tue, 30 Jul 2013 19:07:26 +0000 Subject: [New-bugs-announce] [issue18601] Example "command-line interface to difflib" has typographical error Message-ID: <1375211246.29.0.527231910426.issue18601@psf.upfronthosting.co.za> New submission from Stephen Paul Chappell: The example at the bottom is good but has a line with a bad variable it is name. It says: with open(fromlines) as fromf, open(tofile) as tof: fromlines, tolines = list(fromf), list(tof) In the first line, fromlines does no even exist yet. should say: with open(fromlines) as fromf, open(tofile) as tof: from, tolines = list(fromf), list(tof) ---------- assignee: docs at python components: Demos and Tools, Documentation messages: 193948 nosy: Zero, docs at python priority: normal severity: normal status: open title: Example "command-line interface to difflib" has typographical error versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 30 21:57:47 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 30 Jul 2013 19:57:47 +0000 Subject: [New-bugs-announce] [issue18602] "_io" module names itself "io" Message-ID: <1375214267.87.0.837503153982.issue18602@psf.upfronthosting.co.za> New submission from Antoine Pitrou: In Modules/_io/_iomodule.c, the name field of the module struct is initialized to "io" rather than "_io". The change should intuitively be harmless, but perhaps there's a reason why it is like that? ---------- components: Library (Lib) messages: 193953 nosy: pitrou priority: low severity: normal status: open title: "_io" module names itself "io" type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 31 01:58:45 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 30 Jul 2013 23:58:45 +0000 Subject: [New-bugs-announce] [issue18603] PyOS_mystricmp unused and no longer available Message-ID: <1375228725.23.0.641374823001.issue18603@psf.upfronthosting.co.za> New submission from Christian Heimes: The two functions PyOS_strnicmp() and PyOS_stricmp() from Python/pystrcmp.c are no longer used by any function in the core. Because no module references any object from Python/pystrcmp.c the object file is not included in the Python binary: $ nm -P python | grep ^PyOS | sort PyOS_AfterFork T 000000000044040e 0000000000000036 PyOS_double_to_string T 00000000005da3de 0000000000000119 PyOS_FiniInterrupts T 0000000000440380 000000000000000b PyOS_getsig T 0000000000423994 0000000000000041 PyOS_InitInterrupts T 00000000004402f5 000000000000008b PyOS_InputHook B 000000000095d478 0000000000000008 PyOS_InterruptOccurred T 000000000044038b 000000000000003e PyOS_ReadlineFunctionPointer B 000000000095d5c8 0000000000000008 PyOS_Readline T 000000000063ffb5 000000000000012e PyOS_setsig T 00000000004239d5 0000000000000078 PyOS_snprintf T 000000000041c7bc 00000000000000b8 PyOS_StdioReadline T 000000000063fe1c 0000000000000199 PyOS_string_to_double T 00000000005d9b50 0000000000000146 PyOS_strtol T 00000000005d3ded 00000000000000d6 PyOS_strtoul T 00000000005d3a00 00000000000003ed PyOS_vsnprintf T 000000000041c874 00000000000000c4 Neither Python 2.7 nor 3.3+ include the functions in their binaries. 2.6 and 3.2 are not affected. The functions are part of the documented and stable API but apparently they are not used very often. ---------- keywords: 3.3regression messages: 193965 nosy: christian.heimes priority: normal severity: normal status: open title: PyOS_mystricmp unused and no longer available type: compile error versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 31 02:13:35 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 31 Jul 2013 00:13:35 +0000 Subject: [New-bugs-announce] [issue18604] Consolidate gui available checks in test.support Message-ID: <1375229615.82.0.560303267268.issue18604@psf.upfronthosting.co.za> New submission from Terry J. Reedy: Current situation: test.support.requires starts with if resource == 'gui' and not _is_gui_available(): On windows, _is_gui_available() uses ctypes to determine that there really is a graphics screen. On other systems, it just returns True, even when it should return False. The _is_gui_available check is repeated with each requires('gui') call even though all after the first would be redundant if False were somehow recorded. I think it should be. test/test_ttkguionly first tries to import _tkinter, as does test_idle, which initializes tcl/tk. It then calls tkinter.test.support.check_tk_availability. That either does a 'darwin'-ctypes check similar to the one for Windows in _is_gui_available (again to avoid a crash), or it tries to create a tk widget and looks for a TclError. Given that tcl has already been initialized successfully, the widget creation check is a gui-available check for non-Darwin systems. A global in tkinter.test.support records the result of the check so it is only run once. If 'gui' is in use_resources, test_idle just does the widget check for *nix gui availability. It records a negative result by removing 'gui' from use_resources. The tkinter system does not work for Idle because Idle tests use unittest test discovery instead of tkinter's custom test discovery. Given that, splitting test_idle into test_idle_text and test_idle_gui seems to not be possible. Anyway, if test_idle were to be split, categories like '_windows', '_dialogs', and '_extensions' would be much more sensible and useful. ---------------- For this issue, I propose: 1. Move the custom darwin gui check to test.support, after the custom windows gui check. It should be noted that a) Both of these are gui-framework independent; and b) Neither seems to be needed for any current buildbots (which makes it hard to verify that they work on current systems). However, they were needed in the past and might be again in the future, so each should be checked *once* in each regrtest run with 'gui' set. 2. If the crash-avoidance checks pass, run tkinter.Tk() as a final check on all systems (but especially those not covered by the first checks). But note in comments that this will have to change if tk is augmented or optionally replaced by another gui framework. 3. In requires(), run the above if 'gui' is set and requested, and record a negative result by unsetting 'gui' (removing it from use_resources). Perhaps output a note that this has been done. Subsequent gui requests will skip. I considered putting this logic in regrtest instead, but see 4. 4. Currently, requires never skips when the caller is the main module. Perhaps requires('gui') should skip even then when there is no gui system. This could happen if a no-gui system ran a console script with "python -m test.text_xxx". 5. Remove the current gui check from test_idle. Idle tests should continue to work as they are. 6. Revising test_tk and test_ttk_guionly to use the revised test.support would be a larger patch. It might best be done while modernizing the tkinter test system to use unittest discovery and .main, in another issue. I am still learning the details of the tkinter test system. ----- To avoid immediate controversy, I marked this as an 'enhancement' for 3.4. But if the Mac 'darwin' check were currently needed, I would consider it a bug that it is buried in a tkinter function whose API is not right for Idle, instead of being in test.support. (And in 2.7, the function is buried in a module in a package with an illegal name.) So I think backporting should be considered. ---------- messages: 193966 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: Consolidate gui available checks in test.support type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 31 09:03:02 2013 From: report at bugs.python.org (=?utf-8?q?Maciej_Blizi=C5=84ski?=) Date: Wed, 31 Jul 2013 07:03:02 +0000 Subject: [New-bugs-announce] [issue18605] 2.7: test_threading hangs on Solaris 9 Message-ID: <1375254182.2.0.923446047018.issue18605@psf.upfronthosting.co.za> New submission from Maciej Blizi?ski: Python version: 2.7.5 OS: Solaris 9 Architecture: sparc Looks similar to Issue5114 and Issue6643 but both are now closed. It seems specific to Solaris 9, I'm not seeing this issue on Solaris 10. The symptom is that test_threading hangs indefinitely (tested overnight) . When running pstack on the process, I'm seeing this: ----------------- lwp# 1 / thread# 1 -------------------- ff3dc734 lwp_park (0, 0, 0) ff3d3c74 s9_lwp_park (0, 0, 0, 1, feed4f48, 18f5a4) + 28 ff3dc698 s9_handler (0, 0, 0, 1, feed4f48, 18f5a4) + 90 ff1dea70 _sema_wait (0, feee66a0, fed6b054, feee6000, 2a298478, d1f20) + 1d4 ff1dec30 sema_wait (81aa8, ff1dec24, 722a5b4b, 1101c, feed4f48, 134d60) + c feed4f48 sem_wait (81aa8, 0, fed6b1ac, 0, 0, 1) + 20 ff050890 PyThread_acquire_lock (81aa8, 1, fed6b214, 2, 0, 1ae778) + 5c ff05524c lock_PyThread_acquire_lock (0, 22030, 0, 13ee40, 16a298, 55150) + 50 fefa779c PyCFunction_Call (1ae788, 22030, 0, ff0d8eb8, 55150, ff0551fc) + e4 ff016b14 PyEval_EvalFrameEx (18f5a0, 0, 0, d4f66, 16a298, 22030) + 5ee8 ff0185d0 PyEval_EvalCodeEx (12c968, 0, 18f5a0, 4, 1, 18f5a4) + 924 ff0168f8 PyEval_EvalFrameEx (1902b8, 0, 1, 1765c0, 16a298, 1b12d0) + 5ccc ff0185d0 PyEval_EvalCodeEx (13f608, 0, 1902b8, 4, 1, 1902bc) + 924 ff0168f8 PyEval_EvalFrameEx (154748, 0, 1, 31f7f, 16a298, 1b1250) + 5ccc ff0185d0 PyEval_EvalCodeEx (10d650, 54a50, 154748, 2203c, 0, 2203c) + 924 fef8e11c function_call (22038, 22030, 1386f0, 2203c, 130730, 22030) + 168 fef604e8 PyObject_Call (130730, 22030, 1386f0, ff0e0340, fef8dfb4, 0) + 60 ff0137dc PyEval_EvalFrameEx (169110, 0, 22030, 10e62d, 16a298, 22030) + 2bb0 ff017478 PyEval_EvalFrameEx (168f80, 0, 169114, 1769fa, 16a298, 16a298) + 684c ff017478 PyEval_EvalFrameEx (176cb0, 0, 168f84, 12a2c0, 16a298, 16a298) + 684c ff0185d0 PyEval_EvalCodeEx (13f410, 176cb4, 176cb0, 13433c, 1, 0) + 924 fef8e040 function_call (1b26f0, 134330, 0, ff1bc000, 1b26f0, 0) + 8c fef604e8 PyObject_Call (1b26f0, 134330, 0, ff0e0340, fef8dfb4, 134320) + 60 fef6e530 instancemethod_call (0, 134330, 0, 0, 1b26f0, 134bd0) + a4 fef604e8 PyObject_Call (c3b48, 22030, 0, ff0e0340, fef6e48c, 0) + 60 ff01051c PyEval_CallObjectWithKeywords (c3b48, 22030, 0, 0, 0, 0) + 68 ff05568c t_bootstrap (63bd0, 0, 0, 0, 16a298, ff0e2804) + 4c ff1e53a4 _lwp_start (0, 0, 0, 0, 0, 0) ----------------- lwp# 2 / thread# 2 -------------------- ff3dc734 lwp_park (0, 0, 0) ff3d3c74 s9_lwp_park (0, 0, 0, 1, b64a0d58, 136818) + 28 ff3dc698 s9_handler (0, 0, 0, 1, b64a0d58, 136818) + 90 ff1dea70 _sema_wait (0, feee66a0, fec6b054, feee6000, 2a298478, d1f20) + 1d4 ff1dec30 sema_wait (8ab00, ff1dec24, 722a5b4b, 1101c, feed4f48, 134d60) + c feed4f48 sem_wait (8ab00, 0, fec6b1ac, 0, 0, 1) + 20 ff050890 PyThread_acquire_lock (8ab00, 1, fec6b214, 2, 0, 1ae610) + 5c ff05524c lock_PyThread_acquire_lock (0, 22030, 0, 13ee40, 156168, 55160) + 50 fefa779c PyCFunction_Call (1ae620, 22030, 0, ff0d8eb8, 55160, ff0551fc) + e4 ff016b14 PyEval_EvalFrameEx (18fe60, 0, 0, d4f66, 156168, 22030) + 5ee8 ff0185d0 PyEval_EvalCodeEx (12c968, 0, 18fe60, 4, 1, 18fe64) + 924 ff0168f8 PyEval_EvalFrameEx (18fce8, 0, 1, 1765c0, 156168, 1b11b0) + 5ccc ff0185d0 PyEval_EvalCodeEx (13f608, 0, 18fce8, 4, 1, 18fcec) + 924 ff0168f8 PyEval_EvalFrameEx (18fb88, 0, 1, 136155, 156168, 1a2930) + 5ccc ff0185d0 PyEval_EvalCodeEx (48b60, 18fb8c, 18fb88, 19d41c, 1, 2203c) + 924 fef8e11c function_call (22038, 19d410, 1b3c00, 2203c, 130370, 22030) + 168 fef604e8 PyObject_Call (130370, 19d410, 1b3c00, ff0e0340, fef8dfb4, 19d400) + 60 ff0137dc PyEval_EvalFrameEx (18fa20, 0, 19d410, 10e62d, 156168, 134950) + 2bb0 ff017478 PyEval_EvalFrameEx (18f890, 0, 18fa24, 1769fa, 156168, 156168) + 684c ff017478 PyEval_EvalFrameEx (18f728, 0, 18f894, 12a2c0, 156168, 156168) + 684c ff0185d0 PyEval_EvalCodeEx (13f410, 18f72c, 18f728, 19d3fc, 1, 0) + 924 fef8e040 function_call (1b26f0, 19d3f0, 0, ff1bc000, 1b26f0, 0) + 8c fef604e8 PyObject_Call (1b26f0, 19d3f0, 0, ff0e0340, fef8dfb4, 19d3e0) + 60 fef6e530 instancemethod_call (0, 19d3f0, 0, 0, 1b26f0, 1b1250) + a4 fef604e8 PyObject_Call (1aeaf8, 22030, 0, ff0e0340, fef6e48c, 0) + 60 ff01051c PyEval_CallObjectWithKeywords (1aeaf8, 22030, 0, 0, 0, 0) + 68 ff05568c t_bootstrap (63c30, 0, 0, 0, 156168, ff0e2804) + 4c ff1e53a4 _lwp_start (0, 0, 0, 0, 0, 0) ---------- components: Tests messages: 193978 nosy: automatthias priority: normal severity: normal status: open title: 2.7: test_threading hangs on Solaris 9 type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 31 10:20:20 2013 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 31 Jul 2013 08:20:20 +0000 Subject: [New-bugs-announce] [issue18606] Add statistics module to standard library Message-ID: <1375258820.22.0.0684222529612.issue18606@psf.upfronthosting.co.za> New submission from Steven D'Aprano: I proposed adding a statistics module to the standard library some time ago, and received some encouragement: http://mail.python.org/pipermail/python-ideas/2011-September/011524.html Real life intervened, plus a bad case of over-engineering, but over the last few weeks I have culled my earlier (private) attempt down to manageable size. I would like to propose the attached module for the standard library. I also have a set of unit-tests for this module. At the moment it covers about 30-40% of the functions in the module, but I should be able to supply unit tests for the remaining functions over the next few days. ---------- components: Library (Lib) files: statistics.py messages: 193988 nosy: stevenjd priority: normal severity: normal status: open title: Add statistics module to standard library type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31097/statistics.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 31 21:41:06 2013 From: report at bugs.python.org (Andres Adjimann) Date: Wed, 31 Jul 2013 19:41:06 +0000 Subject: [New-bugs-announce] [issue18607] struct.unpack Message-ID: <1375299666.6.0.0308363021993.issue18607@psf.upfronthosting.co.za> New submission from Andres Adjimann: There is something wrong with struct.unpack. import struct print struct.calcsize('BBBBBHB') 8 print struct.calcsize('BBBBBHB') 9 ---------- messages: 194009 nosy: Andres.Adjimann priority: normal severity: normal status: open title: struct.unpack type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 31 23:20:31 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 31 Jul 2013 21:20:31 +0000 Subject: [New-bugs-announce] [issue18608] Avoid keeping a strong reference to locale in the _io module Message-ID: <1375305631.67.0.684843179592.issue18608@psf.upfronthosting.co.za> New submission from Antoine Pitrou: Keeping a strong reference to locale in _io prevents several modules from being collected before being wiped at shutdown. Attached patch stores a weakref instead. ---------- components: Library (Lib) files: io_locale_ref.patch keywords: patch messages: 194023 nosy: amaury.forgeotdarc, benjamin.peterson, pitrou priority: normal severity: normal stage: patch review status: open title: Avoid keeping a strong reference to locale in the _io module type: resource usage versions: Python 3.4 Added file: http://bugs.python.org/file31103/io_locale_ref.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 31 23:24:37 2013 From: report at bugs.python.org (David Edelsohn) Date: Wed, 31 Jul 2013 21:24:37 +0000 Subject: [New-bugs-announce] [issue18609] test_ctypes failure on AIX in PyEval_CallObjectWithKeywords Message-ID: <1375305877.13.0.891928742401.issue18609@psf.upfronthosting.co.za> New submission from David Edelsohn: test_ctypes now crashes on AIX after the ceval change to PyEval_CallObjectWithKeywords to check PyErr_Occurred(). #5 0x100ff0c8 in PyEval_CallObjectWithKeywords (func=0x300a4c3c, arg=0x3062bb24, kw=0x0) at Python/ceval.c:4066 #6 0x10166bfc in PyCodec_Decode (object=0x305d5834, encoding=0x200a0b80 "iso8859-1", errors=0x102dd0b4 "surrogateescape") at Python/codecs.c:403 #7 0x1006d500 in PyUnicode_Decode ( s=0xdb1c8234 <_GLOBAL__FD__ctypes_so+8356> "_ctypes/callbacks.c", size=19, encoding=0x200a0b80 "iso8859-1", errors=0x102dd0b4 "surrogateescape") at Objects/unicodeobject.c:3045 #8 0x1006f208 in PyUnicode_DecodeFSDefaultAndSize ( s=0xdb1c8234 <_GLOBAL__FD__ctypes_so+8356> "_ctypes/callbacks.c", size=19) at Objects/unicodeobject.c:3640 #9 0x1006f150 in PyUnicode_DecodeFSDefault ( s=0xdb1c8234 <_GLOBAL__FD__ctypes_so+8356> "_ctypes/callbacks.c") at Objects/unicodeobject.c:3618 #10 0x1017b870 in PyCode_NewEmpty ( filename=0xdb1c8234 <_GLOBAL__FD__ctypes_so+8356> "_ctypes/callbacks.c", funcname=0xdb1c8218 <_GLOBAL__FD__ctypes_so+8328> "'calling callback function'", firstlineno=260) at Objects/codeobject.c:174 #11 0xdb1c3960 in _ctypes_add_traceback ( funcname=0xdb1c8218 <_GLOBAL__FD__ctypes_so+8328> "'calling callback function'", filename=0xdb1c8234 <_GLOBAL__FD__ctypes_so+8356> "_ctypes/callbacks.c", lineno=260) at /home/dje/src/cpython/Modules/_ctypes/callbacks.c:104 #12 0xdb1c4204 in _CallPythonObject (mem=0x2ff144d8, restype=0x303a1ddc, setfunc=@0x20365824: 0xdb1bbfd4 , callable=0x3055b454, converters=0x30628e6c, flags=257, pArgs=0x2ff14444) at /home/dje/src/cpython/Modules/_ctypes/callbacks.c:261 #13 0xdb1c4690 in closure_fcn (cif=0x30528de8, resp=0x2ff144d8, args=0x2ff14440, userdata=0x30528dcc) at /home/dje/src/cpython/Modules/_ctypes/callbacks.c:322 #14 0xdb1c2a90 in ffi_closure_helper_DARWIN (closure=0x20367008, rvalue=0x2ff144d8, pgr=0x2ff14570, pfr=0x2ff144f0) at /home/dje/src/cpython/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c:1355 #15 0xdb1c2c80 in ffi_closure_ASM () from /home/dje/src/cpython/build/lib.aix-7.1-3.4-pydebug/_ctypes.so #16 0xdb1c2ba0 in ffi_call_AIX () from /home/dje/src/cpython/build/lib.aix-7.1-3.4-pydebug/_ctypes.so #17 0xdb1c231c in ffi_call (cif=0x2ff146b8, fn=0x20367008, rvalue=0x2ff14770, avalue=0x2ff14750) at /home/dje/src/cpython/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c:936 #18 0xdb1a3a68 in _call_function_pointer (flags=4353, pProc=0x20367008, avalues=0x2ff14750, atypes=0x2ff14730, restype=0x303a1ddc, resmem=0x2ff14770, argcount=1) at /home/dje/src/cpython/Modules/_ctypes/callproc.c:811 #19 0xdb1a47c4 in _ctypes_callproc (pProc=0x20367008, argtuple=0x3062be6c, flags=4353, argtypes=0x3062b99c, restype=0x304735a4, checker=0x0) at /home/dje/src/cpython/Modules/_ctypes/callproc.c:1152 #20 0xdb19da70 in PyCFuncPtr_call (self=0x3061e9c4, inargs=0x3062be6c, kwds=0x3062bd1c) at /home/dje/src/cpython/Modules/_ctypes/_ctypes.c:3820 #21 0x1010b85c in PyObject_Call (func=0x3061e9c4, arg=0x3062be6c, kw=0x3062bd1c) at Objects/abstract.c:2105 #22 0x10101778 in ext_do_call (func=0x3061e9c4, pp_stack=0x2ff15154, flags=3, na=0, nk=0) at Python/ceval.c:4537 #23 0x100f8464 in PyEval_EvalFrameEx (f=0x305e5bcc, throwflag=0) at Python/ceval.c:2858 #24 0x100fca84 in PyEval_EvalCodeEx (_co=0x3055a980, globals=0x30554d1c, locals=0x0, args=0x3062c300, argcount=3, kws=0x3062c30c, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3567 #25 0x101004d4 in fast_function (func=0x3055b514, pp_stack=0x2ff15bb0, n=3, na=3, nk=0) at Python/ceval.c:4320 ---------- components: Interpreter Core messages: 194024 nosy: David.Edelsohn priority: normal severity: normal status: open title: test_ctypes failure on AIX in PyEval_CallObjectWithKeywords type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________