From report at bugs.python.org Fri Mar 1 00:31:56 2013 From: report at bugs.python.org (Dan) Date: Thu, 28 Feb 2013 23:31:56 +0000 Subject: [issue12641] Remove -mno-cygwin from distutils In-Reply-To: <1311699751.35.0.569127767575.issue12641@psf.upfronthosting.co.za> Message-ID: <1362094316.55.0.766466520182.issue12641@psf.upfronthosting.co.za> Dan added the comment: There's an additional aspect. Even though I don't use Windows as a development platform, I care about being able to propose Python to clients as a cross-platform technology (instead of, say, Java). Having an essential piece of Python infrastructure fail miserably on Windows impacts Python's appeal / credentials. To clarify another point, I think that Python should pick and support an "official" package manager (be it distutils, pip or whatever) not eventually, but ASAP. For the time being it looks like distutils is a keystone, therefore it needs to work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 01:19:10 2013 From: report at bugs.python.org (Jon) Date: Fri, 01 Mar 2013 00:19:10 +0000 Subject: [issue12641] Remove -mno-cygwin from distutils In-Reply-To: <1311699751.35.0.569127767575.issue12641@psf.upfronthosting.co.za> Message-ID: <1362097149.99.0.311822883751.issue12641@psf.upfronthosting.co.za> Jon added the comment: Eric, I'm assuming you are the key decision maker for any fix. As I want to see this issue stay razor focused, where specifically do you need community help? Depending upon your needs, I can test on my win7 32bit notebook with official python 2.7.3. It also has arch 3.7.9 and ubuntu server 12.10 virtualbox vm's. I don't build python from source with mingw and my win8 64bit box isn't ready yet. The win7 box has mingw gcc 4.6.2 32bit and mingw-w64 32bit toolchains, both of which have msys and autohell goodies. I'm swamped these days but will carve out time from somewhere. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 03:43:18 2013 From: report at bugs.python.org (karl) Date: Fri, 01 Mar 2013 02:43:18 +0000 Subject: [issue747320] rfc2822 formatdate functionality duplication Message-ID: <1362105798.07.0.631565887067.issue747320@psf.upfronthosting.co.za> karl added the comment: R. David Murray: Sure. Is it better? issue-747320-1.patch It seems there are already tests for gmt date format in Lib/test/test_email/test_utils.py ---------- Added file: http://bugs.python.org/file29279/issue-747320-1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 08:27:09 2013 From: report at bugs.python.org (Aman Shah) Date: Fri, 01 Mar 2013 07:27:09 +0000 Subject: [issue17299] Test cPickle with real files In-Reply-To: <1361867979.39.0.619834075084.issue17299@psf.upfronthosting.co.za> Message-ID: <1362122829.58.0.478016783742.issue17299@psf.upfronthosting.co.za> Aman Shah added the comment: I had put in the renaming because "ioclass" is not defined in the class itself, only in the subclasses. So, instantiating it and using dumps/loads would be meaningless and would raise an error. Which is similar to the behavior of an abstract class. Also, the "if(self.f):" part can be improved as you said and I looked at the patch for other similar mistakes. But, it's an isolated mistake (at lines 33 and 74) and so maybe it can be fixed during the merge itself? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 09:16:09 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 08:16:09 +0000 Subject: [issue17323] Disable [X refs, Y blocks] ouput in debug builds Message-ID: <1362125769.07.0.506127363333.issue17323@psf.upfronthosting.co.za> New submission from Ezio Melotti: I suggest to disable the [X refs, Y blocks] ouput in debug builds by default, and provide an option to enable it if/when necessary. Most of the time these values are not necessary, and they end up getting in the way while copy/pasting code from the interpreter and/or running tests (we even have a function in test.support to get rid of them). They are sometimes useful while investigating refleaks, so there should still be an option to enable it. I'm not sure what would be the best way to do it (a new python flag?). ---------- components: Interpreter Core messages: 183244 nosy: ezio.melotti priority: normal severity: normal stage: needs patch status: open title: Disable [X refs, Y blocks] ouput in debug builds type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 09:47:20 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 08:47:20 +0000 Subject: [issue11955] 3.3 : test_argparse.py fails 'make test' In-Reply-To: <1304093741.94.0.09129303291.issue11955@psf.upfronthosting.co.za> Message-ID: <1362127640.56.0.976561682507.issue11955@psf.upfronthosting.co.za> Ezio Melotti added the comment: The attached patch adds the list of args to the output of assertRaises in case of error, e.g.: FAIL: test_failures_one_group_sysargs (test.test_argparse.TestPositionalsNargsZeroOrMoreNone) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/wolf/dev/py/3.3/Lib/test/test_argparse.py", line 216, in wrapper test_func(self) File "/home/wolf/dev/py/3.3/Lib/test/test_argparse.py", line 236, in test_failures parser.parse_args(args) AssertionError: ArgumentParserError not raised : ['foo', 'bar'] ---------- keywords: +patch nosy: +ezio.melotti stage: -> patch review versions: +Python 3.4 Added file: http://bugs.python.org/file29280/issue11955.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 09:50:55 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 08:50:55 +0000 Subject: [issue14468] Update cloning guidelines in devguide In-Reply-To: <1333296467.92.0.464102844472.issue14468@psf.upfronthosting.co.za> Message-ID: <1362127855.82.0.60396861015.issue14468@psf.upfronthosting.co.za> Ezio Melotti added the comment: Yes, it should be added back in the FAQs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 09:54:06 2013 From: report at bugs.python.org (Larry Hastings) Date: Fri, 01 Mar 2013 08:54:06 +0000 Subject: [issue17324] SimpleHTTPServer serves files even if the URL has a trailing slash Message-ID: <1362128046.23.0.253565985522.issue17324@psf.upfronthosting.co.za> New submission from Larry Hastings: To reproduce: 1) Create a file called "foo.txt" in the local directory, put whatever you like in it. 2) Run "python -m SimpleHTTPServer" or "python3 -m http.server". 3) Point your web browser at "http://127.0.0.1:8000/foo.txt/". 4) Note that the server has served the contents of "foo.txt" as "foo.txt/". It shouldn't do that! Reproduced with 2.7.3, 3.2.3, and 3.3.0. I assume it's still there in trunk. ---------- components: Library (Lib) keywords: easy messages: 183247 nosy: larry priority: low severity: normal status: open title: SimpleHTTPServer serves files even if the URL has a trailing slash versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 09:54:33 2013 From: report at bugs.python.org (Larry Hastings) Date: Fri, 01 Mar 2013 08:54:33 +0000 Subject: [issue17324] SimpleHTTPServer serves files even if the URL has a trailing slash In-Reply-To: <1362128046.23.0.253565985522.issue17324@psf.upfronthosting.co.za> Message-ID: <1362128073.36.0.36978210091.issue17324@psf.upfronthosting.co.za> Changes by Larry Hastings : ---------- stage: -> test needed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 09:56:54 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 01 Mar 2013 08:56:54 +0000 Subject: [issue17079] Fix test discovery for test_ctypes.py In-Reply-To: <1362001721.85.0.416982491929.issue17079@psf.upfronthosting.co.za> Message-ID: <3ZHPdK2GZVzRhN@mail.python.org> Roundup Robot added the comment: New changeset 42d4a29509c4 by Ezio Melotti in branch '3.3': #17079: test_ctypes now works with unittest test discovery. Patch by Zachary Ware. http://hg.python.org/cpython/rev/42d4a29509c4 New changeset e222f24837dd by Ezio Melotti in branch 'default': #17079: merge with 3.3. http://hg.python.org/cpython/rev/e222f24837dd ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 09:57:37 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 08:57:37 +0000 Subject: [issue17079] Fix test discovery for test_ctypes.py In-Reply-To: <1362001721.85.0.416982491929.issue17079@psf.upfronthosting.co.za> Message-ID: <1362128257.56.0.692063683564.issue17079@psf.upfronthosting.co.za> Ezio Melotti added the comment: Fixed, thanks for the patch! ---------- assignee: -> ezio.melotti resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 10:24:59 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 01 Mar 2013 09:24:59 +0000 Subject: [issue17082] Fix test discovery for test_dbm*.py In-Reply-To: <1359568677.42.0.42152696128.issue17082@psf.upfronthosting.co.za> Message-ID: <3ZHQFl07G9zRyg@mail.python.org> Roundup Robot added the comment: New changeset b62317fe1a22 by Ezio Melotti in branch '3.3': #17082: test_dbm* now work with unittest test discovery. Patch by Zachary Ware. http://hg.python.org/cpython/rev/b62317fe1a22 New changeset e35c053cc4ec by Ezio Melotti in branch 'default': #17082: merge with 3.3. http://hg.python.org/cpython/rev/e35c053cc4ec ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 10:26:17 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 09:26:17 +0000 Subject: [issue17082] Fix test discovery for test_dbm*.py In-Reply-To: <1359568677.42.0.42152696128.issue17082@psf.upfronthosting.co.za> Message-ID: <1362129977.75.0.827117881688.issue17082@psf.upfronthosting.co.za> Ezio Melotti added the comment: Fixed, thanks for the patch! There are still two "failures", but they will be addressed in #16935. ---------- assignee: -> ezio.melotti resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 10:51:32 2013 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 01 Mar 2013 09:51:32 +0000 Subject: [issue17325] improve organization of the PyPI distutils docs Message-ID: <1362131491.68.0.398716399036.issue17325@psf.upfronthosting.co.za> New submission from Chris Jerdonek: This issue is to improve the organization of the PyPI section of the Distutils documentation, now that the information has been combined into one page. A patch is attached. Improvements include: (1) Creating a section for command options common to both register and upload. Previously, this information was confined to the upload section, even though the information was applicable to both commands. (2) Separating general information about PyPI (e.g. PyPI user permissions and the web interface) from the information about Distutils command usage. (3) Consolidating information about the .pypirc file in the .pypirc section. Previously, some of the .pypirc information was spread throughout the upload section, even though the information is equally applicable to the register command. ---------- assignee: eric.araujo components: Distutils, Documentation files: issue-pypi-docs.patch keywords: patch messages: 183252 nosy: chris.jerdonek, eric.araujo, tarek priority: normal severity: normal stage: patch review status: open title: improve organization of the PyPI distutils docs type: enhancement versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file29281/issue-pypi-docs.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 11:08:41 2013 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 01 Mar 2013 10:08:41 +0000 Subject: [issue17323] Disable [X refs, Y blocks] ouput in debug builds In-Reply-To: <1362125769.07.0.506127363333.issue17323@psf.upfronthosting.co.za> Message-ID: <1362132521.4.0.0211563019649.issue17323@psf.upfronthosting.co.za> Chris Jerdonek added the comment: The "refs" output also complicates testing in some cases, e.g. http://hg.python.org/cpython/file/bc4458493024/Lib/test/test_subprocess.py#l61 http://hg.python.org/cpython/file/bc4458493024/Lib/test/test_subprocess.py#l786 ---------- nosy: +chris.jerdonek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 12:29:09 2013 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 01 Mar 2013 11:29:09 +0000 Subject: [issue17288] cannot jump from a return after setting f_lineno In-Reply-To: <1361726813.15.0.719765769531.issue17288@psf.upfronthosting.co.za> Message-ID: <1362137349.08.0.649996532446.issue17288@psf.upfronthosting.co.za> Xavier de Gaye added the comment: Nosying Benjamin Peterson who knows frame_setlineno (issue 14612) and nosying Jes?s Cea Avi?n. Hoping they don't mind. This problem occurs also when setting f_lineno from an exception debug event. One may crash the interpreter (or get a "SystemError: unknown opcode") when the return debug event is one that handles a yield statement. For example the following test causes a segmentation fault on python 3.3.0: $ python /tmp/jump.py > /tmp/jump.py(7)() -> for i in gen(): (Pdb) step --Call-- > /tmp/jump.py(1)gen() -> def gen(): (Pdb) step > /tmp/jump.py(2)gen() -> for i in range(1): (Pdb) step > /tmp/jump.py(3)gen() -> yield i (Pdb) step --Return-- > /tmp/jump.py(3)gen()->0 -> yield i (Pdb) jump 2 > /tmp/jump.py(2)gen()->0 -> for i in range(1): (Pdb) step > /tmp/jump.py(8)() -> lineno = 8 (Pdb) step > /tmp/jump.py(7)() -> for i in gen(): (Pdb) step --Call-- > /tmp/jump.py(2)gen()->0 -> for i in range(1): (Pdb) step Segmentation fault ---------- nosy: +benjamin.peterson, jcea Added file: http://bugs.python.org/file29282/jump.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 12:43:08 2013 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 01 Mar 2013 11:43:08 +0000 Subject: [issue17288] cannot jump from a return after setting f_lineno In-Reply-To: <1361726813.15.0.719765769531.issue17288@psf.upfronthosting.co.za> Message-ID: <1362138188.46.0.814288833605.issue17288@psf.upfronthosting.co.za> Xavier de Gaye added the comment: The proposed patch fixes the problem: * f_lineno cannot be set now from an exception trace function or from a return trace function. * The broken arithmetic involving a null pointer (f->f_stacktop, at the end of frame_setlineno when popping blocks that are being jumped from and the function is invoked from an exception trace function or a return trace function), is fixed now. * Blocks cannot be popped now in frame_setlineno (the cause of the crash) when tracing a yield. To summarize the proposed fixes on f_lineno accessors: * setter: f_lineno can only be set in the frame that is being traced (issue 17277) and from within a line trace function (current issue). * getter: f_lineno is valid in the frame being traced (issue 17277) and: + not from within a call trace function (i.e. when f->f_trace == NULL) + from within a line trace function + and from within an exception or return trace function. There is a corner case here when returning to a frame that was not being traced previously (its f_lineno is not valid) and that has had its local trace function f_trace set from within a trace function in one of its callees (the fix of issue 13183 does that) and when the first trace function invoked on returning to that frame is an exception or a return trace function: this is correctly handled by the f_trace setter that makes sure that f_lineno is accurate when setting f_trace (and an extension module implementing tracing, must ensure that f_lineno is accurate when setting f_trace). ---------- keywords: +patch Added file: http://bugs.python.org/file29283/default.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 13:48:08 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 01 Mar 2013 12:48:08 +0000 Subject: [issue16935] unittest should understand SkipTest at import time during test discovery In-Reply-To: <1357915388.69.0.583817209092.issue16935@psf.upfronthosting.co.za> Message-ID: <3ZHVm74kbRzSwM@mail.python.org> Roundup Robot added the comment: New changeset 61ce6deb4577 by Ezio Melotti in branch 'default': #16935: unittest now counts the module as skipped if it raises SkipTest, instead of counting it as an error. Patch by Zachary Ware. http://hg.python.org/cpython/rev/61ce6deb4577 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 13:49:23 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 12:49:23 +0000 Subject: [issue16935] unittest should understand SkipTest at import time during test discovery In-Reply-To: <1357915388.69.0.583817209092.issue16935@psf.upfronthosting.co.za> Message-ID: <1362142163.48.0.870390262742.issue16935@psf.upfronthosting.co.za> Ezio Melotti added the comment: Applied, thanks for the patch! SkipTest should probably be documented, but that's a separate issue :) ---------- assignee: michael.foord -> ezio.melotti keywords: -gsoc resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 13:54:47 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 01 Mar 2013 12:54:47 +0000 Subject: [issue16935] unittest should understand SkipTest at import time during test discovery In-Reply-To: <1357915388.69.0.583817209092.issue16935@psf.upfronthosting.co.za> Message-ID: <3ZHVvm0nt0zRJy@mail.python.org> Roundup Robot added the comment: New changeset 22b6b59c70e6 by Ezio Melotti in branch 'default': #16935: update test_crypt now that unittest discover understands SkipTest. http://hg.python.org/cpython/rev/22b6b59c70e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 13:58:25 2013 From: report at bugs.python.org (Christoph Zwerschke) Date: Fri, 01 Mar 2013 12:58:25 +0000 Subject: [issue17326] Windows build docs still referring to VS 2008 in 3.3 Message-ID: <1362142705.89.0.367756520949.issue17326@psf.upfronthosting.co.za> New submission from Christoph Zwerschke: The first paragraph in PCbuild/readme.txt of Python 3.3 still talks about Visual C++ 2008 Express and Visual Studio 2008. It says that VS 2008 is required at the very least (which may be still true, I'm not sure), but then it also says "the official Python releases are built with this [i.e. the 2008] version of VS", while it seems they have been built with VS 2010 in reality (as the title is also indicating). ---------- assignee: docs at python components: Documentation messages: 183259 nosy: cito, docs at python priority: normal severity: normal status: open title: Windows build docs still referring to VS 2008 in 3.3 type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 14:00:17 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 13:00:17 +0000 Subject: [issue17326] Windows build docs still referring to VS 2008 in 3.3 In-Reply-To: <1362142705.89.0.367756520949.issue17326@psf.upfronthosting.co.za> Message-ID: <1362142817.74.0.48252067154.issue17326@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +brian.curtin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 14:45:55 2013 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 01 Mar 2013 13:45:55 +0000 Subject: [issue17327] Add PyDict_GetItemSetDefault() as C-API for dict.setdefault() Message-ID: <1362145555.76.0.784733003054.issue17327@psf.upfronthosting.co.za> New submission from Stefan Behnel: The functionality of dict.setdefault() is not currently available through the C-API. Specfically, there is no way to test for a key and insert a fallback value for it without evaluating the hash function twice. The attached patch adds a new C-API function PyDict_GetItemSetDefault() that makes this feature available. Like all PyDict_Getitem*() functions, it returns a borrowed reference. I hope I got the update in refcounts.dat right. I have no idea how to express that a function *may* increase the refcounts of its arguments. ---------- components: Interpreter Core files: pydict_setitemdefault.patch keywords: patch messages: 183260 nosy: scoder priority: normal severity: normal status: open title: Add PyDict_GetItemSetDefault() as C-API for dict.setdefault() type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file29284/pydict_setitemdefault.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 15:03:53 2013 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 01 Mar 2013 14:03:53 +0000 Subject: [issue17328] Fix reference leak in dict_setdefault() in case of resize failure Message-ID: <1362146633.78.0.0455037271826.issue17328@psf.upfronthosting.co.za> New submission from Stefan Behnel: While writing the patch for issue 17327, I noticed that there is a double reference leak in dict_setdefault() under the rare condition that resizing fails. I'm not 100% sure that it's ok to move the increfs behind the resizing, but considering that the resizing code actually looks safe and shouldn't kill references that are currently in the dict, I don't think it can be a problem. And the caller should always own a reference to these two anyway. Alternatively, decrefing them if the failure occurs would be a less intrusive change. ---------- components: Interpreter Core files: dict_setdefault_refleak.patch keywords: patch messages: 183261 nosy: scoder priority: normal severity: normal status: open title: Fix reference leak in dict_setdefault() in case of resize failure type: resource usage versions: Python 2.6, Python 2.7, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file29285/dict_setdefault_refleak.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 16:04:33 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 01 Mar 2013 15:04:33 +0000 Subject: [issue17329] Document unittest.SkipTest Message-ID: <1362150273.59.0.386989863107.issue17329@psf.upfronthosting.co.za> New submission from Brett Cannon: ---------- assignee: docs at python components: Documentation messages: 183262 nosy: brett.cannon, docs at python, ezio.melotti, michael.foord, zach.ware priority: normal severity: normal stage: needs patch status: open title: Document unittest.SkipTest versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 16:16:29 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 01 Mar 2013 15:16:29 +0000 Subject: [issue17324] SimpleHTTPServer serves files even if the URL has a trailing slash In-Reply-To: <1362128046.23.0.253565985522.issue17324@psf.upfronthosting.co.za> Message-ID: <1362150989.54.0.584773667505.issue17324@psf.upfronthosting.co.za> Senthil Kumaran added the comment: I thought this was fixed (recently). Shall look again. Having the tests is the only hard part here. ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 16:23:51 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 01 Mar 2013 15:23:51 +0000 Subject: [issue17288] cannot jump from a return after setting f_lineno In-Reply-To: <1361726813.15.0.719765769531.issue17288@psf.upfronthosting.co.za> Message-ID: <1362151431.76.0.409169670679.issue17288@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 17:17:57 2013 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 01 Mar 2013 16:17:57 +0000 Subject: [issue17288] cannot jump from a return after setting f_lineno In-Reply-To: <1361726813.15.0.719765769531.issue17288@psf.upfronthosting.co.za> Message-ID: <1362154677.75.0.112332850444.issue17288@psf.upfronthosting.co.za> Xavier de Gaye added the comment: Must add for completeness that f_lineno must be valid within a return trace function for the reasons explained in the last paragraph of Objects/lnotab_notes.txt. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 17:28:02 2013 From: report at bugs.python.org (=?utf-8?q?C=C3=A9dric_de_Saint_Martin?=) Date: Fri, 01 Mar 2013 16:28:02 +0000 Subject: [issue15795] Zipfile.extractall does not preserve file permissions In-Reply-To: <1346106964.12.0.723201722432.issue15795@psf.upfronthosting.co.za> Message-ID: <1362155282.69.0.609738616372.issue15795@psf.upfronthosting.co.za> Changes by C?dric de Saint Martin : ---------- nosy: +desaintmartin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 18:59:46 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 17:59:46 +0000 Subject: [issue17298] Twisted test failure triggered by change in 2.7 branch In-Reply-To: <1361831094.62.0.865591087681.issue17298@psf.upfronthosting.co.za> Message-ID: <1362160786.83.0.643620496766.issue17298@psf.upfronthosting.co.za> Ezio Melotti added the comment: That buildbot seems to be green again: https://buildbot.twistedmatrix.com/builders/lucid32-py2.7maint/builds/2359/ Glyph, can you confirm that the problem has been fixed and that this issue can be closed? ---------- nosy: +ezio.melotti status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 19:30:50 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 18:30:50 +0000 Subject: [issue17315] test_posixpath doesn't clean up after itself In-Reply-To: <1361995121.83.0.653056148204.issue17315@psf.upfronthosting.co.za> Message-ID: <1362162650.03.0.337377575246.issue17315@psf.upfronthosting.co.za> Ezio Melotti added the comment: On Linux it looks OK. Does it always happen? Where is the file located? ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 19:31:48 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 18:31:48 +0000 Subject: [issue17312] test_aifc doesn't clean up after itself In-Reply-To: <1361993994.98.0.627362156743.issue17312@psf.upfronthosting.co.za> Message-ID: <1362162708.6.0.121157062861.issue17312@psf.upfronthosting.co.za> Ezio Melotti added the comment: On Linux it looks OK. Does it always happen? Where is the file located? ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 19:35:31 2013 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 01 Mar 2013 18:35:31 +0000 Subject: [issue17281] Broken links at pypi In-Reply-To: <1361630635.92.0.90935154891.issue17281@psf.upfronthosting.co.za> Message-ID: <1362162931.39.0.0346719172639.issue17281@psf.upfronthosting.co.za> ?ric Araujo added the comment: First link is broken because the distutils2 project in its current form is stopped and the doc is nowhere. (Obsolete versions can be found in a few places :/) Second link is broken due to Python wiki config changes. I will update the PyPI metadata to explain the status of distutils2 and its successors. Thanks for the report. ---------- 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 Fri Mar 1 19:37:16 2013 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 01 Mar 2013 18:37:16 +0000 Subject: [issue17315] test_posixpath doesn't clean up after itself In-Reply-To: <1361995121.83.0.653056148204.issue17315@psf.upfronthosting.co.za> Message-ID: <1362163036.41.0.194771741285.issue17315@psf.upfronthosting.co.za> Chris Jerdonek added the comment: The file gets created in the current working directory. You won't see it when using regrtest since regrtest creates and then deletes a temp working directory. To see it easier, try running instead: ./python.exe -m unittest test.test_posixpath ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 19:38:11 2013 From: report at bugs.python.org (Erik Bray) Date: Fri, 01 Mar 2013 18:38:11 +0000 Subject: [issue17330] Check st_nlink in addition to st_mtime to invalidate FileFinder cache Message-ID: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> New submission from Erik Bray: This is vaguely related to issue14067, though the patch suggested there would make this problem worse, not better. This addresses a problem that cropped up on OSX in which some code that, for Good Reasons, generates a module in a package directory and then expects to be able to import it. Because HFS+ does not offer sub-second resolution for mtime the generated module is not found. We didn't have this problem on Linux or Windows. I've attached one possible solution to the issue, which uses a tuple of st_mtime and st_nlink to determine if the cache should be invalidated. This should pick up most file creation/deletion on such file systems even if the directory's mtime hasn't changed. This doesn't add any additional system calls so it shouldn't have any significant performance impact. In the meantime importlib.invalidate_caches() offers a consistent workaround, but it was surprising when this issue was found to be platform dependent. ---------- components: None hgrepos: 178 messages: 183270 nosy: erik.bray priority: normal severity: normal status: open title: Check st_nlink in addition to st_mtime to invalidate FileFinder cache type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 19:38:34 2013 From: report at bugs.python.org (Erik Bray) Date: Fri, 01 Mar 2013 18:38:34 +0000 Subject: [issue17330] Check st_nlink in addition to st_mtime to invalidate FileFinder cache In-Reply-To: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> Message-ID: <1362163114.52.0.511883943223.issue17330@psf.upfronthosting.co.za> Changes by Erik Bray : ---------- keywords: +patch Added file: http://bugs.python.org/file29286/94e671589c0e.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 19:40:42 2013 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 01 Mar 2013 18:40:42 +0000 Subject: [issue11448] docs for HTTPConnection.set_tunnel are ambiguous In-Reply-To: <1299636529.48.0.302129596868.issue11448@psf.upfronthosting.co.za> Message-ID: <1362163242.7.0.878166939556.issue11448@psf.upfronthosting.co.za> ?ric Araujo added the comment: > This is a possible additional example for set_tunnel, Thanks. In general, our tooling expects unified diffs, such as produced by hg diff. > modification of python3.3/html/_sources/library/http.client.txt That?s a copy for web hosting, the real source is in Doc/library/http.client.rst (see devguide for more info). ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 19:41:15 2013 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 01 Mar 2013 18:41:15 +0000 Subject: [issue17306] Improve the way abstract base classes are shown in help() In-Reply-To: <1361932149.15.0.421194254516.issue17306@psf.upfronthosting.co.za> Message-ID: <1362163275.5.0.190473718227.issue17306@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo versions: +Python 3.4 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 19:43:14 2013 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 01 Mar 2013 18:43:14 +0000 Subject: [issue17312] test_aifc doesn't clean up after itself In-Reply-To: <1361993994.98.0.627362156743.issue17312@psf.upfronthosting.co.za> Message-ID: <1362163394.46.0.218196398917.issue17312@psf.upfronthosting.co.za> Chris Jerdonek added the comment: Similar to as I stated in issue 17315, you won't see it when using regrtest since regrtest creates and then deletes a temp working directory. The file gets created and is left behind in the current working directory. Try running using unittest, e.g. ./python.exe -m unittest test.test_aifc.AIFCLowLevelTest.test_write_aiff_by_extension ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 19:56:42 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 01 Mar 2013 18:56:42 +0000 Subject: [issue17330] Check st_nlink in addition to st_mtime to invalidate FileFinder cache In-Reply-To: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> Message-ID: <1362164202.77.0.232925412937.issue17330@psf.upfronthosting.co.za> Brett Cannon added the comment: [for anyone else who doesn't know what st_nlink is for: http://docs.python.org/3/library/stat.html#stat.ST_NLINK] Since it doesn't add stat overhead as it's just part of what os.path.stats() returns I'm fine with adding it to part of the invalidation scheme. What do you think, Antoine? ---------- nosy: +brett.cannon, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 20:01:10 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 01 Mar 2013 19:01:10 +0000 Subject: [issue17315] test_posixpath doesn't clean up after itself In-Reply-To: <1361995121.83.0.653056148204.issue17315@psf.upfronthosting.co.za> Message-ID: <3ZHg2Y6W5RzRv4@mail.python.org> Roundup Robot added the comment: New changeset ed3ca7298055 by Ezio Melotti in branch '2.7': #17315: unlink a file that test_posixpath was leaving around. http://hg.python.org/cpython/rev/ed3ca7298055 New changeset c65e98ce1a05 by Ezio Melotti in branch '3.2': #17315: unlink a file that test_posixpath was leaving around. http://hg.python.org/cpython/rev/c65e98ce1a05 New changeset 7a2169a80f48 by Ezio Melotti in branch '3.3': #17315: merge with 3.2. http://hg.python.org/cpython/rev/7a2169a80f48 New changeset 7234370fc556 by Ezio Melotti in branch 'default': #17315: merge with 3.3. http://hg.python.org/cpython/rev/7234370fc556 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 20:02:32 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 19:02:32 +0000 Subject: [issue17315] test_posixpath doesn't clean up after itself In-Reply-To: <1361995121.83.0.653056148204.issue17315@psf.upfronthosting.co.za> Message-ID: <1362164552.94.0.38921838367.issue17315@psf.upfronthosting.co.za> Ezio Melotti added the comment: Should be fixed now. ---------- assignee: -> ezio.melotti resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed versions: +Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 20:06:38 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 01 Mar 2013 19:06:38 +0000 Subject: [issue17330] Check st_nlink in addition to st_mtime to invalidate FileFinder cache In-Reply-To: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> Message-ID: <1362164798.06.0.641514357934.issue17330@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Well, importlib.invalidate_caches() is not a workaround, it's really the right way to solve your issue (for example if instead of writing a new module, you modify an existing one: st_nlink will then remain the same). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 20:10:45 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 01 Mar 2013 19:10:45 +0000 Subject: [issue17312] test_aifc doesn't clean up after itself In-Reply-To: <1361993994.98.0.627362156743.issue17312@psf.upfronthosting.co.za> Message-ID: <3ZHgFd0780z7LmZ@mail.python.org> Roundup Robot added the comment: New changeset 10909360a11d by Ezio Melotti in branch 'default': #17312: unlink a file that test_aifc was leaving around. http://hg.python.org/cpython/rev/10909360a11d ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 20:11:23 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 19:11:23 +0000 Subject: [issue17312] test_aifc doesn't clean up after itself In-Reply-To: <1361993994.98.0.627362156743.issue17312@psf.upfronthosting.co.za> Message-ID: <1362165083.65.0.813556487811.issue17312@psf.upfronthosting.co.za> Ezio Melotti added the comment: Should be fixed now. ---------- assignee: -> ezio.melotti resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 20:16:55 2013 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 01 Mar 2013 19:16:55 +0000 Subject: [issue17312] test_aifc doesn't clean up after itself In-Reply-To: <1361993994.98.0.627362156743.issue17312@psf.upfronthosting.co.za> Message-ID: <1362165415.12.0.10244680622.issue17312@psf.upfronthosting.co.za> Chris Jerdonek added the comment: Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 20:17:15 2013 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 01 Mar 2013 19:17:15 +0000 Subject: [issue17315] test_posixpath doesn't clean up after itself In-Reply-To: <1361995121.83.0.653056148204.issue17315@psf.upfronthosting.co.za> Message-ID: <1362165435.44.0.397717870966.issue17315@psf.upfronthosting.co.za> Chris Jerdonek added the comment: Thanks, I confirmed the fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 20:24:15 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 19:24:15 +0000 Subject: [issue17328] Fix reference leak in dict_setdefault() in case of resize failure In-Reply-To: <1362146633.78.0.0455037271826.issue17328@psf.upfronthosting.co.za> Message-ID: <1362165855.67.0.529979598332.issue17328@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +serhiy.storchaka stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 20:33:51 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 01 Mar 2013 19:33:51 +0000 Subject: [issue17330] Check st_nlink in addition to st_mtime to invalidate FileFinder cache In-Reply-To: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> Message-ID: <1362166431.66.0.888547211946.issue17330@psf.upfronthosting.co.za> Brett Cannon added the comment: Antoine does make a good point: adding st_nlink could lead to some hard-to-discover bugs because something will work the first time when the file is added but then subsequently fail if you are modifying the new file in-place. I'm going to go with Antoine's thinking and close this bug as "won't fix". Thanks for at least taking a stab at the code, Erik. ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 20:48:04 2013 From: report at bugs.python.org (Glyph Lefkowitz) Date: Fri, 01 Mar 2013 19:48:04 +0000 Subject: [issue17298] Twisted test failure triggered by change in 2.7 branch In-Reply-To: <1361831094.62.0.865591087681.issue17298@psf.upfronthosting.co.za> Message-ID: <1362167284.75.0.718312720982.issue17298@psf.upfronthosting.co.za> Glyph Lefkowitz added the comment: Confirmed. Thanks very much for addressing it promptly. ---------- resolution: -> duplicate status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 20:49:11 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Mar 2013 19:49:11 +0000 Subject: [issue17298] Twisted test failure triggered by change in 2.7 branch In-Reply-To: <1361831094.62.0.865591087681.issue17298@psf.upfronthosting.co.za> Message-ID: <1362167351.07.0.0681899015654.issue17298@psf.upfronthosting.co.za> Ezio Melotti added the comment: Thank you for finding and reporting it! ---------- stage: needs patch -> committed/rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 20:51:26 2013 From: report at bugs.python.org (Erik Bray) Date: Fri, 01 Mar 2013 19:51:26 +0000 Subject: [issue17330] Check st_nlink in addition to st_mtime to invalidate FileFinder cache In-Reply-To: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> Message-ID: <1362167486.73.0.923197015567.issue17330@psf.upfronthosting.co.za> Erik Bray added the comment: Why should modifying the file in place be expected to do anything with respect to the directory cache? If that module has already been imported then modifying it should not require the cache to be invalidated. If the file is modified *before* it's imported that's still irrelevant because that means the file exists in the directory and will be included in the cache when it gets generated. Relying on invalidate_caches() is a workaround because it's not even necessary on better filesystems--the existing behavior already leads to hard to find bugs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 20:57:03 2013 From: report at bugs.python.org (Erik Bray) Date: Fri, 01 Mar 2013 19:57:03 +0000 Subject: [issue17330] Check st_nlink in addition to st_mtime to invalidate FileFinder cache In-Reply-To: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> Message-ID: <1362167823.61.0.0147819449223.issue17330@psf.upfronthosting.co.za> Erik Bray added the comment: Put another way, the cache associated with a FileFinder only keeps track of the filenames in a directory, and not their individual mtimes. So if a new file is added to the directory the cache should be invalided. Likewise if a file is removed. If a file is modified or removed and a new file with the same name subsequently added this is irrelevant to the cache. Importing that module will still succeed if it hasn't already been imported. If that module's file is *not* in the cache then an ImportError is raised. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 21:08:36 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 01 Mar 2013 20:08:36 +0000 Subject: [issue17330] Check st_nlink in addition to st_mtime to invalidate FileFinder cache In-Reply-To: <1362167486.73.0.923197015567.issue17330@psf.upfronthosting.co.za> Message-ID: <1362168301.3490.3.camel@localhost.localdomain> Antoine Pitrou added the comment: > Put another way, the cache associated with a FileFinder only keeps > track of the filenames in a directory, and not their individual > mtimes. So if a new file is added to the directory the cache should > be invalided. Likewise if a file is removed. True, but if a file is removed and another added, st_nlink won't change. Which will lead to even harder to find bugs. I agree it would be better if it were always possible to detect directory modifications, without any false negatives. Sadly it is not (blame POSIX, I guess, although Windows is not better here), hence invalidate_caches(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 21:17:26 2013 From: report at bugs.python.org (Erik Bray) Date: Fri, 01 Mar 2013 20:17:26 +0000 Subject: [issue17330] Check st_nlink in addition to st_mtime to invalidate FileFinder cache In-Reply-To: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> Message-ID: <1362169046.68.0.995112688274.issue17330@psf.upfronthosting.co.za> Erik Bray added the comment: Fair enough, but then I would propose removing the automatic cache invalidation based on mtime altogether. It's just not reliable enough--this caused previously working code to break unexpectedly, and only on a single platform at that. I'm fine with "importlib.invalidate_caches()" being the correct solution--but then that should be consistent and enforced, and not just something you may have to do sometimes in some cases but that you don't really need in other cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 21:38:47 2013 From: report at bugs.python.org (Erik Bray) Date: Fri, 01 Mar 2013 20:38:47 +0000 Subject: [issue17330] Check st_nlink in addition to st_mtime to invalidate FileFinder cache In-Reply-To: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> Message-ID: <1362170327.63.0.479947065271.issue17330@psf.upfronthosting.co.za> Erik Bray added the comment: I should add, Antoine's counter-example of a file that's renamed or replaced already doesn't work either under OSX. So while this solution won't address that (even more narrow) use case, it would at least improve the existing situation for what I would like to think is a much more common use case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 21:39:45 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 01 Mar 2013 20:39:45 +0000 Subject: [issue16997] subtests In-Reply-To: <1358543231.78.0.354364612897.issue16997@psf.upfronthosting.co.za> Message-ID: <1362170385.92.0.315022486524.issue16997@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > That means there's a part of Antoine's patch I disagree with: the > change to eliminate the derived "overall" result attached to the > aggregate test. The patch doesn't eliminate it, there are even tests for it. (see the various call order tests) > The complexity involved in attempting to get expectedFailure() to > behave as expected is also a strong indication that there are still > problems with the way these results are being aggregated. No, the complexity stems from the fact that the expectedFailure decorator knows nothing about the test running machinery and instead blindly raises an exception. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 21:40:39 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 01 Mar 2013 20:40:39 +0000 Subject: [issue17330] Check st_nlink in addition to st_mtime to invalidate FileFinder cache In-Reply-To: <1362170327.63.0.479947065271.issue17330@psf.upfronthosting.co.za> Message-ID: <1362170224.3490.4.camel@localhost.localdomain> Antoine Pitrou added the comment: > I should add, Antoine's counter-example of a file that's renamed or > replaced already doesn't work either under OSX. So while this > solution won't address that (even more narrow) use case, it would at > least improve the existing situation for what I would like to think is > a much more common use case. Yes, it seems all possibilities have mixed outcomes. I'll let Brett decide :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 21:53:41 2013 From: report at bugs.python.org (Mathieu Pasquet) Date: Fri, 01 Mar 2013 20:53:41 +0000 Subject: [issue17331] Fix str methods for detecting digits with unicode Message-ID: <1362171220.98.0.881684038408.issue17331@psf.upfronthosting.co.za> New submission from Mathieu Pasquet: In py3k, str.isalnum(), str.isdigit(), and str.isdecimal() are broken because they take into account various unicode numbers. A common case is doing something like that: num = -1 while num == -1: num_in = input('Enter a number> ') if num_in.isdigit(): num = int(num_in) # do stuff ? If you enter ?, or any esoteric unicode representation of a number, all the methods referenced above will return True. I believe this is a bug. It also affects the stdlib, e.g. in collection.namedtuple, A = namedtuple('A?', 'x y') will return an ugly Syntax Error, because the sanity check uses str.isalnum(), which says it?s ok. (n.b.: of course, no sane person should ever want to do the above, but I find it worth mentionning) ---------- components: Unicode messages: 183291 nosy: ezio.melotti, mathieui priority: normal severity: normal status: open title: Fix str methods for detecting digits with unicode type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 21:57:35 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Mar 2013 20:57:35 +0000 Subject: [issue17301] An in-place version of many bytearray methods is needed In-Reply-To: <1361910523.06.0.491264384267.issue17301@psf.upfronthosting.co.za> Message-ID: <1362171455.18.0.551873327509.issue17301@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I think you need to make more of a case for 'should'. Bytearrays are, well, byte arrays, not text arrays. I could just as well claim that the ascii text operations should not even be there. They are certainly not needed for typical mixed binary-ascii protocol strings, which is what bytearrars were intended for. In any case, this would fatten the api considerably for not too much benefit. I think that this, like many or most enhancement proposals, should best be discussed on python-ideas list before any tracker action. I consider translate an exception to the above comments. It is a byte operation, not a text operations. bytearry.translate could plausibly have been defined as 'in-place' when added. Most of the other operations are special cases of translate, and can therefore be done with translate, without the limitation to only ascii chars. If one wants to directly uppercase latin-1 encoded bytes without decoding to text, one would need .translate anyway. ---------- components: +Library (Lib) -Interpreter Core nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 22:00:43 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Mar 2013 21:00:43 +0000 Subject: [issue17302] HTTP/2.0 - Implementations/Testing efforts In-Reply-To: <1361912085.4.0.961439299516.issue17302@psf.upfronthosting.co.za> Message-ID: <1362171643.05.0.938912197198.issue17302@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- resolution: -> postponed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 22:31:03 2013 From: report at bugs.python.org (Ernie Hershey) Date: Fri, 01 Mar 2013 21:31:03 +0000 Subject: [issue17332] typo in json docs - "convered" should be "converted" Message-ID: <1362173463.23.0.943587603223.issue17332@psf.upfronthosting.co.za> New submission from Ernie Hershey: Hi, On these pages: http://docs.python.org/3.4/library/json.html http://docs.python.org/3.3/library/json.html http://docs.python.org/3.2/library/json.html http://docs.python.org/2/library/json.html http://docs.python.org/2.6/library/json.html This line says "convered" but should be "converted." Note Keys in key/value pairs of JSON are always of the type str. When a dictionary is converted into JSON, all the keys of the dictionary are coerced to strings. As a result of this, if a dictionary is convered into JSON and then back into a dictionary, the dictionary may not equal the original one. That is, loads(dumps(x)) != x if x has non-string keys. ---------- assignee: docs at python components: Documentation messages: 183293 nosy: docs at python, ernest priority: normal severity: normal status: open title: typo in json docs - "convered" should be "converted" 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 Fri Mar 1 22:38:20 2013 From: report at bugs.python.org (Zachary Ware) Date: Fri, 01 Mar 2013 21:38:20 +0000 Subject: [issue17333] Fix test discovery for test_imaplib.py Message-ID: <1362173900.83.0.151362153333.issue17333@psf.upfronthosting.co.za> New submission from Zachary Ware: Here's a patch for test_imaplib.py that converts test_main into load_tests. ---------- components: Tests files: test_imaplib_discovery.diff keywords: patch messages: 183294 nosy: brett.cannon, ezio.melotti, zach.ware priority: normal severity: normal status: open title: Fix test discovery for test_imaplib.py type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file29287/test_imaplib_discovery.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 22:43:03 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 01 Mar 2013 21:43:03 +0000 Subject: [issue17331] Fix str methods for detecting digits with unicode In-Reply-To: <1362171220.98.0.881684038408.issue17331@psf.upfronthosting.co.za> Message-ID: <1362174183.62.0.087992245183.issue17331@psf.upfronthosting.co.za> R. David Murray added the comment: I think this is working as designed, and can't be changed (at least not easily) because of backward compatibility even if there are bits of the design that are deemed buggy. The issue, I believe, is what is considered a number by the Unicode consortium. See issue 10557 for some background. Python should at least be consistent about what is treated as a number, though, so the ugly syntax error from namedtuple is probably a bug. ---------- nosy: +eric.smith, lemburg, mark.dickinson, r.david.murray, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 22:55:20 2013 From: report at bugs.python.org (Florent Xicluna) Date: Fri, 01 Mar 2013 21:55:20 +0000 Subject: [issue17331] Fix str methods for detecting digits with unicode In-Reply-To: <1362171220.98.0.881684038408.issue17331@psf.upfronthosting.co.za> Message-ID: <1362174920.8.0.25442908189.issue17331@psf.upfronthosting.co.za> Florent Xicluna added the comment: Actually, the character is SUPERSCRIPT ONE, in the category No (Number other). http://www.fileformat.info/info/unicode/char/b9/index.htm This is not a valid category for the identifiers, only "Nd" Number decimal is accepted. The issue is probably in namedtuple, which should check the "unicodedata.category" or better, check with method str.isidentifier. ---------- nosy: +flox versions: +Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 23:00:13 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 01 Mar 2013 22:00:13 +0000 Subject: [issue17330] Stop checking for directory cache invalidation in importlib In-Reply-To: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> Message-ID: <1362175213.81.0.32877130868.issue17330@psf.upfronthosting.co.za> Brett Cannon added the comment: So let's see what options we have on the table. Status quo: picks up mutated modules as long as the mtime is granular enough. Fails in the face of added fails under the same conditions. Need to call importlib.invalidate_caches() to avoid this problem. Add st_nlinks: Would help in the situation of an added/removed file. Doesn't fix mtime granularity problem. Still might need to call importlib.invalidate_caches() if doing more than adding files. Drop implicit cache validation entirely: Force people to call importlib.invalidate_caches() no matter what (so no more accidental "it worked on my machine but not that other one"). Cuts down on stat call overhead by 1 per file-based import (which benchmarking suggests doesn't get us anything). I'm leaning towards just dropping the implicit cache invalidation and forcing people to call importlib.invalidate_caches() when they muck with the underlying modules on sys.path/__path__. This probably would have helped when we started to run into similar problems in the stdlib's test suite when this whole caching mechanism was added. Since this lowers the chance of mistakenly thinking code will work when deployed on other filesystems and speed things up in the majority of cases where people are not dynamically generating files in sys.path. I don't know if backporting is a good idea, though, as it might catch people by surprise who are not trying to run on different filesystems in 3.3.1. Then again, being lucky in not needing to call importlib.invalidate_caches() doesn't mean that starting to call it properly is a bad thing in a bugfix release. Re-opening the bug under a different name while we think about this. ---------- components: +Interpreter Core -None resolution: wont fix -> stage: -> needs patch status: closed -> open title: Check st_nlink in addition to st_mtime to invalidate FileFinder cache -> Stop checking for directory cache invalidation in importlib versions: +Python 3.4 -Python 3.3 Added file: http://bugs.python.org/file29288/drop_implicit_cache_invalidation.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 23:15:36 2013 From: report at bugs.python.org (Mathieu Pasquet) Date: Fri, 01 Mar 2013 22:15:36 +0000 Subject: [issue17331] Fix str methods for detecting digits with unicode In-Reply-To: <1362171220.98.0.881684038408.issue17331@psf.upfronthosting.co.za> Message-ID: <1362176136.01.0.815888153412.issue17331@psf.upfronthosting.co.za> Mathieu Pasquet added the comment: I understand the reasoning behind the feature, and the will to be unicode-compliant, but I think this might still break a lot of code (though it may never be detected). I understand that isdecimal() is the safe way, because anything that is a decimal (Nd) can be translated to an integer by int() ; however, what is the recommended way to get something that isnumeric() into an int? unicodedata.normalize('NFKD', num) or unicodedata.normalize('NFKC', num)? Maybe str could have a method that does this, or methods performing exclusively on ascii values? Sorry for the noise, I did not find issue 10557 when I searched. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 23:26:16 2013 From: report at bugs.python.org (Zachary Ware) Date: Fri, 01 Mar 2013 22:26:16 +0000 Subject: [issue17334] Fix test discovery for test_index.py Message-ID: <1362176776.61.0.51954698694.issue17334@psf.upfronthosting.co.za> New submission from Zachary Ware: Just subclassing issues in this one. ---------- components: Tests files: test_index_discovery.diff keywords: patch messages: 183299 nosy: brett.cannon, ezio.melotti, zach.ware priority: normal severity: normal status: open title: Fix test discovery for test_index.py type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file29289/test_index_discovery.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 23:42:31 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Mar 2013 22:42:31 +0000 Subject: [issue17309] __bytes__ doesn't work in subclass of int and str In-Reply-To: <1361979686.07.0.236846670702.issue17309@psf.upfronthosting.co.za> Message-ID: <1362177751.95.0.109015402078.issue17309@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The library doc says that if the source argument for bytes() or bytearray() is a string or integer it is treated a certain way. I believe 'string' and 'integer' are meant to include subclasses of str and int, else it should have said str or int. You have verified that int subclass instances are indeed treated as integers. The following shows that str subclass instances are treated as strings. class mystr(str): def __bytes__(self): return b'hello' print(bytes(mystr('a'))) raises TypeError: string argument without an encoding The language reference says "object.__bytes__(self): Called by bytes() to compute a byte-string representation of an object." No exception is given. I see this as a contradiction in the manual, in which case the current behavior rules and the contradiction is removed by changing the doc part that conflicts with behavior. That would mean extending the doc sentence with 'that is not a string or integer'. However, I am waiting for other opinions for two reasons. 1. The doc also specified special treatment for buffer interface and iterable objects. However, __bytes__ *is* checked first for those objects. class myit(list): def __bytes__(self): return b'hello' print (bytes (myit([1,2,3]))) # b'hello' class mybit(bytes): # example def __bytes__(self): return b'hello' print (bytes (mybit(b'a'))) # b'hello' So the exception is limited to 'strings' and 'integers', making it somewhat inconsistent. 2. If someone gives an str or int subclass a __bytes__ method, they can only mean for it to be called by bytes(), as there is no other use of that special method. On the third hand, a user of a class who tests its instances before calling bytes with "isinstance(x, (str, int))" instead of "type(x) is str or type(x) is int", likely expects getting normal string or integer behavior. Of course, the same might be true if the test is 'isiterable(x)'. If behavior were changed, I think it should wait for 3.4 since the current behavior is not clearly a bug to me. ---------- assignee: -> docs at python components: +Documentation -Interpreter Core nosy: +docs at python, terry.reedy title: __bytes__ doesn't work in subclass of int -> __bytes__ doesn't work in subclass of int and str versions: +Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 1 23:45:01 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Mar 2013 22:45:01 +0000 Subject: [issue17285] subprocess.check_output incorrectly state that output is always bytes In-Reply-To: <1361706230.84.0.572016082.issue17285@psf.upfronthosting.co.za> Message-ID: <1362177901.45.0.670527066437.issue17285@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +terry.reedy versions: +Python 3.4 -Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 00:03:39 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Mar 2013 23:03:39 +0000 Subject: [issue17309] __bytes__ doesn't work in subclass of int and str In-Reply-To: <1361979686.07.0.236846670702.issue17309@psf.upfronthosting.co.za> Message-ID: <1362179019.82.0.210337701512.issue17309@psf.upfronthosting.co.za> Terry J. Reedy added the comment: More data: class myit(list): def __bytes__(self): return b'hello' print (bytes(b'a')) class myit(list): def __bytes__(self): return b'hello' print (bytearray (myit([1,2,3]))) # bytearray(b'a') # bytearray(b'\x01\x02\x03') class by: def __bytes__(self): return b'hello' # TypeError: 'by' object is not iterable (Error message is incomplete.) So bytearray *always* treats objects as specified in its library entry and never calls __bytes__, making its value sometimes unequal as a sequence of bytes from bytes with the same input. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 00:04:58 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Mar 2013 23:04:58 +0000 Subject: [issue17310] Ctypes callbacks shows problem on Windows Python (64bit) In-Reply-To: <1361980274.18.0.791136497364.issue17310@psf.upfronthosting.co.za> Message-ID: <1362179098.52.0.706576811298.issue17310@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +amaury.forgeotdarc, meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 00:29:00 2013 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 01 Mar 2013 23:29:00 +0000 Subject: [issue17301] An in-place version of many bytearray methods is needed In-Reply-To: <1362171455.18.0.551873327509.issue17301@psf.upfronthosting.co.za> Message-ID: Gregory P. Smith added the comment: Translate isn't a text operation. (That's the api I wanted). The others I only lists for completeness because someone else would complain if I hadn't. ;) On Mar 1, 2013 12:57 PM, "Terry J. Reedy" wrote: > > Terry J. Reedy added the comment: > > I think you need to make more of a case for 'should'. Bytearrays are, > well, byte arrays, not text arrays. I could just as well claim that the > ascii text operations should not even be there. They are certainly not > needed for typical mixed binary-ascii protocol strings, which is what > bytearrars were intended for. In any case, this would fatten the api > considerably for not too much benefit. I think that this, like many or most > enhancement proposals, should best be discussed on python-ideas list before > any tracker action. > > I consider translate an exception to the above comments. It is a byte > operation, not a text operations. bytearry.translate could plausibly have > been defined as 'in-place' when added. Most of the other operations are > special cases of translate, and can therefore be done with translate, > without the limitation to only ascii chars. If one wants to directly > uppercase latin-1 encoded bytes without decoding to text, one would need > .translate anyway. > > ---------- > components: +Library (Lib) -Interpreter Core > nosy: +terry.reedy > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 00:34:46 2013 From: report at bugs.python.org (Florent Xicluna) Date: Fri, 01 Mar 2013 23:34:46 +0000 Subject: [issue17331] namedtuple raises a SyntaxError instead of ValueError on invalid identifier In-Reply-To: <1362171220.98.0.881684038408.issue17331@psf.upfronthosting.co.za> Message-ID: <1362180886.61.0.52287313274.issue17331@psf.upfronthosting.co.za> Florent Xicluna added the comment: This is consistent: >>> '?'.isnumeric(), '?'.isdigit(), '?'.isdecimal() (True, True, False) >>> unicodedata.numeric('?') 1.0 >>> unicodedata.digit('?') 1 >>> unicodedata.decimal('?') Traceback (most recent call last): File "", line 1, in ValueError: not a decimal >>> Changing the title to focus on the issue with collections.namedtuple. ---------- components: +Library (Lib) title: Fix str methods for detecting digits with unicode -> namedtuple raises a SyntaxError instead of ValueError on invalid identifier versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 01:00:54 2013 From: report at bugs.python.org (Ron Adam) Date: Sat, 02 Mar 2013 00:00:54 +0000 Subject: [issue10716] Modernize pydoc to use better HTML and separate CSS In-Reply-To: <1292491539.55.0.135732310832.issue10716@psf.upfronthosting.co.za> Message-ID: <1362182454.88.0.144340766307.issue10716@psf.upfronthosting.co.za> Ron Adam added the comment: I'm going to go over this issue again with fresh eyes after having been away for some time. Recent experience with another project has helped answer some of the questions I had earlier. Particulary, how not to over specifying class names and id's. This should lead to cleaner html pages that will be easier to style with css. It should also lead to a smaller patch. ;-) It seems that most of the input so far has more to do with spelling rather than function. Is there a prefered style guide for css that we should use? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 01:21:44 2013 From: report at bugs.python.org (Eric Snow) Date: Sat, 02 Mar 2013 00:21:44 +0000 Subject: [issue17330] Stop checking for directory cache invalidation in importlib In-Reply-To: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> Message-ID: <1362183704.25.0.708185085593.issue17330@psf.upfronthosting.co.za> Eric Snow added the comment: Yanking the implicit cache validation does seem to be the simplest solution here. Perhaps we could come up with a complex way of making this work, but I don't think it's worth it. What may be worth it is making the admonition of "use invalidate_caches()" easier to find. I imagine the situation like this: 1. dynamically generate module 2. try to import it and get ImportError 3. scratch head and make sure it's actually valid code, reboot, etc. 4. still not working 5. search google or Python docs for an answer and step 5 isn't working out well enough. Removing the implicit cache invalidation would only make a more reliable step 5 even more important. How to make that happen? I'm not sure. Perhaps a dedicated "Trouble-shooting Imports" FAQ with a links to it on relevant pages like importlib, imp, and the import statement. Maybe we already have something like that and I've just missed it. ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 01:22:04 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 02 Mar 2013 00:22:04 +0000 Subject: [issue17331] namedtuple raises a SyntaxError instead of ValueError on invalid identifier In-Reply-To: <1362171220.98.0.881684038408.issue17331@psf.upfronthosting.co.za> Message-ID: <1362183724.01.0.501120670267.issue17331@psf.upfronthosting.co.za> Antoine Pitrou added the comment: namedtuple should simply use isidentifier(), rather than isalnum(). ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 01:23:25 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 02 Mar 2013 00:23:25 +0000 Subject: [issue17330] Stop checking for directory cache invalidation in importlib In-Reply-To: <1362183704.25.0.708185085593.issue17330@psf.upfronthosting.co.za> Message-ID: <1362183590.3490.5.camel@localhost.localdomain> Antoine Pitrou added the comment: I would suggest checking on python-dev before removing the cache freshness check. Some people may rely on it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 01:34:23 2013 From: report at bugs.python.org (Neal Norwitz) Date: Sat, 02 Mar 2013 00:34:23 +0000 Subject: [issue17335] FieldStorageClass is messed up Message-ID: <1362184463.11.0.388912351396.issue17335@psf.upfronthosting.co.za> New submission from Neal Norwitz: This problem goes back to 2.6 at least. In Lib/cgi.py FieldStorageClass = None def read_multi(self, environ, keep_blank_values, strict_parsing): """Internal: read a part that is itself multipart.""" ib = self.innerboundary if not valid_boundary(ib): raise ValueError, 'Invalid boundary in multipart form: %r' % (ib,) self.list = [] if self.qs_on_post: for key, value in urlparse.parse_qsl(self.qs_on_post, self.keep_blank_values, self.strict_parsing): self.list.append(MiniFieldStorage(key, value)) FieldStorageClass = None The set of FieldStorageClass is to a local variable, so a no-op since it's never read. The class attribute will always be None unless set outside this class (not sure if it is). It looks like it should just be removed. ---------- messages: 183308 nosy: Neal.Norwitz priority: normal severity: normal status: open title: FieldStorageClass is messed up versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 03:31:30 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 02 Mar 2013 02:31:30 +0000 Subject: [issue17330] Stop checking for directory cache invalidation in importlib In-Reply-To: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> Message-ID: <1362191490.41.0.19511223671.issue17330@psf.upfronthosting.co.za> Brett Cannon added the comment: Fine, I asked python-dev, but I said it's going to take a lot to convince me not to rip out the cache invalidation code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 03:42:08 2013 From: report at bugs.python.org (Erik Bray) Date: Sat, 02 Mar 2013 02:42:08 +0000 Subject: [issue17330] Stop checking for directory cache invalidation in importlib In-Reply-To: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> Message-ID: <1362192128.21.0.646603702865.issue17330@psf.upfronthosting.co.za> Erik Bray added the comment: Dropping the implicit invalidation altogether works for me. I was hoping to find a better solution because for the majority of use cases I personally care about the existing behavior is preferable. That said I have to support OSX users as possibly the majority of my userbase, and I think that for anyone it's a big enough exception that it can't be ignored. That being the case, explicit is better than implicit here. I didn't have too much trouble finding importlib.invalidate_caches() once I realized what the problem was, but the fact that this change needs to be made could be better advertised I suppose. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 06:17:23 2013 From: report at bugs.python.org (Ramchandra Apte) Date: Sat, 02 Mar 2013 05:17:23 +0000 Subject: [issue17331] namedtuple raises a SyntaxError instead of ValueError on invalid identifier In-Reply-To: <1362171220.98.0.881684038408.issue17331@psf.upfronthosting.co.za> Message-ID: <1362201443.35.0.332206347615.issue17331@psf.upfronthosting.co.za> Ramchandra Apte added the comment: > namedtuple should simply use isidentifier(), rather than isalnum(). +2 ---------- nosy: +Ramchandra Apte _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 07:01:48 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 02 Mar 2013 06:01:48 +0000 Subject: [issue17331] namedtuple raises a SyntaxError instead of ValueError on invalid identifier In-Reply-To: <1362171220.98.0.881684038408.issue17331@psf.upfronthosting.co.za> Message-ID: <1362204108.16.0.0527731693143.issue17331@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> rhettinger priority: normal -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 08:51:55 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 02 Mar 2013 07:51:55 +0000 Subject: [issue17331] namedtuple raises a SyntaxError instead of ValueError on invalid identifier In-Reply-To: <1362171220.98.0.881684038408.issue17331@psf.upfronthosting.co.za> Message-ID: <3ZJ07t2dLQz7LnN@mail.python.org> Roundup Robot added the comment: New changeset 80bcc98bf939 by Raymond Hettinger in branch '3.3': Issue #17331: Use isidentifier() instead of isalnum() to check for valid identifiers. http://hg.python.org/cpython/rev/80bcc98bf939 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 12:28:04 2013 From: report at bugs.python.org (Manuel Jacob) Date: Sat, 02 Mar 2013 11:28:04 +0000 Subject: [issue17336] Complex number representation round-trip doesn't work with signed zero values Message-ID: <1362223684.37.0.0348889498791.issue17336@psf.upfronthosting.co.za> New submission from Manuel Jacob: When evaluating, signed zero complex numbers aren't recovered correctly. >>> -0j (-0-0j) >>> (-0-0j) 0j >>> 0j 0j According to http://docs.python.org/dev/reference/datamodel.html#object.__repr__ the representation can be used to recreate an object with the same value. Shouldn't this also be possible with complex numbers? When using complex('...'), round-trip works correctly. While this can be used to recover the exact number, i find it confusing that complex('...') isn't the same as eval('...'). >>> complex('-0j') -0j >>> complex('(-0-0j)') (-0-0j) >>> complex('0j') 0j ---------- messages: 183313 nosy: mjacob priority: normal severity: normal status: open title: Complex number representation round-trip doesn't work with signed zero values type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 12:30:19 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 11:30:19 +0000 Subject: [issue17336] Complex number representation round-trip doesn't work with signed zero values In-Reply-To: <1362223684.37.0.0348889498791.issue17336@psf.upfronthosting.co.za> Message-ID: <1362223819.86.0.0285055745083.issue17336@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti, mark.dickinson, skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 13:05:00 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 12:05:00 +0000 Subject: [issue10967] move regrtest over to using more unittest infrastructure In-Reply-To: <1295567145.8.0.568957178125.issue10967@psf.upfronthosting.co.za> Message-ID: <1362225900.74.0.545790519745.issue10967@psf.upfronthosting.co.za> Ezio Melotti added the comment: > For one thing, I think resources could be implemented in terms of skips While working on #17333 I noticed a related problem. Most of the tests in test_imaplib are skipped if the 'network' resource is not specified. The test contains the following lines to enable those tests when the file is executed directly: if __name__ == "__main__": support.use_resources = ['network'] unittest.main() but this clearly doesn't work while using unittest discovery, so those tests are skipped. Implementing resources as skips makes sense, but we might also need a way to specify what resources are needed that works with unittest discovery. Running these tests only when the test file is executed directly or through `regrtest -u` is also an option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 13:33:25 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 02 Mar 2013 12:33:25 +0000 Subject: [issue17333] Fix test discovery for test_imaplib.py In-Reply-To: <1362173900.83.0.151362153333.issue17333@psf.upfronthosting.co.za> Message-ID: <3ZJ6Nh28fFzRrK@mail.python.org> Roundup Robot added the comment: New changeset 02bbc5375a56 by Ezio Melotti in branch '3.3': #17333: test_imaplib now works with unittest test discovery. Patch by Zachary Ware. http://hg.python.org/cpython/rev/02bbc5375a56 New changeset b8bafae4a15a by Ezio Melotti in branch 'default': #17333: merge with 3.3. http://hg.python.org/cpython/rev/b8bafae4a15a ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 13:35:57 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 12:35:57 +0000 Subject: [issue17333] Fix test discovery for test_imaplib.py In-Reply-To: <1362173900.83.0.151362153333.issue17333@psf.upfronthosting.co.za> Message-ID: <1362227757.17.0.974933020339.issue17333@psf.upfronthosting.co.za> Ezio Melotti added the comment: Fixed, thanks for the patch! As noted in msg183314, several tests are not included while using unittest discovery, but that's a separate issue. ---------- assignee: -> ezio.melotti resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 13:48:20 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 02 Mar 2013 12:48:20 +0000 Subject: [issue17334] Fix test discovery for test_index.py In-Reply-To: <1362176776.61.0.51954698694.issue17334@psf.upfronthosting.co.za> Message-ID: <3ZJ6jv4LlJz7Lnp@mail.python.org> Roundup Robot added the comment: New changeset 886df716cd09 by Ezio Melotti in branch '3.3': #17334: test_index now works with unittest test discovery. Patch by Zachary Ware. http://hg.python.org/cpython/rev/886df716cd09 New changeset 1c71882938eb by Ezio Melotti in branch 'default': #17334: merge with 3.3. http://hg.python.org/cpython/rev/1c71882938eb ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 13:49:10 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 12:49:10 +0000 Subject: [issue17334] Fix test discovery for test_index.py In-Reply-To: <1362176776.61.0.51954698694.issue17334@psf.upfronthosting.co.za> Message-ID: <1362228550.96.0.136390025663.issue17334@psf.upfronthosting.co.za> Ezio Melotti added the comment: Fixed, thanks for the patch! ---------- assignee: -> ezio.melotti resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 13:49:24 2013 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 02 Mar 2013 12:49:24 +0000 Subject: [issue17336] Complex number representation round-trip doesn't work with signed zero values In-Reply-To: <1362223684.37.0.0348889498791.issue17336@psf.upfronthosting.co.za> Message-ID: <1362228564.38.0.588425011757.issue17336@psf.upfronthosting.co.za> Changes by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 13:55:04 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 12:55:04 +0000 Subject: [issue10716] Modernize pydoc to use better HTML and separate CSS In-Reply-To: <1292491539.55.0.135732310832.issue10716@psf.upfronthosting.co.za> Message-ID: <1362228904.46.0.240332659163.issue10716@psf.upfronthosting.co.za> Ezio Melotti added the comment: > Is there a prefered style guide for css that we should use? If you mean indentation/spacing, my preferred style is: selector { property1: value1; property2: value2; ... } FWIW I agree an HTML5 doctype should be used. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 14:05:33 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 13:05:33 +0000 Subject: [issue12301] Use :role:`sys.thing` instead of ``sys.thing`` throughout In-Reply-To: <1307636549.73.0.554335270504.issue12301@psf.upfronthosting.co.za> Message-ID: <1362229533.7.0.534140785706.issue12301@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- type: -> enhancement versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 14:13:31 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 13:13:31 +0000 Subject: [issue7855] Add test cases for ctypes/winreg for issues found in IronPython In-Reply-To: <1265311030.9.0.277359551887.issue7855@psf.upfronthosting.co.za> Message-ID: <1362230011.42.0.516147967364.issue7855@psf.upfronthosting.co.za> Ezio Melotti added the comment: Dino, what's the status of this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 14:17:07 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 13:17:07 +0000 Subject: [issue10712] 2to3 fixer for deprecated unittest method names In-Reply-To: <1292441796.9.0.018359428873.issue10712@psf.upfronthosting.co.za> Message-ID: <1362230227.41.0.688351923975.issue10712@psf.upfronthosting.co.za> Ezio Melotti added the comment: Can this still go on 2.7/3.2/3.3? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 14:20:30 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 13:20:30 +0000 Subject: [issue11787] File handle leak in TarFile lib In-Reply-To: <1302115375.88.0.984018215443.issue11787@psf.upfronthosting.co.za> Message-ID: <1362230430.25.0.0209063327815.issue11787@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 14:43:03 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 13:43:03 +0000 Subject: [issue15866] encode(..., 'xmlcharrefreplace') produces entities for surrogate pairs In-Reply-To: <1346871274.13.0.653364801762.issue15866@psf.upfronthosting.co.za> Message-ID: <1362231783.68.0.863154236399.issue15866@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 15:21:14 2013 From: report at bugs.python.org (karl) Date: Sat, 02 Mar 2013 14:21:14 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362234074.77.0.228895410245.issue17322@psf.upfronthosting.co.za> karl added the comment: http://hg.python.org/cpython/file/3.3/Lib/urllib/request.py#l359 def add_header(self, key, val): # useful for something like authentication self.headers[key.capitalize()] = val and http://hg.python.org/cpython/file/3.3/Lib/urllib/request.py#l271 in __init__ of class Request: for key, value in headers.items(): self.add_header(key, value) Tests seem to be there, but there are none. Is there a reason why there are no tests? http://hg.python.org/cpython/file/3.3/Lib/test/test_urllib2.py#l98 Or should I add a test in http://hg.python.org/cpython/file/3.3/Lib/test/test_urllib.py I'm confused :) I need guidance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 16:09:24 2013 From: report at bugs.python.org (mic_e) Date: Sat, 02 Mar 2013 15:09:24 +0000 Subject: [issue17337] input() and raw_input() do not work correctly with colored prompts Message-ID: <1362236964.85.0.134127148195.issue17337@psf.upfronthosting.co.za> New submission from mic_e: With a prompt that uses ANSI color escape codes, python3 input() and python2 raw_input() behave incorrectly when it comes to the wrapping of the first line - almost certainly due to the wrong string length calculation. The line breaking occurs k characters early, where k is the number of characters in the ANSI escape sequence. Even worse, the line break does not switch to the next line, but instead jumps back to the beginning, overwriting the prompt and the previously written input. How to reproduce: Call input() with a color-coded string as argument, and type until you would expect the usual line break. Example: mic at mic-nb ~ $ python3 Python 3.3.0 (default, Dec 22 2012, 21:02:07) [GCC 4.7.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> prompt="\x1b[31;1mthis is a bold red prompt> \x1b[m" >>> len(prompt) 37 >>> input(prompt) uvwxyzs a bold red prompt> abcdefghijklmnopqrst 'abcdefghijklmnopqrstuvwxyz' >>> mic at mic-nb ~ $ python2 Python 2.7.3 (default, Dec 22 2012, 21:14:12) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> prompt="\x1b[31;1mthis is a bold red prompt> \x1b[m" >>> len(prompt) 37 >>> raw_input(prompt) uvwxyzs a bold red prompt> abcdefghijklmnopqrst 'abcdefghijklmnopqrstuvwxyz' >>> mic at mic-nb ~ $ tput cols 57 I have typed directly after the prompt the string 'abcdefghijklmnopqrstuvwxyz', so the expected result would be be this is a bold red prompt> abcdefghijklmnopqrstuvwxyz with four more characters of space before the line break Note that the break occurs exactly 8 characters early, which is the total amount of ANSI escape sequence characters. Also note that the readline module is impored in my .pyrc file. ---------- components: Library (Lib) messages: 183323 nosy: mic_e priority: normal severity: normal status: open title: input() and raw_input() do not work correctly with colored prompts type: behavior versions: Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 16:42:45 2013 From: report at bugs.python.org (Ram Rachum) Date: Sat, 02 Mar 2013 15:42:45 +0000 Subject: [issue17032] Misleading error message: global name 'X' is not defined In-Reply-To: <1359124974.58.0.158587338796.issue17032@psf.upfronthosting.co.za> Message-ID: <1362238965.64.0.759109729637.issue17032@psf.upfronthosting.co.za> Ram Rachum added the comment: Was the patch applied? Is there any reason why it should not be applied? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 16:43:13 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 15:43:13 +0000 Subject: [issue17337] input() and raw_input() do not work correctly with colored prompts In-Reply-To: <1362236964.85.0.134127148195.issue17337@psf.upfronthosting.co.za> Message-ID: <1362238993.06.0.985256095481.issue17337@psf.upfronthosting.co.za> Ezio Melotti added the comment: I can reproduce the issue, but only from the interactive interpreter while using input() directly (Linux/py3). I tried the following things: $ ./python -c 'print("\x1b[31;1mthis is a bold red prompt> \x1b[m", end=""); input()' $ ./python -c 'input("\x1b[31;1mthis is a bold red prompt> \x1b[m");' >>> print("\x1b[31;1mthis is a bold red prompt> \x1b[m", end=""); input() >>> input("\x1b[31;1mthis is a bold red prompt> \x1b[m") In the first 3 cases once I reach the end of the line, the text went on a new line. In the last case it started writing over the prompt instead of going on a newline, and once it reached the end of line again it went on a newline correctly. ---------- nosy: +ezio.melotti versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 16:44:26 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 15:44:26 +0000 Subject: [issue17032] Misleading error message: global name 'X' is not defined In-Reply-To: <1359124974.58.0.158587338796.issue17032@psf.upfronthosting.co.za> Message-ID: <1362239066.21.0.350542484126.issue17032@psf.upfronthosting.co.za> Ezio Melotti added the comment: Not yet, I wanted to make sure that everyone agrees on the change. If I don't get other replies I'll commit it soon. ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 16:46:03 2013 From: report at bugs.python.org (Ram Rachum) Date: Sat, 02 Mar 2013 15:46:03 +0000 Subject: [issue17032] Misleading error message: global name 'X' is not defined In-Reply-To: <1359124974.58.0.158587338796.issue17032@psf.upfronthosting.co.za> Message-ID: <1362239163.73.0.339833614351.issue17032@psf.upfronthosting.co.za> Ram Rachum added the comment: (I fixed the patch to not have a typo.) ---------- Added file: http://bugs.python.org/file29290/cpython_patch1of1_8e9346e7ae87.patch.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 16:46:26 2013 From: report at bugs.python.org (Ram Rachum) Date: Sat, 02 Mar 2013 15:46:26 +0000 Subject: [issue17032] Misleading error message: global name 'X' is not defined In-Reply-To: <1359124974.58.0.158587338796.issue17032@psf.upfronthosting.co.za> Message-ID: <1362239186.77.0.746988582138.issue17032@psf.upfronthosting.co.za> Changes by Ram Rachum : Removed file: http://bugs.python.org/file29006/cpython_patch1of1_8e9346e7ae87.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 17:00:01 2013 From: report at bugs.python.org (=?utf-8?q?Michael_En=C3=9Flin?=) Date: Sat, 02 Mar 2013 16:00:01 +0000 Subject: [issue17337] input() and raw_input() do not work correctly with colored prompts In-Reply-To: <1362236964.85.0.134127148195.issue17337@psf.upfronthosting.co.za> Message-ID: <1362240001.24.0.0810294331572.issue17337@psf.upfronthosting.co.za> Michael En?lin added the comment: The issue might very well be strictly related to GNU readline. I have both successfully reproduced it in a C program: #include #include int main() { readline("\x1b[31;1mthis is a bold red prompt\x1b[m> "); } gcc -lreadline test.c and found a fix, hinted at by this stackoverflow post: http://stackoverflow.com/questions/9468435/look-how-to-fix-column-calculation-in-python-readline-if-use-color-prompt Readline uses the characters \x01 and \x02 to mark invisible portions of the prompt, so I am now pre-processing the prompt with this function: def surround_ansi_escapes(prompt, start = "\x01", end = "\x02"): escaped = False result = "" for c in prompt: if c == "\x1b" and not escaped: result += start + c escaped = True elif c.isalpha() and escaped: result += c + end escaped = False else: result += c return result However, in my opionion this fact deserves at least to be mentioned in the readline documentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 17:48:57 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 02 Mar 2013 16:48:57 +0000 Subject: [issue10967] move regrtest over to using more unittest infrastructure In-Reply-To: <1295567145.8.0.568957178125.issue10967@psf.upfronthosting.co.za> Message-ID: <1362242937.72.0.787410053207.issue10967@psf.upfronthosting.co.za> R. David Murray added the comment: We have previously discussed adding resource-awareness to unittest, but that is a much bigger project (API design, scope considerations, etc etc). In the meantime, what we could do is modify the current resource-skip logic slightly: make it so that tests are *not* skipped for resource reasons *unless* some flag in support is set indicating that resource enforcement is in effect *and* the specified resource is not in the list of currently-asserted resources. That way tests are only skipped for resource reasons if run via regrtest. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 18:12:37 2013 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 02 Mar 2013 17:12:37 +0000 Subject: [issue10712] 2to3 fixer for deprecated unittest method names In-Reply-To: <1362230227.41.0.688351923975.issue10712@psf.upfronthosting.co.za> Message-ID: Gregory P. Smith added the comment: Yes! 2to3 features are allowed in stable releases. On Mar 2, 2013 5:17 AM, "Ezio Melotti" wrote: > > Ezio Melotti added the comment: > > Can this still go on 2.7/3.2/3.3? > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 18:16:43 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 17:16:43 +0000 Subject: [issue10967] move regrtest over to using more unittest infrastructure In-Reply-To: <1295567145.8.0.568957178125.issue10967@psf.upfronthosting.co.za> Message-ID: <1362244603.3.0.278091132297.issue10967@psf.upfronthosting.co.za> Ezio Melotti added the comment: There are actually three separate issues here: 1) The resources don't use unittest skip (or at least not always), so while running the tests without regrtests there are no indication that some tests have been skipped. This could be addressed by converting the current resources to proper skips (with something like @skip_unless_resource('network')) and shouldn't be too difficult. 2) The "network" resource could be enabled by default, given that network connectivity is nowadays fairly common (it would be even better if that was detected automatically at runtime). This would enable more tests and shouldn't have negative side-effects (unless the network is not available and the tests have no way to realize that and fail). 3) unittest could have a "resource API", but that's not strictly necessary if we still provide a way to run the skipped tests through regrtest and/or while running the test file individually. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 18:22:15 2013 From: report at bugs.python.org (Evgeny Kapun) Date: Sat, 02 Mar 2013 17:22:15 +0000 Subject: [issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse) In-Reply-To: <1279836939.11.0.811316280273.issue9334@psf.upfronthosting.co.za> Message-ID: <1362244935.77.0.452139600774.issue9334@psf.upfronthosting.co.za> Changes by Evgeny Kapun : ---------- nosy: +abacabadabacaba _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 18:23:39 2013 From: report at bugs.python.org (Alex Gaynor) Date: Sat, 02 Mar 2013 17:23:39 +0000 Subject: [issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing Message-ID: <1362245019.42.0.972918137955.issue17338@psf.upfronthosting.co.za> New submission from Alex Gaynor: Following the length_hint PEP, we should expose this facility to end-python programmers. The semantics would be basically: the list has behavior identical to if you hadn't provided length_hint, except the VM is free to preallocate efficiently. CPython (and PyPy) use this kind of logic internally all over the place when lists are to be returned (including, but not limited to, list() with a single argument!) If this is considered to be a good idea I'll whip up a patch. ---------- messages: 183332 nosy: alex priority: normal severity: normal status: open title: Add length_hint parameter to list, dict, set constructors to allow efficient presizing type: performance versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 18:34:55 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 02 Mar 2013 17:34:55 +0000 Subject: [issue17331] namedtuple raises a SyntaxError instead of ValueError on invalid identifier In-Reply-To: <1362171220.98.0.881684038408.issue17331@psf.upfronthosting.co.za> Message-ID: <1362245695.21.0.606839645986.issue17331@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Thanks for the suggestion. isidentifier() was exactly what was needed. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 18:35:08 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 02 Mar 2013 17:35:08 +0000 Subject: [issue10967] move regrtest over to using more unittest infrastructure In-Reply-To: <1295567145.8.0.568957178125.issue10967@psf.upfronthosting.co.za> Message-ID: <1362245708.23.0.248299572659.issue10967@psf.upfronthosting.co.za> R. David Murray added the comment: No controversy on (1), we should just do that. I don't see a strong reason to change (2). I always run the test suite with -uall, but if I were running a restricted set I'd rather not have resources outside the local machine be accessed. My proposal is a way to provide (3): running the regrtest-resource-skipped tests when not running them through regrtest. If you *also* want a way to skip tests based on resource when running them outside regrtest, then unittest would have to grow a resource API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 18:45:29 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 17:45:29 +0000 Subject: [issue10967] move regrtest over to using more unittest infrastructure In-Reply-To: <1295567145.8.0.568957178125.issue10967@psf.upfronthosting.co.za> Message-ID: <1362246329.84.0.771408160261.issue10967@psf.upfronthosting.co.za> Ezio Melotti added the comment: > I'd rather not have resources outside the local machine be accessed. Fair enough. > If you *also* want a way to skip tests based on resource when running > them outside regrtest, then unittest would have to grow a resource API. This can already be done though -- adding a resource API to unittest would just provide an additional way to do it without going through regrtest. I don't think we will ever get rid of regrtest. It would be nice if most of the code could be removed and standard unittest features were used instead, but regrtest will always have more advanced/customized feature built on top of unittest (which is not to say that a resource API for unittest is useless, but that's not a blocker for this issue :). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 19:23:43 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 02 Mar 2013 18:23:43 +0000 Subject: [issue10967] move regrtest over to using more unittest infrastructure In-Reply-To: <1295567145.8.0.568957178125.issue10967@psf.upfronthosting.co.za> Message-ID: <1362248623.65.0.0588316740787.issue10967@psf.upfronthosting.co.za> R. David Murray added the comment: So you are agreeing with my proposal? And no, I don't think the goal is to get rid of regrtest, it is just to make it as small as practical. Or to put it another way, to add the features of regrtest that are generally useful to unittest. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 19:31:44 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 18:31:44 +0000 Subject: [issue10967] move regrtest over to using more unittest infrastructure In-Reply-To: <1295567145.8.0.568957178125.issue10967@psf.upfronthosting.co.za> Message-ID: <1362249104.94.0.991694349585.issue10967@psf.upfronthosting.co.za> Ezio Melotti added the comment: > So you are agreeing with my proposal? I will have to see a concrete proposal first. If a resource API is useful enough to be added to unittest, and we can come up with a decent API we can move it there, otherwise it can just stay in regrtest. There's also the issue that the unittest API is already quite big, and adding even more things there might do more harm than good. There are several other parts of regrtest that can take advantage of already existing unittest features first, and convert them might be enough to close this issue even if the existing resource infrastructure is kept in regrtest. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 19:34:17 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 02 Mar 2013 18:34:17 +0000 Subject: [issue10967] move regrtest over to using more unittest infrastructure In-Reply-To: <1295567145.8.0.568957178125.issue10967@psf.upfronthosting.co.za> Message-ID: <1362249257.05.0.261490830001.issue10967@psf.upfronthosting.co.za> R. David Murray added the comment: My proposal is how to do this without adding anything to unittest. It is about how to implement the skips so that all tests are run when run under unittest, but resource control still happens when the tests run under regrtest. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 19:39:56 2013 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 02 Mar 2013 18:39:56 +0000 Subject: [issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing In-Reply-To: <1362245019.42.0.972918137955.issue17338@psf.upfronthosting.co.za> Message-ID: <1362249596.77.0.179706626341.issue17338@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Definitely needs to be discussed on python-ideas/python-dev. ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 19:42:21 2013 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 02 Mar 2013 18:42:21 +0000 Subject: [issue17309] __bytes__ doesn't work in subclass of int and str In-Reply-To: <1361979686.07.0.236846670702.issue17309@psf.upfronthosting.co.za> Message-ID: <1362249741.84.0.338357934841.issue17309@psf.upfronthosting.co.za> Benjamin Peterson added the comment: This has been fixed recently: $ ./python bytes.py b'\x00' b'hello' ---------- nosy: +benjamin.peterson resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 19:45:02 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 18:45:02 +0000 Subject: [issue10967] move regrtest over to using more unittest infrastructure In-Reply-To: <1295567145.8.0.568957178125.issue10967@psf.upfronthosting.co.za> Message-ID: <1362249902.4.0.0228883794105.issue10967@psf.upfronthosting.co.za> Ezio Melotti added the comment: Yes, that could be done as well, but even if they are not run by default under unittest, I'd be already happy to see them marked as skipped. If I see that they are skipped I can always switch to regrtest to enable the necessary resource, or just execute the file directly if the resource is enabled just before unittest.main() (like the example in msg183314). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 20:17:11 2013 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 02 Mar 2013 19:17:11 +0000 Subject: [issue17336] Complex number representation round-trip doesn't work with signed zero values In-Reply-To: <1362223684.37.0.0348889498791.issue17336@psf.upfronthosting.co.za> Message-ID: <1362251831.58.0.106615041141.issue17336@psf.upfronthosting.co.za> Mark Dickinson added the comment: This is not easy to avoid, I'm afraid, and it's a consequence of Python's usual rules for mixed-type arithmetic: (-0-0j) is interpreted as 0 - (0.0 + 0.0j) --- that is, the 0j is promoted to a complex instance (by giving it zero real part) before the subtraction is performed. Then the real part of the result is computed as 0.0 - 0.0, which is 0.0. Note that the first 0.0 comes from converting the *integer* 0 to a complex number. If you do -0.0-0.0j you'll see a different result: >>> -0.0-0.0j (-0+0j) ---------- resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 20:18:11 2013 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 02 Mar 2013 19:18:11 +0000 Subject: [issue17336] Complex number representation round-trip doesn't work with signed zero values In-Reply-To: <1362223684.37.0.0348889498791.issue17336@psf.upfronthosting.co.za> Message-ID: <1362251891.81.0.929114605244.issue17336@psf.upfronthosting.co.za> Mark Dickinson added the comment: An aside: C99 gets around this problem by allowing an (optional) Imaginary type, separate from Complex. Very few compilers support it, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 20:20:14 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 02 Mar 2013 19:20:14 +0000 Subject: [issue17032] Misleading error message: global name 'X' is not defined In-Reply-To: <1359124974.58.0.158587338796.issue17032@psf.upfronthosting.co.za> Message-ID: <1362252014.33.0.690965002871.issue17032@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 20:58:02 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 02 Mar 2013 19:58:02 +0000 Subject: [issue10967] move regrtest over to using more unittest infrastructure In-Reply-To: <1295567145.8.0.568957178125.issue10967@psf.upfronthosting.co.za> Message-ID: <1362254282.68.0.748391926092.issue10967@psf.upfronthosting.co.za> R. David Murray added the comment: Ah, but for me the point of running directly under unit test (and unittest discovery) it to be able to use the standard unittest facilities for running a single testcase or individual test. Converting them to skips without making them run if regrtest isn't active might make things worse for that use case. If we are going to convert them to skips, why not do it right to start with? It won't any harder, since the logic will be baked into the skip decorators. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 20:58:34 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 02 Mar 2013 19:58:34 +0000 Subject: [issue17339] bytes() TypeError message is misleadingly narrow Message-ID: <1362254314.39.0.995387791388.issue17339@psf.upfronthosting.co.za> New submission from Terry J. Reedy: If an object ob does not have a __bytes__ method or buffer interface and is not a string, integer, or iterable, bytes(ob) fails with TypeError: 'object' object is not iterable This is misleadingly narror (similar to #17032). We should either list *all* the things that ob is not 'object' object is not a string, integer, or iterable and does not have a __bytes__ method or buffer interface or simply say 'object' object cannot be converted to bytes and let the programmer recheck what can be. ---------- components: Interpreter Core messages: 183345 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: bytes() TypeError message is misleadingly narrow type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 21:03:23 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 02 Mar 2013 20:03:23 +0000 Subject: [issue17032] Misleading error message: global name 'X' is not defined In-Reply-To: <1359124974.58.0.158587338796.issue17032@psf.upfronthosting.co.za> Message-ID: <1362254603.02.0.236864443047.issue17032@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I just opened #17339 about another situation where the error message references only the last of several checks that failed. bytes(object()) # raises TypeError: 'object' object is not iterable # or 4 other possibilities I think any message like this should be fixed as noticed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 21:16:03 2013 From: report at bugs.python.org (=?utf-8?q?Francisco_Mart=C3=ADn_Brugu=C3=A9?=) Date: Sat, 02 Mar 2013 20:16:03 +0000 Subject: [issue17267] datetime.time support for '+' and 'now' In-Reply-To: <1361450879.34.0.390010426075.issue17267@psf.upfronthosting.co.za> Message-ID: <1362255363.35.0.683612146334.issue17267@psf.upfronthosting.co.za> Francisco Mart?n Brugu? added the comment: Hi Joar, just a detail: is there a reason for the asymmetric check for timedelta isinstance (and raising NotImplemented)? And BTW. isn't a double check for the __sub__ case (or have I missed something)? + def __add__(self, other): + "Add a time and a timedelta" + if not isinstance(other, timedelta): + return NotImplemented vs. ? + def __sub__(self, other): + "Subtract a time and a timedelta." + if isinstance(other, timedelta): + return self + -other + return NotImplemented regards, francis ---------- nosy: +francismb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 21:33:42 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Mar 2013 20:33:42 +0000 Subject: [issue17339] bytes() TypeError message is misleadingly narrow In-Reply-To: <1362254314.39.0.995387791388.issue17339@psf.upfronthosting.co.za> Message-ID: <1362256422.26.0.234871775119.issue17339@psf.upfronthosting.co.za> Ezio Melotti added the comment: See also #16518. ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 22:48:38 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 02 Mar 2013 21:48:38 +0000 Subject: [issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing In-Reply-To: <1362245019.42.0.972918137955.issue17338@psf.upfronthosting.co.za> Message-ID: <1362260918.41.0.0284371257015.issue17338@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Guido has previously rejected any kind of user specified presizing parameter for dictionaries. He felt that it was breaking the abstraction in a way that caused people to focus on implementation specific details. Also, set() and dict() use presizing (and hash value reuse) only in the limited case of the input iterable being an exact dictionary or set. Otherwise, it makes no assumptions about the input iterable and grows as needed. For sets, even when the __len__ is known for a general iterable, we don't know how many unique elements are the input -- consider for example: set([None] * 1000000). In typical use cases for sets, a user also doesn't know in advance how many unique elements will be present -- and to the extent they try to add estimation logic, it would only complicate their programs. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 23:17:04 2013 From: report at bugs.python.org (Berker Peksag) Date: Sat, 02 Mar 2013 22:17:04 +0000 Subject: [issue13477] tarfile module should have a command line In-Reply-To: <1322190665.85.0.356467902383.issue13477@psf.upfronthosting.co.za> Message-ID: <1362262624.84.0.0630425188715.issue13477@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- keywords: +patch nosy: +berker.peksag Added file: http://bugs.python.org/file29291/issue13477.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 2 23:36:17 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 02 Mar 2013 22:36:17 +0000 Subject: [issue17339] bytes() TypeError message is misleadingly narrow In-Reply-To: <1362254314.39.0.995387791388.issue17339@psf.upfronthosting.co.za> Message-ID: <1362263777.65.0.976130781556.issue17339@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Do you prefer the long or short form? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 00:40:00 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 02 Mar 2013 23:40:00 +0000 Subject: [issue17330] Stop checking for directory cache invalidation in importlib In-Reply-To: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> Message-ID: <1362267600.62.0.498267735944.issue17330@psf.upfronthosting.co.za> Brett Cannon added the comment: So Nick Coghlan pointed out that this would require a deprecation warning which is doable using ImportWarning. But that also lowers my motivation to bother since there is no performance benefit. I will, though, at least make it clearer in the What's New doc and in the importlib docs that it is more of a need than an optional thing to do. ---------- assignee: -> brett.cannon nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 00:43:05 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 02 Mar 2013 23:43:05 +0000 Subject: [issue17094] sys._current_frames() reports too many/wrong stack frames In-Reply-To: <1359668363.58.0.777154629349.issue17094@psf.upfronthosting.co.za> Message-ID: <1362267785.21.0.950759332924.issue17094@psf.upfronthosting.co.za> Antoine Pitrou added the comment: hi Charles-Fran?ois, > I'm attaching a patch doing the cleanup in PyEval_ReInitThreads(), with > test. Did you forget to attach the patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 02:15:43 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 03 Mar 2013 01:15:43 +0000 Subject: [issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing In-Reply-To: <1362245019.42.0.972918137955.issue17338@psf.upfronthosting.co.za> Message-ID: <1362273343.05.0.0913821995309.issue17338@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I think it is going a bit too far in the direction of exposing low-level optimizations. Python is not C++. I also agree with Raymond that it's rather rare to construct read-only containers (in the sense that they are allocated once and for all). ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 03:21:01 2013 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 03 Mar 2013 02:21:01 +0000 Subject: [issue13477] tarfile module should have a command line In-Reply-To: <1322190665.85.0.356467902383.issue13477@psf.upfronthosting.co.za> Message-ID: <1362277261.59.0.766819140163.issue13477@psf.upfronthosting.co.za> ?ric Araujo added the comment: Patch looks good! Some minor comments on Rietveld. Could you add tests? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 03:21:31 2013 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 03 Mar 2013 02:21:31 +0000 Subject: [issue17339] bytes() TypeError message is misleadingly narrow In-Reply-To: <1362254314.39.0.995387791388.issue17339@psf.upfronthosting.co.za> Message-ID: <1362277291.56.0.797951243739.issue17339@psf.upfronthosting.co.za> ?ric Araujo added the comment: Short form for me. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 03:28:51 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 03 Mar 2013 02:28:51 +0000 Subject: [issue13477] tarfile module should have a command line In-Reply-To: <1322190665.85.0.356467902383.issue13477@psf.upfronthosting.co.za> Message-ID: <1362277731.17.0.553103839523.issue13477@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 for adding a CLI and +1 for keeping it minimal. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 04:08:08 2013 From: report at bugs.python.org (karl) Date: Sun, 03 Mar 2013 03:08:08 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362280088.6.0.661186048711.issue17322@psf.upfronthosting.co.za> karl added the comment: I created 4 tests for testing trailing and leading spaces on * add_unredirected_header() * add_header() and modified the functions. Tests passed. ? ./python.exe Lib/test/test_urllib2net.py [?] test_headers_with_spaces (__main__.OtherNetworkTests) ... ok [?] ---------------------------------------------------------------------- Ran 16 tests in 17.148s OK (skipped=1) [137988 refs] See the patch issue-17322-1.patch ---------- keywords: +patch Added file: http://bugs.python.org/file29292/issue-17322-1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 04:19:00 2013 From: report at bugs.python.org (karl) Date: Sun, 03 Mar 2013 03:19:00 +0000 Subject: [issue11448] docs for HTTPConnection.set_tunnel are ambiguous In-Reply-To: <1299636529.48.0.302129596868.issue11448@psf.upfronthosting.co.za> Message-ID: <1362280740.85.0.17514325081.issue11448@psf.upfronthosting.co.za> karl added the comment: Ah thanks Eric, I will fix that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 04:31:21 2013 From: report at bugs.python.org (karl) Date: Sun, 03 Mar 2013 03:31:21 +0000 Subject: [issue11448] docs for HTTPConnection.set_tunnel are ambiguous In-Reply-To: <1299636529.48.0.302129596868.issue11448@psf.upfronthosting.co.za> Message-ID: <1362281481.93.0.810480164829.issue11448@psf.upfronthosting.co.za> karl added the comment: ok made a proper patch on the rst file with hg diff. See issue-11448-1.patch ---------- Added file: http://bugs.python.org/file29293/issue-11448-1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 04:48:41 2013 From: report at bugs.python.org (Alex Gaynor) Date: Sun, 03 Mar 2013 03:48:41 +0000 Subject: [issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing In-Reply-To: <1362245019.42.0.972918137955.issue17338@psf.upfronthosting.co.za> Message-ID: <1362282521.75.0.367136904932.issue17338@psf.upfronthosting.co.za> Alex Gaynor added the comment: python-dev/ideas may be a better place to have this discussion, but basically if you're going to insist that stuff like this doesn't go into Python "because it isn't C++", people are going to have to write C++, and that makes me incredibly sad. There's an obvious need for this, CPython uses optimizations like this internally, as does PyPy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 04:52:04 2013 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 03 Mar 2013 03:52:04 +0000 Subject: [issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing In-Reply-To: <1362245019.42.0.972918137955.issue17338@psf.upfronthosting.co.za> Message-ID: <1362282724.67.0.882492062191.issue17338@psf.upfronthosting.co.za> Benjamin Peterson added the comment: I think the emphasis is on "internally" :). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 04:59:14 2013 From: report at bugs.python.org (karl) Date: Sun, 03 Mar 2013 03:59:14 +0000 Subject: [issue12455] urllib2 forces title() on header names, breaking some requests In-Reply-To: <1309461818.92.0.299415077626.issue12455@psf.upfronthosting.co.za> Message-ID: <1362283154.76.0.259488406464.issue12455@psf.upfronthosting.co.za> karl added the comment: Are there issues related to removing the capitalize() and title() appears? # title() * http://hg.python.org/cpython/file/886df716cd09/Lib/urllib/request.py#l1239 # capitalize() * http://hg.python.org/cpython/file/886df716cd09/Lib/urllib/request.py#l359 * http://hg.python.org/cpython/file/886df716cd09/Lib/urllib/request.py#l363 * http://hg.python.org/cpython/file/886df716cd09/Lib/urllib/request.py#l1206 Because the behavior is inconsistent, I would live to propose a patch removing them and be sure to be completely neutral with regards to them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 05:25:19 2013 From: report at bugs.python.org (Ankur Ankan) Date: Sun, 03 Mar 2013 04:25:19 +0000 Subject: [issue13477] tarfile module should have a command line In-Reply-To: <1322190665.85.0.356467902383.issue13477@psf.upfronthosting.co.za> Message-ID: <1362284719.38.0.192044980231.issue13477@psf.upfronthosting.co.za> Ankur Ankan added the comment: I was also working on this issue so thought I should also submit my patch. Has a few extra features from berker.peksag's patch: 1) the name of the files to be extracted can be specified 2) output directory can be specified for extracting files. ---------- Added file: http://bugs.python.org/file29294/issue_13477 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 05:33:23 2013 From: report at bugs.python.org (karl) Date: Sun, 03 Mar 2013 04:33:23 +0000 Subject: [issue12455] urllib2 forces title() on header names, breaking some requests In-Reply-To: <1309461818.92.0.299415077626.issue12455@psf.upfronthosting.co.za> Message-ID: <1362285203.4.0.0620889354062.issue12455@psf.upfronthosting.co.za> karl added the comment: tests in http://hg.python.org/cpython/file/886df716cd09/Lib/test/test_wsgiref.py#l370 also checking that everything is case insensitive. And the method to get the headers in wsgiref, make sure they are lower-case http://hg.python.org/cpython/file/886df716cd09/Lib/wsgiref/headers.py#l82 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 07:24:49 2013 From: report at bugs.python.org (Ankur Ankan) Date: Sun, 03 Mar 2013 06:24:49 +0000 Subject: [issue15542] Documentation incorrectly suggests __init__ called after direct __new__ call In-Reply-To: <1343946223.73.0.562621858875.issue15542@psf.upfronthosting.co.za> Message-ID: <1362291889.59.0.752014541719.issue15542@psf.upfronthosting.co.za> Changes by Ankur Ankan : ---------- nosy: +Ankur.Ankan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 11:29:59 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 03 Mar 2013 10:29:59 +0000 Subject: [issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing In-Reply-To: <1362282521.75.0.367136904932.issue17338@psf.upfronthosting.co.za> Message-ID: <1362306380.3470.2.camel@localhost.localdomain> Antoine Pitrou added the comment: > There's an obvious need for this, CPython uses optimizations like this > internally, as does PyPy. I don't know if it's a need or if it's just "nice to have". By the way, in the list case it also makes C code simpler, since once the list is preallocated you just have to call PyList_SET_ITEM to populate it, and there's no error return to worry about. Also, lists are easy to pre-allocate in pure Python as well: l = [None] * N # populate for i in range(N): l[i] = ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 11:31:12 2013 From: report at bugs.python.org (Alex Gaynor) Date: Sun, 03 Mar 2013 10:31:12 +0000 Subject: [issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing In-Reply-To: <1362245019.42.0.972918137955.issue17338@psf.upfronthosting.co.za> Message-ID: <1362306672.52.0.533795986329.issue17338@psf.upfronthosting.co.za> Alex Gaynor added the comment: That strategy only works if you know the exact count, it fails if you only have an estimate (as __length_hint__ gives you). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 12:10:33 2013 From: report at bugs.python.org (keakon) Date: Sun, 03 Mar 2013 11:10:33 +0000 Subject: [issue17340] Handle malformed cookie Message-ID: <1362309033.05.0.860433762185.issue17340@psf.upfronthosting.co.za> New submission from keakon: One of my user told me that she couldn't login to my website yesterday. I logged her cookie, and found it began with ',BRIDGE_R=;' which was a malformed cookie. Tornado uses Cookie.SimpleCookie.load() to parse her cookie, and returns an empty dict when catching an exception such as CookieError. In that case, Tornado has to treat her as a new user since it believes she didn't provide any cookies. Even after Tornado tried to set cookie (like user_id) for her, it still couldn't parse her cookie the next time. I checked Issue2193 and found the patch provided by spookylukey could fix the bug, but it was rejected. Why not add a default parameter like strict=True, and let users to decide whether to ignore invalid keys or to raise an error? I believe SimpleCookie is useless for handling malformed cookies right now. If it's still not acceptable, should I implement my own Cookie class for Tornado like Django did (https://github.com/django/django/blob/master/django/http/cookie.py)? ---------- components: Library (Lib) messages: 183367 nosy: georg.brandl, keakon, spookylukey priority: normal severity: normal status: open title: Handle malformed cookie type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 12:13:48 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 03 Mar 2013 11:13:48 +0000 Subject: [issue16445] SEGFAULT when deleting Exception.message In-Reply-To: <1352415910.77.0.640632287013.issue16445@psf.upfronthosting.co.za> Message-ID: <3ZJhZM29PKzRwv@mail.python.org> Roundup Robot added the comment: New changeset 0e41c4466d58 by Mark Dickinson in branch '2.7': Issue #16445: Fix potential segmentation fault when deleting an exception message. http://hg.python.org/cpython/rev/0e41c4466d58 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 14:13:16 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 03 Mar 2013 13:13:16 +0000 Subject: [issue17032] Misleading error message: global name 'X' is not defined In-Reply-To: <1359124974.58.0.158587338796.issue17032@psf.upfronthosting.co.za> Message-ID: <3ZJlDC5DLxzQrk@mail.python.org> Roundup Robot added the comment: New changeset f1d3fbcd837d by Ezio Melotti in branch 'default': #17032: The "global" in the "NameError: global name 'x' is not defined" error message has been removed. Patch by Ram Rachum. http://hg.python.org/cpython/rev/f1d3fbcd837d ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 14:14:07 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 03 Mar 2013 13:14:07 +0000 Subject: [issue17032] Misleading error message: global name 'X' is not defined In-Reply-To: <1359124974.58.0.158587338796.issue17032@psf.upfronthosting.co.za> Message-ID: <1362316447.48.0.947012714279.issue17032@psf.upfronthosting.co.za> Ezio Melotti added the comment: Fixed, thanks for the patch! ---------- assignee: -> ezio.melotti resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 14:17:57 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 03 Mar 2013 13:17:57 +0000 Subject: [issue13898] Ignored exception in test_ssl In-Reply-To: <1327769564.73.0.643604928649.issue13898@psf.upfronthosting.co.za> Message-ID: <1362316677.18.0.396192658299.issue13898@psf.upfronthosting.co.za> Ezio Melotti added the comment: I see these failures too on Ubuntu, both in verbose and non-verbose mode: $ ./python -m test -v test_ssl == CPython 3.4.0a0 (default:1c71882938eb+, Mar 3 2013, 14:21:46) [GCC 4.6.3] == Linux-3.2.0-38-generic-i686-with-debian-wheezy-sid little-endian == /home/wolf/dev/py/py3k/build/test_python_21756 Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1) [1/1] test_ssl test_ssl: testing with 'OpenSSL 1.0.1 14 Mar 2012' (1, 0, 1, 0, 15) under Linux ('debian', 'wheezy/sid', '') HAS_SNI = True test_ciphers (test.test_ssl.ContextTests) ... ok [...] test_protocol_sslv3 (test.test_ssl.ThreadedTests) Connecting to an SSLv3 server with various client options ... SSLv3->SSLv3 CERT_NONE SSLv3->SSLv3 CERT_OPTIONAL SSLv3->SSLv3 CERT_REQUIRED {SSLv23->SSLv3} CERT_NONE Exception in thread Thread-62: Traceback (most recent call last): File "/home/wolf/dev/py/py3k/Lib/threading.py", line 639, in _bootstrap_inner self.run() File "/home/wolf/dev/py/py3k/Lib/test/test_ssl.py", line 1029, in run if not self.wrap_conn(): File "/home/wolf/dev/py/py3k/Lib/test/test_ssl.py", line 980, in wrap_conn self.sock, server_side=True) File "/home/wolf/dev/py/py3k/Lib/ssl.py", line 232, in wrap_socket _context=self) File "/home/wolf/dev/py/py3k/Lib/ssl.py", line 332, in __init__ raise x File "/home/wolf/dev/py/py3k/Lib/ssl.py", line 328, in __init__ self.do_handshake() File "/home/wolf/dev/py/py3k/Lib/ssl.py", line 543, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 104] Connection reset by peer {TLSv1->SSLv3} CERT_NONE SSLv23->SSLv3 CERT_NONE ok test_protocol_tlsv1 (test.test_ssl.ThreadedTests) Connecting to a TLSv1 server with various client options ... TLSv1->TLSv1 CERT_NONE TLSv1->TLSv1 CERT_OPTIONAL TLSv1->TLSv1 CERT_REQUIRED {SSLv3->TLSv1} CERT_NONE {SSLv23->TLSv1} CERT_NONE Exception in thread Thread-76: Traceback (most recent call last): File "/home/wolf/dev/py/py3k/Lib/threading.py", line 639, in _bootstrap_inner self.run() File "/home/wolf/dev/py/py3k/Lib/test/test_ssl.py", line 1029, in run if not self.wrap_conn(): File "/home/wolf/dev/py/py3k/Lib/test/test_ssl.py", line 980, in wrap_conn self.sock, server_side=True) File "/home/wolf/dev/py/py3k/Lib/ssl.py", line 232, in wrap_socket _context=self) File "/home/wolf/dev/py/py3k/Lib/ssl.py", line 332, in __init__ raise x File "/home/wolf/dev/py/py3k/Lib/ssl.py", line 328, in __init__ self.do_handshake() File "/home/wolf/dev/py/py3k/Lib/ssl.py", line 543, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 104] Connection reset by peer ok test_recv_send (test.test_ssl.ThreadedTests) [...] ---------------------------------------------------------------------- Ran 58 tests in 2.080s OK (skipped=1) 1 test OK. ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 14:19:09 2013 From: report at bugs.python.org (Ram Rachum) Date: Sun, 03 Mar 2013 13:19:09 +0000 Subject: [issue17032] Misleading error message: global name 'X' is not defined In-Reply-To: <1359124974.58.0.158587338796.issue17032@psf.upfronthosting.co.za> Message-ID: <1362316749.54.0.867887315671.issue17032@psf.upfronthosting.co.za> Ram Rachum added the comment: Awesome, thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 14:34:07 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 03 Mar 2013 13:34:07 +0000 Subject: [issue13898] Ignored exception in test_ssl In-Reply-To: <1327769564.73.0.643604928649.issue13898@psf.upfronthosting.co.za> Message-ID: <1362317647.45.0.667789913013.issue13898@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Ok, I guess we could handle the ConnectionResetError as a SSLError for the purpose of those tests. What probably happens is that OpenSSL versions, instead of answering "sorry, I can't talk to you", brutally reset the connections. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 14:34:29 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 03 Mar 2013 13:34:29 +0000 Subject: [issue13898] Ignored exception in test_ssl In-Reply-To: <1327769564.73.0.643604928649.issue13898@psf.upfronthosting.co.za> Message-ID: <1362317669.5.0.646971175691.issue13898@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Ezio, Nadeem, do you want to provide a patch? ---------- priority: normal -> low versions: +Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 14:56:15 2013 From: report at bugs.python.org (Roy Smith) Date: Sun, 03 Mar 2013 13:56:15 +0000 Subject: [issue17341] Poor error message when compiling invalid regex Message-ID: <1362318975.95.0.685473127287.issue17341@psf.upfronthosting.co.za> New submission from Roy Smith: >>> re.compile('(?P=)') Traceback (most recent call last): File "", line 1, in File "/home/roy/env/python/lib/python2.7/re.py", line 190, in compile return _compile(pattern, flags) File "/home/roy/env/python/lib/python2.7/re.py", line 242, in _compile raise error, v # invalid expression sre_constants.error: bad character in group name The error here is that I put a "=" where it shouldn't be. The error message is misleading. The "group name" is the stuff between the <>'s. That part's fine. What's broken is the stuff outside of the <>'s. Unclear if it's reasonable to expect such precise error reporting here, but this one seems particularly misleading, so opening a ticket to record the observation. ---------- components: Regular Expressions messages: 183375 nosy: ezio.melotti, mrabarnett, roysmith priority: normal severity: normal status: open title: Poor error message when compiling invalid regex type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 15:07:56 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 03 Mar 2013 14:07:56 +0000 Subject: [issue16763] test_ssl with connect_ex don't handle unreachable server correctly In-Reply-To: <1356349308.1.0.276929202525.issue16763@psf.upfronthosting.co.za> Message-ID: <1362319676.37.0.194912799497.issue16763@psf.upfronthosting.co.za> Ezio Melotti added the comment: Is this still an issue? ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 15:17:11 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sun, 03 Mar 2013 14:17:11 +0000 Subject: [issue17094] sys._current_frames() reports too many/wrong stack frames In-Reply-To: <1362267785.21.0.950759332924.issue17094@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: > Did you forget to attach the patch? Oops... ---------- Added file: http://bugs.python.org/file29295/tstate_after_fork.diff _______________________________________ Python tracker _______________________________________ -------------- next part -------------- diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -728,6 +728,31 @@ for t in threads: t.join() + @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()") + def test_clear_threads_states_after_fork(self): + # Issue #17094: check that threads states are cleared after fork() + + # start a bunch of threads + threads = [] + for i in range(16): + t = threading.Thread(target=lambda : time.sleep(0.3)) + threads.append(t) + t.start() + + pid = os.fork() + if pid == 0: + # check that threads states have been cleared + if len(sys._current_frames()) == 1: + os._exit(0) + else: + os._exit(1) + else: + _, status = os.waitpid(pid, 0) + self.assertEqual(0, status) + + for t in threads: + t.join() + class ThreadingExceptionTests(BaseTestCase): # A RuntimeError should be raised if Thread.start() is called diff --git a/Python/ceval.c b/Python/ceval.c --- a/Python/ceval.c +++ b/Python/ceval.c @@ -364,29 +364,29 @@ drop_gil(tstate); } -/* This function is called from PyOS_AfterFork to ensure that newly - created child processes don't hold locks referring to threads which - are not running in the child process. (This could also be done using - pthread_atfork mechanism, at least for the pthreads implementation.) */ +/* This function is called from PyOS_AfterFork to destroy all threads which are + * not running in the child process, and clear internal locks which might be + * held by those threads. (This could also be done using pthread_atfork + * mechanism, at least for the pthreads implementation.) */ void PyEval_ReInitThreads(void) { _Py_IDENTIFIER(_after_fork); PyObject *threading, *result; - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *current_tstate = PyThreadState_GET(); + PyThreadState *tstate, *tstate_next; if (!gil_created()) return; recreate_gil(); pending_lock = PyThread_allocate_lock(); - take_gil(tstate); + take_gil(current_tstate); main_thread = PyThread_get_thread_ident(); /* Update the threading module with the new state. */ - tstate = PyThreadState_GET(); - threading = PyMapping_GetItemString(tstate->interp->modules, + threading = PyMapping_GetItemString(current_tstate->interp->modules, "threading"); if (threading == NULL) { /* threading not imported */ @@ -399,6 +399,16 @@ else Py_DECREF(result); Py_DECREF(threading); + + /* destroy all threads except the current one */ + for (tstate = PyInterpreterState_ThreadHead(current_tstate->interp); + tstate; tstate = tstate_next) { + tstate_next = PyThreadState_Next(tstate); + if (tstate != current_tstate) { + PyThreadState_Clear(tstate); + PyThreadState_Delete(tstate); + } + } } #else From report at bugs.python.org Sun Mar 3 15:22:10 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sun, 03 Mar 2013 14:22:10 +0000 Subject: [issue6419] Broken test_kqueue.py on OpenBSD In-Reply-To: <1246742581.68.0.218952543803.issue6419@psf.upfronthosting.co.za> Message-ID: <1362320530.91.0.837375103433.issue6419@psf.upfronthosting.co.za> Charles-Fran?ois Natali added the comment: The test assumes that the input flags (EV_ADD, EV_ENABLE...) will be returned in the output events. It's apparently not the case on OpenBSD and NetBSD (and probably on OS-X neither, because this check is disabled on this platform), and I can't see anything in the kqueue man pages hinting to this behavior (only specific flags will be set on output, like EV_ERROR). Knowing which flag was specified is not really useful actually. The patch attached just removes this check (we keep checking the file descriptors and filter, of course). ---------- keywords: +needs review, patch Added file: http://bugs.python.org/file29296/kqueue_flags.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 15:25:10 2013 From: report at bugs.python.org (=?utf-8?q?Zbyn=C4=9Bk_Winkler?=) Date: Sun, 03 Mar 2013 14:25:10 +0000 Subject: [issue17342] datetime.strptime does not implement %z Message-ID: <1362320710.15.0.670090383938.issue17342@psf.upfronthosting.co.za> New submission from Zbyn?k Winkler: According to http://docs.python.org/2/library/datetime.html#strftime-strptime-behavior the %z directive is used to specify the timezone offset of the form +HHMM or -HHMM. However it is not implemented in datetime.strptime. I'd prefer to have %z available in strptime but if not having it is a deliberate decision I think it should be mentioned in the documentation as not to confuse users. ---------- components: Library (Lib) messages: 183379 nosy: zwn priority: normal severity: normal status: open title: datetime.strptime does not implement %z type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 15:27:39 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 03 Mar 2013 14:27:39 +0000 Subject: [issue13898] Ignored exception in test_ssl In-Reply-To: <1327769564.73.0.643604928649.issue13898@psf.upfronthosting.co.za> Message-ID: <1362320859.54.0.303878046532.issue13898@psf.upfronthosting.co.za> Ezio Melotti added the comment: The first traceback comes from try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, False, client_options=ssl.OP_NO_SSLv3) in test_protocol_sslv3. The test is marked with the @skip_if_broken_ubuntu_ssl decorator, but this seems to be some different kind of brokenness. ---------- priority: low -> normal versions: -Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 15:30:25 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 03 Mar 2013 14:30:25 +0000 Subject: [issue13898] Ignored exception in test_ssl In-Reply-To: <1327769564.73.0.643604928649.issue13898@psf.upfronthosting.co.za> Message-ID: <1362321025.4.0.549273651738.issue13898@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- priority: normal -> low versions: +Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 15:33:25 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 03 Mar 2013 14:33:25 +0000 Subject: [issue17341] Poor error message when compiling invalid regex In-Reply-To: <1362318975.95.0.685473127287.issue17341@psf.upfronthosting.co.za> Message-ID: <1362321205.07.0.472043150843.issue17341@psf.upfronthosting.co.za> R. David Murray added the comment: The error is that '<' is not legal in a group name, and the parser is parsing the P= form. The error message could be improved by including the bad character in the message. ---------- keywords: +easy nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 15:48:37 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 03 Mar 2013 14:48:37 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362322117.06.0.502279741608.issue17322@psf.upfronthosting.co.za> R. David Murray added the comment: Given that this is an RFC violation it looks appropriate as a bug fix for all active versions to me. The patch looks good, though I might decide to break up the test. ---------- nosy: +r.david.murray stage: -> commit review type: -> behavior versions: +Python 2.7, Python 3.2, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 16:20:24 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 03 Mar 2013 15:20:24 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362324024.26.0.561093262358.issue17322@psf.upfronthosting.co.za> R. David Murray added the comment: Ah, but that's a draft and not approved. Hmm. There is a possibility this change would break code, if the code tries to look up a header by the same key it used to set it. On the other hand, the key use for the set is already modified by the existing code...difficult call. Having looked in more detail at the test, I think it actually belongs in test_urllib2. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 16:42:42 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 03 Mar 2013 15:42:42 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362325362.04.0.981168090469.issue17322@psf.upfronthosting.co.za> R. David Murray added the comment: Here is a modified patch with the tests moved to test_urllib2. I'll give people some time to comment on whether this should be applied at all, and if so if it should be backported. I'm leaning toward doing both, at the moment. Karl, thanks for the report and patch. The urllib tests could use a bit of reorganization to make them more discoverable, but I don't know that that is very likely to happen :) The case of doing an add_header with newlines in it is probably worth a separate issue. We fixed a similar issue in the email package a while back, but that one was much more likely to be an issue since it is much more likely for a program to be adding headers to an email message based on user input than it is to be adding headers to a Request based on user input. But I'm sure it does happen, so it is probably worth fixing. ---------- Added file: http://bugs.python.org/file29297/request_header_space_removal.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 17:29:23 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 03 Mar 2013 16:29:23 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362328163.33.0.808411359863.issue17322@psf.upfronthosting.co.za> Senthil Kumaran added the comment: David & Karl - I had been thinking on this. My understanding of the RFC implies that "server" should reject when the headers contain the whitespace and I had a little concern if the client library should feel free to cleanup a wrongly set headers? Would it be a good idea to see what curl is doing? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 17:38:23 2013 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 03 Mar 2013 16:38:23 +0000 Subject: [issue16447] SEGFAULT when setting type.__name__ In-Reply-To: <1352419760.39.0.728241030951.issue16447@psf.upfronthosting.co.za> Message-ID: <1362328703.53.0.604450434576.issue16447@psf.upfronthosting.co.za> Mark Dickinson added the comment: Patch for the immediate issue, for Python 2.7. The Py_DECREF is delayed until after setting *both* ht_name and tp_name. ---------- Added file: http://bugs.python.org/file29298/issue16447_27.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 17:48:14 2013 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 03 Mar 2013 16:48:14 +0000 Subject: [issue16447] SEGFAULT when setting type.__name__ In-Reply-To: <1352419760.39.0.728241030951.issue16447@psf.upfronthosting.co.za> Message-ID: <1362329294.41.0.942906979785.issue16447@psf.upfronthosting.co.za> Mark Dickinson added the comment: And the corresponding patch against 3.2 (applies cleanly to 3.3 and default, modulo Misc/NEWS fixes). ---------- Added file: http://bugs.python.org/file29299/issue16447_32.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 17:58:24 2013 From: report at bugs.python.org (Nadeem Vawda) Date: Sun, 03 Mar 2013 16:58:24 +0000 Subject: [issue13898] Ignored exception in test_ssl In-Reply-To: <1327769564.73.0.643604928649.issue13898@psf.upfronthosting.co.za> Message-ID: <1362329904.01.0.79862090388.issue13898@psf.upfronthosting.co.za> Nadeem Vawda added the comment: This change fixes the problem (and doesn't break anything else that I can see): --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -979,7 +979,7 @@ self.sslconn = self.server.context.wrap_socket( self.sock, server_side=True) self.server.selected_protocols.append(self.sslconn.selected_npn_protocol()) - except ssl.SSLError as e: + except (ssl.SSLError, ConnectionResetError) as e: # XXX Various errors can have happened here, for example # a mismatching protocol version, an invalid certificate, # or a low-level bug. This should be made more discriminating. Does that look reasonable? ---------- stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 18:04:21 2013 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Mar 2013 17:04:21 +0000 Subject: [issue14123] Indicate that there are no current plans to deprecate printf-style formatting In-Reply-To: <1330202928.96.0.727285588049.issue14123@psf.upfronthosting.co.za> Message-ID: <1362330261.57.0.800972485022.issue14123@psf.upfronthosting.co.za> Mark Lawrence added the comment: I can't see too much sense in leaving this open, what are your opinions? ---------- nosy: +BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 18:55:40 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sun, 03 Mar 2013 17:55:40 +0000 Subject: [issue16860] Use O_CLOEXEC in the tempfile module In-Reply-To: <1357309349.04.0.535037454982.issue16860@psf.upfronthosting.co.za> Message-ID: <1362333340.08.0.625012076346.issue16860@psf.upfronthosting.co.za> Charles-Fran?ois Natali added the comment: Closing. Let's keep O_NOFOLLOW: it doesn't buy much, and might be useful for some arcane reason on some weird platform... ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 18:58:22 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sun, 03 Mar 2013 17:58:22 +0000 Subject: [issue15448] utimes() functions fail with ENOSYS even when detected by configure In-Reply-To: <1343235007.8.0.870502159269.issue15448@psf.upfronthosting.co.za> Message-ID: <1362333502.78.0.0634109077412.issue15448@psf.upfronthosting.co.za> Charles-Fran?ois Natali added the comment: Alright, closing. ---------- resolution: -> invalid stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 19:02:35 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sun, 03 Mar 2013 18:02:35 +0000 Subject: [issue16962] _posixsubprocess module uses outdated getdents system call In-Reply-To: <1358166122.64.0.0915225985014.issue16962@psf.upfronthosting.co.za> Message-ID: <1362333755.35.0.556537552469.issue16962@psf.upfronthosting.co.za> Charles-Fran?ois Natali added the comment: Gregory, do you have time to take care of this? ---------- nosy: +neologix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 19:15:11 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 03 Mar 2013 18:15:11 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362334511.22.0.360442437097.issue17322@psf.upfronthosting.co.za> R. David Murray added the comment: Good point. Seeing what curl does sounds like a good idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 19:53:11 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 03 Mar 2013 18:53:11 +0000 Subject: [issue13898] Ignored exception in test_ssl In-Reply-To: <1327769564.73.0.643604928649.issue13898@psf.upfronthosting.co.za> Message-ID: <1362336791.66.0.336744383804.issue13898@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Yes, it's certainly reasonable. You could add a comment explaining the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 19:53:33 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 03 Mar 2013 18:53:33 +0000 Subject: [issue16962] _posixsubprocess module uses outdated getdents system call In-Reply-To: <1358166122.64.0.0915225985014.issue16962@psf.upfronthosting.co.za> Message-ID: <3ZJtmr3zMvzNlk@mail.python.org> Roundup Robot added the comment: New changeset 30e643e36bae by Gregory P. Smith in branch '3.3': Issue #16962: Use getdents64 instead of the obsolete getdents syscall in http://hg.python.org/cpython/rev/30e643e36bae New changeset 7ab1c55fcf82 by Gregory P. Smith in branch 'default': Fixes Issue #16962: Use getdents64 instead of the obsolete getdents syscall http://hg.python.org/cpython/rev/7ab1c55fcf82 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 19:54:48 2013 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 03 Mar 2013 18:54:48 +0000 Subject: [issue16962] _posixsubprocess module uses outdated getdents system call In-Reply-To: <1358166122.64.0.0915225985014.issue16962@psf.upfronthosting.co.za> Message-ID: <1362336888.24.0.364310466703.issue16962@psf.upfronthosting.co.za> Gregory P. Smith added the comment: looks sane and cleaner than the silly x32 hack in there, i'll take care of it. FYI - your patch forgot to add the "unsigned char d_type;" struct member before name. fixed and applied. When i wrote that code I was probably assuming that sticking with the ancient syscall made more sense for compatibility. I'm happy to see that compatibility goes the other way on this one. ---------- assignee: -> gregory.p.smith resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 19:56:02 2013 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 03 Mar 2013 18:56:02 +0000 Subject: [issue16447] SEGFAULT when setting type.__name__ In-Reply-To: <1352419760.39.0.728241030951.issue16447@psf.upfronthosting.co.za> Message-ID: <1362336962.1.0.296165312825.issue16447@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- stage: needs patch -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 19:56:11 2013 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 03 Mar 2013 18:56:11 +0000 Subject: [issue16447] SEGFAULT when setting type.__name__ In-Reply-To: <1352419760.39.0.728241030951.issue16447@psf.upfronthosting.co.za> Message-ID: <1362336971.25.0.783036529373.issue16447@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- assignee: -> mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 19:57:55 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 03 Mar 2013 18:57:55 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362337075.26.0.341292486129.issue17322@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Looks like curl is sending the headers without removing spaces. Check Raw here link here. (The link would probably be online a week) http://requestb.in/1kfodmj1?inspect $ curl --header "X-MyHeader : 123" http://requestb.in/1kfodmj1 ok $ curl --header " X-MyHeader : 123"http://requestb.in/1kfodmj1 ok $ curl --header " X-MyHeader\nY-Header : 123" http://requestb.in/1kfodmj1 ok ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 20:14:28 2013 From: report at bugs.python.org (karl) Date: Sun, 03 Mar 2013 19:14:28 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362338068.52.0.933869048026.issue17322@psf.upfronthosting.co.za> karl added the comment: Hello, So I tested a bit. The production rules defined by the specification are clear. Spaces before and after are forbidden. header-field = field-name ":" OWS field-value BWS field-name = token field-value = *( field-content / obs-fold ) field-content = *( HTAB / SP / VCHAR / obs-text ) obs-fold = CRLF ( SP / HTAB ) ; obsolete line folding ; see Section 3.2.4 and token = 1*tchar and tchar as tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA Here are the production rules for HTTP headers for messages (so both Request and Responses). You can have funky headers, I guess that would be interesting to add to the urllib tests too. Basically to have something in the library, which check if header contains the tchar characters and sends back a warning of exception when not part of it. curl has a bug too, IMHO. Though, one might argue that it is practical for testing bugs. :) On the side of parsing it's clear for the trailing space but unknown for the leading spaces. I sent a long email explaining the issue to the HTTP WG. See http://lists.w3.org/Archives/Public/ietf-http-wg/2013JanMar/1166.html Let's see what will be the answers ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 20:18:19 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 03 Mar 2013 19:18:19 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362338068.52.0.933869048026.issue17322@psf.upfronthosting.co.za> Message-ID: Senthil Kumaran added the comment: Oh wow. Thank you very much Karl for the care. I am having the same inclination are you too, but determining a definite answer is really helpful before going ahead into making the change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 20:29:32 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 03 Mar 2013 19:29:32 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: Message-ID: Senthil Kumaran added the comment: The curl example also suggest to think about "pragamatic de-facto" stuff. Will removing the spaces cause any breakage? I can say for sure. But if someone can think of it, it would be good for at least us know. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 21:56:40 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 03 Mar 2013 20:56:40 +0000 Subject: [issue17278] SIGSEGV in _heapqmodule.c In-Reply-To: <1361564739.94.0.652055114597.issue17278@psf.upfronthosting.co.za> Message-ID: <1362344200.19.0.471466897265.issue17278@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Antoine, thanks for the patch. This looks like a reasonable solution that is fast and prevents segfaults. The error message should say more than just that the size changed. it should also note that the heap may no longer be in the heap condition since it was interrupted in the middle of an update. I'm also wondering whether a stronger check is needed than detecting a length change (perhaps something akin to the logic used in Py_ReprEnter and Py_ReprLeave). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 22:34:50 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 03 Mar 2013 21:34:50 +0000 Subject: [issue13898] Ignored exception in test_ssl In-Reply-To: <1327769564.73.0.643604928649.issue13898@psf.upfronthosting.co.za> Message-ID: <3ZJyLx21XBz7LkY@mail.python.org> Roundup Robot added the comment: New changeset fa24c1382bd3 by Nadeem Vawda in branch '3.2': Issue #13898: test_ssl no longer prints a spurious stack trace on Ubuntu. http://hg.python.org/cpython/rev/fa24c1382bd3 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 22:44:39 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 03 Mar 2013 21:44:39 +0000 Subject: [issue13898] Ignored exception in test_ssl In-Reply-To: <1327769564.73.0.643604928649.issue13898@psf.upfronthosting.co.za> Message-ID: <3ZJyZH1M5nzRqX@mail.python.org> Roundup Robot added the comment: New changeset 77cbb3ba5d40 by Nadeem Vawda in branch '3.3': Issue #13898: test_ssl no longer prints a spurious stack trace on Ubuntu. http://hg.python.org/cpython/rev/77cbb3ba5d40 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 22:48:36 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 03 Mar 2013 21:48:36 +0000 Subject: [issue13898] Ignored exception in test_ssl In-Reply-To: <1327769564.73.0.643604928649.issue13898@psf.upfronthosting.co.za> Message-ID: <3ZJyfq4SRdzQfC@mail.python.org> Roundup Robot added the comment: New changeset 69f737f410f0 by Nadeem Vawda in branch 'default': Issue #13898: test_ssl no longer prints a spurious stack trace on Ubuntu. http://hg.python.org/cpython/rev/69f737f410f0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 22:53:25 2013 From: report at bugs.python.org (Nadeem Vawda) Date: Sun, 03 Mar 2013 21:53:25 +0000 Subject: [issue13898] Ignored exception in test_ssl In-Reply-To: <1327769564.73.0.643604928649.issue13898@psf.upfronthosting.co.za> Message-ID: <1362347605.5.0.572601957294.issue13898@psf.upfronthosting.co.za> Nadeem Vawda added the comment: > You could add a comment explaining the issue. Done. This doesn't seem to affect 2.7. Marking as fixed in 3.2/3.3/3.4. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 22:57:05 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 03 Mar 2013 21:57:05 +0000 Subject: [issue13898] Ignored exception in test_ssl In-Reply-To: <1327769564.73.0.643604928649.issue13898@psf.upfronthosting.co.za> Message-ID: <1362347825.79.0.935670811808.issue13898@psf.upfronthosting.co.za> Ezio Melotti added the comment: Thanks for the fix -- that solved the problem here too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 23:15:44 2013 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 03 Mar 2013 22:15:44 +0000 Subject: [issue12768] docstrings for the threading module In-Reply-To: <1313548989.72.0.178892692878.issue12768@psf.upfronthosting.co.za> Message-ID: <1362348944.19.0.360981452106.issue12768@psf.upfronthosting.co.za> Eli Bendersky added the comment: moijes, did you address the review comments? Does your patch apply to 3.2? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 23:26:41 2013 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 03 Mar 2013 22:26:41 +0000 Subject: [issue10590] Parameter type error for xml.sax.parseString(string, ...) In-Reply-To: <1291145861.74.0.873169501029.issue10590@psf.upfronthosting.co.za> Message-ID: <1362349600.99.0.909080478058.issue10590@psf.upfronthosting.co.za> Eli Bendersky added the comment: I'm not very knowledgeable in other XML modules, but I hate to see this patch linger. Also it's a pre-requisite for #16986, it seems. Serhiy, since the patch is large could you give a short summary of the things it fixes? Note that the best approach IMHO is to submit and push minimal patches that fix specific issues and not lump several fixes together, unless it doesn't make sense to separate them. ---------- nosy: +eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 3 23:43:59 2013 From: report at bugs.python.org (Christian Heimes) Date: Sun, 03 Mar 2013 22:43:59 +0000 Subject: [issue10590] Parameter type error for xml.sax.parseString(string, ...) In-Reply-To: <1291145861.74.0.873169501029.issue10590@psf.upfronthosting.co.za> Message-ID: <1362350639.42.0.458131439907.issue10590@psf.upfronthosting.co.za> Christian Heimes added the comment: Please hold of any modifications of XML code until we have decided how we are going to fix the XML exploits. Also I think this is a new feature and not a fix. parseString() is documented as 'parses from a buffer string'. It doesn't say that it can parse text. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 00:08:10 2013 From: report at bugs.python.org (karl) Date: Sun, 03 Mar 2013 23:08:10 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362352089.99.0.794632562373.issue17322@psf.upfronthosting.co.za> karl added the comment: OK. I'm inclined to think that we should both remove trailing and leading spaces/tabs should be removed. Reasons: 1. Production rules forbid them. 2. Trailing spaces 2.a Conformant servers will ignore with a 400 bad request (opportunity for another bugs?) 2.b Conformant proxies will rewrite the header by removing spaces. 3. Leading spaces are continuation lines. See below. I had completely missed that. The syntax for headers is: header-field = field-name ":" OWS field-value BWS field-name = token field-value = *( field-content / obs-fold ) field-content = *( HTAB / SP / VCHAR / obs-text ) obs-fold = CRLF ( SP / HTAB ) ; obsolete line folding ; see Section 3.2.4 obs-fold is about line folding which is basically a header that would look like: foo: bar\n blah: something which could be the equivalent of: foo: bar blah: something with "foo" the header field-name and "bar blah: something" the header field-value. which is clearly not the intent of an author doing: request.add_header('Accept', 'text/html') request.add_header(' User-Agent', 'foobar/1.0') because this would be parsed by a conformant server as Accept: text/html User-Agent: foobar/1.0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 02:04:26 2013 From: report at bugs.python.org (Alex Gaynor) Date: Mon, 04 Mar 2013 01:04:26 +0000 Subject: [issue17343] Add a version of str.split which returns an iterator Message-ID: <1362359066.58.0.311917237277.issue17343@psf.upfronthosting.co.za> New submission from Alex Gaynor: str.split returns a list, which is inefficient when you just want to process items one be one. You could emulate this with str.find and tracking indexes manually, but this should really be a builtin behavior. ---------- messages: 183411 nosy: alex priority: normal severity: normal status: open title: Add a version of str.split which returns an iterator type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 02:34:03 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 04 Mar 2013 01:34:03 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362360843.57.0.73291162417.issue17322@psf.upfronthosting.co.za> R. David Murray added the comment: It is a bug in the program, though, and not particularly in the client library. As mentioned, it can even be useful for testing servers. In the email package we faithfully reproduce such headers if they are passed in. The only one we disallow is something that looks like a field label preceded by a newline, since that could be used for a header injection attack if the field value comes from user input. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 03:13:36 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 04 Mar 2013 02:13:36 +0000 Subject: [issue14645] Generator does not translate linesep characters in certain circumstances In-Reply-To: <1335117428.2.0.322445942387.issue14645@psf.upfronthosting.co.za> Message-ID: <1362363216.73.0.648526523056.issue14645@psf.upfronthosting.co.za> R. David Murray added the comment: Here's a patch, against 3.2. It definitely does affect smtplib.send_message. ---------- keywords: +patch priority: normal -> high stage: needs patch -> patch review Added file: http://bugs.python.org/file29300/generator_lineneds.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 03:31:47 2013 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 04 Mar 2013 02:31:47 +0000 Subject: [issue17343] Add a version of str.split which returns an iterator In-Reply-To: <1362359066.58.0.311917237277.issue17343@psf.upfronthosting.co.za> Message-ID: <1362364307.38.0.599287133171.issue17343@psf.upfronthosting.co.za> Gregory P. Smith added the comment: The bytes (and bytearray?) version of this should generate memoryview's instead of new bytes objects to avoid a copy. While not required, It'd be useful if the implementation of this pre-scanned the data internally so that the length of the generated sequence was known up front. This could imply an internal bitset of vector of split indices is kept for the life of the generator (implementation detail left up to the implementor) if scanning over the input data more than once is undesirable. Start with a pure python proof of concept to work everywhere, then write a native version. ---------- nosy: +gregory.p.smith stage: -> needs patch versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 04:48:43 2013 From: report at bugs.python.org (Todd Rovito) Date: Mon, 04 Mar 2013 03:48:43 +0000 Subject: [issue16278] os.rename documentation slightly inaccurate In-Reply-To: <1350581776.08.0.668682100781.issue16278@psf.upfronthosting.co.za> Message-ID: <1362368923.01.0.156378932292.issue16278@psf.upfronthosting.co.za> Changes by Todd Rovito : Removed file: http://bugs.python.org/file27890/OSRename_test_os_3point4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 04:48:54 2013 From: report at bugs.python.org (Todd Rovito) Date: Mon, 04 Mar 2013 03:48:54 +0000 Subject: [issue16278] os.rename documentation slightly inaccurate In-Reply-To: <1350581776.08.0.668682100781.issue16278@psf.upfronthosting.co.za> Message-ID: <1362368934.38.0.482184168424.issue16278@psf.upfronthosting.co.za> Changes by Todd Rovito : Removed file: http://bugs.python.org/file28071/OSRenameDocs3point4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 04:50:35 2013 From: report at bugs.python.org (karl) Date: Mon, 04 Mar 2013 03:50:35 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362369035.24.0.904841893118.issue17322@psf.upfronthosting.co.za> karl added the comment: R. David Murray, You are right it is not specific to the client library. HTTP headers are part of the message (Request/Response) with both the same constraints. Constraints are put on receivers (receiving a message) and senders (sending a message) of the message (which is not specifically related to client or server). Maybe the way forward in the future is to have a header factory shared by all HTTP libs? I noticed that http.client and http.server had similar issues: in http.server send_header in http.client putheader Which are similar features aka constructing headers for sending with the message. And what would be the elegant way to solve this current bug? Ah? before I forget? The WG is having a meeting in 2 weeks. To make a summary of the HTTPBIS work. See the agenda. http://tools.ietf.org/wg/httpbis/agenda?item=agenda-86-httpbis.html The current documents are in Last Call with no issues unresolved. http://trac.tools.ietf.org/wg/httpbis/trac/report/20 So if R. David is worried that it will change, we can wait a bit more before taking actions, if we are going the way of removing leading/trailing spaces. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 04:53:54 2013 From: report at bugs.python.org (Todd Rovito) Date: Mon, 04 Mar 2013 03:53:54 +0000 Subject: [issue16278] os.rename documentation slightly inaccurate In-Reply-To: <1350581776.08.0.668682100781.issue16278@psf.upfronthosting.co.za> Message-ID: <1362369234.18.0.558563973256.issue16278@psf.upfronthosting.co.za> Todd Rovito added the comment: Combined the test cases and document changes into a single patch. As suggested by Mr. Terry Reedy I used a table and removed the text. The table still needs some work but it is a good start. As suggested by Mr. Jerdonek I tried to make the test cases WETter by setting up the files and directories one time in the setup method then only changing that setup in the actual test case only if needed. This patch needs still needs some work but I wanted people to know I had not quit yet. It still needs to be tested on Windows, which I will do ASAP. Thanks. ---------- Added file: http://bugs.python.org/file29301/16278OSRenameDocsTest.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 07:32:05 2013 From: report at bugs.python.org (shilpi) Date: Mon, 04 Mar 2013 06:32:05 +0000 Subject: [issue17344] checking size of size_t... configure: error: Message-ID: <1362378724.97.0.818399526609.issue17344@psf.upfronthosting.co.za> New submission from shilpi: Hi we are facing "checking size of size_t error" in building python2.6 checking size of size_t... configure: error: in `/var/tmp/python_build/Python-2.6.8': configure: error: cannot compute sizeof (size_t). Is there any fix for this issue or anysolution ---------- messages: 183417 nosy: shilpi priority: normal severity: normal status: open title: checking size of size_t... configure: error: versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 07:33:25 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 06:33:25 +0000 Subject: [issue17344] checking size of size_t... configure: error: In-Reply-To: <1362378724.97.0.818399526609.issue17344@psf.upfronthosting.co.za> Message-ID: <1362378805.29.0.0976084962861.issue17344@psf.upfronthosting.co.za> Ezio Melotti added the comment: Have you tried with Python 2.7? ---------- nosy: +ezio.melotti type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 07:36:58 2013 From: report at bugs.python.org (shilpi) Date: Mon, 04 Mar 2013 06:36:58 +0000 Subject: [issue17344] checking size of size_t... configure: error: In-Reply-To: <1362378805.29.0.0976084962861.issue17344@psf.upfronthosting.co.za> Message-ID: shilpi added the comment: I have not tried with Python2.7. Our requirement that we need python2.6. If you have any idea or clue for this issue Regards Shilpi ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 07:50:25 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 06:50:25 +0000 Subject: [issue17344] checking size of size_t... configure: error: In-Reply-To: <1362378724.97.0.818399526609.issue17344@psf.upfronthosting.co.za> Message-ID: <1362379825.93.0.461432294128.issue17344@psf.upfronthosting.co.za> Ezio Melotti added the comment: Can you provide more information about your operating system/platform? Python 2.6 only receives security fixes, so even if it's a bug it can't be fixed there (it could be fixed on 2.7 though). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 08:06:50 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 04 Mar 2013 07:06:50 +0000 Subject: [issue16997] subtests In-Reply-To: <1358543231.78.0.354364612897.issue16997@psf.upfronthosting.co.za> Message-ID: <1362380810.08.0.943064014213.issue16997@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 08:07:00 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 04 Mar 2013 07:07:00 +0000 Subject: [issue7897] Support parametrized tests in unittest In-Reply-To: <1265768482.24.0.694001982317.issue7897@psf.upfronthosting.co.za> Message-ID: <1362380820.49.0.220056054791.issue7897@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 08:21:20 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 04 Mar 2013 07:21:20 +0000 Subject: [issue16098] Bisect optimization in heapq.nsmallest is never used In-Reply-To: <1349091566.51.0.299551598321.issue16098@psf.upfronthosting.co.za> Message-ID: <3ZKCMg2ZhqzS8n@mail.python.org> Roundup Robot added the comment: New changeset 362826298fdb by Raymond Hettinger in branch 'default': Issue #16098: Update heapq.nsmallest to use the same algorithm as nlargest. http://hg.python.org/cpython/rev/362826298fdb ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 08:23:17 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 04 Mar 2013 07:23:17 +0000 Subject: [issue16098] Bisect optimization in heapq.nsmallest is never used In-Reply-To: <1349091566.51.0.299551598321.issue16098@psf.upfronthosting.co.za> Message-ID: <1362381797.45.0.421482348837.issue16098@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 08:29:11 2013 From: report at bugs.python.org (shilpi) Date: Mon, 04 Mar 2013 07:29:11 +0000 Subject: [issue17344] checking size of size_t... configure: error: In-Reply-To: <1362379825.93.0.461432294128.issue17344@psf.upfronthosting.co.za> Message-ID: shilpi added the comment: Hi , Currently we are using thi version cat /etc/release Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved. Assembled 23 August 2011 Regards Shilpi -----Original Message----- From: Ezio Melotti [mailto:report at bugs.python.org] Sent: Monday, March 04, 2013 12:20 PM To: Shilpi Singh (WT01 - GMT-Telecom Equipment) Subject: [issue17344] checking size of size_t... configure: error: Ezio Melotti added the comment: Can you provide more information about your operating system/platform? Python 2.6 only receives security fixes, so even if it's a bug it can't be fixed there (it could be fixed on 2.7 though). ---------- _______________________________________ Python tracker _______________________________________ Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 08:55:45 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 07:55:45 +0000 Subject: [issue17343] Add a version of str.split which returns an iterator In-Reply-To: <1362359066.58.0.311917237277.issue17343@psf.upfronthosting.co.za> Message-ID: <1362383745.91.0.0426757153491.issue17343@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > While not required, It'd be useful if the implementation of this pre-scanned the data internally so that the length of the generated sequence was known up front. This could imply an internal bitset of vector of split indices is kept for the life of the generator (implementation detail left up to the implementor) if scanning over the input data more than once is undesirable. bytearray can be modified between iterations. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 09:22:37 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 08:22:37 +0000 Subject: [issue17328] Fix reference leak in dict_setdefault() in case of resize failure In-Reply-To: <1362146633.78.0.0455037271826.issue17328@psf.upfronthosting.co.za> Message-ID: <1362385357.01.0.143598163023.issue17328@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: LGTM. This is 3.3+ only issue as far as I understand. ---------- nosy: +benjamin.peterson versions: -Python 2.6, Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 09:26:17 2013 From: report at bugs.python.org (Nikita Nemkin) Date: Mon, 04 Mar 2013 08:26:17 +0000 Subject: [issue17345] Portable and extended type specifiers for array module Message-ID: <1362385577.82.0.862277690656.issue17345@psf.upfronthosting.co.za> New submission from Nikita Nemkin: Currently array module only provides platform-dependent type specifiers. It would be very nice to have platform-independent specifiers in addition to that, matching the struct module. For example array(' an array of little-endian 2-byte integers. This issue crops up every time when I use array(). Binary data usually comes in some predefined format and a manual matching to native format has to be done (assuming I want to write portable code). A useful extra would be to support multi-element struct specifiers and present an array of tuples in this case. For example array('iff') -> an array of tuples (int, float, float) with native types. ---------- components: Library (Lib) messages: 183425 nosy: nnemkin priority: normal severity: normal status: open title: Portable and extended type specifiers for array module type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 10:06:28 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 04 Mar 2013 09:06:28 +0000 Subject: [issue17278] SIGSEGV in _heapqmodule.c In-Reply-To: <1361564739.94.0.652055114597.issue17278@psf.upfronthosting.co.za> Message-ID: <1362387988.65.0.158312965402.issue17278@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- Removed message: http://bugs.python.org/msg183401 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 10:07:35 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 04 Mar 2013 09:07:35 +0000 Subject: [issue17278] SIGSEGV in _heapqmodule.c In-Reply-To: <1361564739.94.0.652055114597.issue17278@psf.upfronthosting.co.za> Message-ID: <1362388055.83.0.471217201813.issue17278@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Antoine, thanks for the patch. This looks like a reasonable solution that is fast and prevents segfaults. ---------- assignee: rhettinger -> pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 10:18:56 2013 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 04 Mar 2013 09:18:56 +0000 Subject: [issue15216] Support setting the encoding on a text stream after creation In-Reply-To: <1340880558.16.0.0136840668667.issue15216@psf.upfronthosting.co.za> Message-ID: <1362388736.02.0.958951117196.issue15216@psf.upfronthosting.co.za> Nick Coghlan added the comment: That's a fair point - I think it's acceptable to throw an error in the case of *already decoded* characters that haven't been read. There's also a discussion on python-ideas about an explicit API for clearing the internal buffers, and pushing data back into a stream. If that is added, then set_encoding() would be free to error out if there was any already buffered data - it would be up to the application to call clear_buffer() before calling set_encoding(), and deal with an such data appropriately (such as calling push_data() with the results of the clear_buffer() call) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 10:19:49 2013 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 04 Mar 2013 09:19:49 +0000 Subject: [issue15216] Support setting the encoding on a text stream after creation In-Reply-To: <1340880558.16.0.0136840668667.issue15216@psf.upfronthosting.co.za> Message-ID: <1362388789.17.0.412743255539.issue15216@psf.upfronthosting.co.za> Nick Coghlan added the comment: Oops, meant to link to my post in the thread about a buffer manipulation API: http://mail.python.org/pipermail/python-ideas/2013-March/019769.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 10:45:52 2013 From: report at bugs.python.org (Marius Gedminas) Date: Mon, 04 Mar 2013 09:45:52 +0000 Subject: [issue17346] Pickle tests do not test protocols 0, 1, and 2 for bytes Message-ID: <1362390352.97.0.872736532122.issue17346@psf.upfronthosting.co.za> New submission from Marius Gedminas: I was reading Lib/test/pickletester.py when I noticed that test_bytes loops over all the protocols but doesn't actually use the loop variable anywhere. Attached patch should fix this. ---------- components: Tests files: actually-test-all-protocols.diff keywords: patch messages: 183429 nosy: mgedmin priority: normal severity: normal status: open title: Pickle tests do not test protocols 0, 1, and 2 for bytes type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file29302/actually-test-all-protocols.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 11:17:33 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 10:17:33 +0000 Subject: [issue17346] Pickle tests do not test protocols 0, 1, and 2 for bytes In-Reply-To: <1362390352.97.0.872736532122.issue17346@psf.upfronthosting.co.za> Message-ID: <1362392253.14.0.997143981895.issue17346@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 11:47:56 2013 From: report at bugs.python.org (Florian Weimer) Date: Mon, 04 Mar 2013 10:47:56 +0000 Subject: [issue17347] bsddb._openDBEnv() should not touch current directory Message-ID: <1362394076.13.0.84822225356.issue17347@psf.upfronthosting.co.za> New submission from Florian Weimer: This code: def _openDBEnv(cachesize): e = db.DBEnv() if cachesize is not None: if cachesize >= 20480: e.set_cachesize(0, cachesize) else: raise error, "cachesize must be >= 20480" e.set_lk_detect(db.DB_LOCK_DEFAULT) e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) return e causes Berkeley DB to read the DB_CONFIG file from the current directory, which may have unexpected side effects. Unfortunately, Berkeley DB still reads ./DB_CONFIG even if the first argument to DBEnv.open() is None/NULL, so the only way to suppress this behavior seems a non-existing or known-to-by-empty directory (such as "/var/empty"). ---------- components: Extension Modules messages: 183430 nosy: fweimer priority: normal severity: normal status: open title: bsddb._openDBEnv() should not touch current directory type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 11:49:37 2013 From: report at bugs.python.org (Pradyun Gedam) Date: Mon, 04 Mar 2013 10:49:37 +0000 Subject: [issue17348] Unicode - encoding seems to be lost for inputs of unicode chars Message-ID: <1362394177.55.0.407970210278.issue17348@psf.upfronthosting.co.za> New submission from Pradyun Gedam: In IDLE, I have spotted a peculiar problem. I have attached an .png file which is a screen capture of 'session' on IDLE. It seems that the Unicode character that has been input, loses its encoding. My 'session' Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> c = u'?' >>> ord(c) 128 >>> c.encode('utf-8') '\xc2\x80' >>> c u'\x80' >>> print c ? >>> c = u'\u20ac' >>> ord(c) 8364 >>> c.encode('utf-8') '\xe2\x82\xac' >>> c u'\u20ac' >>> print c ? >>> ---------- components: IDLE messages: 183431 nosy: Pradyun.Gedam priority: normal severity: normal status: open title: Unicode - encoding seems to be lost for inputs of unicode chars versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 12:38:37 2013 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Mon, 04 Mar 2013 11:38:37 +0000 Subject: [issue17347] bsddb._openDBEnv() should not touch current directory In-Reply-To: <1362394076.13.0.84822225356.issue17347@psf.upfronthosting.co.za> Message-ID: <1362397117.3.0.608564239504.issue17347@psf.upfronthosting.co.za> Jes?s Cea Avi?n added the comment: This is a standard Berkeley DB behavior. Can I suggest you to report this "issue" to Oracle forums? http://docs.oracle.com/cd/E17276_01/html/programmer_reference/env_db_config.html https://forums.oracle.com/forums/forum.jspa?forumID=271 Closing as "invalid". if you disagree, please reopen. ---------- nosy: +jcea resolution: -> invalid stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 13:04:33 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 12:04:33 +0000 Subject: [issue16620] Avoid using private function glob.glob1() in msi module and tools In-Reply-To: <1354736049.23.0.98660459286.issue16620@psf.upfronthosting.co.za> Message-ID: <1362398673.2.0.343658968083.issue16620@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I have added some comments on Rietveld. Note that glob.glob() and glob.glob1() returns different filenames. The first returns full paths and the second returns bare filenames without a directory path. Workarounding this may require more in-depth changes to the code. Actually this is a low priority issue. It is no so bad to use private functions from other modules inside Python stdlib. But it can be a bad example for a third party code. ---------- components: +Windows priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 13:09:06 2013 From: report at bugs.python.org (Phil Elson) Date: Mon, 04 Mar 2013 12:09:06 +0000 Subject: [issue13598] string.Formatter doesn't support empty curly braces "{}" In-Reply-To: <1323835162.4.0.792542335688.issue13598@psf.upfronthosting.co.za> Message-ID: <1362398946.01.0.0670046715806.issue13598@psf.upfronthosting.co.za> Phil Elson added the comment: > I didn't see a test case relating to the example in his comment, namely > > f.format("{0:{}}", 'foo', 5) > > Did I miss it? The example should fail, which it wouldn't have done with the patch previously proposed. I believe the case is covered by the block: with self.assertRaises(ValueError): fmt.format("foo{1}{}", "bar", 6) Though there is no harm in adding another test along the lines of: with self.assertRaises(ValueError): fmt.format("{0:{}}", "bar", 6) If you think it is worthwhile? I'm uncertain which documentation to update since the method which has had its signature updated is private and is called solely by Formatter.vformat . Cheers, ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 13:14:18 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 12:14:18 +0000 Subject: [issue17299] Test cPickle with real files In-Reply-To: <1361867979.39.0.619834075084.issue17299@psf.upfronthosting.co.za> Message-ID: <1362399258.7.0.692791120486.issue17299@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I have added comments on Rietveld. Perhaps it will be worth to create mixings for cStringIO.StringIO, BytesIO and file object and then mix them to other tests. Note that there is no sense to change pure Python pickle tests. Python implementation uses the same code for all streams. It's C implementation needs specialized tests (in Lib/test/test_cpickle.py). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 13:20:42 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 12:20:42 +0000 Subject: [issue17299] Test cPickle with real files In-Reply-To: <1361867979.39.0.619834075084.issue17299@psf.upfronthosting.co.za> Message-ID: <1362399642.12.0.108026509031.issue17299@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: David, yes, this is 2.7 only issue. The code was broken recently (see msg182979 in issue13555) due to insufficient testing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 13:27:33 2013 From: report at bugs.python.org (Andrey Lebedev) Date: Mon, 04 Mar 2013 12:27:33 +0000 Subject: [issue17349] wsgiref.simple_server.demo_app is not PEP-3333 compatible Message-ID: <1362400053.87.0.0342035983925.issue17349@psf.upfronthosting.co.za> New submission from Andrey Lebedev: Under certain circumstances, wsgiref.simple_server.demo_app may return unicode data, but that is prohibited by PEP-3333. This happens if environ with unicode key is passed to demo_app. Unicode keys are then written to StringIO instance, automatically making its value unicode. Type of environ keys is not strictly mandated by PEP-3333, however output of WSGI application is: "When called by the server, the application object must return an iterable yielding zero or more bytestrings.", see http://www.python.org/dev/peps/pep-3333/#specification-details Test case is attached. ---------- components: Library (Lib) files: wsgirefbug.py messages: 183437 nosy: Andrey.Lebedev priority: normal severity: normal status: open title: wsgiref.simple_server.demo_app is not PEP-3333 compatible type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file29303/wsgirefbug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 13:29:50 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 12:29:50 +0000 Subject: [issue17346] Pickle tests do not test protocols 0, 1, and 2 for bytes In-Reply-To: <1362390352.97.0.872736532122.issue17346@psf.upfronthosting.co.za> Message-ID: <1362400190.66.0.913517908158.issue17346@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: LGTM. ---------- nosy: +serhiy.storchaka versions: +Python 3.2, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 13:36:21 2013 From: report at bugs.python.org (Thomas Kluyver) Date: Mon, 04 Mar 2013 12:36:21 +0000 Subject: [issue16851] Hint about correct ismethod and isfunction usage In-Reply-To: <1357231289.77.0.0608728593688.issue16851@psf.upfronthosting.co.za> Message-ID: <1362400580.98.0.603046764475.issue16851@psf.upfronthosting.co.za> Thomas Kluyver added the comment: I agree that the docs for inspect.ismethod() for Python 2 are wrong. The docs say: "Return true if the object is a bound method written in Python." However, it also returns True for an unbound method: >>> class A: ... def meth(self): ... pass ... >>> A.meth >>> import inspect >>> inspect.ismethod(A.meth) True ---------- nosy: +takluyver _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 13:53:26 2013 From: report at bugs.python.org (Stefan Ring) Date: Mon, 04 Mar 2013 12:53:26 +0000 Subject: [issue17094] sys._current_frames() reports too many/wrong stack frames In-Reply-To: <1359668363.58.0.777154629349.issue17094@psf.upfronthosting.co.za> Message-ID: <1362401606.77.0.835465489621.issue17094@psf.upfronthosting.co.za> Stefan Ring added the comment: When I originally worked on this, I noticed that _PyThread_CurrentFrames also iterates over all interpreters. Because I have no experience with or use for multiple interpreters, I intentionally left it out of my patch, but shouldn't it be taken into account for a real patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 13:56:24 2013 From: report at bugs.python.org (Tomgu) Date: Mon, 04 Mar 2013 12:56:24 +0000 Subject: [issue1124861] subprocess fails on GetStdHandle in interactive GUI Message-ID: <1362401784.45.0.793568889899.issue1124861@psf.upfronthosting.co.za> Tomgu added the comment: Here I get one problem need help. In python 2.7.5 version I write a script "test.py" as below ### import subprocess fileID=file('test1.log','w') process_response = subprocess.call('netsh wlan show\ interface',stdout=fileID,shell=True) fileID.flush() fileID.close() ### It run in windows7 os MSDOS console is OK and I try to run it in STAF command C:\> STAF local PROCESS START COMMAND python C:\>test.py WAIT STDERRTOSTDOUT RETURNSTDOUT Response -------- { Return Code: 1 Key : Files : [ { Return Code: 0 Data : Traceback (most recent call last): File "C:\test.py", line 3, in process_response = subprocess.call('netsh wlan show interface',stdout=fileID ,shell=True) File "C:\Python27\lib\subprocess.py", line 493, in call return Popen(*popenargs, **kwargs).wait() File "C:\Python27\lib\subprocess.py", line 672, in __init__ errread, errwrite) = self._get_handles(stdin, stdout, stderr) File "C:\Python27\lib\subprocess.py", line 784, in _get_handles p2cread = self._make_inheritable(p2cread) File "C:\Python27\lib\subprocess.py", line 823, in _make_inheritable _subprocess.DUPLICATE_SAME_ACCESS) WindowsError: [Error 6] The handle is invalid } ] I just start to learn python, I dont know how to resolve, need help. ---------- nosy: +gwtking type: -> compile error versions: +Python 2.7 -Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 13:59:46 2013 From: report at bugs.python.org (Tomgu) Date: Mon, 04 Mar 2013 12:59:46 +0000 Subject: [issue1124861] subprocess fails on GetStdHandle in interactive GUI Message-ID: <1362401986.68.0.995506978027.issue1124861@psf.upfronthosting.co.za> Tomgu added the comment: Update, the python version is '2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 14:09:13 2013 From: report at bugs.python.org (Phil Elson) Date: Mon, 04 Mar 2013 13:09:13 +0000 Subject: [issue16382] Better warnings exception for bad category In-Reply-To: <1351779406.35.0.0813926106632.issue16382@psf.upfronthosting.co.za> Message-ID: <1362402553.58.0.653962863926.issue16382@psf.upfronthosting.co.za> Phil Elson added the comment: Ok. I think I've done all of the actions from the reviews. I'm not sure if I should remove the old patches or not? Thanks, ---------- Added file: http://bugs.python.org/file29304/pelson_warnings_fix_4.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 14:09:24 2013 From: report at bugs.python.org (Tomgu) Date: Mon, 04 Mar 2013 13:09:24 +0000 Subject: [issue17350] Use STAF call python script will case 1124861 issue in 2.7.2 version Message-ID: <1362402564.96.0.853290291647.issue17350@psf.upfronthosting.co.za> New submission from Tomgu: Here I get one problem use STAF call python and need help. In python 2.7.2 version I write a script "test.py" as below ### import subprocess fileID=file('test1.log','w') process_response = subprocess.call('netsh wlan show\ interface',stdout=fileID,shell=True) fileID.flush() fileID.close() ### It run in windows7 os MSDOS console is OK and I try to run it in STAF command C:\> STAF local PROCESS START COMMAND python C:\>test.py WAIT STDERRTOSTDOUT RETURNSTDOUT Response -------- { Return Code: 1 Key : Files : [ { Return Code: 0 Data : Traceback (most recent call last): File "C:\test.py", line 3, in process_response = subprocess.call('netsh wlan show interface',stdout=fileID ,shell=True) File "C:\Python27\lib\subprocess.py", line 493, in call return Popen(*popenargs, **kwargs).wait() File "C:\Python27\lib\subprocess.py", line 672, in __init__ errread, errwrite) = self._get_handles(stdin, stdout, stderr) File "C:\Python27\lib\subprocess.py", line 784, in _get_handles p2cread = self._make_inheritable(p2cread) File "C:\Python27\lib\subprocess.py", line 823, in _make_inheritable _subprocess.DUPLICATE_SAME_ACCESS) WindowsError: [Error 6] The handle is invalid } ] Like known issue 1124861. I just start to learn python, I dont know how to resolve, need help. ---------- messages: 183444 nosy: gwtking priority: normal severity: normal status: open title: Use STAF call python script will case 1124861 issue in 2.7.2 version type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 14:14:48 2013 From: report at bugs.python.org (Stefan Ring) Date: Mon, 04 Mar 2013 13:14:48 +0000 Subject: [issue17094] sys._current_frames() reports too many/wrong stack frames In-Reply-To: <1359668363.58.0.777154629349.issue17094@psf.upfronthosting.co.za> Message-ID: <1362402888.78.0.158454290897.issue17094@psf.upfronthosting.co.za> Stefan Ring added the comment: (Regarding your test) I have also noticed in the past that joining threads after a fork has caused hangs occasionally, although that might have resulted from the messed up _current_frames. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 14:20:33 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 13:20:33 +0000 Subject: [issue15866] encode(..., 'xmlcharrefreplace') produces entities for surrogate pairs In-Reply-To: <1346871274.13.0.653364801762.issue15866@psf.upfronthosting.co.za> Message-ID: <1362403233.83.0.893127781964.issue15866@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I prefer a little different (simpler for me) form: for (p = collstart; p < collend;) { Py_UCS4 ch = *p++; if ((0xD800 <= ch && ch <= 0xDBFF) && (p < collend) && (0xDC00 <= *p && *p <= 0xDFFF)) { ch = ((((ch & 0x03FF) << 10) | ((Py_UCS4)*p++ & 0x03FF)) + 0x10000); } str += sprintf(str, "&#%d;", (int)ch); } And please look at the loop above ("determine replacement size"). It should be corrected too. It will be simpler to use a buffer with static size (``char buffer[2+29+1+1];``) as in charmap encoder. Perhaps charmap encoder should be fixed too (and common code extracted to separate function). I doubt about '\ud83d\udc9d' on wide build. Is it right to encode it as b'💝' and not as b'��'? This will be compatible with narrow build but will break compatibility with 3.3+. What is less evil? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 14:21:18 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 13:21:18 +0000 Subject: [issue11787] File handle leak in TarFile lib In-Reply-To: <1302115375.88.0.984018215443.issue11787@psf.upfronthosting.co.za> Message-ID: <1362403278.43.0.323754954837.issue11787@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Actually it was fixed in issue16477. ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 14:23:26 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 04 Mar 2013 13:23:26 +0000 Subject: [issue17346] Pickle tests do not test protocols 0, 1, and 2 for bytes In-Reply-To: <1362390352.97.0.872736532122.issue17346@psf.upfronthosting.co.za> Message-ID: <3ZKMPT2P6MzQmm@mail.python.org> Roundup Robot added the comment: New changeset a982feb29584 by Ezio Melotti in branch '3.2': #17346: make sure pickle tests are run against all protocols. Initial patch by Marius Gedminas. http://hg.python.org/cpython/rev/a982feb29584 New changeset 796de4f7df07 by Ezio Melotti in branch '3.3': #17346: merge with 3.2. http://hg.python.org/cpython/rev/796de4f7df07 New changeset 5c8a5cfe25b0 by Ezio Melotti in branch 'default': #17346: merge with 3.3. http://hg.python.org/cpython/rev/5c8a5cfe25b0 New changeset 654136546895 by Ezio Melotti in branch '2.7': #17346: make sure pickle tests are run against all protocols. http://hg.python.org/cpython/rev/654136546895 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 14:24:04 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 13:24:04 +0000 Subject: [issue17346] Pickle tests do not test protocols 0, 1, and 2 for bytes In-Reply-To: <1362390352.97.0.872736532122.issue17346@psf.upfronthosting.co.za> Message-ID: <1362403444.1.0.427228480542.issue17346@psf.upfronthosting.co.za> Ezio Melotti added the comment: Fixed, thanks for the report and the patch! ---------- assignee: -> ezio.melotti resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 14:39:22 2013 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 04 Mar 2013 13:39:22 +0000 Subject: [issue16997] subtests In-Reply-To: <1358543231.78.0.354364612897.issue16997@psf.upfronthosting.co.za> Message-ID: <1362404362.76.0.0564223555919.issue16997@psf.upfronthosting.co.za> Nick Coghlan added the comment: I think I have figured out what bothers me about the expectedfailure changes, and they actually relate to how expectedfailure was implemented in the first place: I had previously assumed that decorator was an *annotating* decorator - that it set an attribute on the function to indicate it was expected to fail, and the test execution machinery then took that into account when deciding how to interpret the test result. The fact that it is instead a *wrapping* decorator is what made the addition of subtest support far more complicated than I expected. However, I'm wondering if it might still be possible to avoid the need for a thread local context to handle the combination of expected failures and subtests when we have access to the test caseby adding the annotation that I expected to be there in the first place. Can't we: 1. Update the expectedfailure decorator to also set "_expecting_failure = True" on the wrapped test case function 2. Update unittest.TestCase.__init__ to do: "self._expecting_failure = hasattr(testMethod, '__func__') and getattr(testMethod.__func__, '_expecting_failure', False)" 3. Update unittest._SubTest.__init__ to do: "self._expecting_failure = test_case._expecting_failure" 4. Update testPartExecutor to check "if test_case._expecting_failure:" instead of the current check of the thread local context ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 14:40:03 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 04 Mar 2013 13:40:03 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362404403.17.0.167433730114.issue17322@psf.upfronthosting.co.za> R. David Murray added the comment: A crazy idea that occurred to me was to create an "rfc822-style-header management" module, and share it between email, http, and urllib. We'd probably break too many things backward-compatibility wise if we did that, but I still think it is an interesting thought :) On the other hand, having thought about this particular issue some more: in the email package we have the constraint of needing to be able to exactly reproduce the input data, whereas in the http world that constraint does not apply. So in the http world, given that headers are *already* being transformed by the code in question (title casing), it seems reasonable that blank stripping also be done, even just from an API standpoint. Really I guess the only question is how likely this is to break existing code. I'm pretty sure it is small enough that doing this in 3.4 would be fine, but I don't know how to estimate if it is small enough to also change it in maintenance releases. Since this particular bit is a new standard, maybe we just go with 3.4? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 14:41:28 2013 From: report at bugs.python.org (Michael Foord) Date: Mon, 04 Mar 2013 13:41:28 +0000 Subject: [issue16997] subtests In-Reply-To: <1358543231.78.0.354364612897.issue16997@psf.upfronthosting.co.za> Message-ID: <1362404488.54.0.865228991996.issue16997@psf.upfronthosting.co.za> Michael Foord added the comment: Getting rid of the thread local would be an improvement, and the change to how expected failures is done sounds good too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 14:48:58 2013 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 04 Mar 2013 13:48:58 +0000 Subject: [issue13598] string.Formatter doesn't support empty curly braces "{}" In-Reply-To: <1323835162.4.0.792542335688.issue13598@psf.upfronthosting.co.za> Message-ID: <1362404938.12.0.214450943279.issue13598@psf.upfronthosting.co.za> Vinay Sajip added the comment: > I believe the case is covered by the block: [snip] Ah, right. I wasn't sure that was the exact same code path that was being exercised. But I didn't look very closely. > If you think it is worthwhile? Only if it exercises a different code path. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 15:01:44 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 04 Mar 2013 14:01:44 +0000 Subject: [issue16997] subtests In-Reply-To: <1362404362.76.0.0564223555919.issue16997@psf.upfronthosting.co.za> Message-ID: <1843927953.9671365.1362405697443.JavaMail.root@zimbra10-e2.priv.proxad.net> Antoine Pitrou added the comment: > However, I'm wondering if it might still be possible to avoid the > need for a thread local context to handle the combination of > expected failures and subtests when we have access to the test > caseby adding the annotation that I expected to be there in the > first place. But that would break use cases where you use @expectedFailure on a function called by the test method, not directly on the test method itself. I don't really care about those use cases myself, but not breaking them is the reason I chose not to change the @expectedFailure implementation. I'll let Michael decide :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 15:04:23 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 14:04:23 +0000 Subject: [issue10590] Parameter type error for xml.sax.parseString(string, ...) In-Reply-To: <1291145861.74.0.873169501029.issue10590@psf.upfronthosting.co.za> Message-ID: <1362405863.58.0.0873654711733.issue10590@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Low-level part already extracted to issue17089 and committed. Issue16986 has a similar patch for cElementTree. The main part of path was moved to issue2175 which is now pre-requisite for issue16986 and for this issue. It contains additional tests and additional fixes. It is hard and little sense to split them on separated patches. Let's move the discussion to issue2175. And then the patch for this issue will be small and simple, only several lines and one test. At least this issue is less important and actually can be considered as a new feature. ---------- stage: patch review -> needs patch type: behavior -> enhancement versions: -Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 15:06:40 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 14:06:40 +0000 Subject: [issue10590] Parameter type error for xml.sax.parseString(string, ...) In-Reply-To: <1291145861.74.0.873169501029.issue10590@psf.upfronthosting.co.za> Message-ID: <1362406000.92.0.121392548683.issue10590@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file28757/sax_parse.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 15:13:08 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 14:13:08 +0000 Subject: [issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8 In-Reply-To: <1358441659.05.0.359191214505.issue16986@psf.upfronthosting.co.za> Message-ID: <1362406388.79.0.02349098097.issue16986@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Eli, this issue no longer has open pre-requisites. Issue10590 was replaced by issue17089 which closed now. Issue17089 fixed Python interface to expat parser, but cElementTree uses C interface of expat directly and the proposed pathes fix it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 15:18:43 2013 From: report at bugs.python.org (Eli Bendersky) Date: Mon, 04 Mar 2013 14:18:43 +0000 Subject: [issue10590] Parameter type error for xml.sax.parseString(string, ...) In-Reply-To: <1291145861.74.0.873169501029.issue10590@psf.upfronthosting.co.za> Message-ID: <1362406723.55.0.103879941561.issue10590@psf.upfronthosting.co.za> Eli Bendersky added the comment: Serhiy, OK - I'll look at #2175 first. But yes, Christian is right, let's wait for the security issues to be resolved first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 15:36:39 2013 From: report at bugs.python.org (Phil Elson) Date: Mon, 04 Mar 2013 14:36:39 +0000 Subject: [issue17351] Fixed python3 descriptor documentation example + removal of explicit "object" inheritance in docs Message-ID: <1362407799.21.0.301955058492.issue17351@psf.upfronthosting.co.za> New submission from Phil Elson: The example at http://docs.python.org/3.4/howto/descriptor.html#properties does not run due to the old style "raise AttributeError, message" form. This patch fixes the problem, and also goes through the docs to remove explicit sub-classing from "object". The only remaining instances of this now are: $> grep -r -E "class .*\(object\)\:" Doc/* Doc/howto/pyporting.rst: class UnicodeMixin(object): Doc/reference/compound_stmts.rst: class Foo(object): Doc/tools/sphinxext/pyspecific.py:class PyDecoratorMixin(object): Doc/whatsnew/2.6.rst: class C(object): Doc/whatsnew/2.2.rst: class C(object): Doc/whatsnew/2.2.rst: class C(object): Doc/whatsnew/2.2.rst: class C(object): Doc/whatsnew/2.2.rst: class C(object): Doc/whatsnew/2.2.rst: >>> class C(object): Which are all (minus tools/sphinxext/pyspecific) referring to python2 in some context. I'm not bound to fixing the explicit object subclassing, so if it is better off not being here, that's fine. Cheers, ---------- assignee: docs at python components: Documentation files: pelson_doc_decorator.diff keywords: patch messages: 183458 nosy: docs at python, pelson, rhettinger priority: normal severity: normal status: open title: Fixed python3 descriptor documentation example + removal of explicit "object" inheritance in docs versions: Python 3.1 Added file: http://bugs.python.org/file29305/pelson_doc_decorator.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 15:37:33 2013 From: report at bugs.python.org (Zachary Ware) Date: Mon, 04 Mar 2013 14:37:33 +0000 Subject: [issue10967] move regrtest over to using more unittest infrastructure In-Reply-To: <1295567145.8.0.568957178125.issue10967@psf.upfronthosting.co.za> Message-ID: <1362407853.35.0.467008291765.issue10967@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 15:42:35 2013 From: report at bugs.python.org (Zachary Ware) Date: Mon, 04 Mar 2013 14:42:35 +0000 Subject: [issue8273] move generally useful test.support functions into the unittest package In-Reply-To: <1270034351.93.0.515899636762.issue8273@psf.upfronthosting.co.za> Message-ID: <1362408155.25.0.278852855219.issue8273@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 15:48:02 2013 From: report at bugs.python.org (karl) Date: Mon, 04 Mar 2013 14:48:02 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362408482.96.0.49074980962.issue17322@psf.upfronthosting.co.za> karl added the comment: R. David.: > A crazy idea that occurred to me was to create an "rfc822-style-header management" module, and share it between email, http, and urllib. Yes it is basically what I had in mind when I said: >Maybe the way forward in the future is to have a header factory shared by all HTTP libs? I'm not sure if it's easy to share in between emails and HTTP. Emails are now defined by RFC5322: https://tools.ietf.org/html/rfc5322#section-2.2 2.2. Header Fields Header fields are lines beginning with a field name, followed by a colon (":"), followed by a field body, and terminated by CRLF. A field name MUST be composed of printable US-ASCII characters (i.e., characters that have values between 33 and 126, inclusive), except colon. A field body may be composed of printable US-ASCII characters as well as the space (SP, ASCII value 32) and horizontal tab (HTAB, ASCII value 9) characters (together known as the white space characters, WSP). A field body MUST NOT include CR and LF except when used in "folding" and "unfolding", as described in section 2.2.3. All field bodies MUST conform to the syntax described in sections 3 and 4 of this specification. Maybe it's doable and worth exploring but I have the feeling we would end up with something along field-name ":" field-value and all the rules for field-name and field-value being different for HTTP and email, because they really are. Folding, set of characters, etc. :) Another thing which should be also the opportunity for opening another issue. HTTP headers and python dictionaries is not a very good match. :) But this is drifting off-topic. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 15:48:38 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 04 Mar 2013 14:48:38 +0000 Subject: [issue17328] Fix reference leak in dict_setdefault() in case of resize failure In-Reply-To: <1362146633.78.0.0455037271826.issue17328@psf.upfronthosting.co.za> Message-ID: <3ZKPHn4srBzQfC@mail.python.org> Roundup Robot added the comment: New changeset 1a589001d752 by Benjamin Peterson in branch '3.3': fix possible setdefault refleak (closes #17328) http://hg.python.org/cpython/rev/1a589001d752 New changeset fac46cf6af3f by Benjamin Peterson in branch 'default': merge 3.3 (#17328) http://hg.python.org/cpython/rev/fac46cf6af3f ---------- nosy: +python-dev resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 15:54:53 2013 From: report at bugs.python.org (Eli Bendersky) Date: Mon, 04 Mar 2013 14:54:53 +0000 Subject: [issue16575] ctypes: unions as arguments In-Reply-To: <1354163044.21.0.431588472559.issue16575@psf.upfronthosting.co.za> Message-ID: <1362408893.19.0.729204972383.issue16575@psf.upfronthosting.co.za> Eli Bendersky added the comment: A minimal fix would be to update the documentation. A more comprehensive fix would be to tweak ctypes to reject unions and bit-fields when running on non-x86 (does this work for ARM and other non-Intel archs?) An even more comprehensive fix would be to make this work, but that would require forking libffi and should presumably be first implemented upstream. ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, eli.bendersky stage: -> needs patch versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 16:05:51 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 15:05:51 +0000 Subject: [issue16004] Add `make touch` to 2.7 Makefile In-Reply-To: <1348391075.72.0.200262721096.issue16004@psf.upfronthosting.co.za> Message-ID: <1362409551.93.0.787730918208.issue16004@psf.upfronthosting.co.za> Ezio Melotti added the comment: Nick, is the attached patch ok? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 16:11:32 2013 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 04 Mar 2013 15:11:32 +0000 Subject: [issue17352] Be clear that __prepare__ must be declared as a static method Message-ID: <1362409892.83.0.717786566871.issue17352@psf.upfronthosting.co.za> New submission from Nick Coghlan: The docs on __prepare__ don't make it clear that it should be a staticmethod, and the error message if you forget is not obvious at all. (This is particularly so, since the examples in PEP 3115 had it as an ordinary method). ---------- messages: 183463 nosy: ncoghlan priority: normal severity: normal status: open title: Be clear that __prepare__ must be declared as a static method _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 16:12:57 2013 From: report at bugs.python.org (Armin Rigo) Date: Mon, 04 Mar 2013 15:12:57 +0000 Subject: [issue16575] ctypes: unions as arguments In-Reply-To: <1354163044.21.0.431588472559.issue16575@psf.upfronthosting.co.za> Message-ID: <1362409977.96.0.812954271836.issue16575@psf.upfronthosting.co.za> Armin Rigo added the comment: See also http://bugs.python.org/issue16576. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 16:27:53 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 15:27:53 +0000 Subject: [issue17341] Poor error message when compiling invalid regex In-Reply-To: <1362318975.95.0.685473127287.issue17341@psf.upfronthosting.co.za> Message-ID: <1362410873.46.0.271239145217.issue17341@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: See also issue14462. It will be easier to include a full group name than an invalid character. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 16:28:05 2013 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 04 Mar 2013 15:28:05 +0000 Subject: [issue17352] Be clear that __prepare__ must be declared as a class method In-Reply-To: <1362409892.83.0.717786566871.issue17352@psf.upfronthosting.co.za> Message-ID: <1362410885.34.0.951833351879.issue17352@psf.upfronthosting.co.za> Nick Coghlan added the comment: Class method, not static method (super() breaks if you declare it as a static method) ---------- title: Be clear that __prepare__ must be declared as a static method -> Be clear that __prepare__ must be declared as a class method _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 16:58:53 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 04 Mar 2013 15:58:53 +0000 Subject: [issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff) In-Reply-To: <1362086834.26.0.0452612015515.issue17322@psf.upfronthosting.co.za> Message-ID: <1362412733.8.0.700870306937.issue17322@psf.upfronthosting.co.za> R. David Murray added the comment: Aren't the folding rules are the same? The character set rules are different, I think, but the email package is going to be flexible in that regard. The email package also uses a data structure that is not a python dictionary (it is actually a list with an extra dict-like interface), and its features may well be useful for handling http headers. But you are right, we are wandering off topic :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 17:12:59 2013 From: report at bugs.python.org (Michael Foord) Date: Mon, 04 Mar 2013 16:12:59 +0000 Subject: [issue16997] subtests In-Reply-To: <1358543231.78.0.354364612897.issue16997@psf.upfronthosting.co.za> Message-ID: <1362413579.72.0.134226745849.issue16997@psf.upfronthosting.co.za> Michael Foord added the comment: That's a use case that I'm not very *interested* in supporting personally - however it may well be a use case that was "designed in" and that others have a need for (I didn't implement expectedFailure support). I think expectedFailure should be used sparingly and for a utility function to be *able* to turn a failure into a expectedFailure sounds actively dangerous. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 17:19:47 2013 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 04 Mar 2013 16:19:47 +0000 Subject: [issue16997] subtests In-Reply-To: <1358543231.78.0.354364612897.issue16997@psf.upfronthosting.co.za> Message-ID: <1362413987.08.0.622767227713.issue16997@psf.upfronthosting.co.za> Nick Coghlan added the comment: The docs are fairly explicit about the intended use case: "Mark the test as an expected failure. If the test fails when run, the test is not counted as a failure." (from http://docs.python.org/3/library/unittest#unittest.expectedFailure) Nothing there about being able to call some other function and have doing so incidentally mark your test as an expected failure (which I actually consider highly *un*desirable behaviour) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 17:20:34 2013 From: report at bugs.python.org (Michael Foord) Date: Mon, 04 Mar 2013 16:20:34 +0000 Subject: [issue16997] subtests In-Reply-To: <1358543231.78.0.354364612897.issue16997@psf.upfronthosting.co.za> Message-ID: <1362414034.27.0.309075965519.issue16997@psf.upfronthosting.co.za> Michael Foord added the comment: So, if it's not documented behaviour I think it's fine to lose it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 17:26:25 2013 From: report at bugs.python.org (karl) Date: Mon, 04 Mar 2013 16:26:25 +0000 Subject: [issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline In-Reply-To: <1315334514.02.0.137561826697.issue12921@psf.upfronthosting.co.za> Message-ID: <1362414385.41.0.450880810228.issue12921@psf.upfronthosting.co.za> karl added the comment: orsenthil, I made a proper patch for it with hg diff. It is very short. See issue-12921-2.patch ---------- Added file: http://bugs.python.org/file29306/issue-12921-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 17:26:35 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 04 Mar 2013 16:26:35 +0000 Subject: [issue17343] Add a version of str.split which returns an iterator In-Reply-To: <1362359066.58.0.311917237277.issue17343@psf.upfronthosting.co.za> Message-ID: <1362414395.34.0.206967364243.issue17343@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 17:27:44 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 04 Mar 2013 16:27:44 +0000 Subject: [issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing In-Reply-To: <1362245019.42.0.972918137955.issue17338@psf.upfronthosting.co.za> Message-ID: <1362414464.64.0.985757997916.issue17338@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 17:29:05 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 04 Mar 2013 16:29:05 +0000 Subject: [issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline In-Reply-To: <1362414385.41.0.450880810228.issue12921@psf.upfronthosting.co.za> Message-ID: Senthil Kumaran added the comment: Karl, Ack. The patch looks good. I shall go about with testing + committing this.. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 17:30:24 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 04 Mar 2013 16:30:24 +0000 Subject: [issue16997] subtests In-Reply-To: <1358543231.78.0.354364612897.issue16997@psf.upfronthosting.co.za> Message-ID: <1362414624.3.0.328332968871.issue16997@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 17:34:15 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 16:34:15 +0000 Subject: [issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing In-Reply-To: <1362245019.42.0.972918137955.issue17338@psf.upfronthosting.co.za> Message-ID: <1362414855.25.0.174678940285.issue17338@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This unlikely will be useful. C code uses __length_hint__ because C code is fast enough and fill time can be comparable to resize time. But Python code will be one or two order slower and resize time is insignificant fraction of total time for any real code. You can implement your proposition and do the tests, and I doubt that they will show impressive results. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 17:36:20 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 16:36:20 +0000 Subject: [issue13477] tarfile module should have a command line In-Reply-To: <1322190665.85.0.356467902383.issue13477@psf.upfronthosting.co.za> Message-ID: <1362414980.61.0.958037045298.issue13477@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 17:43:40 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 16:43:40 +0000 Subject: [issue17339] bytes() TypeError message is misleadingly narrow In-Reply-To: <1362254314.39.0.995387791388.issue17339@psf.upfronthosting.co.za> Message-ID: <1362415420.58.0.8827627545.issue17339@psf.upfronthosting.co.za> Ezio Melotti added the comment: > 'object' object cannot be converted to bytes This is not entirely accurate for the bytes(int) case though, since it's not converting the int to bytes. OTOH if we want to keep the message short we have to make compromises about accuracy and completeness. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 17:46:27 2013 From: report at bugs.python.org (karl) Date: Mon, 04 Mar 2013 16:46:27 +0000 Subject: [issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline In-Reply-To: <1315334514.02.0.137561826697.issue12921@psf.upfronthosting.co.za> Message-ID: <1362415587.03.0.86055910904.issue12921@psf.upfronthosting.co.za> karl added the comment: orsenthil, When you have done a patch for testing I would love to see it. I could not find a proper way of doing it. I'm eager to learn. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 17:49:07 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 16:49:07 +0000 Subject: [issue14123] Indicate that there are no current plans to deprecate printf-style formatting In-Reply-To: <1330202928.96.0.727285588049.issue14123@psf.upfronthosting.co.za> Message-ID: <1362415747.39.0.627983522551.issue14123@psf.upfronthosting.co.za> Ezio Melotti added the comment: The only issue seems about the use of the word "deprecate", but I think it's fine, so I'll close this issue. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 18:27:47 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 17:27:47 +0000 Subject: [issue16278] os.rename documentation slightly inaccurate In-Reply-To: <1350581776.08.0.668682100781.issue16278@psf.upfronthosting.co.za> Message-ID: <1362418067.39.0.748533119488.issue16278@psf.upfronthosting.co.za> Ezio Melotti added the comment: Adding more tests is good, even though there are still a few things that should be improved (see comments on rietveld). Regarding the documentation I'm not sure it's a good idea to be so detailed. On one hand, if we test the behavior we can make sure that the documentation is accurate, OTOH it might make the docs more confusing and once this behavior is documented it will be difficult to change it (and there might still be exceptions on different platforms/filesystems or if symlinks are involved). Maybe it would be better to suggest a LBYL approach rather trying to document and deal with all the different combinations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 18:28:49 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 17:28:49 +0000 Subject: [issue17301] An in-place version of many bytearray methods is needed In-Reply-To: <1361910523.06.0.491264384267.issue17301@psf.upfronthosting.co.za> Message-ID: <1362418129.34.0.865091354589.issue17301@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: How *just and *strip can modify an argument in-place? All other methods except title (lower, swapcase, upper) are partial cases of translate. I.e. you need only in-place translate. However I doubt that difference will be more than several percents. Actually translate uses more tacts per byte than memcpy. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 18:29:57 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Mar 2013 17:29:57 +0000 Subject: [issue17332] typo in json docs - "convered" should be "converted" In-Reply-To: <1362173463.23.0.943587603223.issue17332@psf.upfronthosting.co.za> Message-ID: <1362418197.49.0.519683017539.issue17332@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- keywords: +easy stage: -> needs patch versions: -Python 2.6, Python 3.1, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 18:30:19 2013 From: report at bugs.python.org (moijes12) Date: Mon, 04 Mar 2013 17:30:19 +0000 Subject: [issue12768] docstrings for the threading module In-Reply-To: <1313548989.72.0.178892692878.issue12768@psf.upfronthosting.co.za> Message-ID: <1362418219.88.0.703328654353.issue12768@psf.upfronthosting.co.za> moijes12 added the comment: Hi I am seen the review comments and made the changes accordingly. I am not sure if my changes apply to 3.2. How do I do that ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 18:52:13 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 17:52:13 +0000 Subject: [issue17344] checking size of size_t... configure: error: In-Reply-To: <1362378724.97.0.818399526609.issue17344@psf.upfronthosting.co.za> Message-ID: <1362419533.91.0.776615046361.issue17344@psf.upfronthosting.co.za> Ezio Melotti added the comment: The SPARC Solaris buildbot with cc compilers run configure without problems, whereas the ones with gcc are broken because of gcc (and they don't even reach the configure step that checks for size_t). If we cannot confirm that there is a problem on a currently maintained version of Python I'm afraid I'll have to close this issue. ---------- nosy: +trent status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 19:00:18 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 18:00:18 +0000 Subject: [issue16851] Hint about correct ismethod and isfunction usage In-Reply-To: <1357231289.77.0.0608728593688.issue16851@psf.upfronthosting.co.za> Message-ID: <1362420018.31.0.535883482457.issue16851@psf.upfronthosting.co.za> Ezio Melotti added the comment: I checked the tests on 2.7 and found this: # contrary to spec, ismethod() is also True for unbound methods # (see #1785) self.assertIn(('f', B.f), inspect.getmembers(B, inspect.ismethod)) #1785 also has some discussion about this. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 19:10:44 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 18:10:44 +0000 Subject: [issue15866] encode(..., 'xmlcharrefreplace') produces entities for surrogate pairs In-Reply-To: <1346871274.13.0.653364801762.issue15866@psf.upfronthosting.co.za> Message-ID: <1362420644.05.0.788358961833.issue15866@psf.upfronthosting.co.za> Ezio Melotti added the comment: > I doubt about '\ud83d\udc9d' on wide build. Is it right to encode it as > b'💝' and not as b'��'? I don't think so. IIRC surrogates are invalid in UTF-32, and certainly shouldn't be recombined. > This will be compatible with narrow build but will break compatibility > with 3.3+. What is less evil? I think it's better to be compatible with 3.3+. This is anyway a rather obscure corner case. Do you want to propose a new patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 19:14:40 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 18:14:40 +0000 Subject: [issue11787] File handle leak in TarFile lib In-Reply-To: <1302115375.88.0.984018215443.issue11787@psf.upfronthosting.co.za> Message-ID: <1362420880.96.0.0365937045903.issue11787@psf.upfronthosting.co.za> Ezio Melotti added the comment: Closing as duplicate then. ---------- resolution: -> duplicate stage: test needed -> committed/rejected status: open -> closed superseder: -> tarfile fails to close file handles in case of exception _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 19:20:15 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 18:20:15 +0000 Subject: [issue12768] docstrings for the threading module In-Reply-To: <1313548989.72.0.178892692878.issue12768@psf.upfronthosting.co.za> Message-ID: <1362421215.52.0.58959940456.issue12768@psf.upfronthosting.co.za> Ezio Melotti added the comment: 3.2$ hg imp --no-c http://bugs.python.org/file29268/12768_2.patch applying http://bugs.python.org/file29268/12768_2.patch patching file Lib/threading.py Hunk #3 FAILED at 58 Hunk #4 FAILED at 79 Hunk #5 FAILED at 92 Hunk #6 FAILED at 125 Hunk #10 FAILED at 252 Hunk #12 succeeded at 386 with fuzz 1 (offset 82 lines). Hunk #13 FAILED at 317 Hunk #17 FAILED at 405 Hunk #22 FAILED at 576 Hunk #23 FAILED at 589 Hunk #30 FAILED at 897 Hunk #33 succeeded at 1124 with fuzz 2 (offset 132 lines). 10 out of 35 hunks FAILED -- saving rejects to file Lib/threading.py.rej abort: patch failed to apply > I am not sure if my changes apply to 3.2. How do I do that ? You have to switch to the 3.2 branch using "hg up 3.2", and then use "hg import" as showed above to apply the patch. You will also need to run configure/make again to build 3.2, so you can run tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 19:24:57 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 18:24:57 +0000 Subject: [issue12768] docstrings for the threading module In-Reply-To: <1313548989.72.0.178892692878.issue12768@psf.upfronthosting.co.za> Message-ID: <1362421497.07.0.326281456701.issue12768@psf.upfronthosting.co.za> Ezio Melotti added the comment: FWIW it applies cleanly on 3.3, but unless we decide to target 3.3+ only, the patch needs to be adapted for 2.7/3.2. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 19:51:21 2013 From: report at bugs.python.org (Santoso Wijaya) Date: Mon, 04 Mar 2013 18:51:21 +0000 Subject: [issue17343] Add a version of str.split which returns an iterator In-Reply-To: <1362359066.58.0.311917237277.issue17343@psf.upfronthosting.co.za> Message-ID: <1362423081.99.0.76350833056.issue17343@psf.upfronthosting.co.za> Changes by Santoso Wijaya : ---------- nosy: +santa4nt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 20:18:47 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 04 Mar 2013 19:18:47 +0000 Subject: [issue17330] Stop checking for directory cache invalidation in importlib In-Reply-To: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za> Message-ID: <1362424727.5.0.988400493565.issue17330@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 20:24:13 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Mon, 04 Mar 2013 19:24:13 +0000 Subject: [issue17025] reduce multiprocessing.Queue contention In-Reply-To: Message-ID: Charles-Fran?ois Natali added the comment: So, what do you think? Is the simple version offloading the serialization to queue enough, or should we go for a full-blown atomic Connection/Pipe/etc? I find the performance gain quite appreciable (basically queue didn't scale at all, now it scales with the number of cores). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 20:25:51 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 04 Mar 2013 19:25:51 +0000 Subject: [issue17025] reduce multiprocessing.Queue contention In-Reply-To: <1359042546.71.0.578815247507.issue17025@psf.upfronthosting.co.za> Message-ID: <1362425151.64.0.661607256449.issue17025@psf.upfronthosting.co.za> Antoine Pitrou added the comment: IMHO the simple version is good enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 20:33:55 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 04 Mar 2013 19:33:55 +0000 Subject: [issue17278] SIGSEGV in _heapqmodule.c In-Reply-To: <1361564739.94.0.652055114597.issue17278@psf.upfronthosting.co.za> Message-ID: <3ZKWcy0lHjz7Ll3@mail.python.org> Roundup Robot added the comment: New changeset 21ded74b51fa by Antoine Pitrou in branch '2.7': Issue #17278: Fix a crash in heapq.heappush() and heapq.heappop() when the list is being resized concurrently. http://hg.python.org/cpython/rev/21ded74b51fa ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 20:35:52 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 04 Mar 2013 19:35:52 +0000 Subject: [issue14266] pyunit script as shorthand for python -m unittest In-Reply-To: <1331586037.12.0.876793471383.issue14266@psf.upfronthosting.co.za> Message-ID: <1362425752.63.0.494890605271.issue14266@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 20:38:02 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 04 Mar 2013 19:38:02 +0000 Subject: [issue14266] pyunit script as shorthand for python -m unittest In-Reply-To: <1331586037.12.0.876793471383.issue14266@psf.upfronthosting.co.za> Message-ID: <1362425882.74.0.783701858632.issue14266@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: As I mentioned on python-dev, having a `pyunit` script is nice (whatever it's called), but we need to keep the `-m invocation` which will probably be the recommendation on distros such as Debian which provide multiple versions of Python. We're not going to want to install all possible flavors of `pyunit2.6`, `pyunit2.7`, `punit2.6-dbg`, `pyunit-3.2-dbg`, etc. etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 20:39:46 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 04 Mar 2013 19:39:46 +0000 Subject: [issue17278] SIGSEGV in _heapqmodule.c In-Reply-To: <1361564739.94.0.652055114597.issue17278@psf.upfronthosting.co.za> Message-ID: <3ZKWlj2dqqzRJy@mail.python.org> Roundup Robot added the comment: New changeset 905b02749c26 by Antoine Pitrou in branch '3.2': Issue #17278: Fix a crash in heapq.heappush() and heapq.heappop() when the list is being resized concurrently. http://hg.python.org/cpython/rev/905b02749c26 New changeset 451299b97b4f by Antoine Pitrou in branch '3.3': Issue #17278: Fix a crash in heapq.heappush() and heapq.heappop() when the list is being resized concurrently. http://hg.python.org/cpython/rev/451299b97b4f New changeset d57c60db94e7 by Antoine Pitrou in branch 'default': Issue #17278: Fix a crash in heapq.heappush() and heapq.heappop() when the list is being resized concurrently. http://hg.python.org/cpython/rev/d57c60db94e7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 20:45:01 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 04 Mar 2013 19:45:01 +0000 Subject: [issue14266] pyunit script as shorthand for python -m unittest In-Reply-To: <1362425882.74.0.783701858632.issue14266@psf.upfronthosting.co.za> Message-ID: <1362426080.3474.0.camel@localhost.localdomain> Antoine Pitrou added the comment: > We're not going to want to install all possible flavors of > `pyunit2.6`, `pyunit2.7`, `punit2.6-dbg`, `pyunit-3.2-dbg`, etc. etc. Why not? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 20:45:21 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 04 Mar 2013 19:45:21 +0000 Subject: [issue17278] SIGSEGV in _heapqmodule.c In-Reply-To: <1361564739.94.0.652055114597.issue17278@psf.upfronthosting.co.za> Message-ID: <1362426321.35.0.93391490837.issue17278@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Ok, committed, thank you! ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 20:48:53 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 04 Mar 2013 19:48:53 +0000 Subject: [issue17025] reduce multiprocessing.Queue contention In-Reply-To: <1359042546.71.0.578815247507.issue17025@psf.upfronthosting.co.za> Message-ID: <1362426533.39.0.765027855039.issue17025@psf.upfronthosting.co.za> Richard Oudkerk added the comment: It looks like queues_contention.diff has the line obj = pickle.dumps(obj) in both _feed() and put(). Might that be why the third set of benchmarks was slower than the second? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 21:01:26 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Mon, 04 Mar 2013 20:01:26 +0000 Subject: [issue17025] reduce multiprocessing.Queue contention In-Reply-To: <1362426533.39.0.765027855039.issue17025@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: > It looks like queues_contention.diff has the line > > obj = pickle.dumps(obj) > > in both _feed() and put(). Might that be why the third set of benchmarks > was slower than the second? _feed() is a Queue method, put() its SimpleQueue() counterpart. Am I missing something? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 21:09:46 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 04 Mar 2013 20:09:46 +0000 Subject: [issue14266] pyunit script as shorthand for python -m unittest In-Reply-To: <1362426080.3474.0.camel@localhost.localdomain> Message-ID: <20130304150943.19bbfa8c@anarchist.wooz.org> Barry A. Warsaw added the comment: On Mar 04, 2013, at 07:45 PM, Antoine Pitrou wrote: > >Antoine Pitrou added the comment: > >> We're not going to want to install all possible flavors of >> `pyunit2.6`, `pyunit2.7`, `punit2.6-dbg`, `pyunit-3.2-dbg`, etc. etc. > >Why not? We don't know at package build time which versions will be necessary or possible, since that depends on the user's system on which the package will be installed. So we can't add those files to the package manifest. They could be installed dynamically by a maintainer script (that gets triggered at package installation time) but that's less than ideal because then we'll need to also add machinery to properly track deletions so that when they're dependencies get removed we can remove the scripts too. This is something that's very much frowned upon in Debian, especially for /usr/bin scripts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 21:33:35 2013 From: report at bugs.python.org (Jacques Fortier) Date: Mon, 04 Mar 2013 20:33:35 +0000 Subject: [issue17353] Plistlib outputs empty data tags when deeply nested Message-ID: <1362429215.6.0.797287296233.issue17353@psf.upfronthosting.co.za> New submission from Jacques Fortier: To reproduce: import plistlib print plistlib.writePlistToString([[[[[[[[[{'test': plistlib.Data('aaaaaa')}]]]]]]]]]) Compare to: print plistlib.writePlistToString([[[[[[[[{'test': Data('aaaaaa')}]]]]]]]]) It looks like the max line length calculation in the Data class is causing the output to be empty once you get nested far enough. ---------- components: Library (Lib) messages: 183496 nosy: jfortier priority: normal severity: normal status: open title: Plistlib outputs empty data tags when deeply nested versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 21:36:20 2013 From: report at bugs.python.org (Jacques Fortier) Date: Mon, 04 Mar 2013 20:36:20 +0000 Subject: [issue17353] Plistlib outputs empty data tags when deeply nested In-Reply-To: <1362429215.6.0.797287296233.issue17353@psf.upfronthosting.co.za> Message-ID: <1362429380.3.0.975745146285.issue17353@psf.upfronthosting.co.za> Jacques Fortier added the comment: My second print should have been: print plistlib.writePlistToString([[[[[[[[{'test': plistlib.Data('aaaaaa')}]]]]]]]]) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 21:48:53 2013 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Mon, 04 Mar 2013 20:48:53 +0000 Subject: [issue14266] pyunit script as shorthand for python -m unittest In-Reply-To: <1331586037.12.0.876793471383.issue14266@psf.upfronthosting.co.za> Message-ID: <1362430133.85.0.818213239484.issue14266@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 21:53:49 2013 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 04 Mar 2013 20:53:49 +0000 Subject: [issue17343] Add a version of str.split which returns an iterator In-Reply-To: <1362359066.58.0.311917237277.issue17343@psf.upfronthosting.co.za> Message-ID: <1362430429.36.0.141567516949.issue17343@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Indeed, a bytearray version would require the talked about but not implemented due to complexity (in pep3118) support for locking a buffer from other mutations. best concentrate on bytes then. Do we have a memoryview equivalent for PyUnicode? If not, we should... (a separate enhancement request) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 22:34:47 2013 From: report at bugs.python.org (Zachary Ware) Date: Mon, 04 Mar 2013 21:34:47 +0000 Subject: [issue17066] Fix test discovery for test_robotparser.py In-Reply-To: <1359405171.11.0.463426342019.issue17066@psf.upfronthosting.co.za> Message-ID: <1362432887.22.0.722319564927.issue17066@psf.upfronthosting.co.za> Zachary Ware added the comment: I got to looking over my patch here again, and thought of another possible fix. I'm not sure which is uglier, though :) The problem is that most of the test cases are created using a custom subclass of unittest.TestCase which takes extra constructor arguments. Discovery doesn't expect a TestCase subclass to want extra arguments, so it fails noisily trying to 'discover' RobotTestCase. Patch version 2 just makes a couple small adjustments to version 1, which replaces the custom subclass with a base class to provide runTest, and a factory function to create the TestCase instances. Version 3 is a different approach, which provides default arguments to the extra constructor parameters, and bails out of __init__ early if the index argument is not an int (checking for None doesn't work because at some point, discovery calls 'RobotTestCase("runTest")', which makes 'index' "runTest"). Both approaches look kind of ugly to me, but both get the job done. ---------- Added file: http://bugs.python.org/file29307/test_robotparser_discovery.v2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 22:35:18 2013 From: report at bugs.python.org (Zachary Ware) Date: Mon, 04 Mar 2013 21:35:18 +0000 Subject: [issue17066] Fix test discovery for test_robotparser.py In-Reply-To: <1359405171.11.0.463426342019.issue17066@psf.upfronthosting.co.za> Message-ID: <1362432918.13.0.700623894868.issue17066@psf.upfronthosting.co.za> Changes by Zachary Ware : Added file: http://bugs.python.org/file29308/test_robotparser_discovery.v3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 23:09:55 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 04 Mar 2013 22:09:55 +0000 Subject: [issue17025] reduce multiprocessing.Queue contention In-Reply-To: Message-ID: <51351BAE.4000207@gmail.com> Richard Oudkerk added the comment: On 04/03/2013 8:01pm, Charles-Fran?ois Natali wrote: >> It looks like queues_contention.diff has the line >> >> obj = pickle.dumps(obj) >> >> in both _feed() and put(). Might that be why the third set of benchmarks >> was slower than the second? > > _feed() is a Queue method, put() its SimpleQueue() counterpart. Am I > missing something? No. I only looked at the diff and assumed both changes were for Queue. Since you marked issue 10886 as superceded, do you intend to do the pickling in put()? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 23:13:20 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 04 Mar 2013 22:13:20 +0000 Subject: [issue17343] Add a version of str.split which returns an iterator In-Reply-To: <1362359066.58.0.311917237277.issue17343@psf.upfronthosting.co.za> Message-ID: <1362435200.49.0.189483573645.issue17343@psf.upfronthosting.co.za> Brett Cannon added the comment: There is no string view that I know of. Interesting idea, though, thanks to the immutability of strings. Would much have to be different other than boundary checking and __hash__ (and hoping extension authors are changing things in-place)? I say go ahead and open the issue for the idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 23:30:26 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 04 Mar 2013 22:30:26 +0000 Subject: [issue17301] An in-place version of many bytearray methods is needed In-Reply-To: <1361910523.06.0.491264384267.issue17301@psf.upfronthosting.co.za> Message-ID: <1362436226.76.0.78015511958.issue17301@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Gregory, if an in-place version of .translate is all you want, only ask for that. Change the title and let us focus on the best case. Forget what others *might* want. Serhiy, what is 'tacts per byte'? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 23:32:03 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 04 Mar 2013 22:32:03 +0000 Subject: [issue16848] Mac OS X: python-config --ldflags and location of Python.framework In-Reply-To: <1357212774.75.0.369526303193.issue16848@psf.upfronthosting.co.za> Message-ID: <3ZKbZW0kyqz7Lp0@mail.python.org> Roundup Robot added the comment: New changeset bab708624dc4 by Ned Deily in branch '2.7': Issue #16848: python-config now returns proper --ldflags values for OS X http://hg.python.org/cpython/rev/bab708624dc4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 23:34:01 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 22:34:01 +0000 Subject: [issue11732] Skip decorator for tests requiring manual intervention on Windows In-Reply-To: <1301604811.48.0.519862680053.issue11732@psf.upfronthosting.co.za> Message-ID: <1362436441.65.0.199084992809.issue11732@psf.upfronthosting.co.za> Ezio Melotti added the comment: Attached an updated patch: - renamed the context manager from no_crash_popups to suppress_crash_popup, as suggested by Brian (I also made it singular, because there shouldn't be more than one crash/popup per call); - used the context manager on all the crashing tests (test_capi and test_faulthandler); - added documentation; I tested it on Windows 7 and Linux (where it's a no-op), and according to MSDN it should work even on Windows XP. If there aren't other comments I'll commit this soon. If test_capi is also crashing on 2.7/3.2, I will probably backport it there too. ---------- Added file: http://bugs.python.org/file29309/nopopup2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 23:36:05 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 04 Mar 2013 22:36:05 +0000 Subject: [issue17301] An in-place version of many bytearray methods is needed In-Reply-To: <1361910523.06.0.491264384267.issue17301@psf.upfronthosting.co.za> Message-ID: <1362436565.38.0.127807212314.issue17301@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 23:39:27 2013 From: report at bugs.python.org (Ned Deily) Date: Mon, 04 Mar 2013 22:39:27 +0000 Subject: [issue16848] Mac OS X: python-config --ldflags and location of Python.framework In-Reply-To: <1357212774.75.0.369526303193.issue16848@psf.upfronthosting.co.za> Message-ID: <1362436767.19.0.663351008695.issue16848@psf.upfronthosting.co.za> Ned Deily added the comment: Other than the tabs, the patch LGTM. I originally noticed the problem when addressing Issue14197, a Python 3 only issue, and fixed it there. But I did not go back and check that the python-config part was also an issue for 2.7. Now committed for release in 2.7.4. ---------- resolution: -> fixed stage: needs patch -> committed/rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 4 23:40:07 2013 From: report at bugs.python.org (Ned Deily) Date: Mon, 04 Mar 2013 22:40:07 +0000 Subject: [issue16848] Mac OS X: python-config --ldflags and location of Python.framework In-Reply-To: <1357212774.75.0.369526303193.issue16848@psf.upfronthosting.co.za> Message-ID: <1362436807.15.0.326738632983.issue16848@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 01:20:38 2013 From: report at bugs.python.org (Matthias Braun) Date: Tue, 05 Mar 2013 00:20:38 +0000 Subject: [issue3290] python-config --cflags includes irrelevant flags In-Reply-To: <1215284947.23.0.370691849564.issue3290@psf.upfronthosting.co.za> Message-ID: <1362442838.02.0.915018107163.issue3290@psf.upfronthosting.co.za> Matthias Braun added the comment: I hacked up a proof-of-concept patch which filters out the most annoying flags (warnings, -Ox and -DNDEBUG flags). (Though IMO the only really robust solution would be not having code but just declarations in the public headers, so --includes is enough. In my personal project I ended up to just use --includes and manually make sure that I don't use any of the code in the headers, but just the declarations). ---------- keywords: +patch nosy: +Matthias.Braun Added file: http://bugs.python.org/file29310/python-config-filter-cflags.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 01:50:38 2013 From: report at bugs.python.org (Berker Peksag) Date: Tue, 05 Mar 2013 00:50:38 +0000 Subject: [issue13477] tarfile module should have a command line In-Reply-To: <1322190665.85.0.356467902383.issue13477@psf.upfronthosting.co.za> Message-ID: <1362444638.74.0.276242139716.issue13477@psf.upfronthosting.co.za> Berker Peksag added the comment: > Patch looks good! Some minor comments on Rietveld. Thanks for the review, ?ric. > Could you add tests? Done. Here's the new patch with ?ric's comments addressed. ---------- Added file: http://bugs.python.org/file29311/issue13477_v2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 05:05:14 2013 From: report at bugs.python.org (Todd Rovito) Date: Tue, 05 Mar 2013 04:05:14 +0000 Subject: [issue16278] os.rename documentation slightly inaccurate In-Reply-To: <1350581776.08.0.668682100781.issue16278@psf.upfronthosting.co.za> Message-ID: <1362456314.33.0.129592963196.issue16278@psf.upfronthosting.co.za> Todd Rovito added the comment: Ezio, Thank you or the feedback I will continue to polish the test cases. As far as the documentation I really like the table and find it easy to read but I could go either way. If you read the history of this issue other Python Core Developers asked to write test cases and make sure the documentation matches the test cases. It makes no difference to me I just want to contribute!!!! Which approach will produce the best results for the Python community? I think the table is a good compromise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 06:15:17 2013 From: report at bugs.python.org (Jacques Fortier) Date: Tue, 05 Mar 2013 05:15:17 +0000 Subject: [issue17353] Plistlib outputs empty data tags when deeply nested In-Reply-To: <1362429215.6.0.797287296233.issue17353@psf.upfronthosting.co.za> Message-ID: <1362460517.13.0.186960214696.issue17353@psf.upfronthosting.co.za> Jacques Fortier added the comment: Quick source inspection suggests this is present in the latest version. ---------- versions: +Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 07:28:00 2013 From: report at bugs.python.org (Trent Nelson) Date: Tue, 05 Mar 2013 06:28:00 +0000 Subject: [issue17344] checking size of size_t... configure: error: In-Reply-To: <1362419533.91.0.776615046361.issue17344@psf.upfronthosting.co.za> Message-ID: <20130305062755.GA80374@snakebite.org> Trent Nelson added the comment: Shilpi, can you paste the exact ./configure invocation you're using? ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 07:49:56 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 05 Mar 2013 06:49:56 +0000 Subject: [issue16098] Bisect optimization in heapq.nsmallest is never used In-Reply-To: <1349091566.51.0.299551598321.issue16098@psf.upfronthosting.co.za> Message-ID: <3ZKpd000Xtz7Ll4@mail.python.org> Roundup Robot added the comment: New changeset de6627cf81f4 by Raymond Hettinger in branch '3.3': Issue #16098: Update heapq.nsmallest to use the same algorithm as nlargest. http://hg.python.org/cpython/rev/de6627cf81f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 08:12:58 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 05 Mar 2013 07:12:58 +0000 Subject: [issue17128] OS X system openssl deprecated - installer should build local libssl In-Reply-To: <1360569587.45.0.627693614853.issue17128@psf.upfronthosting.co.za> Message-ID: Senthil Kumaran added the comment: Ronald: Sorry for the delay in response. I was referring to this: https://github.com/capistrano/capistrano/issues/250#issuecomment-8055991 " Mountain Lion no longer includes OpenSSL as it uses a different SSL implementation. So, you need to have RVM install OpenSSL, then reinstall rubies. This also fixes the SSL error with bundler updating gems." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 08:21:07 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 05 Mar 2013 07:21:07 +0000 Subject: [issue16098] Bisect optimization in heapq.nsmallest is never used In-Reply-To: <1349091566.51.0.299551598321.issue16098@psf.upfronthosting.co.za> Message-ID: <3ZKqJy4XwPzT2L@mail.python.org> Roundup Robot added the comment: New changeset aa9ed98a49cb by Raymond Hettinger in branch '2.7': Issue #16098: Update heapq.nsmallest to use the same algorithm as nlargest. http://hg.python.org/cpython/rev/aa9ed98a49cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 10:24:00 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 05 Mar 2013 09:24:00 +0000 Subject: [issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline In-Reply-To: <1315334514.02.0.137561826697.issue12921@psf.upfronthosting.co.za> Message-ID: <3ZKt2l2yHCz7Lmy@mail.python.org> Roundup Robot added the comment: New changeset c31d700dea8b by Senthil Kumaran in branch '2.7': Fix Issue #12921: BaseHTTPServer's send_error should send the correct error http://hg.python.org/cpython/rev/c31d700dea8b New changeset 5126e62c60af by Senthil Kumaran in branch '3.2': Fix Issue #12921: BaseHTTPServer's send_error should send the correct error http://hg.python.org/cpython/rev/5126e62c60af New changeset 5d76a4746d9d by Senthil Kumaran in branch '3.3': Fix Issue #12921: BaseHTTPServer's send_error should send the correct error http://hg.python.org/cpython/rev/5d76a4746d9d New changeset b87792757ee8 by Senthil Kumaran in branch 'default': Fix Issue #12921: BaseHTTPServer's send_error should send the correct error http://hg.python.org/cpython/rev/b87792757ee8 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 10:31:08 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 05 Mar 2013 09:31:08 +0000 Subject: [issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline In-Reply-To: <1315334514.02.0.137561826697.issue12921@psf.upfronthosting.co.za> Message-ID: <1362475868.5.0.478336491775.issue12921@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Karl - thanks for your telnet debugging session output. Helped realized the problem better. So I had been thinking that sending message is okay. But had not realized that same variable name was used and was causing problem. I have gone ahead with the fix for now. And for the tests, I think, will be written very similar to test_header_buffering_of_send_error of test_header_bufferring_of_send_error - when send_error is sent and then error asserted. (Usually, I try to change test and patch together and that's our protocol too. In this case, I only tested it manually, thinking that there is not test coverage for this portion (yet). But later when I peeked into tests, I saw that it would be written for this scenario). Will include and then close this report. The other suggestion of Paul can be included in another report and so the change of the error status to proper 501 Not Implemented. Thanks. ---------- versions: +Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 10:54:15 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 05 Mar 2013 09:54:15 +0000 Subject: [issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline In-Reply-To: <1315334514.02.0.137561826697.issue12921@psf.upfronthosting.co.za> Message-ID: <1362477255.2.0.32638993464.issue12921@psf.upfronthosting.co.za> Senthil Kumaran added the comment: There is a test failure. which leads me to believe that "Error message" may probably be relied upon by some applications. FAIL: test_header_length (test.test_httpservers.BaseHTTPRequestHandlerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/export/home/buildbot/64bits/3.2.cea-indiana-amd64/build/Lib/test/test_httpservers.py", line 605, in test_header_length self.assertEqual(result[0], b'HTTP/1.1 400 Line too long\r\n') AssertionError: b'HTTP/1.1 400 Bad Request\r\n' != b'HTTP/1.1 400 Line too long\r\n' I think, I am going revert the change I made first. Because, looking at documentation and usage, leads me to believe that we are bit assuming much from a misleading example. send_error(code, message) - message here is optional, but when sent, the server is responsible for displaying it. It is *never* advertised that the traceback can be sent as a message. However, I do think there a chance for improvement and that is the reason, I went ahead with the change. The improvement can be send_error - response header could be the uniform shortmsg and response body can be the message that is sent by send_error(code, message). Now, this will be improvement and it should be discussed in that aspect rather than as a fix for anything. Going ahead with the revert. Sorry for the mistake. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 10:56:30 2013 From: report at bugs.python.org (Dmitry Shachnev) Date: Tue, 05 Mar 2013 09:56:30 +0000 Subject: [issue17354] TypeError when running setup.py upload --show-response Message-ID: <1362477390.5.0.0948217479976.issue17354@psf.upfronthosting.co.za> New submission from Dmitry Shachnev: When running `python3 setup.py sdist upload --show-response`, one may get this exception: Traceback (most recent call last): File "setup.py", line 47, in requires=['dbus'] File "/usr/lib/python3.2/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.2/distutils/dist.py", line 917, in run_commands self.run_command(cmd) File "/usr/lib/python3.2/distutils/dist.py", line 936, in run_command cmd_obj.run() File "/usr/lib/python3.2/distutils/command/upload.py", line 66, in run self.upload_file(command, pyversion, filename) File "/usr/lib/python3.2/distutils/command/upload.py", line 201, in upload_file msg = '\n'.join(('-' * 75, r.read(), '-' * 75)) TypeError: sequence item 1: expected str instance, bytes found This happens because r is binary stream, so r.read() returns bytes. A trivial patch that fixes the problem is attached. ---------- components: Library (Lib) files: distutils-decode-server-response.patch keywords: patch messages: 183517 nosy: mitya57 priority: normal severity: normal status: open title: TypeError when running setup.py upload --show-response versions: Python 3.3 Added file: http://bugs.python.org/file29312/distutils-decode-server-response.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 11:25:47 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 05 Mar 2013 10:25:47 +0000 Subject: [issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline In-Reply-To: <1315334514.02.0.137561826697.issue12921@psf.upfronthosting.co.za> Message-ID: <3ZKvQ30gzXzRtR@mail.python.org> Roundup Robot added the comment: New changeset 4e6c46d5f77d by Senthil Kumaran in branch '2.7': Reverting the changeset c31d700dea8b made for Issue #12921 http://hg.python.org/cpython/rev/4e6c46d5f77d New changeset 637d7c953b10 by Senthil Kumaran in branch '3.2': Reverting the changeset 5126e62c60af made for Issue #12921 http://hg.python.org/cpython/rev/637d7c953b10 New changeset 84e7a7f6ddb8 by Senthil Kumaran in branch '3.3': Reverting the changeset 5d76a4746d9d made for Issue #12921 http://hg.python.org/cpython/rev/84e7a7f6ddb8 New changeset b0890674bc21 by Senthil Kumaran in branch 'default': Reverting the changeset b87792757ee8 made for Issue #12921 http://hg.python.org/cpython/rev/b0890674bc21 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 11:53:39 2013 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 05 Mar 2013 10:53:39 +0000 Subject: [issue6419] Broken test_kqueue.py on OpenBSD In-Reply-To: <1246742581.68.0.218952543803.issue6419@psf.upfronthosting.co.za> Message-ID: <1362480819.14.0.417457815055.issue6419@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- nosy: -mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 12:01:03 2013 From: report at bugs.python.org (Kushal Das) Date: Tue, 05 Mar 2013 11:01:03 +0000 Subject: [issue15465] Improved documentation for C API version info In-Reply-To: <1343372725.26.0.84225170505.issue15465@psf.upfronthosting.co.za> Message-ID: <1362481263.76.0.119450224817.issue15465@psf.upfronthosting.co.za> Changes by Kushal Das : Added file: http://bugs.python.org/file29313/issue15465v4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 12:04:12 2013 From: report at bugs.python.org (Kushal Das) Date: Tue, 05 Mar 2013 11:04:12 +0000 Subject: [issue15465] Improved documentation for C API version info In-Reply-To: <1343372725.26.0.84225170505.issue15465@psf.upfronthosting.co.za> Message-ID: <1362481452.96.0.502899141571.issue15465@psf.upfronthosting.co.za> Kushal Das added the comment: version 4 of the patch contains a new column in table as Bytes as suggested by Ezio Melotti ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 12:57:57 2013 From: report at bugs.python.org (karl) Date: Tue, 05 Mar 2013 11:57:57 +0000 Subject: [issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline In-Reply-To: <1315334514.02.0.137561826697.issue12921@psf.upfronthosting.co.za> Message-ID: <1362484677.11.0.558995467283.issue12921@psf.upfronthosting.co.za> karl added the comment: The culprit is here http://hg.python.org/cpython/file/3.3/Lib/http/server.py#l320 That an application or a person decides to send another message is ok. Designer choice. That the library is sending something optional as a test seems more uncomfortable. The list of codes for 4xx is declared at http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-22#section-6.5 In HTTP, only the code is mandatory, the text is optional. But indeed you reveal a loophole, which means that someone might want to send a message for the body. That said, I still do not think it should lend in the header for reasons explained previously (serious breakage). I will come up with something which is fixing the issue without breaking the existent. That said, do I open another bug for the test? The test should be fixed too. It should test 400 only. and not the full status-line. The previous test is also an issue, testing 414. Because the prose in the spec is "URI Too Long" and not "HTTP/1.1 414 Request-URI Too Long" http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-22#section-6.5.12 Hmmm? I see all tests are like this. It should be fixed. Opening bug? Thought? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 13:21:27 2013 From: report at bugs.python.org (karl) Date: Tue, 05 Mar 2013 12:21:27 +0000 Subject: [issue17355] http tests testing more than the error code are fragile Message-ID: <1362486087.71.0.484772154915.issue17355@psf.upfronthosting.co.za> New submission from karl: Some of the tests of the HTTP Test suite are checking for the full status-line, instead of just the error code. Why is it an issue? 1. The only mandatory part in the status-line is the error code. The phrase is optional. For example the response is made of 3 parts. HTTP/1.1 400 Bad Request ('HTTP/1.1', '400', 'Bad Request') Only 400 is the mandatory part of the error code and is testing the error. 2. It creates dependencies on how we conceive, modify the construction of the status-line and error messages. 3. Some tests are testing messages with different "optional texts". http://hg.python.org/cpython/file/3.3/Lib/test/test_httpservers.py#l640 Test for "HTTP/1.1 400 Line Too Long\r\n". Instead of just testing "400". (A specific message could be put in the body, but that's informational) http://hg.python.org/cpython/file/3.3/Lib/test/test_httpservers.py#l633 Test for "HTTP/1.1 414 Request-URI Too Long\r\n" instead of just testing "414", btw the spec says for the optional message "URI Too Long" http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-22#section-6.5.12 Testing the message, IMHO, should be only, for testing the construction of the message. The tests here are made for testing the right error code, but they try to do more. Hope it helps :) Threading: related to http://bugs.python.org/issue12921#msg183520 ---------- messages: 183521 nosy: karlcow, orsenthil priority: normal severity: normal status: open title: http tests testing more than the error code are fragile versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 13:21:46 2013 From: report at bugs.python.org (karl) Date: Tue, 05 Mar 2013 12:21:46 +0000 Subject: [issue17355] http tests testing more than the error code are fragile In-Reply-To: <1362486087.71.0.484772154915.issue17355@psf.upfronthosting.co.za> Message-ID: <1362486106.62.0.375851575722.issue17355@psf.upfronthosting.co.za> Changes by karl : ---------- components: +Library (Lib), Tests _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 13:22:43 2013 From: report at bugs.python.org (karl) Date: Tue, 05 Mar 2013 12:22:43 +0000 Subject: [issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline In-Reply-To: <1315334514.02.0.137561826697.issue12921@psf.upfronthosting.co.za> Message-ID: <1362486163.0.0.352211887767.issue12921@psf.upfronthosting.co.za> karl added the comment: Senthil, I created another bug reports for the tests which are fragile. http://bugs.python.org/issue17355 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 14:30:53 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Tue, 05 Mar 2013 13:30:53 +0000 Subject: [issue17025] reduce multiprocessing.Queue contention In-Reply-To: <51351BAE.4000207@gmail.com> Message-ID: Charles-Fran?ois Natali added the comment: > No. I only looked at the diff and assumed both changes were for Queue. OK, great. > Since you marked issue 10886 as superceded, do you intend to do the > pickling in put()? Actually no, I'll reopen it. I find the performance hit important, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 14:31:23 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Tue, 05 Mar 2013 13:31:23 +0000 Subject: [issue10886] Unhelpful backtrace for multiprocessing.Queue In-Reply-To: <1294744619.25.0.366060169853.issue10886@psf.upfronthosting.co.za> Message-ID: <1362490283.12.0.840449721662.issue10886@psf.upfronthosting.co.za> Changes by Charles-Fran?ois Natali : ---------- status: closed -> open superseder: reduce multiprocessing.Queue contention -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 14:33:53 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Mar 2013 13:33:53 +0000 Subject: [issue15866] encode(..., 'xmlcharrefreplace') produces entities for surrogate pairs In-Reply-To: <1346871274.13.0.653364801762.issue15866@psf.upfronthosting.co.za> Message-ID: <1362490433.6.0.456077634486.issue15866@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > I think it's better to be compatible with 3.3+. This is anyway a rather obscure corner case. Well, we should not introduce new divergence between 3.2 wide build and 3.3. > Do you want to propose a new patch? I will do it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 14:34:04 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Mar 2013 13:34:04 +0000 Subject: [issue17353] Plistlib outputs empty data tags when deeply nested In-Reply-To: <1362429215.6.0.797287296233.issue17353@psf.upfronthosting.co.za> Message-ID: <1362490444.58.0.580834597832.issue17353@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: We should limit the indentation to be less than the maximal line length. ---------- assignee: -> ronaldoussoren components: +Macintosh nosy: +ronaldoussoren, serhiy.storchaka stage: -> needs patch type: -> behavior versions: +Python 3.2, Python 3.3 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 14:35:23 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 05 Mar 2013 13:35:23 +0000 Subject: [issue17355] http tests testing more than the error code are fragile In-Reply-To: <1362486087.71.0.484772154915.issue17355@psf.upfronthosting.co.za> Message-ID: <1362490523.54.0.0594445318325.issue17355@psf.upfronthosting.co.za> R. David Murray added the comment: We are testing our http server. It is not obviously inappropriate to test the full string. Especially in the Line to Long case, where we are testing that our specific error message is produced. If you wish to argue that we should emit the standard message and only put the specific info in the body of the response, that would be a design change, and then we should probably test for *that*, since it would be a change from current behavior. Personally I find the more-specific information being in the response code message to be helpful, but I haven't done enough web programming lately for my opinion to count for much :) So, I do not think this issue needs to be separate from issue 12921. The tests should be fixed as part of the enhancement being advocated there (and I certainly agree it should be *possible* to control the two messages separately, regardless of what we choose to do by default). ---------- nosy: +r.david.murray resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> http.server.BaseHTTPRequestHandler.send_error and trailing newline _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 14:40:31 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 05 Mar 2013 13:40:31 +0000 Subject: [issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline In-Reply-To: <1315334514.02.0.137561826697.issue12921@psf.upfronthosting.co.za> Message-ID: <1362490831.67.0.964207676751.issue12921@psf.upfronthosting.co.za> R. David Murray added the comment: Which I closed, sorry. I agree it should be possible to control the text produced with the error code separately from the text in the body. I prefer the specific text produced by our http server to the generic message, but I would only be -0 on changing this so that the default was the generic message and the specific message only went in the body. Since changing that would change the behavior of existing code, this is an enhacement request and not a bug fix. (That is, it may be a design bug, but those get fixed as enhancements :) Either way, the httpserver tests will need to be modified to test the API enhancement, and the possible default text change, proposed here. ---------- nosy: +r.david.murray type: behavior -> enhancement versions: -Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 14:54:18 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Mar 2013 13:54:18 +0000 Subject: [issue17343] Add a version of str.split which returns an iterator In-Reply-To: <1362359066.58.0.311917237277.issue17343@psf.upfronthosting.co.za> Message-ID: <1362491658.78.0.22429576704.issue17343@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > Indeed, a bytearray version would require the talked about but not implemented due to complexity (in pep3118) support for locking a buffer from other mutations. I rather think that a bytearray version can't pre-scan the data. Note that an array for pre-scanned result can be larger than input data (if we split into a large number of small items). Also note that iterative split useful when we do not want to process all input, but only several first items. Actually I think that in most common cases non-iterative split will be faster than iterative one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 15:05:44 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Mar 2013 14:05:44 +0000 Subject: [issue17343] Add a version of str.split which returns an iterator In-Reply-To: <1362359066.58.0.311917237277.issue17343@psf.upfronthosting.co.za> Message-ID: <1362492344.07.0.318483218705.issue17343@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > There is no string view that I know of. Interesting idea, though, thanks to the immutability of strings. Would much have to be different other than boundary checking and __hash__ (and hoping extension authors are changing things in-place)? Objects/stringlib/unicode_format.h contains internal structure SubString which can be taken as a basis. But it is unlikely that it will be useful. All API which accept strings will require converting substring views to regular strings. And substring object can consume more memory than full string. This looks like a step backwards from PEP 393. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 15:20:15 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 05 Mar 2013 14:20:15 +0000 Subject: [issue17301] An in-place version of many bytearray methods is needed In-Reply-To: <1361910523.06.0.491264384267.issue17301@psf.upfronthosting.co.za> Message-ID: <1362493215.97.0.691360913269.issue17301@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Sorry, Terry, I was meaning a CPU time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 15:23:35 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 05 Mar 2013 14:23:35 +0000 Subject: [issue17301] An in-place version of many bytearray methods is needed In-Reply-To: <1361910523.06.0.491264384267.issue17301@psf.upfronthosting.co.za> Message-ID: <1362493415.32.0.451902013798.issue17301@psf.upfronthosting.co.za> Christian Heimes added the comment: +1 ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 15:54:31 2013 From: report at bugs.python.org (karl) Date: Tue, 05 Mar 2013 14:54:31 +0000 Subject: [issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline In-Reply-To: <1315334514.02.0.137561826697.issue12921@psf.upfronthosting.co.za> Message-ID: <1362495271.41.0.568023264572.issue12921@psf.upfronthosting.co.za> karl added the comment: hehe. No hard feelings. I still do not think it is a good idea to test the "error code" and its associated message in the same test. :) For example, in RFC2616, 414 is defined as 414 Request-URI Too Long and in the HTTP1.1bis (which will not get a new version number) because the goal of the work was to just clarify and not make incompatible changes, 414 is defined as 414 URI Too Long which is fine because the message is optional. With the current tests, it will make it hard to modify :) http://hg.python.org/cpython/file/3.3/Lib/http/server.py#l627 # More about this specific issue Right now, send_error groks everything, which is not very good in terms of security and side effects. http://hg.python.org/cpython/file/3.3/Lib/http/server.py#l404 def send_error(self, code, message=None): Then later on: try: shortmsg, longmsg = self.responses[code] * shortmsg is supposed to bewhat is written in the spec. * longmsg is specific to the python project. When the message is not defined it takes the shortmsg http://hg.python.org/cpython/file/3.3/Lib/http/server.py#l421 but if defined it sends everything whatever it is http://hg.python.org/cpython/file/3.3/Lib/http/server.py#l428 Checking the status-line http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-22#section-3.1.2 3.1.2. Status Line The first line of a response message is the status-line, consisting of the protocol version, a space (SP), the status code, another space, a possibly-empty textual phrase describing the status code, and ending with CRLF. status-line = HTTP-version SP status-code SP reason-phrase CRLF The status-code element is a 3-digit integer code describing the result of the server's attempt to understand and satisfy the client's corresponding request. The rest of the response message is to be interpreted in light of the semantics defined for that status code. See Section 6 of [Part2] for information about the semantics of status codes, including the classes of status code (indicated by the first digit), the status codes defined by this specification, considerations for the definition of new status codes, and the IANA registry. status-code = 3DIGIT The reason-phrase element exists for the sole purpose of providing a textual description associated with the numeric status code, mostly out of deference to earlier Internet application protocols that were more frequently used with interactive text clients. A client SHOULD ignore the reason-phrase content. reason-phrase = *( HTAB / SP / VCHAR / obs-text ) * So client SHOULD ignore the reason-phrase * The reason-phrase can only contains ** HTAB (horizontal tab) ** SP (space) ** VCHAR (any visible [USASCII] character) ** obs-text *** As a convention, ABNF rule names prefixed with "obs-" denote "obsolete" grammar rules that appear for historical reasons. *** obs-text = %x80-FF (range of characters) A hacky way to mitigate the issue would be to 1. extract the first line (stop after the first CRLF) 2. sanitize this line. (allow only "*(HTAB / SP / VCHAR / %x80-FF)" ) 3. send only this. Thoughts? Honestly, I do not find very satisfying. ;) but at least it should not break everything. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 16:41:28 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 05 Mar 2013 15:41:28 +0000 Subject: [issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline In-Reply-To: <1315334514.02.0.137561826697.issue12921@psf.upfronthosting.co.za> Message-ID: <1362498088.71.0.262301280434.issue12921@psf.upfronthosting.co.za> R. David Murray added the comment: Your suggestion could probably be applied as a bug fix to maintenance releases, but is it worth the effort? We don't generally try to protect programmers from themselves in Python. On the other hand, there should clearly be a way to provide the 'explain' text as well as the message text. In 3.4 we could add an 'explain' keyword to send_error. If only explain is specified, we'd use the shortmsg for message. That way, a programmer writing new code can make it work the way they want it to, while existing code will continue to work the way it used to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 17:07:38 2013 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 05 Mar 2013 16:07:38 +0000 Subject: [issue17301] An in-place version of many bytearray methods is needed In-Reply-To: <1362493215.97.0.691360913269.issue17301@psf.upfronthosting.co.za> Message-ID: Gregory P. Smith added the comment: The important reasons for this are memory use and cache thrashing, not just CPU time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 18:05:31 2013 From: report at bugs.python.org (karl) Date: Tue, 05 Mar 2013 17:05:31 +0000 Subject: [issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline In-Reply-To: <1315334514.02.0.137561826697.issue12921@psf.upfronthosting.co.za> Message-ID: <1362503131.45.0.0418195692156.issue12921@psf.upfronthosting.co.za> karl added the comment: R.david Trying another patch just for understanding if it's what you meant. What it does: 1. adding an 'explain' keyword 2. escaping the explain message for the body 3. checking for injection of newline in the reason phrase. For the part 3, TODO: check if there are other parts in the library if the reason phrase is injected in the message. ---------- Added file: http://bugs.python.org/file29314/issue-12921-3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 18:09:48 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 05 Mar 2013 17:09:48 +0000 Subject: [issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing In-Reply-To: <1362245019.42.0.972918137955.issue17338@psf.upfronthosting.co.za> Message-ID: <1362503388.36.0.890164228586.issue17338@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 18:13:02 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 05 Mar 2013 17:13:02 +0000 Subject: [issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing In-Reply-To: <1362245019.42.0.972918137955.issue17338@psf.upfronthosting.co.za> Message-ID: <1362503582.4.0.111658464695.issue17338@psf.upfronthosting.co.za> Christian Heimes added the comment: My python-ideas posting about the same topic http://mail.python.org/pipermail/python-ideas/2013-March/019807.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 18:50:39 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Tue, 05 Mar 2013 17:50:39 +0000 Subject: [issue10886] Unhelpful backtrace for multiprocessing.Queue In-Reply-To: <1294744619.25.0.366060169853.issue10886@psf.upfronthosting.co.za> Message-ID: <1362505839.05.0.545837614356.issue10886@psf.upfronthosting.co.za> Charles-Fran?ois Natali added the comment: For the record, I'm posting thse benchmark numbers here (originally from issue #17025): """ with patch: $ ./python /tmp/multi_queue.py took 0.7945001125335693 seconds with 1 workers took 0.7428359985351562 seconds with 2 workers took 0.7897098064422607 seconds with 3 workers took 1.1860828399658203 seconds with 4 workers I tried Richard's suggestion of serializing the data inside put(), but this reduces performance quite notably: $ ./python /tmp/multi_queue.py took 1.412883996963501 seconds with 1 workers took 1.3212130069732666 seconds with 2 workers took 1.2271699905395508 seconds with 3 workers took 1.4817359447479248 seconds with 4 workers Although I didn't analyse it further, I guess one reason could be that if the serializing is done in put(), the feeder thread has nothing to do but keep waiting for data to be available from the buffer, send it, and block until there's more to do: basically, it almost doesn't use its time-slice, and spends its time blocking and doing context switches. """ So serializing the data from put() seems to have a significant performance impact (other benchmarks are welcome), that's something to keep in mind. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 19:12:15 2013 From: report at bugs.python.org (Vladimir Rutsky) Date: Tue, 05 Mar 2013 18:12:15 +0000 Subject: [issue17356] Invalid link to repr() built-in function description Message-ID: <1362507135.12.0.423032726441.issue17356@psf.upfronthosting.co.za> New submission from Vladimir Rutsky: References to built-in function repr() links to repr module (http://docs.python.org/2/library/repr.html#module-repr), but must link to description in http://docs.python.org/2/library/functions.html. It can be at least in http://docs.python.org/2/library/functions.html (link in table at page top). ---------- assignee: docs at python components: Documentation messages: 183538 nosy: docs at python, vrutsky priority: normal severity: normal status: open title: Invalid link to repr() built-in function description type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 19:23:49 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 05 Mar 2013 18:23:49 +0000 Subject: [issue17357] Add missing verbosity message to importlib Message-ID: <1362507829.49.0.31047461658.issue17357@psf.upfronthosting.co.za> New submission from Brett Cannon: Looks like I missed some verbosity messages in importlib. The most obvious one is the "trying" messages under verbosity 2 (-vv or PYTHONVERBOSE=2). Should probably go through import.c again and make sure no other messages are missing (http://hg.python.org/cpython/file/637d7c953b10/Python/import.c). ---------- components: Interpreter Core keywords: easy messages: 183539 nosy: brett.cannon, twouters priority: normal severity: normal stage: needs patch status: open title: Add missing verbosity message to importlib type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 19:33:54 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 05 Mar 2013 18:33:54 +0000 Subject: [issue11732] Skip decorator for tests requiring manual intervention on Windows In-Reply-To: <1301604811.48.0.519862680053.issue11732@psf.upfronthosting.co.za> Message-ID: <3ZL6FF5bkgzSqc@mail.python.org> Roundup Robot added the comment: New changeset 834a451f1cdb by Ezio Melotti in branch '3.3': #11732: add a new suppress_crash_popup() context manager to test.support. http://hg.python.org/cpython/rev/834a451f1cdb New changeset b87123015fb0 by Ezio Melotti in branch 'default': #11732: merge with 3.3. http://hg.python.org/cpython/rev/b87123015fb0 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 19:39:46 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 05 Mar 2013 18:39:46 +0000 Subject: [issue17357] Add missing verbosity message to importlib In-Reply-To: <1362507829.49.0.31047461658.issue17357@psf.upfronthosting.co.za> Message-ID: <1362508786.58.0.573720742248.issue17357@psf.upfronthosting.co.za> Brett Cannon added the comment: Any change below needs to be checked for what verbosity it matters for (although I think there is only a single level 2 message): PySys_WriteStderr("# %s has bad magic\n", cpathname); (http://hg.python.org/cpython/file/637d7c953b10/Python/import.c#l1038) PySys_WriteStderr("import %s # directory %s\n", name, pathname); although that might be confusing in the face of namespace packages (http://hg.python.org/cpython/file/637d7c953b10/Python/import.c#l1435) PySys_WriteStderr("# trying %s\n", buf); (http://hg.python.org/cpython/file/637d7c953b10/Python/import.c#l1837) PySys_WriteStderr("import %s # frozen%s\n", name, ispackage ? " package" : ""); (http://hg.python.org/cpython/file/637d7c953b10/Python/import.c#l2335) PySys_WriteStderr("import %s # builtin\n", name); (http://hg.python.org/cpython/file/637d7c953b10/Python/import.c#l2224) Everything else changed, but is covered by some new verbose message. Should probably change "created {!r}" to "wrote {!r}" in importlib (http://hg.python.org/cpython/file/b0890674bc21/Lib/importlib/_bootstrap.py#l1091) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 19:42:10 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 05 Mar 2013 18:42:10 +0000 Subject: [issue17357] Add missing verbosity message to importlib In-Reply-To: <1362507829.49.0.31047461658.issue17357@psf.upfronthosting.co.za> Message-ID: <1362508930.33.0.680608801208.issue17357@psf.upfronthosting.co.za> Brett Cannon added the comment: Actually, the builtin/frozen stuff is covered by a catch-all "import ..." message in importlib itself (I thought I wasn't _that_ sloppy when I added the messages). That just leaves the bad magic number, what to do about a matching directory, and "trying". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 19:50:29 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 05 Mar 2013 18:50:29 +0000 Subject: [issue14489] repr() function link on the built-in function documentation is incorrect In-Reply-To: <1333520679.63.0.90940412535.issue14489@psf.upfronthosting.co.za> Message-ID: <1362509429.26.0.22786968807.issue14489@psf.upfronthosting.co.za> R. David Murray added the comment: Confirm that this is not fixed. ---------- resolution: fixed -> stage: committed/rejected -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 19:51:23 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 05 Mar 2013 18:51:23 +0000 Subject: [issue17356] Invalid link to repr() built-in function description In-Reply-To: <1362507135.12.0.423032726441.issue17356@psf.upfronthosting.co.za> Message-ID: <1362509483.56.0.232116337658.issue17356@psf.upfronthosting.co.za> R. David Murray added the comment: Closing in favor of re-opening issue 14489, which tried to fix this and apparently failed. ---------- nosy: +r.david.murray resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> repr() function link on the built-in function documentation is incorrect _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 19:51:48 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 05 Mar 2013 18:51:48 +0000 Subject: [issue14489] repr() function link on the built-in function documentation is incorrect In-Reply-To: <1333520679.63.0.90940412535.issue14489@psf.upfronthosting.co.za> Message-ID: <1362509508.66.0.438411688468.issue14489@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- nosy: +vrutsky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 19:53:35 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 05 Mar 2013 18:53:35 +0000 Subject: [issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing In-Reply-To: <1362245019.42.0.972918137955.issue17338@psf.upfronthosting.co.za> Message-ID: <1362509615.11.0.898720848367.issue17338@psf.upfronthosting.co.za> Christian Heimes added the comment: Here is an experimental patch. The speedup is ... measurable. $ ./python -m timeit -n1000 "l = []" "l.__preallocate__(10000)" "app = l.append" "for i in range(10000): app(i)" "l.__shrink__()" 1000 loops, best of 3: 3.68 msec per loop $ ./python -m timeit -n1000 "l = []" "app = l.append" "for i in range(10000): app(i)" 1000 loops, best of 3: 3.75 msec per loop ---------- keywords: +patch Added file: http://bugs.python.org/file29315/preallocate.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 19:54:25 2013 From: report at bugs.python.org (Ezio Melotti) Date: Tue, 05 Mar 2013 18:54:25 +0000 Subject: [issue17223] Initializing array.array with unicode type code and buffer segfaults In-Reply-To: <1361144705.32.0.225799767897.issue17223@psf.upfronthosting.co.za> Message-ID: <1362509665.92.0.452265603445.issue17223@psf.upfronthosting.co.za> Ezio Melotti added the comment: Tests are still failing on Windows: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/1558/steps/test/logs/stdio ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 20:01:10 2013 From: report at bugs.python.org (Ezio Melotti) Date: Tue, 05 Mar 2013 19:01:10 +0000 Subject: [issue14489] repr() function link on the built-in function documentation is incorrect In-Reply-To: <1333520679.63.0.90940412535.issue14489@psf.upfronthosting.co.za> Message-ID: <1362510070.14.0.38504407291.issue14489@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 20:04:41 2013 From: report at bugs.python.org (Ezio Melotti) Date: Tue, 05 Mar 2013 19:04:41 +0000 Subject: [issue11732] Skip decorator for tests requiring manual intervention on Windows In-Reply-To: <1301604811.48.0.519862680053.issue11732@psf.upfronthosting.co.za> Message-ID: <1362510281.73.0.101141646336.issue11732@psf.upfronthosting.co.za> Ezio Melotti added the comment: I applied this only on 3.3/3.x because I didn't manage to test on 2.7/3.2. If test_ctypes and/or other tests are failing there I can backport it, but the patch needs to be tweaked there because it doesn't apply cleanly (and there's no test_faulthandler there). ---------- assignee: brian.curtin -> ezio.melotti resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 20:12:50 2013 From: report at bugs.python.org (Brian Curtin) Date: Tue, 05 Mar 2013 19:12:50 +0000 Subject: [issue17323] Disable [X refs, Y blocks] ouput in debug builds In-Reply-To: <1362125769.07.0.506127363333.issue17323@psf.upfronthosting.co.za> Message-ID: <1362510770.37.0.375619028595.issue17323@psf.upfronthosting.co.za> Brian Curtin added the comment: I don't know exactly what the option would be called, but +1 on the idea. Perhaps something under the interpreter's -X option since it's implementation-specific? This output gets in the way a fair bit when debugging interpreter sessions, and Chris brings up a good point about testability. ---------- nosy: +brian.curtin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 20:33:05 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 05 Mar 2013 19:33:05 +0000 Subject: [issue17358] imp.load_module() leads to the improper caching of the 'file' argument Message-ID: <1362511985.74.0.511214026015.issue17358@psf.upfronthosting.co.za> New submission from Brett Cannon: As of right now, if you use imp.load_module(), it will store any 'file' argument you give it in a hacked loader. That's a problem when you call imp.reload() on such a module, though, as subsequent calls to __loader__.load_module() will attempt to use the cached file object which was closed on the initial load. What the code should do is use the hacked loader to load the module, but then set an unhacked loader to __loader__ for reloads to work properly. Traceback below: ====================================================================== ERROR: test_source (test.test_imp.ReloadTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/build/work/cf49a3092a96daebb23bf3c6e0d86ac9/google3/tmp/lib/python3.3/test/test_imp.py", line 248, in test_source imp.reload(os) File "/build/work/cf49a3092a96daebb23bf3c6e0d86ac9/google3/tmp/lib/python3.3/imp.py", line 252, in reload return module.__loader__.load_module(name) File "", line 586, in _check_name_wrapper File "", line 1023, in load_module File "", line 1004, in load_module File "", line 562, in module_for_loader_wrapper File "", line 854, in _load_module File "", line 978, in get_code File "/build/work/cf49a3092a96daebb23bf3c6e0d86ac9/google3/tmp/lib/python3.3/imp.py", line 88, in get_data with self.file: ValueError: I/O operation on closed file. ---------- components: Library (Lib) keywords: easy messages: 183549 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: imp.load_module() leads to the improper caching of the 'file' argument versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 20:40:25 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 05 Mar 2013 19:40:25 +0000 Subject: [issue17359] python modules.zip is not documented Message-ID: <1362512425.64.0.937549165034.issue17359@psf.upfronthosting.co.za> New submission from Marc-Andre Lemburg: The feature to run a ZIP file containing Python modules is not documented. It was implemented in Python 2.6: * http://bugs.python.org/issue1739468 and mentioned in the "What's new": * http://docs.python.org/2/whatsnew/2.6.html?highlight=python%20run%20zip%20files#other-language-changes but searching the documentation for "__main__.py" returns 0 hits in the docs (for Python 2.7 and 3.4). I guess "python dir" should also be mentioned somewhere... ---------- assignee: docs at python components: Documentation messages: 183550 nosy: docs at python, lemburg priority: normal severity: normal status: open title: python modules.zip is not documented versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 5 20:48:45 2013 From: report at bugs.python.org (Eli Bendersky) Date: Tue, 05 Mar 2013 19:48:45 +0000 Subject: [issue17359] python modules.zip is not documented In-Reply-To: <1362512425.64.0.937549165034.issue17359@psf.upfronthosting.co.za> Message-ID: <1362512925.34.0.75235502308.issue17359@psf.upfronthosting.co.za> Eli Bendersky added the comment: >From http://docs.python.org/3/using/cmdline.html: Package names are also permitted. When a package name is supplied instead of a normal module, the interpreter will execute .__main__ as the main module. This behaviour is deliberately similar to the handling of directories and zipfiles that are passed to the interpreter as the script argument. This is for "-m" Also: