From report at bugs.python.org Thu Mar 1 00:32:00 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 29 Feb 2012 23:32:00 +0000 Subject: [issue14153] Expose os.device_encoding() at the C level In-Reply-To: <1330448630.79.0.296713458855.issue14153@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset c80d9a0bd5a0 by Brett Cannon in branch 'default': Issue #14153 Create _Py_device_encoding() to prevent _io from having to import http://hg.python.org/cpython/rev/c80d9a0bd5a0 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 00:32:36 2012 From: report at bugs.python.org (Brett Cannon) Date: Wed, 29 Feb 2012 23:32:36 +0000 Subject: [issue14153] Expose os.device_encoding() at the C level In-Reply-To: <1330448630.79.0.296713458855.issue14153@psf.upfronthosting.co.za> Message-ID: <1330558356.35.0.907772145956.issue14153@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: -> brett.cannon resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 01:00:48 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 01 Mar 2012 00:00:48 +0000 Subject: [issue14163] tkinter: problems with hello doc example Message-ID: <1330560048.21.0.5556738264.issue14163@psf.upfronthosting.co.za> New submission from Terry J. Reedy : After an intro, the tkinter docs start with a traditional 'Hello World'. http://docs.python.org/py3k/library/tkinter.html#a-simple-hello-world-program Problem 1. The example ends with root.destroy John Salerno, today, on python-list thread "Is it necessary to call Tk() when writing a GUI app with Tkinter?", reported the following, which I verified. On Windows, at least, closing the unlabelled Tk window by clicking the normal [X} close button on the frame causes _tkinter.TclError: can't invoke "destroy" command: application has been destroyed This does not happen if one instead clicks the QUIT button inside the frame (as that does not destroy the app). Question 1a. Does the example work the same with current tcl/tk on *nix and mac? I assume it should, but I do not know if the example was buggy from the beginning or if something changes. In any case, I do not want to commit a solution that is not tested on more than my Win7. Question 1b. How do we most simply fix this part of the example? In '''self.QUIT["command"] = self.quit''', I changed 'quit' to 'destroy' and the result is to destroy the widgets but leave the outer frame and continue the mainloop. I tried another solution based on adding self.protocol("WM_DELETE_WINDOW", self.onDestroyWindow) to __init__(), but while this worked for Rick Johnson's class App(tk.Tk) example in his response to Salerno, it does not work for this class Application(Frame) example as the latter has no .protocol attribute. --- Problem 2. A 'Hello World' example should say 'Hello World' instead of just 'hello'. So I make the trivial edit and tk add braces and displays '{Hello World}'. What??? Adding '\n' does not trigger brace addition, so "Hello_World\n(click_me)" works as expected. Queston 2. How does one put a space in a button label with triggering addition of braces, or is this impossible? --- Problem and Solution 3. The example currently puts a loud capital red QUIT button first, and the quiet lowercase blass hello button second. This is backwards in both placement and emphasis. Putting the expanded hello buttom on top and QUIT under looks better to me. --- Problem 4 (in the intro, before the example): There is a lot that could be changed or added to the doc, but I think revising to use Tkinter all you need is a simple import statement: import tkinter Or, more often: from tkinter import * (3.x version) to add what I think is the best option, 'import tkinter as tk', as at least equal to the '*' option, should be done soon. I am thinking of something like to use Tkinter, use one of these import statements: import tkinter import tkinter as tk from tkinter import * ---------- assignee: docs at python components: Documentation, Tkinter messages: 154669 nosy: docs at python, ned.deily, serwy, terry.reedy priority: normal severity: normal status: open title: tkinter: problems with hello doc example type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 01:44:26 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Mar 2012 00:44:26 +0000 Subject: [issue14162] PEP 416: Add a builtin frozendict type In-Reply-To: <1330538704.6.0.815931694291.issue14162@psf.upfronthosting.co.za> Message-ID: <1330562666.59.0.284187042146.issue14162@psf.upfronthosting.co.za> STINNER Victor added the comment: frozendict_builtins.patch: make CPython supports frozendict for the __builtins__ mapping. It is an example of frozendict usage which helps my pysandbox project. ---------- title: Implementation of the PEP 416 (Add a builtin frozendict type) -> PEP 416: Add a builtin frozendict type Added file: http://bugs.python.org/file24690/frozendict_builtins.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 02:01:14 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 01 Mar 2012 01:01:14 +0000 Subject: [issue14159] __len__ method of weakset In-Reply-To: <1330527323.97.0.52214771843.issue14159@psf.upfronthosting.co.za> Message-ID: <1330563674.56.0.080725376128.issue14159@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- priority: normal -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 05:59:07 2012 From: report at bugs.python.org (Oleg Plakhotnyuk) Date: Thu, 01 Mar 2012 04:59:07 +0000 Subject: [issue13394] Patch to increase aifc lib test coverage In-Reply-To: <1321169659.12.0.870815067565.issue13394@psf.upfronthosting.co.za> Message-ID: <1330577947.77.0.027261405373.issue13394@psf.upfronthosting.co.za> Oleg Plakhotnyuk added the comment: For convenience I have uploaded the separate patch without warnings. Which means that it will generate some output during tests run. ---------- Added file: http://bugs.python.org/file24691/test_aifc_3_2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 06:02:24 2012 From: report at bugs.python.org (Oleg Plakhotnyuk) Date: Thu, 01 Mar 2012 05:02:24 +0000 Subject: [issue13394] Patch to increase aifc lib test coverage In-Reply-To: <1321169659.12.0.870815067565.issue13394@psf.upfronthosting.co.za> Message-ID: <1330578144.05.0.320190635193.issue13394@psf.upfronthosting.co.za> Changes by Oleg Plakhotnyuk : Removed file: http://bugs.python.org/file24691/test_aifc_3_2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 06:02:58 2012 From: report at bugs.python.org (Oleg Plakhotnyuk) Date: Thu, 01 Mar 2012 05:02:58 +0000 Subject: [issue13394] Patch to increase aifc lib test coverage In-Reply-To: <1321169659.12.0.870815067565.issue13394@psf.upfronthosting.co.za> Message-ID: <1330578178.05.0.467958953387.issue13394@psf.upfronthosting.co.za> Changes by Oleg Plakhotnyuk : Added file: http://bugs.python.org/file24692/test_aifc_3_2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 06:15:53 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 01 Mar 2012 05:15:53 +0000 Subject: [issue14163] tkinter: problems with hello doc example In-Reply-To: <1330560048.21.0.5556738264.issue14163@psf.upfronthosting.co.za> Message-ID: <1330578953.52.0.868207573808.issue14163@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Rick Johnson anwered question 1b on python-list: simply move root.destroy to the button. I make other changes also: use import...as; show that options can be set in constructor call. File uploaded. ---------- stage: -> patch review Added file: http://bugs.python.org/file24693/tk_hello.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 06:23:20 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 01 Mar 2012 05:23:20 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1330579400.03.0.704162786959.issue11379@psf.upfronthosting.co.za> ?ric Araujo added the comment: I?m not sure I would use note markup, though (cf. Raymond?s aversion to littering the doc with note and warning boxes). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 06:47:13 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 01 Mar 2012 05:47:13 +0000 Subject: [issue14161] python2 file __repr__ does not escape filename In-Reply-To: <1330533810.56.0.673512322833.issue14161@psf.upfronthosting.co.za> Message-ID: <1330580833.35.0.249502546945.issue14161@psf.upfronthosting.co.za> ?ric Araujo added the comment: Funny one :D Reproduced on linux: >>> open('/tmp/t\nest', 'w') file_repr in Objects/fileobject.c calls http://docs.python.org/c-api/unicode#PyUnicode_AsUnicodeEscapeString, equivalent to encode('unicode-escape'), so backslashes should be escaped. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 06:58:17 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 01 Mar 2012 05:58:17 +0000 Subject: [issue14161] python2 file __repr__ does not escape filename In-Reply-To: <1330533810.56.0.673512322833.issue14161@psf.upfronthosting.co.za> Message-ID: <1330581497.89.0.825178058534.issue14161@psf.upfronthosting.co.za> ?ric Araujo added the comment: Duh, obviously that code branch is used only for unicode paths: >>> open('/tmp/t\nest', 'w') >>> open(u'/tmp/t\nest', 'w') There does not seem to be something similar in http://docs.python.org/c-api/string, so I guess one would have to create intermediary objects to decode str to unicode, transform with unicode-escape and convert back to str. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 07:33:51 2012 From: report at bugs.python.org (Eli Bendersky) Date: Thu, 01 Mar 2012 06:33:51 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1330579400.03.0.704162786959.issue11379@psf.upfronthosting.co.za> Message-ID: Eli Bendersky added the comment: > > I?m not sure I would use note markup, though (cf. Raymond?s aversion to > littering the doc with note and warning boxes). > I also dislike box littering, but this one seems like a really good fit for a note, since it's completely outside the flow of that documentation page. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 08:04:25 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 01 Mar 2012 07:04:25 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1330585465.57.0.136913857414.issue11379@psf.upfronthosting.co.za> Raymond Hettinger added the comment: This is a reasonable case for a note. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 08:40:28 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 01 Mar 2012 07:40:28 +0000 Subject: [issue4080] unittest: display time of each test case In-Reply-To: <1223497696.14.0.913391715353.issue4080@psf.upfronthosting.co.za> Message-ID: <1330587628.39.0.556807700315.issue4080@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo title: pyunit - display time of each test case - patch -> unittest: display time of each test case _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 08:43:08 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 01 Mar 2012 07:43:08 +0000 Subject: [issue14160] TarFile.extractfile fails to extract targets of top-level relative symlinks In-Reply-To: <1330530660.51.0.926091322087.issue14160@psf.upfronthosting.co.za> Message-ID: <1330587788.73.0.620938752964.issue14160@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo, lars.gustaebel title: Tarfile.extractfile fails to extract targets of top-level relative symlinks -> TarFile.extractfile fails to extract targets of top-level relative symlinks versions: +Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 08:47:21 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 01 Mar 2012 07:47:21 +0000 Subject: [issue4080] unittest: display time of each test case In-Reply-To: <1223497696.14.0.913391715353.issue4080@psf.upfronthosting.co.za> Message-ID: <1330588041.14.0.672739899599.issue4080@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I think this would be a useful feature. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 09:01:18 2012 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 01 Mar 2012 08:01:18 +0000 Subject: [issue14161] python2 file __repr__ does not escape filename In-Reply-To: <1330533810.56.0.673512322833.issue14161@psf.upfronthosting.co.za> Message-ID: <1330588878.75.0.0652629475009.issue14161@psf.upfronthosting.co.za> Ezio Melotti added the comment: The attached patch seems to do the trick (not sure if it's the best way to fix the issue though): >>> open('woo\raa') >>> open('woo\ra\'a', 'w') >>> open('woo\ra\'a"', 'w') >>> It's more or less equivalent to: - return "" % (fname, mode, addr) + return "" % (repr(fname), mode, addr) ---------- keywords: +patch stage: needs patch -> test needed Added file: http://bugs.python.org/file24694/issue14161.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 09:04:39 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 01 Mar 2012 08:04:39 +0000 Subject: [issue14150] AIX, crash loading shared module into another process than python like operator.so results in 0509-130 In-Reply-To: <1330434369.23.0.116359457055.issue14150@psf.upfronthosting.co.za> Message-ID: <1330589079.9.0.985696851043.issue14150@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo, loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 09:32:51 2012 From: report at bugs.python.org (Stefan Krah) Date: Thu, 01 Mar 2012 08:32:51 +0000 Subject: [issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?) In-Reply-To: <1287858158.95.0.0752296181045.issue10181@psf.upfronthosting.co.za> Message-ID: <1330590771.39.0.689061315073.issue10181@psf.upfronthosting.co.za> Stefan Krah added the comment: > From the PEP: "The buffer interface (type Py_buffer, type slots bf_getbuffer > and bf_releasebuffer, etc) has been omitted from the ABI, since the stability > of the Py_buffer structure is not clear at this time. Inclusion in the ABI > can be considered in future releases." Great, that's exactly what I was looking for. - As far as I can see the issue is finished, so I'm closing it. Thanks again everyone for all the help! ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 09:45:13 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 01 Mar 2012 08:45:13 +0000 Subject: [issue1346572] Remove inconsistent behavior between import and zipimport Message-ID: <1330591513.52.0.204659168264.issue1346572@psf.upfronthosting.co.za> ?ric Araujo added the comment: Still an issue with 3.2: zipimport considers both pyc and pyo with or without -O. The discussion starts here: http://mail.python.org/pipermail/python-dev/2006-November/thread.html#69822 (This was originally closed instead of asking for another fix because SourceForge separated bugs and patches.) ---------- nosy: +brett.cannon, eric.araujo, ncoghlan resolution: invalid -> stage: -> needs patch status: closed -> open versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 09:48:02 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 01 Mar 2012 08:48:02 +0000 Subject: [issue1346572] Remove inconsistent behavior between import and zipimport Message-ID: <1330591682.69.0.767699263054.issue1346572@psf.upfronthosting.co.za> ?ric Araujo added the comment: I need to qualify something: I reproduced the bug with legacy/pre-PEP 3147/in-the-same-dir pyc and pyo files. One could argue that pycache directories in 3.2+ make this irrelevant and that it?s too late for 2.x. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 10:33:13 2012 From: report at bugs.python.org (Stefan Krah) Date: Thu, 01 Mar 2012 09:33:13 +0000 Subject: [issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers In-Reply-To: <1326709751.32.0.965094376059.issue13797@psf.upfronthosting.co.za> Message-ID: <1330594393.77.0.00963529832041.issue13797@psf.upfronthosting.co.za> Stefan Krah added the comment: I'm trying to understand what you want to be able to write. Do you perhaps have a short example? Also, to get the bigger picture: Is this related to your strview proposal? http://mail.python.org/pipermail/python-ideas/2011-December/012993.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 10:48:57 2012 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 01 Mar 2012 09:48:57 +0000 Subject: [issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers In-Reply-To: <1330594393.77.0.00963529832041.issue13797@psf.upfronthosting.co.za> Message-ID: Nick Coghlan added the comment: Consider a Python wrapper around a bytes object, or mmap or similar that wants to pass PEP 3118 buffer requests through to the underlying object. Currently, there's no way to write such a delegation - the delegating class has to be written in C. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 12:04:20 2012 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 01 Mar 2012 11:04:20 +0000 Subject: [issue14155] Deja vu in re's documentation In-Reply-To: <1330481540.05.0.869825762197.issue14155@psf.upfronthosting.co.za> Message-ID: <1330599860.68.0.195125895917.issue14155@psf.upfronthosting.co.za> Ezio Melotti added the comment: Do you think I should mention that you can still use match and a regex that starts to ^ in combination with the start argument of r.match to match at the beginning of a line? I'm not sure that's necessary. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 12:05:53 2012 From: report at bugs.python.org (Robin Becker) Date: Thu, 01 Mar 2012 11:05:53 +0000 Subject: [issue8170] Wrong Paths for distutils build --plat-name=win-amd64 In-Reply-To: <1268913333.33.0.305416760988.issue8170@psf.upfronthosting.co.za> Message-ID: <1330599953.18.0.829736008617.issue8170@psf.upfronthosting.co.za> Robin Becker added the comment: I cheated on the building both versions. I had 32 bit python installed and with the help of a colleague got hold of the installed files for the 64 bit version. I noticed that distutils was looking for the 64bit files in new_lib = os.path.join(sys.exec_prefix, 'PCbuild'). However, even though I had the files there the loader was missing them and trying to use the earlier lib specs. Experimenting with the command line led to the desire to prioritize the amd4 lib specification ie use insert instead of append for library_dirs. After this patch things do seem to work, but perhaps there's a better fix that removes/moves the 32 bit libs in some way. However, given that I am building the exes with a 32 bit python I suppose it's natural for distutils to assume we need the 32 bit libs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 12:11:35 2012 From: report at bugs.python.org (Michael Foord) Date: Thu, 01 Mar 2012 11:11:35 +0000 Subject: [issue4080] unittest: display time of each test case In-Reply-To: <1223497696.14.0.913391715353.issue4080@psf.upfronthosting.co.za> Message-ID: <1330600295.42.0.407786400029.issue4080@psf.upfronthosting.co.za> Michael Foord added the comment: Yes, it would definitely be useful (as would a count of how far through the test run we are [27/129] style). Getting to completing (even for testing) the "extensible" unittest is something I will still do (and nose2 is being built off the prototype work I did), but isn't going to happen immediately - so it's not a good reason to hold up these improvements. I'll be sprinting at PyCon and look at this issue then. I'm keen to avoid proliferating command line parameters to the unittest test runner. Ezio - why would you want to disable this feature? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 13:25:26 2012 From: report at bugs.python.org (John Napster) Date: Thu, 01 Mar 2012 12:25:26 +0000 Subject: [issue14164] my little contribution to the docs Message-ID: <1330604725.79.0.785320238353.issue14164@psf.upfronthosting.co.za> New submission from John Napster : This patch fixes some small grammar things in the docs. Hope you like my contribution. ---------- assignee: docs at python components: Documentation files: patch.diff keywords: patch messages: 154688 nosy: docs at python, joenapnap priority: normal severity: normal status: open title: my little contribution to the docs type: enhancement versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file24695/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 13:32:13 2012 From: report at bugs.python.org (Florent Xicluna) Date: Thu, 01 Mar 2012 12:32:13 +0000 Subject: [issue14164] my little contribution to the docs In-Reply-To: <1330604725.79.0.785320238353.issue14164@psf.upfronthosting.co.za> Message-ID: <1330605133.62.0.292551411816.issue14164@psf.upfronthosting.co.za> Changes by Florent Xicluna : ---------- stage: -> patch review versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 13:40:22 2012 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 01 Mar 2012 12:40:22 +0000 Subject: [issue14159] __len__ method of weakset In-Reply-To: <1330527323.97.0.52214771843.issue14159@psf.upfronthosting.co.za> Message-ID: <1330605622.32.0.281189037146.issue14159@psf.upfronthosting.co.za> Yury Selivanov added the comment: As expected, it seems that the patch fixes the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 13:58:33 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Mar 2012 12:58:33 +0000 Subject: [issue14162] PEP 416: Add a builtin frozendict type In-Reply-To: <1330538704.6.0.815931694291.issue14162@psf.upfronthosting.co.za> Message-ID: <1330606713.64.0.241676886632.issue14162@psf.upfronthosting.co.za> STINNER Victor added the comment: Another frozendict usage example: freeze the dict of a new type if it contains __final__ in its namespace. Example: >>> class Classic: ... pass ... >>> Classic.attr=1 >>> class FinalizedType: ... __final__=True ... >>> FinalizedType.attr=1 (...) TypeError: 'frozendict' object does not support item assignment This patch is not part of the PEP 416 and is just a proof-of-concept. ---------- Added file: http://bugs.python.org/file24696/type_final.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 14:07:00 2012 From: report at bugs.python.org (Petri Lehtinen) Date: Thu, 01 Mar 2012 13:07:00 +0000 Subject: [issue14164] my little contribution to the docs In-Reply-To: <1330604725.79.0.785320238353.issue14164@psf.upfronthosting.co.za> Message-ID: <1330607220.99.0.33476546337.issue14164@psf.upfronthosting.co.za> Petri Lehtinen added the comment: See also #13868 by Retro. ---------- nosy: +petri.lehtinen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 14:19:38 2012 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 01 Mar 2012 13:19:38 +0000 Subject: [issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers In-Reply-To: <1326709751.32.0.965094376059.issue13797@psf.upfronthosting.co.za> Message-ID: <1330607978.14.0.63808457811.issue13797@psf.upfronthosting.co.za> Nick Coghlan added the comment: To answer your other question, no, strview isn't related - that's strictly a PEP 3118 *consumer*, which is well supported from the Python side now that memoryview is fixed. The trick will be to allow a Python implemented object to be a PEP 3118 exporter *without* having to inherit from a C implemented type that does the slot mapping. Since PEP 3118 didn't describe a Python level API for the protocol, it may actually require a new PEP. One example for what you could do with it: use the new memoryview.cast() to provide multidimensional views on an exporter that only supports 1D exports natively. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 14:38:06 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 01 Mar 2012 13:38:06 +0000 Subject: [issue12572] HP/UX compiler workarounds In-Reply-To: <1310744425.61.0.885060542603.issue12572@psf.upfronthosting.co.za> Message-ID: <1330609086.02.0.116566873738.issue12572@psf.upfronthosting.co.za> Changes by ?ric Araujo : Added file: http://bugs.python.org/file22671/getpath.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 14:52:36 2012 From: report at bugs.python.org (Sven Marnach) Date: Thu, 01 Mar 2012 13:52:36 +0000 Subject: [issue14165] The new shlex.quote() function should be marked "New in version 3.3" Message-ID: <1330609956.34.0.635238408021.issue14165@psf.upfronthosting.co.za> New submission from Sven Marnach : The function shlex.quotes() [1] does not yet exist in Python 3.2 [2], so it should be marked "New in version 3.3." in the docs. I double-checked that it really does not yet exist in 3.2 and is not only missing from the 3.2 documentation. [1]: http://docs.python.org/dev/library/shlex.html#shlex.quote [2]: http://docs.python.org/py3k/library/shlex.html ---------- assignee: docs at python components: Documentation messages: 154693 nosy: docs at python, smarnach priority: normal severity: normal status: open title: The new shlex.quote() function should be marked "New in version 3.3" versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 15:10:06 2012 From: report at bugs.python.org (Eli Bendersky) Date: Thu, 01 Mar 2012 14:10:06 +0000 Subject: [issue14164] my little contribution to the docs In-Reply-To: <1330604725.79.0.785320238353.issue14164@psf.upfronthosting.co.za> Message-ID: <1330611006.89.0.938486887186.issue14164@psf.upfronthosting.co.za> Eli Bendersky added the comment: John, thanks for the contribution, however this is not a valid fix. See the Wikipedia page for floating point: http://en.wikipedia.org/wiki/Floating_point No dash! There is no need to go over the Python docs fixing such "mistakes". If you have time to contribute to Python, there's *plenty* of opportunities to do so in a useful way. ---------- nosy: +eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 15:34:10 2012 From: report at bugs.python.org (sbt) Date: Thu, 01 Mar 2012 14:34:10 +0000 Subject: [issue14166] private dispatch table for picklers Message-ID: <1330612450.14.0.527502526549.issue14166@psf.upfronthosting.co.za> New submission from sbt : Currently the only documented way to have customised pickling for a type is to register a reduction function with the global dispatch table managed by the copyreg module. But such global changes are liable to disrupt other code which uses pickling. Multiprocessing deals with this by defining a ForkingPickler class which subclasses the pure python _Pickler class (using undocumented features), and supports registering reduction functions specifically for that class. I would like to see some documented alternative which works with both C and Python implementations. At least then multiprocessing can avoid using slow pure python pickling. The attached patch allows a pickler object to have a private dispatch table which it uses *instead* of the global one. It lets one write code like p = pickle.Pickler(...) p.dispatch_table = copyreg.dispatch_table.copy() p.dispatch_table[SomeClass] = reduce_SomeClass or class MyPickler(pickle.Pickler): dispatch_table = copyreg.dispatch_table.copy() MyPickler.dispatch_table[SomeClass] = reduce_SomeClass p = MyPickler(...) The equivalent using copyreg would be copyreg.pickle(SomeClass, reduce_SomeClass) p = pickle.Pickler(...) ---------- files: pickle_dispatch.patch keywords: patch messages: 154695 nosy: sbt priority: normal severity: normal status: open title: private dispatch table for picklers type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24697/pickle_dispatch.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 15:54:50 2012 From: report at bugs.python.org (Matthew Johnson) Date: Thu, 01 Mar 2012 14:54:50 +0000 Subject: [issue14164] my little contribution to the docs In-Reply-To: <1330604725.79.0.785320238353.issue14164@psf.upfronthosting.co.za> Message-ID: <1330613690.6.0.0807622940868.issue14164@psf.upfronthosting.co.za> Matthew Johnson added the comment: I think he's right to fix those "mistakes". Just see the first sentence @ http://docs.python.org/tutorial/floatingpoint.html#floating-point-arithmetic-issues-and-limitations It reads: "Floating-point numbers are represented in [...]" So as you can see, there are places in the docs where the hyphen/dash is there, other places where it is not. I, personally, don't get the whole "some places yes, someplaces no" philosophy. I think the patch should be applied. I think he was just trying to make some consistentcy in the docs as his first contribution. I must also point out that I don't understand the whole "some places title-case, other places sentence-case" titles in the docs. It's kind of confusing. What are your thoughts about all this? ---------- nosy: +Matthew.Johnson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 16:07:09 2012 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 01 Mar 2012 15:07:09 +0000 Subject: [issue14167] document return statement in finally blocks Message-ID: <1330614429.57.0.59180427723.issue14167@psf.upfronthosting.co.za> New submission from Yury Selivanov : I think that the documentation should put more emphasis on the `return` statement in a `finally` block. Example: def test(): try: 1/0 finally: return 10 >>> test() 10 I think we need to add a warning, or at least a note, that 'return' masks exceptions, if any occurred. ---------- assignee: docs at python components: Documentation messages: 154697 nosy: Yury.Selivanov, docs at python, georg.brandl, rhettinger priority: normal severity: normal status: open title: document return statement in finally blocks type: enhancement versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 16:28:01 2012 From: report at bugs.python.org (Brett Cannon) Date: Thu, 01 Mar 2012 15:28:01 +0000 Subject: [issue1346572] Remove inconsistent behavior between import and zipimport Message-ID: <1330615681.85.0.0169289886948.issue1346572@psf.upfronthosting.co.za> Brett Cannon added the comment: I like that argument. =) If this is not an issue in Python 3.3 then this should be closed as out of date since it will break code if it is changed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 16:32:29 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 01 Mar 2012 15:32:29 +0000 Subject: [issue14159] __len__ method of weakset In-Reply-To: <1330527323.97.0.52214771843.issue14159@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 1cd0688ff004 by Antoine Pitrou in branch '3.2': Issue #14159: Fix the len() of weak containers (WeakSet, WeakKeyDictionary, WeakValueDictionary) to return a better approximation when some objects are dead or dying. http://hg.python.org/cpython/rev/1cd0688ff004 New changeset b1b2a29d3d81 by Antoine Pitrou in branch 'default': Issue #14159: Fix the len() of weak containers (WeakSet, WeakKeyDictionary, WeakValueDictionary) to return a better approximation when some objects are dead or dying. http://hg.python.org/cpython/rev/b1b2a29d3d81 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 16:39:01 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 01 Mar 2012 15:39:01 +0000 Subject: [issue14159] __len__ method of weakset In-Reply-To: <1330527323.97.0.52214771843.issue14159@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset b6acfbe2bdbe by Antoine Pitrou in branch '2.7': Issue #14159: Fix the len() of weak sets to return a better approximation when some objects are dead or dying. http://hg.python.org/cpython/rev/b6acfbe2bdbe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 16:39:51 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Mar 2012 15:39:51 +0000 Subject: [issue14159] __len__ method of weakset In-Reply-To: <1330527323.97.0.52214771843.issue14159@psf.upfronthosting.co.za> Message-ID: <1330616391.8.0.465869165723.issue14159@psf.upfronthosting.co.za> Antoine Pitrou added the comment: 2.7 didn't have the weak dict issue, but I still backported the tests there. Closing, should be fixed now. Thanks for reporting! ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 16:49:01 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Mar 2012 15:49:01 +0000 Subject: [issue14161] python2 file __repr__ does not escape filename In-Reply-To: <1330533810.56.0.673512322833.issue14161@psf.upfronthosting.co.za> Message-ID: <1330616941.61.0.0522201491769.issue14161@psf.upfronthosting.co.za> Antoine Pitrou added the comment: 1. PyObject_Repr() should IMO be preferred (it's the abstract, high-level function). 2. You must check the result for NULL before calling PyString_AsString() on it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 17:29:08 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 01 Mar 2012 16:29:08 +0000 Subject: [issue1346572] Remove inconsistent behavior between import and zipimport Message-ID: <1330619348.73.0.219171031652.issue1346572@psf.upfronthosting.co.za> ?ric Araujo added the comment: It entirely depends on how much you care about pyc-only/pyo-only zipfile distributions, and compatibility between zipimport and importlib (i.e. if you don?t plan on matching the zipimport bug in importlib, might as well fix zipimport in 2.7 and 3.2). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 17:44:15 2012 From: report at bugs.python.org (Berker Peksag) Date: Thu, 01 Mar 2012 16:44:15 +0000 Subject: [issue5626] misleading comment in socket.gethostname() documentation In-Reply-To: <1238515382.33.0.784525971679.issue5626@psf.upfronthosting.co.za> Message-ID: <1330620255.95.0.506978832619.issue5626@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- keywords: +patch Added file: http://bugs.python.org/file24698/issue5626_v1.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 17:44:33 2012 From: report at bugs.python.org (Berker Peksag) Date: Thu, 01 Mar 2012 16:44:33 +0000 Subject: [issue5626] misleading comment in socket.gethostname() documentation In-Reply-To: <1238515382.33.0.784525971679.issue5626@psf.upfronthosting.co.za> Message-ID: <1330620273.66.0.411960479342.issue5626@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 17:57:35 2012 From: report at bugs.python.org (Eli Bendersky) Date: Thu, 01 Mar 2012 16:57:35 +0000 Subject: [issue14165] The new shlex.quote() function should be marked "New in version 3.3" In-Reply-To: <1330609956.34.0.635238408021.issue14165@psf.upfronthosting.co.za> Message-ID: <1330621055.21.0.881677732612.issue14165@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- nosy: +eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 18:08:08 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 01 Mar 2012 17:08:08 +0000 Subject: [issue14165] The new shlex.quote() function should be marked "New in version 3.3" In-Reply-To: <1330609956.34.0.635238408021.issue14165@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 73be78d21003 by Eli Bendersky in branch 'default': Add missing 'versionadded' for shlex.quote; closes #14165 http://hg.python.org/cpython/rev/73be78d21003 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 18:21:39 2012 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 01 Mar 2012 17:21:39 +0000 Subject: [issue14168] minidom behaves differently in 3.3 compared to 3.2 Message-ID: <1330622499.39.0.488658908154.issue14168@psf.upfronthosting.co.za> New submission from Vinay Sajip : The following script, minidom_test.py, from xml.dom import minidom data = b''' https://example.com/blog/ https://example.com/blog/1/ ''' doc = minidom.parseString(data) for link in doc.getElementsByTagName('link'): print(link._attrs) produces different results in Python 3.2 and 3.3: vinay at eta-oneiric64:~/projects/scratch$ python3.2 minidom_test.py {} {} vinay at eta-oneiric64:~/projects/scratch$ python3.3 minidom_test.py None None ---------- components: Library (Lib), XML keywords: 3.2regression messages: 154705 nosy: loewis, r.david.murray, vinay.sajip priority: normal severity: normal status: open title: minidom behaves differently in 3.3 compared to 3.2 type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 18:27:15 2012 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 01 Mar 2012 17:27:15 +0000 Subject: [issue14158] test_mailbox fails if file or dir named by support.TESTFN exists In-Reply-To: <1330523782.18.0.210760102045.issue14158@psf.upfronthosting.co.za> Message-ID: <1330622835.97.0.198755857058.issue14158@psf.upfronthosting.co.za> Vinay Sajip added the comment: Updated patch available on Rietveld - I'll commit it four hours from now if there are no objections. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 19:03:06 2012 From: report at bugs.python.org (Fabio Menegazzo) Date: Thu, 01 Mar 2012 18:03:06 +0000 Subject: [issue14169] compiler.compile fails on "if" statement in attached file Message-ID: <1330624985.96.0.952704814324.issue14169@psf.upfronthosting.co.za> New submission from Fabio Menegazzo : compiler.compile fails on "if" statement in attached file. When executing the code compiler.compile(contents, '', 'exec') passing the attached file contents, the following error is raised: ValueError: chr() arg not in range(256) This won't fail when using the builtin "compile". Also removing the "if" statement or any line before it, the contents are compiled successfully. ---------- files: small_with_error.py messages: 154707 nosy: menegazzobr priority: normal severity: normal status: open title: compiler.compile fails on "if" statement in attached file type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file24699/small_with_error.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 19:08:45 2012 From: report at bugs.python.org (poq) Date: Thu, 01 Mar 2012 18:08:45 +0000 Subject: [issue14164] my little contribution to the docs In-Reply-To: <1330604725.79.0.785320238353.issue14164@psf.upfronthosting.co.za> Message-ID: <1330625325.05.0.905835305825.issue14164@psf.upfronthosting.co.za> poq added the comment: It is generally considered more correct to write "floating-point number", because "floating-point" is a compound adjective here. The hyphen clarifies that it should be parsed as ((floating point) number) instead of (floating (point number)). However, in practice "floating point number" is also commonly used. I completely agree with Eli that this is just nitpicking, and not a productive use of Python developers' time. ---------- nosy: +poq _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 19:20:30 2012 From: report at bugs.python.org (Brian Curtin) Date: Thu, 01 Mar 2012 18:20:30 +0000 Subject: [issue14164] Hyphenation suggestions - floating-point/floating point In-Reply-To: <1330604725.79.0.785320238353.issue14164@psf.upfronthosting.co.za> Message-ID: <1330626030.39.0.393643080307.issue14164@psf.upfronthosting.co.za> Brian Curtin added the comment: Hyphenation changes are not going to be made unless the current text is actually incorrect, confusing, or leads to people misunderstanding what is meant. ---------- nosy: +brian.curtin resolution: -> rejected stage: patch review -> committed/rejected status: open -> closed title: my little contribution to the docs -> Hyphenation suggestions - floating-point/floating point _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 20:13:10 2012 From: report at bugs.python.org (Andrew Smith) Date: Thu, 01 Mar 2012 19:13:10 +0000 Subject: [issue14164] Hyphenation suggestions - floating-point/floating point In-Reply-To: <1330604725.79.0.785320238353.issue14164@psf.upfronthosting.co.za> Message-ID: <1330629190.67.0.338139668085.issue14164@psf.upfronthosting.co.za> Andrew Smith added the comment: I think he was trying to say that there is inconsistency in the docs... And since you guys are all about consistency... Why the punch below the belt? ---------- nosy: +Andrew.Smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 20:14:46 2012 From: report at bugs.python.org (Brian Curtin) Date: Thu, 01 Mar 2012 19:14:46 +0000 Subject: [issue14164] Hyphenation suggestions - floating-point/floating point In-Reply-To: <1330604725.79.0.785320238353.issue14164@psf.upfronthosting.co.za> Message-ID: <1330629286.92.0.196844793448.issue14164@psf.upfronthosting.co.za> Changes by Brian Curtin : ---------- nosy: -brian.curtin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 20:47:41 2012 From: report at bugs.python.org (Brett Cannon) Date: Thu, 01 Mar 2012 19:47:41 +0000 Subject: [issue1346572] Remove inconsistent behavior between import and zipimport Message-ID: <1330631261.47.0.559548757716.issue1346572@psf.upfronthosting.co.za> Brett Cannon added the comment: I don't care about compatibility between zipimport and importlib. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 20:51:21 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 01 Mar 2012 19:51:21 +0000 Subject: [issue13491] Fixes for sqlite3 doc In-Reply-To: <1322390027.54.0.855055968281.issue13491@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset d2cf730de195 by Petri Lehtinen in branch '2.7': sqlite3: Port relevant documentation changes from 3.2 http://hg.python.org/cpython/rev/d2cf730de195 New changeset 5f492397ccb8 by Petri Lehtinen in branch '3.2': sqlite3: Port documentation changes from the 2.7 branch http://hg.python.org/cpython/rev/5f492397ccb8 New changeset 82032c64dd89 by Petri Lehtinen in branch 'default': Merge branch '3.2' http://hg.python.org/cpython/rev/82032c64dd89 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 20:53:54 2012 From: report at bugs.python.org (Petri Lehtinen) Date: Thu, 01 Mar 2012 19:53:54 +0000 Subject: [issue13491] Fixes for sqlite3 doc In-Reply-To: <1322390027.54.0.855055968281.issue13491@psf.upfronthosting.co.za> Message-ID: <1330631634.86.0.797902296114.issue13491@psf.upfronthosting.co.za> Petri Lehtinen added the comment: All patches applied, thanks everybody! ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 22:53:37 2012 From: report at bugs.python.org (py.user) Date: Thu, 01 Mar 2012 21:53:37 +0000 Subject: [issue14155] Deja vu in re's documentation In-Reply-To: <1330481540.05.0.869825762197.issue14155@psf.upfronthosting.co.za> Message-ID: <1330638817.43.0.533117578274.issue14155@psf.upfronthosting.co.za> py.user added the comment: this sentence was deleted: http://docs.python.org/py3k/library/re.html#matching-vs-searching "The ?match? operation succeeds only if the pattern matches at the start of the string regardless of mode, or at the starting position given by the optional pos argument regardless of whether a newline precedes it." this sentence exists now: http://docs.python.org/dev/library/re.html#re.match "Note that even in MULTILINE mode, re.match() will only match at the beginning of the string and not at the beginning of each line." but the multiline mode affects on regex.match() a reader may confuse re.match() and regex.match(), although regex.match() cites to regex.search() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 22:53:51 2012 From: report at bugs.python.org (py.user) Date: Thu, 01 Mar 2012 21:53:51 +0000 Subject: [issue14155] Deja vu in re's documentation In-Reply-To: <1330481540.05.0.869825762197.issue14155@psf.upfronthosting.co.za> Message-ID: <1330638831.22.0.464816631329.issue14155@psf.upfronthosting.co.za> py.user added the comment: I won't open another topic: 1) http://docs.python.org/py3k/library/re.html#regular-expression-syntax "Most of the standard escapes supported by Python string literals are also accepted by the regular expression parser: \a \b \f \n \r \t \v \x \\ " \b can be used only in character set [], when others can be used without it 2) http://docs.python.org/py3k/library/re.html#regular-expression-syntax "Octal escapes are included in a limited form. If the first digit is a 0, or if there are three octal digits, it is considered an octal escape. Otherwise, it is a group reference. As for string literals, octal escapes are always at most three digits in length." http://docs.python.org/py3k/library/re.html#regular-expression-syntax description of the back refference: "\number Matches the contents of the group of the same number. Groups are numbered starting from 1. For example, (.+) \1 matches 'the the' or '55 55', but not 'the end' (note the space after the group). This special sequence can only be used to match one of the first 99 groups. If the first digit of number is 0, or number is 3 octal digits long, it will not be interpreted as a group match, but as the character with octal value number. Inside the '[' and ']' of a character class, all numeric escapes are treated as characters." a duplicate ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 23:49:35 2012 From: report at bugs.python.org (Brett Cannon) Date: Thu, 01 Mar 2012 22:49:35 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1330642175.77.0.59446197431.issue2377@psf.upfronthosting.co.za> Brett Cannon added the comment: I have replied to Antoine's review and so generated a new patch. At this point my bootstrap_importlib branch is 5% slower in a standard build in the normal_startup benchmark (11% if you use a debug build). This is still w/o profiling the Python code to look for inefficiencies (of which I'm sure there are some considering how long I have been banging away at this code). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 23:50:51 2012 From: report at bugs.python.org (Brett Cannon) Date: Thu, 01 Mar 2012 22:50:51 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1330642251.02.0.896308424573.issue2377@psf.upfronthosting.co.za> Changes by Brett Cannon : Added file: http://bugs.python.org/file24700/131d1d107f26.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 1 23:51:15 2012 From: report at bugs.python.org (Brett Cannon) Date: Thu, 01 Mar 2012 22:51:15 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1330642275.6.0.275152252773.issue2377@psf.upfronthosting.co.za> Changes by Brett Cannon : Removed file: http://bugs.python.org/file24418/f0b459af26fb.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 00:14:58 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Mar 2012 23:14:58 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1330642175.77.0.59446197431.issue2377@psf.upfronthosting.co.za> Message-ID: <1330643465.3405.0.camel@localhost.localdomain> Antoine Pitrou added the comment: > At this point my bootstrap_importlib branch is 5% slower in a standard > build in the normal_startup benchmark (11% if you use a debug build). I think that's fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 00:44:22 2012 From: report at bugs.python.org (Matthew Miller) Date: Thu, 01 Mar 2012 23:44:22 +0000 Subject: [issue14160] TarFile.extractfile fails to extract targets of top-level relative symlinks In-Reply-To: <1330530660.51.0.926091322087.issue14160@psf.upfronthosting.co.za> Message-ID: <1330645462.89.0.576296986634.issue14160@psf.upfronthosting.co.za> Changes by Matthew Miller : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 00:51:17 2012 From: report at bugs.python.org (Giovanni Funchal) Date: Thu, 01 Mar 2012 23:51:17 +0000 Subject: [issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO In-Reply-To: <1290324717.4.0.0270982528857.issue10484@psf.upfronthosting.co.za> Message-ID: <1330645877.49.0.501577493042.issue10484@psf.upfronthosting.co.za> Giovanni Funchal added the comment: This is still an issue as of python 3.2.2 and is affecting me. ---------- nosy: +Giovanni.Funchal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 01:05:11 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 02 Mar 2012 00:05:11 +0000 Subject: [issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO In-Reply-To: <1290324717.4.0.0270982528857.issue10484@psf.upfronthosting.co.za> Message-ID: <1330646711.23.0.738169759182.issue10484@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Oh Sorry. I shall fix this by this weekend. ---------- assignee: -> orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 02:00:12 2012 From: report at bugs.python.org (Glenn Linderman) Date: Fri, 02 Mar 2012 01:00:12 +0000 Subject: [issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO In-Reply-To: <1290324717.4.0.0270982528857.issue10484@psf.upfronthosting.co.za> Message-ID: <1330650012.87.0.373554372853.issue10484@psf.upfronthosting.co.za> Glenn Linderman added the comment: issue 13893 contains code that fixes this, and several other open issues. Sadly, I created that code by "debugging and rewriting until it worked", and only then teased apart the specific, separable issues that I had debugged and fixed, and created issues. I'm not up to speed on the Python development process, but feel free to borrow any or all of my code in issue 13893, which contains the fixes for all the following issues: issue 10483 issue 10484 (this issue) issue 10485 issue 10486 (creates more standard Environment variables, not sure all) issue 10487 I would certainly like to see all of these issues fixed, rather than continue to maintain my own code in parallel to various Python releases. Whether they are fixed with my code, or with other code, is immaterial to me, but my code has been running for over a year in my environments without discovering additional bugs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 02:24:24 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 02 Mar 2012 01:24:24 +0000 Subject: [issue14158] test_mailbox fails if file or dir named by support.TESTFN exists In-Reply-To: <1330523782.18.0.210760102045.issue14158@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 707586c70195 by Vinay Sajip in branch '3.2': Closes #14158: improved resilience to test files left behind. http://hg.python.org/cpython/rev/707586c70195 New changeset a92e73dfbff6 by Vinay Sajip in branch 'default': Closes #14158: merged test file resilience fix from 3.2. http://hg.python.org/cpython/rev/a92e73dfbff6 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 04:33:36 2012 From: report at bugs.python.org (Eric Snow) Date: Fri, 02 Mar 2012 03:33:36 +0000 Subject: [issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers In-Reply-To: <1326709751.32.0.965094376059.issue13797@psf.upfronthosting.co.za> Message-ID: <1330659216.79.0.599991386036.issue13797@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 04:34:07 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 03:34:07 +0000 Subject: [issue14168] minidom behaves differently in 3.3 compared to 3.2 In-Reply-To: <1330622499.39.0.488658908154.issue14168@psf.upfronthosting.co.za> Message-ID: <1330659247.89.0.171018872146.issue14168@psf.upfronthosting.co.za> ?ric Araujo added the comment: That would be caused by Martin?s change in 5d27a32ebbcc. I don?t see the docs marking _attrs public, so I think this is not a bug. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 04:38:24 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 03:38:24 +0000 Subject: [issue14165] The new shlex.quote() function should be marked "New in version 3.3" In-Reply-To: <1330609956.34.0.635238408021.issue14165@psf.upfronthosting.co.za> Message-ID: <1330659504.77.0.123564892141.issue14165@psf.upfronthosting.co.za> ?ric Araujo added the comment: Thanks, I forgot that :) shlex.quote used to be pipes.quote, an undocumented but used function; do you think this should be mentioned in shlex.quote?s doc to let people know thaw if they used pipes.quote they have an official upgrade path, or should we just leave it at that? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 04:43:31 2012 From: report at bugs.python.org (nkxyz) Date: Fri, 02 Mar 2012 03:43:31 +0000 Subject: [issue14170] print unicode string error in cmd console Message-ID: <1330659811.63.0.966664432837.issue14170@psf.upfronthosting.co.za> New submission from nkxyz : print u'????' ?raceback (most recent call last): File "C:\Users\__test.py", line 96, in sys.exit(main()) File "C:\Users\__test.py", line 84, in main print u'??????' IOError: [Errno 28] No space left on device the unicode must start with a ascii char, then print can works like this: "print u' ????'" ---------- components: IO messages: 154724 nosy: nkxyz priority: normal severity: normal status: open title: print unicode string error in cmd console type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 04:44:55 2012 From: report at bugs.python.org (nkxyz) Date: Fri, 02 Mar 2012 03:44:55 +0000 Subject: [issue14170] print unicode string error in win8 cmd console In-Reply-To: <1330659811.63.0.966664432837.issue14170@psf.upfronthosting.co.za> Message-ID: <1330659895.62.0.871344812066.issue14170@psf.upfronthosting.co.za> Changes by nkxyz : ---------- title: print unicode string error in cmd console -> print unicode string error in win8 cmd console _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 05:16:21 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 04:16:21 +0000 Subject: [issue8706] accept keyword arguments on most base type methods and builtins In-Reply-To: <1273777855.43.0.0259016277933.issue8706@psf.upfronthosting.co.za> Message-ID: <1330661781.52.0.728329993019.issue8706@psf.upfronthosting.co.za> ?ric Araujo added the comment: I agree with Ezio and Raymond. Tentatively editing the title to reflect the reduction in scope. ---------- nosy: +eric.araujo title: accept keyword arguments on all base type methods and builtins -> accept keyword arguments on most base type methods and builtins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 05:36:35 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 04:36:35 +0000 Subject: [issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect In-Reply-To: <1330382649.62.0.524230876085.issue14144@psf.upfronthosting.co.za> Message-ID: <1330662995.57.0.171121419198.issue14144@psf.upfronthosting.co.za> ?ric Araujo added the comment: Could you give the RFC section or URI? I glanced at the page about status codes but did not find a prohibition on POST. ---------- nosy: +eric.araujo title: urllib2 HTTPRedirectHandler not handling POST data in redirect -> urllib2 HTTPRedirectHandler not forwarding POST data in redirect _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 05:36:55 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 04:36:55 +0000 Subject: [issue14166] private dispatch table for picklers In-Reply-To: <1330612450.14.0.527502526549.issue14166@psf.upfronthosting.co.za> Message-ID: <1330663015.24.0.986755767474.issue14166@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +alexandre.vassalotti, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 05:38:57 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 04:38:57 +0000 Subject: [issue14167] document return statement in finally blocks In-Reply-To: <1330614429.57.0.59180427723.issue14167@psf.upfronthosting.co.za> Message-ID: <1330663137.72.0.781566627988.issue14167@psf.upfronthosting.co.za> ?ric Araujo added the comment: This behavior surprised me for a second, but it makes sense. An example in the docs is certainly appropriate. Would you like to suggest a place and phrasing for it? ---------- keywords: +easy nosy: +eric.araujo stage: -> needs patch versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 05:43:53 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 04:43:53 +0000 Subject: [issue13719] bdist_msi upload fails In-Reply-To: <1325855918.9.0.207720990162.issue13719@psf.upfronthosting.co.za> Message-ID: <1330663433.21.0.562697542063.issue13719@psf.upfronthosting.co.za> ?ric Araujo added the comment: Ralf, could you test my patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 06:06:05 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 05:06:05 +0000 Subject: [issue14164] Hyphenation suggestions - floating-point/floating point In-Reply-To: <1330604725.79.0.785320238353.issue14164@psf.upfronthosting.co.za> Message-ID: <1330664765.77.0.306212029082.issue14164@psf.upfronthosting.co.za> ?ric Araujo added the comment: Python has a lot of known and unknown bugs that need to be fixed, many missing features needing to be implemented, and a lot of room for improvement in its documentation. That?s why we welcome people who want to help. You?re not the first one to propose a trivial typographic patch that is rejected. I?m writing this long-ish message to serve as a reference for future rejections. Maybe you thought it would be a risk-free way to become a contributor, but as it turns out, this kind of patches is not helpful. All Python developers are volunteers, and we review bugs and patches on our limited free time. It is worthwhile to fix clear errors, ambiguities, outdated facts and wrong advice in the documentation; it is not worthwhile to add or remove a few commas and hyphens just for consistency?s sake. (Moreover, hyphens in English don?t have rules as clear as we commonly think, like poq pointed.) There is no ?some places title-case, other places sentence-case? philosophy; different people wrote various parts of the documentation, and we just live with it. We fix bugs, improve code, add examples, think about missing features, read specifications, reply to email, improve wordings; we just don?t have the time to care about questionable changes that don?t add any value for us or our users. Consistency is a design principle; it does not mean obsessive polishing. There are also other principles that are equally valid, and also pure pragmatic constraints. John and Matthew, you are more than welcome to report bugs you find, or to work on fixing a bug, from the long list of bugs that really would improve people?s life when fixed. If you are unsure about the process or about your patch, please join http://mail.python.org/mailman/listinfo/core-mentorship mailing list to ask any question you might have: we will help you. Hope this clarifies things without hurting anyone?s feelings. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 06:15:47 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 02 Mar 2012 05:15:47 +0000 Subject: [issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect In-Reply-To: <1330382649.62.0.524230876085.issue14144@psf.upfronthosting.co.za> Message-ID: <1330665347.01.0.172106375714.issue14144@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Here is a section which talks about 3xx redirection http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 10.3 Redirection 3xx This class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request. The action required MAY be carried out by the user agent without interaction with the user if and only if the method used in the second request is GET or HEAD. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 06:21:45 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 02 Mar 2012 05:21:45 +0000 Subject: [issue14165] The new shlex.quote() function should be marked "New in version 3.3" In-Reply-To: <1330609956.34.0.635238408021.issue14165@psf.upfronthosting.co.za> Message-ID: <1330665705.1.0.251491943008.issue14165@psf.upfronthosting.co.za> Eli Bendersky added the comment: IMHO just leave it. The documentation is mainly for reference, i.e. describing in the best way possible what's available *now*. If you want to mention an upgrade path, write a blog :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 06:27:33 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 05:27:33 +0000 Subject: [issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect In-Reply-To: <1330382649.62.0.524230876085.issue14144@psf.upfronthosting.co.za> Message-ID: <1330666053.81.0.171910045236.issue14144@psf.upfronthosting.co.za> ?ric Araujo added the comment: That?s clear as mud :) If I read correctly, the text means that the user agent is free to follow redirects without asking the user if the request is GET or HEAD, and needs to ask the user if the request is e.g. POST. That?s in line with what Firefox does when you refresh after a POST: It asks you to confirm if you want the data to be re-sent. POST not being idempotent explains the need for this precaution. So, I think a library like urllib should not prevent people from doing something that is allowed. +1 to a new param to transfer the body when following a redirect under a POST. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 06:38:25 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 05:38:25 +0000 Subject: [issue1346572] Remove inconsistent behavior between import and zipimport Message-ID: <1330666705.53.0.4823620534.issue1346572@psf.upfronthosting.co.za> ?ric Araujo added the comment: OK, I?m leaving this open until the next weekly report just in case someone interested comes here and weighs in, otherwise I?ll close as wontfix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 06:40:21 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 05:40:21 +0000 Subject: [issue14158] test_mailbox fails if file or dir named by support.TESTFN exists In-Reply-To: <1330523782.18.0.210760102045.issue14158@psf.upfronthosting.co.za> Message-ID: <1330666821.91.0.950110335055.issue14158@psf.upfronthosting.co.za> ?ric Araujo added the comment: Is 2.7 not affected? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 06:44:09 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 02 Mar 2012 05:44:09 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 81e606862a89 by Eli Bendersky in branch '3.2': Issue #11379: add a note in xml.dom.minidom suggesting to use etree in some cases http://hg.python.org/cpython/rev/81e606862a89 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 06:46:18 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 02 Mar 2012 05:46:18 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset ccd16ad37544 by Eli Bendersky in branch '2.7': Issue #11379: add a note in xml.dom.minidom suggesting to use etree in some cases http://hg.python.org/cpython/rev/ccd16ad37544 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 06:47:12 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 02 Mar 2012 05:47:12 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1330667232.3.0.935257701309.issue11379@psf.upfronthosting.co.za> Eli Bendersky added the comment: Committed to 2.7, 3.2 and 3.3 I suppose this issue can be closed now? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 06:49:58 2012 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 02 Mar 2012 05:49:58 +0000 Subject: [issue1346572] Remove inconsistent behavior between import and zipimport Message-ID: <1330667398.32.0.863965099034.issue1346572@psf.upfronthosting.co.za> Nick Coghlan added the comment: Does "compileall" generate both .pyc and .pyo by default? Or do you have to run it twice? If the latter, does pysetup handle that for you? MvL is correct that zipimport should ignore .pyo files when __debug__ is set and vice-versa, but the precompilation tools should also take care of generating both versions by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 06:54:09 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 05:54:09 +0000 Subject: [issue1346572] Remove inconsistent behavior between import and zipimport Message-ID: <1330667649.16.0.531590956782.issue1346572@psf.upfronthosting.co.za> ?ric Araujo added the comment: > Does "compileall" generate both .pyc and .pyo by default? python3 -m compileall generates pyc, python3 -O -m compileall pyo. Functions in py_compile and compileall gained an optimize argument in 3.2. > does pysetup handle that for you? You?ll have to be more specific. Bytecode files can be created when building a bdist or on install from source. Packaging commands do not depend on the calling Python?s -O option, they have their own options to let users specify if they want pyc files, pyo, neither or both. > MvL is correct that zipimport should ignore .pyo files when __debug__ is set and vice-versa, but the > precompilation tools should also take care of generating both versions by default. Really? The behaviors of compileall and packaging seems better to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 07:26:43 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Fri, 02 Mar 2012 06:26:43 +0000 Subject: [issue14170] print unicode string error in win8 cmd console In-Reply-To: <1330659811.63.0.966664432837.issue14170@psf.upfronthosting.co.za> Message-ID: <1330669603.21.0.168098097313.issue14170@psf.upfronthosting.co.za> Martin v. L?wis added the comment: What is the code page of your console (try: "chcp"). ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 07:37:47 2012 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 02 Mar 2012 06:37:47 +0000 Subject: [issue1346572] Remove inconsistent behavior between import and zipimport Message-ID: <1330670267.31.0.131194991547.issue1346572@psf.upfronthosting.co.za> Nick Coghlan added the comment: Status quo sounds fine then. +1 for closing it again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 07:48:20 2012 From: report at bugs.python.org (Zooko O'Whielacronx) Date: Fri, 02 Mar 2012 06:48:20 +0000 Subject: [issue14171] warnings from valgrind about openssl as used by CPython Message-ID: <1330670900.9.0.919434132567.issue14171@psf.upfronthosting.co.za> New submission from Zooko O'Whielacronx : The buildbot for the Tahoe-LAFS and pycryptopp projects runs CPython under valgrind on Fedora, and valgrind emits warnings like this: ==30127== Conditional jump or move depends on uninitialised value(s) ==30127== at 0x4C2AD01: bcmp (mc_replace_strmem.c:889) ==30127== by 0xC1D1646: fips_get_entropy (fips_drbg_lib.c:166) ==30127== by 0xC1D1D6E: FIPS_drbg_instantiate (fips_drbg_lib.c:234) ==30127== by 0xC15F590: RAND_init_fips (rand_lib.c:286) ==30127== by 0xC0F54D3: OPENSSL_init_library (o_init.c:106) ==30127== by 0xBE76AF8: SSL_library_init (ssl_algs.c:68) ==30127== by 0xBC2B39D: init_hashlib (in /usr/lib64/python2.7/lib-dynload/_hashlib.so) ==30127== by 0x4F1DB00: _PyImport_LoadDynamicModule (in /usr/lib64/libpython2.7.so.1.0) You can see the full output from such a buildbot run here: https://tahoe-lafs.org/buildbot-pycryptopp/builders/Ruben%20Fedora%20syslib/builds/58/steps/test%20valgrind/logs/valgrind Here is information about the versions of software involved: https://tahoe-lafs.org/buildbot-pycryptopp/builders/Ruben%20Fedora%20syslib/builds/58/steps/show-tool-versions/logs/stdio The owner of the buildslave machine says that the openssl package was "openssl-1.0.1-0.1.beta2.fc17.x86_64". Not having looked closer, I assume this is just a case of openssl using uninitialized memory as part of the initialization of the PRNG. Accordingly, I wrote suppressions stanzas for our valgrind suppressions file, which made the warnings go away. Here are the suppression expressions: # generated on buildbot.rubenkerkhof.com, which had, according to Ruben # Fedora's package "openssl-1.0.1-0.1.beta2.fc17.x86_64" { buildbot.rubenkerkhof.com cond fips openssl 1 Memcheck:Cond fun:bcmp fun:fips_get_entropy fun:FIPS_drbg_instantiate fun:RAND_init_fips fun:OPENSSL_init_library fun:SSL_library_init fun:init_hashlib } { buildbot.rubenkerkhof.com cond fips openssl 2 Memcheck:Cond fun:fips_get_entropy fun:FIPS_drbg_instantiate fun:RAND_init_fips fun:OPENSSL_init_library fun:SSL_library_init fun:init_hashlib } { buildbot.rubenkerkhof.com val _x86_64_AES_encrypt_compact Memcheck:Value8 fun:_x86_64_AES_encrypt_compact fun:AES_encrypt } I opened this ticket on launchpad.net to track the handling of this issue in various projects such as openssl, pycryptopp, CPython, valgrind, and Fedora: https://bugs.launchpad.net/pycryptopp/+bug/944585 ---------- components: Library (Lib) files: cpython-openssl101.supp messages: 154742 nosy: zooko priority: normal severity: normal status: open title: warnings from valgrind about openssl as used by CPython versions: Python 2.7 Added file: http://bugs.python.org/file24701/cpython-openssl101.supp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 08:23:50 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 02 Mar 2012 07:23:50 +0000 Subject: [issue8706] accept keyword arguments on most base type methods and builtins In-Reply-To: <1273777855.43.0.0259016277933.issue8706@psf.upfronthosting.co.za> Message-ID: <1330673030.74.0.667840771676.issue8706@psf.upfronthosting.co.za> Gregory P. Smith added the comment: restricting the scope of this makes sense. also: just because an argument is listed in the docs with a name does not mean that that name is the most appropriate; part of adding keyword support should be choosing a sensible name. Keyword arguments, when used, should increase the readability of code rather than add to confusion. I intend to bring this up for a brief discussion at the language summit next week as representatives of all the Python VMs will be in the same room at once. Goal: define the appropriate scope or at the very least non-scope. As for performance and memory use, yes, it could have a small impact but it should not be large [worth measuring] and that seems like something we should fix in a more general way rather than by limiting the way methods can be called based on how a given VM is implemented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 08:27:51 2012 From: report at bugs.python.org (Petri Lehtinen) Date: Fri, 02 Mar 2012 07:27:51 +0000 Subject: [issue8890] Use tempfile instead of /tmp in examples In-Reply-To: <1275599514.93.0.639768129715.issue8890@psf.upfronthosting.co.za> Message-ID: <1330673271.87.0.126837327995.issue8890@psf.upfronthosting.co.za> Petri Lehtinen added the comment: I think this issue was closed too hastily. Only the logging documentation has been fixed. @grubert: I agree with the assumption that /tmp is mostly used because it's writable. In my opinion, the directory could just be left out and only leave the file name. ---------- nosy: +petri.lehtinen status: closed -> open versions: +Python 3.3 -Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 08:45:53 2012 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 02 Mar 2012 07:45:53 +0000 Subject: [issue8706] accept keyword arguments on most base type methods and builtins In-Reply-To: <1273777855.43.0.0259016277933.issue8706@psf.upfronthosting.co.za> Message-ID: <1330674353.24.0.548013807115.issue8706@psf.upfronthosting.co.za> Ezio Melotti added the comment: > also: just because an argument is listed in the docs with a name does > not mean that that name is the most appropriate; part of adding keyword > support should be choosing a sensible name. I agree, but other implementations might not have this limitation and might already use the name that appears in the documentation/docstring -- or even a better one. > I intend to bring this up for a brief discussion at the language summit > next week +1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 08:48:39 2012 From: report at bugs.python.org (Stefan Krah) Date: Fri, 02 Mar 2012 07:48:39 +0000 Subject: [issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1 In-Reply-To: <1285787018.03.0.476755592717.issue9990@psf.upfronthosting.co.za> Message-ID: <1330674519.42.0.567758538532.issue9990@psf.upfronthosting.co.za> Stefan Krah added the comment: Since this issue targeted 2.7 and 3.2: In a brief discussion on python-dev it was decided that the 3.3 fixes from #10181 won't be backported for a number of reasons, see: http://mail.python.org/pipermail/python-dev/2012-February/116872.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 08:49:15 2012 From: report at bugs.python.org (Stefan Krah) Date: Fri, 02 Mar 2012 07:49:15 +0000 Subject: [issue8305] memoview[0] creates an invalid view if ndim != 1 In-Reply-To: <1270308282.65.0.542260907353.issue8305@psf.upfronthosting.co.za> Message-ID: <1330674555.91.0.309047277427.issue8305@psf.upfronthosting.co.za> Stefan Krah added the comment: Since this issue targeted 2.7 and 3.2: In a brief discussion on python-dev it was decided that the 3.3 fixes from #10181 won't be backported for a number of reasons, see: http://mail.python.org/pipermail/python-dev/2012-February/116872.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 08:52:39 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 02 Mar 2012 07:52:39 +0000 Subject: [issue8706] accept keyword arguments on most base type methods and builtins In-Reply-To: <1273777855.43.0.0259016277933.issue8706@psf.upfronthosting.co.za> Message-ID: <1330674759.83.0.359958145673.issue8706@psf.upfronthosting.co.za> Gregory P. Smith added the comment: I kicked off a discussion on python-ideas. Lets take this there for the time being. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 09:26:57 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 08:26:57 +0000 Subject: [issue8706] accept keyword arguments on most base type methods and builtins In-Reply-To: <1273777855.43.0.0259016277933.issue8706@psf.upfronthosting.co.za> Message-ID: <1330676817.82.0.408533928719.issue8706@psf.upfronthosting.co.za> ?ric Araujo added the comment: See also #13386 for the doc part. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 09:30:24 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 08:30:24 +0000 Subject: [issue8754] quote bad module name in ImportError-like messages In-Reply-To: <1274202200.16.0.392487565261.issue8754@psf.upfronthosting.co.za> Message-ID: <1330677024.53.0.319081568854.issue8754@psf.upfronthosting.co.za> ?ric Araujo added the comment: > With issue1559549 adding a 'name' argument, I'm going to push to have it gain a reasonable default > __str__ if 'name' is set but nothing else. That patch also contains some helper functions which > should simplify Eric's patch. Maybe you?re talking about my first patch? The latest one does not touch C code and I don?t see why it depends on the other bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 09:34:45 2012 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 02 Mar 2012 08:34:45 +0000 Subject: [issue14168] minidom behaves differently in 3.3 compared to 3.2 In-Reply-To: <1330622499.39.0.488658908154.issue14168@psf.upfronthosting.co.za> Message-ID: <1330677285.47.0.428508871026.issue14168@psf.upfronthosting.co.za> Vinay Sajip added the comment: The error which prompted this issue was not caused by external code peeking into the internals - it was just my toy test script which did that. The error came up in Django testing: ====================================================================== ERROR: test_secure_urls (regressiontests.syndication.tests.SyndicationFeedTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/vinay/projects/django3/tests/regressiontests/syndication/tests.py", line 255, in test_secure_urls if link.getAttribute('rel') == 'self': File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/xml/dom/minidom.py", line 727, in getAttribute return self._attrs[attname].value TypeError: 'NoneType' object is not subscriptable So, perhaps there is a missing _ensure_attributes() call somewhere. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 09:54:12 2012 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 02 Mar 2012 08:54:12 +0000 Subject: [issue14168] minidom behaves differently in 3.3 compared to 3.2 In-Reply-To: <1330622499.39.0.488658908154.issue14168@psf.upfronthosting.co.za> Message-ID: <1330678452.32.0.00545007174355.issue14168@psf.upfronthosting.co.za> Vinay Sajip added the comment: Upon inspection, _ensure_attributes() is only called in _get_attributes(), setAttributeNode() and _set_attribute_node(). The last of these is only called by setAttributeNode(), and it would appear that setAttributeNode() is only called if there *are* attributes. _get_attributes() is only called by writexml(). So, calls to public methods getAttribute(), getAttributeNS() and a few others are likely to fail because, if there are no attributes in the XML being processed, _ensure_attributes() wouldn't get called. It looks like a bug to me! ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 10:05:31 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 09:05:31 +0000 Subject: [issue14168] Bug in minidom 3.3 after optimization patch In-Reply-To: <1330622499.39.0.488658908154.issue14168@psf.upfronthosting.co.za> Message-ID: <1330679131.02.0.0603323301954.issue14168@psf.upfronthosting.co.za> ?ric Araujo added the comment: Agreed :) Needs unit tests that use the public attributes. ---------- keywords: +easy -3.2regression stage: -> needs patch title: minidom behaves differently in 3.3 compared to 3.2 -> Bug in minidom 3.3 after optimization patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 10:08:55 2012 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 02 Mar 2012 09:08:55 +0000 Subject: [issue14158] test_mailbox fails if file or dir named by support.TESTFN exists In-Reply-To: <1330523782.18.0.210760102045.issue14158@psf.upfronthosting.co.za> Message-ID: <1330679335.59.0.290724038843.issue14158@psf.upfronthosting.co.za> Vinay Sajip added the comment: > Is 2.7 not affected? It might be, but the code for regrtest looked somewhat different. I will revisit this once the buildbots have run for a few days with the 3.x changes, to confirm that they are OK. Marking as pending to remind me. ---------- status: closed -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 10:42:59 2012 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 02 Mar 2012 09:42:59 +0000 Subject: [issue14172] ref-counting leak in buffer usage in Python/marshal.c Message-ID: <1330681379.13.0.854959913583.issue14172@psf.upfronthosting.co.za> New submission from Stefan Behnel : Line 428 in Python/marshal.c calls pb->bf_releasebuffer() without dec-refing the view.obj field afterwards. I don't think this is really so truly performance critical that it can't accept the couple of nanoseconds that it takes to go through PyBuffer_Release() instead. ---------- components: Interpreter Core messages: 154755 nosy: scoder priority: normal severity: normal status: open title: ref-counting leak in buffer usage in Python/marshal.c type: behavior versions: Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 10:47:55 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 02 Mar 2012 09:47:55 +0000 Subject: [issue14170] print unicode string error in win8 cmd console In-Reply-To: <1330659811.63.0.966664432837.issue14170@psf.upfronthosting.co.za> Message-ID: <1330681675.51.0.221471999765.issue14170@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 10:54:09 2012 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 02 Mar 2012 09:54:09 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1330682049.53.0.774891635832.issue11379@psf.upfronthosting.co.za> Stefan Behnel added the comment: Thanks Eli. What about the "Lightweight DOM implementation", though? Following Martin's comment that performance characteristics (like "fast", "memory friendly" or "lightweight") should normally not be documented, I'm still suggesting to replace it with a less easily misinterpreted phrase like "W3C DOM implementation". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 11:22:27 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 02 Mar 2012 10:22:27 +0000 Subject: [issue14128] _elementtree should expose types and factory functions consistently with ElementTree In-Reply-To: <1330248620.3.0.71621144947.issue14128@psf.upfronthosting.co.za> Message-ID: <1330683747.81.0.193087311557.issue14128@psf.upfronthosting.co.za> Eli Bendersky added the comment: Attaching a patch that exposes ET.Element as a type, instead of as a factory function. I'd really love to get a review for this, since I'm still relatively inexperienced when it comes to writing C extension code. ---------- keywords: +patch Added file: http://bugs.python.org/file24702/Element_class_issue14128.1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 11:27:12 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 02 Mar 2012 10:27:12 +0000 Subject: [issue13462] Improve code and tests for Mixin2to3 In-Reply-To: <1322066341.39.0.436349182896.issue13462@psf.upfronthosting.co.za> Message-ID: <1330684032.66.0.383192010653.issue13462@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- priority: -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 11:41:33 2012 From: report at bugs.python.org (Ferringb) Date: Fri, 02 Mar 2012 10:41:33 +0000 Subject: [issue14173] PyOS_FiniInterupts leaves signal.getsignal segfaulty Message-ID: <1330684893.81.0.620988158976.issue14173@psf.upfronthosting.co.za> New submission from Ferringb : During Py_Finalize (pythonrun.c), it does the following: 1) suppress signal handling PyOs_FiniInterupts 2) clear caches 3) force gc collection; first for objects, then via wiping modules. The problem is that for unix OSs, Modules/signal.c's PyOs_FiniInterrupts leaves itself in a state where its internal Handlers are effectively reset to NULL, except the various functions don't properly handle that scenario. Attached is a test case demonstrating it; it segfaults on every python version I've tested (2.4->3.2; haven't tried 3.3). Since this *only* occurs during the final gc sweep when modules are destroyed, its a bit of a pain in the ass to detect that we're in that scenario, and that we must not touch signal.getsignal lest it segfault the interp. That said, def _SignalModuleUsable(): try: signal.signal(signal.SIGUSR1, signal.signal(signal.SIGUSR1, some_handler)) return True except (TypeError, AttributeError, SystemError): # we were invoked in a module cleanup context. return False does manage to poke the api just right so that it can be detected w/out segfaulting the interp. Finally, note that while folks could point at __del__... its not really at fault. Doing a proper weakref.ref finalizer can trigger the same- the fault is signal.c's PyOs_FiniInterrupts leaving the signal module in a bad state. For the testcase, I used __del__ just because it was quicker/less code to do so. ---------- components: Interpreter Core files: test.py messages: 154758 nosy: ferringb priority: normal severity: normal status: open title: PyOS_FiniInterupts leaves signal.getsignal segfaulty type: crash versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file24703/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 11:46:41 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 02 Mar 2012 10:46:41 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1330685201.69.0.807993779963.issue11379@psf.upfronthosting.co.za> Eli Bendersky added the comment: Stefan, frankly I'm not familiar enough with either xml.dom or xml.dom.minidom to have a solid opinion at this point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 11:51:31 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 10:51:31 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1330685491.26.0.626883732291.issue11379@psf.upfronthosting.co.za> ?ric Araujo added the comment: I think I?ve always understood ?lightweight? to mean ?minimal?. xml.dom provides minidom, a basic implementation, pulldom, a different implementation, and other libraries such as 4Dom are full-fledged implementations. So ?lightweight? is not a problem to me (but I acknowledge that it might be misleading for other people), especially given that I think that DOM itself is not elegant or lightweight (as in ?conceptually small?). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 13:08:10 2012 From: report at bugs.python.org (Arnout van Meer) Date: Fri, 02 Mar 2012 12:08:10 +0000 Subject: [issue14174] argparse.REMAINDER fails to parse remainder correctly Message-ID: <1330690090.15.0.511487898244.issue14174@psf.upfronthosting.co.za> New submission from Arnout van Meer : Reproduction case is attached and should speak for itself, but the short brief is that the argparse.REMAINDER behaviour is very inconsistent based on what (potentially) defined argument handlers come before it. Tested this on Python 2.7 on OS X, but also grabbed the latest argparse.py from hg to verify against this. ---------- components: Library (Lib) files: worker.py messages: 154761 nosy: rr2do2 priority: normal severity: normal status: open title: argparse.REMAINDER fails to parse remainder correctly type: behavior versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file24704/worker.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 13:08:44 2012 From: report at bugs.python.org (Arnout van Meer) Date: Fri, 02 Mar 2012 12:08:44 +0000 Subject: [issue14174] argparse.REMAINDER fails to parse remainder correctly In-Reply-To: <1330690090.15.0.511487898244.issue14174@psf.upfronthosting.co.za> Message-ID: <1330690124.37.0.565154774168.issue14174@psf.upfronthosting.co.za> Changes by Arnout van Meer : Removed file: http://bugs.python.org/file24704/worker.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 13:09:11 2012 From: report at bugs.python.org (Arnout van Meer) Date: Fri, 02 Mar 2012 12:09:11 +0000 Subject: [issue14174] argparse.REMAINDER fails to parse remainder correctly In-Reply-To: <1330690090.15.0.511487898244.issue14174@psf.upfronthosting.co.za> Message-ID: <1330690151.72.0.49698732718.issue14174@psf.upfronthosting.co.za> Changes by Arnout van Meer : Added file: http://bugs.python.org/file24704/worker.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 13:09:55 2012 From: report at bugs.python.org (Arnout van Meer) Date: Fri, 02 Mar 2012 12:09:55 +0000 Subject: [issue14174] argparse.REMAINDER fails to parse remainder correctly In-Reply-To: <1330690090.15.0.511487898244.issue14174@psf.upfronthosting.co.za> Message-ID: <1330690195.24.0.224057700769.issue14174@psf.upfronthosting.co.za> Changes by Arnout van Meer : Added file: http://bugs.python.org/file24705/bug_argparse.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 13:10:04 2012 From: report at bugs.python.org (Arnout van Meer) Date: Fri, 02 Mar 2012 12:10:04 +0000 Subject: [issue14174] argparse.REMAINDER fails to parse remainder correctly In-Reply-To: <1330690090.15.0.511487898244.issue14174@psf.upfronthosting.co.za> Message-ID: <1330690204.07.0.404736946013.issue14174@psf.upfronthosting.co.za> Changes by Arnout van Meer : Removed file: http://bugs.python.org/file24704/worker.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 13:26:56 2012 From: report at bugs.python.org (Arnout van Meer) Date: Fri, 02 Mar 2012 12:26:56 +0000 Subject: [issue14174] argparse.REMAINDER fails to parse remainder correctly In-Reply-To: <1330690090.15.0.511487898244.issue14174@psf.upfronthosting.co.za> Message-ID: <1330691216.26.0.00227054122106.issue14174@psf.upfronthosting.co.za> Changes by Arnout van Meer : Added file: http://bugs.python.org/file24704/worker.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 13:27:24 2012 From: report at bugs.python.org (Arnout van Meer) Date: Fri, 02 Mar 2012 12:27:24 +0000 Subject: [issue14174] argparse.REMAINDER fails to parse remainder correctly In-Reply-To: <1330690090.15.0.511487898244.issue14174@psf.upfronthosting.co.za> Message-ID: <1330691244.82.0.84866689216.issue14174@psf.upfronthosting.co.za> Changes by Arnout van Meer : Removed file: http://bugs.python.org/file24704/worker.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 13:31:30 2012 From: report at bugs.python.org (Florent Xicluna) Date: Fri, 02 Mar 2012 12:31:30 +0000 Subject: [issue14175] broken links on /download/ page Message-ID: <1330691489.97.0.756489125199.issue14175@psf.upfronthosting.co.za> New submission from Florent Xicluna : The links for the latest RC are broken on the official page. http://www.python.org/download/ And the "release" page only list 3.2.3 rc1 and forget the other 3: http://www.python.org/download/releases/ ---------- messages: 154762 nosy: flox priority: normal severity: normal status: open title: broken links on /download/ page type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 13:36:56 2012 From: report at bugs.python.org (Jean-Michel Fauth) Date: Fri, 02 Mar 2012 12:36:56 +0000 Subject: [issue14176] Fix unicode literals (for PEP 414) Message-ID: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> New submission from Jean-Michel Fauth : Now, that the PEP 414 has been accepted, I can only strongly recommend to fix the problem of unicode literals as a partial workaround. >>> print u'abc???' abc? >>> If these six characters are not rendered correctly, you shoud read: LATIN SMALL LETTER A LATIN SMALL LETTER B LATIN SMALL LETTER C LATIN SMALL LIGATURE OE LATIN SMALL LETTER E WITH ACUTE EURO SIGN It is not necessary to give here the list of the numerous libs that do not understand u'unicode literals' as shown above. (I wrote all my Py2 code in a u'unicode mode', and I know how hard it is to have to select between the u'' or unicode() variants. Face it. Python has never worked [*], Python does not work, Python will never work. More important, it is more than clear to me, there is no willingness to solve this issue. (The holy compatibilty with not working code). [*] Except the pure ASCII serie (Py 1.5) and the Python 3[0,1,2] serie. No offense. I'm pretty sure the creator of this PEP is not even able to type on his machine the list of the 42 characters supposed to be available it the typographies (plural) used by the different countries speaking French. The whole free/open source software disaster in all its splendor. Regards. jmf ---------- components: None messages: 154763 nosy: Jean-Michel.Fauth priority: normal severity: normal status: open title: Fix unicode literals (for PEP 414) versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 14:14:41 2012 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 02 Mar 2012 13:14:41 +0000 Subject: [issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?) In-Reply-To: <1287858158.95.0.0752296181045.issue10181@psf.upfronthosting.co.za> Message-ID: <1330694081.17.0.322828562236.issue10181@psf.upfronthosting.co.za> Nick Coghlan added the comment: It occurs to me that one thing that *could* be backported to early versions are some of the documentation improvements on how to correctly handle the lifecycle of fields in Py_buffer. That gets messy though because memoryview doesn't behave nicely in those versions, so we'd be violating our own guidelines. Perhaps the relevant sections should be updated with a reference saying that the semantics have been cleaned up in 3.3, and if in doubt, try to follow the 3.3 documentation? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 14:53:26 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 02 Mar 2012 13:53:26 +0000 Subject: [issue14176] Fix unicode literals (for PEP 414) In-Reply-To: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> Message-ID: <1330696406.06.0.507544648041.issue14176@psf.upfronthosting.co.za> Benjamin Peterson added the comment: What exactly is the bug you're reporting? Python 2.7.2 (default, Oct 27 2011, 22:35:02) [GCC 4.5.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print u'abc???' abc??? ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 14:56:01 2012 From: report at bugs.python.org (Patrick Westerhoff) Date: Fri, 02 Mar 2012 13:56:01 +0000 Subject: [issue14133] improved PEP 409 implementation In-Reply-To: <1330269562.83.0.382343969435.issue14133@psf.upfronthosting.co.za> Message-ID: <1330696561.1.0.265924656664.issue14133@psf.upfronthosting.co.za> Changes by Patrick Westerhoff : ---------- nosy: +poke _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 14:58:44 2012 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 02 Mar 2012 13:58:44 +0000 Subject: [issue14176] Fix unicode literals (for PEP 414) In-Reply-To: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> Message-ID: <1330696724.01.0.280307919534.issue14176@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- components: +Unicode -None nosy: +ezio.melotti type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 15:51:55 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 02 Mar 2012 14:51:55 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1330699915.02.0.650009607879.issue11379@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > I think I?ve always understood ?lightweight? to mean ?minimal?. Then how about saying "minimal" instead of "lightweight"? (also, it seems it really means "incomplete" or "partial", which are of course less positive sounding) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 15:58:52 2012 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 02 Mar 2012 14:58:52 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1330700332.14.0.170941892574.issue11379@psf.upfronthosting.co.za> Ezio Melotti added the comment: "Minimal" sounds good to me, it also matches the name of the module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 16:23:35 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 02 Mar 2012 15:23:35 +0000 Subject: [issue14173] PyOS_FiniInterupts leaves signal.getsignal segfaulty In-Reply-To: <1330684893.81.0.620988158976.issue14173@psf.upfronthosting.co.za> Message-ID: <1330701815.18.0.18946066059.issue14173@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I needed to modify the script to make it crash under 3.2/3.3. Attaching modified version. Here is the relevant part of the gdb traceback: Program received signal SIGSEGV, Segmentation fault. 0x000000000052b87b in signal_getsignal (self=, args=(1,)) at ./Modules/signalmodule.c:372 372 Py_INCREF(old_handler); Missing debug package(s), you should install: glibc-debug-2.12.1-11.3.mga1.x86_64 (gdb) bt #0 0x000000000052b87b in signal_getsignal (self=, args=(1,)) at ./Modules/signalmodule.c:372 #1 0x00000000005f520b in PyCFunction_Call (func= , arg=(1,), kw=0x0) at Objects/methodobject.c:81 ---------- nosy: +haypo, pitrou versions: +Python 3.3 -Python 2.6, Python 3.1 Added file: http://bugs.python.org/file24706/sig.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 16:24:46 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 02 Mar 2012 15:24:46 +0000 Subject: [issue14170] print unicode string error in win8 cmd console In-Reply-To: <1330659811.63.0.966664432837.issue14170@psf.upfronthosting.co.za> Message-ID: <1330701886.16.0.342926598988.issue14170@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 16:27:35 2012 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 02 Mar 2012 15:27:35 +0000 Subject: [issue4080] unittest: display time of each test case In-Reply-To: <1223497696.14.0.913391715353.issue4080@psf.upfronthosting.co.za> Message-ID: <1330702055.49.0.079914133442.issue4080@psf.upfronthosting.co.za> Ezio Melotti added the comment: Because it looks like line noise and doesn't provide an useful information in most of the cases (at least for me), see e.g.: + test_format (__main__.MyTestCase) ... [0.000612s] skipped 'not supported in this library version' + test_nothing (__main__.MyTestCase) ... [0.000486s] skipped 'demonstrating skipping' + test_windows_support (__main__.MyTestCase) ... [0.000090s] skipped 'requires Windows' It might still be useful to find the slowest test(s), or for test suites that take a long time (so I'm not opposed to having it as an option that can be enabled if needed), but for most of the tests it will just show an almost meaningless fraction of second. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 16:33:20 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Mar 2012 15:33:20 +0000 Subject: [issue14170] print unicode string error in win8 cmd console In-Reply-To: <1330701886.19.0.649081277056.issue14170@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: It looks like a duplicate of the issue #11395 which has been fixed in Python 3.2.1, but not backported to Python 2.7. Can you please try your program with Python 3.2.1? And maybe also attach the whole test script? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 16:36:41 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 15:36:41 +0000 Subject: [issue4080] unittest: display time used by each test case In-Reply-To: <1223497696.14.0.913391715353.issue4080@psf.upfronthosting.co.za> Message-ID: <1330702601.76.0.0200223699847.issue4080@psf.upfronthosting.co.za> ?ric Araujo added the comment: Also, when you?re tracking down slow tests, you may want to run your tests with the time needed by each test file and then each test method. Nite that I don?t know of a way to have unittest print each test file to stdout now (i.e. a level of verbosity between ?just one dot? and ?each method?). ---------- title: unittest: display time of each test case -> unittest: display time used by each test case versions: +Python 3.3 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 16:40:19 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 15:40:19 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1330702819.94.0.737322908351.issue11379@psf.upfronthosting.co.za> ?ric Araujo added the comment: Right, patch for 3.2. Also edited the module docstring (info taken from the docstring of xml.dom). BTW I really think we could have avoided some verbosity by adding the recommendation to use xml.etree in the first paragraph of Doc/library/xml.dom.minidom.rst. ---------- Added file: http://bugs.python.org/file24707/minidom-desc.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 16:41:35 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 02 Mar 2012 15:41:35 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1330702895.45.0.471661575303.issue11379@psf.upfronthosting.co.za> ?ric Araujo added the comment: s/Mininal/Minimal/ in the synopsis ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 16:55:42 2012 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 02 Mar 2012 15:55:42 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1330703742.65.0.862033167655.issue11379@psf.upfronthosting.co.za> Stefan Behnel added the comment: Yes, I think that's better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 17:22:45 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 02 Mar 2012 16:22:45 +0000 Subject: [issue14172] ref-counting leak in buffer usage in Python/marshal.c In-Reply-To: <1330681379.13.0.854959913583.issue14172@psf.upfronthosting.co.za> Message-ID: <1330705365.25.0.254059496057.issue14172@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Here is a patch. ---------- keywords: +patch nosy: +pitrou, skrah Added file: http://bugs.python.org/file24708/marshalbufs.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 17:22:51 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 02 Mar 2012 16:22:51 +0000 Subject: [issue14172] ref-counting leak in buffer usage in Python/marshal.c In-Reply-To: <1330681379.13.0.854959913583.issue14172@psf.upfronthosting.co.za> Message-ID: <1330705371.65.0.392443794424.issue14172@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- stage: -> patch review versions: -Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 17:23:09 2012 From: report at bugs.python.org (Pawel Prokop) Date: Fri, 02 Mar 2012 16:23:09 +0000 Subject: [issue4080] unittest: display time used by each test case In-Reply-To: <1223497696.14.0.913391715353.issue4080@psf.upfronthosting.co.za> Message-ID: <1330705389.01.0.846453867716.issue4080@psf.upfronthosting.co.za> Pawel Prokop added the comment: I agree with Ezio, this feature should have an option to enable/disable. Anyway, I use it in different way. Since 2008, I've used this feature for performance comparision, whether some implementation changes in application code did not slow down application. Tests run after each commit. I compare execution time of particular test before and after commit. With additional scripts, I create metrics and charts using gnuplot to visualize how execution time of each test changed during the development. I can ensure the performance stability of the application. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 17:23:35 2012 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 02 Mar 2012 16:23:35 +0000 Subject: [issue14167] document return statement in finally blocks In-Reply-To: <1330614429.57.0.59180427723.issue14167@psf.upfronthosting.co.za> Message-ID: <1330705415.75.0.907884158687.issue14167@psf.upfronthosting.co.za> Yury Selivanov added the comment: Well, I guess the best place to put it would be http://docs.python.org/py3k/reference/compound_stmts.html#finally I've attached the patch, please take a look. If it's possible to make it more clear, feel free to rephrase it. But please include the example, this behaviour needs to be emphasized. ---------- keywords: +patch Added file: http://bugs.python.org/file24709/finally_doc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 17:25:12 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 02 Mar 2012 16:25:12 +0000 Subject: [issue14177] marshal.loads accepts unicode strings Message-ID: <1330705512.68.0.880632816673.issue14177@psf.upfronthosting.co.za> New submission from Antoine Pitrou : >>> marshal.loads('T') True >>> marshal.loads(b'T') True Contrast with: >>> marshal.load(io.BytesIO(b'T')) True >>> marshal.load(io.StringIO('T')) Traceback (most recent call last): File "", line 1, in TypeError: f.read() returned not bytes but str ---------- components: Extension Modules keywords: easy messages: 154778 nosy: pitrou priority: normal severity: normal stage: needs patch status: open title: marshal.loads accepts unicode strings type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 17:33:46 2012 From: report at bugs.python.org (Georg Brandl) Date: Fri, 02 Mar 2012 16:33:46 +0000 Subject: [issue14175] broken links on /download/ page In-Reply-To: <1330691489.97.0.756489125199.issue14175@psf.upfronthosting.co.za> Message-ID: <1330706026.18.0.89976715823.issue14175@psf.upfronthosting.co.za> Georg Brandl added the comment: I fixed the links on /download/ and added the other versions on /releases/. ---------- nosy: +georg.brandl resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 17:36:24 2012 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 02 Mar 2012 16:36:24 +0000 Subject: [issue14178] Failing tests for ElementTree Message-ID: <1330706183.38.0.536130831322.issue14178@psf.upfronthosting.co.za> New submission from Stefan Behnel : These are tests from lxml's ET compatibility test suite that now fail in ElementTree: def test_delslice_step(self): Element = self.etree.Element SubElement = self.etree.SubElement a = Element('a') b = SubElement(a, 'b') c = SubElement(a, 'c') d = SubElement(a, 'd') e = SubElement(a, 'e') del a[1::2] self.assertEquals( [b, d], list(a)) def test_delslice_step_negative(self): Element = self.etree.Element SubElement = self.etree.SubElement a = Element('a') b = SubElement(a, 'b') c = SubElement(a, 'c') d = SubElement(a, 'd') e = SubElement(a, 'e') del a[::-1] self.assertEquals( [], list(a)) def test_delslice_step_negative2(self): Element = self.etree.Element SubElement = self.etree.SubElement a = Element('a') b = SubElement(a, 'b') c = SubElement(a, 'c') d = SubElement(a, 'd') e = SubElement(a, 'e') del a[::-2] self.assertEquals( [b, d], list(a)) The error messages go like this: del a[1::2] ValueError: attempt to assign sequence of size 0 to extended slice of size 2 del a[::-1] ValueError: attempt to assign sequence of size 0 to extended slice of size 4 del a[::-2] ValueError: attempt to assign sequence of size 0 to extended slice of size 2 Additionally, I get this error: self.assertNotEquals(None, e.code) AttributeError: 'ParseError' object has no attribute 'code' for this test: required_versions_ET['test_feed_parser_error_position'] = (1,3) def test_feed_parser_error_position(self): ParseError = self.etree.ParseError parser = self.etree.XMLParser() try: parser.close() except ParseError: e = sys.exc_info()[1] self.assertNotEquals(None, e.code) self.assertNotEquals(0, e.code) self.assert_(isinstance(e.position, tuple)) self.assert_(e.position >= (0, 0)) The complete test suite is here: https://github.com/lxml/lxml/blob/master/src/lxml/tests/test_elementtree.py ---------- components: Library (Lib), XML messages: 154780 nosy: scoder priority: normal severity: normal status: open title: Failing tests for ElementTree type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 17:37:20 2012 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 02 Mar 2012 16:37:20 +0000 Subject: [issue14178] Failing tests for ElementTree In-Reply-To: <1330706183.38.0.536130831322.issue14178@psf.upfronthosting.co.za> Message-ID: <1330706240.36.0.547115809149.issue14178@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +eli.bendersky, ezio.melotti, flox stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 18:05:28 2012 From: report at bugs.python.org (Joel Verhagen) Date: Fri, 02 Mar 2012 17:05:28 +0000 Subject: [issue4773] HTTPMessage not documented and has inconsistent API across 2.6/3.0 In-Reply-To: <1230586952.45.0.591912771259.issue4773@psf.upfronthosting.co.za> Message-ID: <1330707928.11.0.00432102610633.issue4773@psf.upfronthosting.co.za> Joel Verhagen added the comment: There is a difference in what HTTPResponse.getheaders() returns. Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import httplib >>> c = httplib.HTTPConnection('www.joelverhagen.com') >>> c.request('GET', '/sandbox/tests/cookies.php') >>> c.getresponse().getheaders() [('content-length', '0'), ('set-cookie', 'test_cookie1=foobar; expires=Fri, 02-Mar-2012 16:54:15 GMT, test_cookie2=barfoo; expires=Fri, 02-Mar-2012 16:54:15 GMT'), ('vary', 'Accept-Encoding'), ('server', 'Apache'), ('date', 'Fri, 02 Mar 2012 16:53:15 GMT'), ('content-type', 'text/html')] Python 3.2.2 (default, Sep 4 2011, 09:07:29) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from http import client >>> c = client.HTTPConnection('www.joelverhagen.com') >>> c.request('GET', '/sandbox/tests/cookies.php') >>> c.getresponse().getheaders() [('Date', 'Fri, 02 Mar 2012 16:56:40 GMT'), ('Server', 'Apache'), ('Set-Cookie', 'test_cookie1=foobar; expires=Fri, 02-Mar-2012 16:57:40 GMT'), ('Set-Cookie', 'test_cookie2=barfoo; expires=Fri, 02-Mar-2012 16:57:40 GMT'), ('Vary', 'Accept-Encoding'), ('Content-Length', '0'), ('Content-Type', 'text/html')] As you can see, in 2.7.2 HTTPResponse.getheaders() in 2.7.2 joins headers with the same name by ", ". In 3.2.2, the headers are kept separate and two or more 2-tuples. This causes problems if you convert the list of 2-tuples to a dict, because the keys collide (causing all but one of the values associated the non-unique keys to be overwritten). It looks like this problem is caused by using the email header parser (which keeps the keys and values as separate 2-tuples). In Python 2.7.2, the HTTPMessage.addheader(...) function does the comma-separating. Is this API change intentional? Should HTTPResponse.getheaders() comma-separate the values like the HTTPResponse.getheader(...) function (in both 2.7.2 and 3.2.2)? See also: https://github.com/shazow/urllib3/issues/3#issuecomment-3008415 ---------- nosy: +joel.verhagen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 18:06:56 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Fri, 02 Mar 2012 17:06:56 +0000 Subject: [issue14176] Fix unicode literals (for PEP 414) In-Reply-To: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> Message-ID: <1330708016.78.0.517647719425.issue14176@psf.upfronthosting.co.za> Martin v. L?wis added the comment: What operating system and what terminal are you using? If Windows: what code page does your terminal run in? ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 18:21:15 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 02 Mar 2012 17:21:15 +0000 Subject: [issue14172] ref-counting leak in buffer usage in Python/marshal.c In-Reply-To: <1330681379.13.0.854959913583.issue14172@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 185a6ae76479 by Antoine Pitrou in branch '3.2': Issue #14172: Fix reference leak when marshalling a buffer-like object (other than a bytes object). http://hg.python.org/cpython/rev/185a6ae76479 New changeset b1303cf15e01 by Antoine Pitrou in branch 'default': Issue #14172: Fix reference leak when marshalling a buffer-like object (other than a bytes object). http://hg.python.org/cpython/rev/b1303cf15e01 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 18:23:46 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 02 Mar 2012 17:23:46 +0000 Subject: [issue14172] ref-counting leak in buffer usage in Python/marshal.c In-Reply-To: <1330681379.13.0.854959913583.issue14172@psf.upfronthosting.co.za> Message-ID: <1330709026.03.0.133264409044.issue14172@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Fixed. Apparently 2.7 isn't affected. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 19:07:14 2012 From: report at bugs.python.org (Florian M) Date: Fri, 02 Mar 2012 18:07:14 +0000 Subject: [issue14179] Test coverage for lib/re.py Message-ID: <1330711634.92.0.5841595214.issue14179@psf.upfronthosting.co.za> New submission from Florian M : I added one small test in lib/test/test_re.py for complete coverage of 're._compile' method. ---------- components: Tests files: re_coverage.patch keywords: patch messages: 154785 nosy: flomm priority: normal severity: normal status: open title: Test coverage for lib/re.py versions: Python 3.3 Added file: http://bugs.python.org/file24710/re_coverage.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 19:43:33 2012 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 02 Mar 2012 18:43:33 +0000 Subject: [issue14179] Test coverage for lib/re.py In-Reply-To: <1330711634.92.0.5841595214.issue14179@psf.upfronthosting.co.za> Message-ID: <1330713813.97.0.0528127933636.issue14179@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti stage: -> patch review type: -> enhancement versions: +Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 19:44:36 2012 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 02 Mar 2012 18:44:36 +0000 Subject: [issue14179] Test coverage for lib/re.py In-Reply-To: <1330711634.92.0.5841595214.issue14179@psf.upfronthosting.co.za> Message-ID: <1330713876.86.0.424444355258.issue14179@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti stage: -> patch review type: -> enhancement versions: +Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 20:05:09 2012 From: report at bugs.python.org (Roger Serwy) Date: Fri, 02 Mar 2012 19:05:09 +0000 Subject: [issue14163] tkinter: problems with hello doc example In-Reply-To: <1330560048.21.0.5556738264.issue14163@psf.upfronthosting.co.za> Message-ID: <1330715109.48.0.146111519194.issue14163@psf.upfronthosting.co.za> Roger Serwy added the comment: I tried your tk_hello.py code and it works on Python 3. The code for creating the QUIT button exceeds 80 columns. I'd insert a \n after the second argument: self.QUIT = tk.Button(self, text = "QUIT", fg = "red", command = root.destroy) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 20:13:42 2012 From: report at bugs.python.org (Roger Serwy) Date: Fri, 02 Mar 2012 19:13:42 +0000 Subject: [issue14163] tkinter: problems with hello doc example In-Reply-To: <1330560048.21.0.5556738264.issue14163@psf.upfronthosting.co.za> Message-ID: <1330715622.69.0.916346176071.issue14163@psf.upfronthosting.co.za> Roger Serwy added the comment: I tried your tk_hello.py code and it works on Python 3. The code for creating the QUIT button exceeds 80 columns. I'd insert a \n after the second argument: self.QUIT = tk.Button(self, text = "QUIT", fg = "red", command = root.destroy) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 20:18:54 2012 From: report at bugs.python.org (Jay Deiman) Date: Fri, 02 Mar 2012 19:18:54 +0000 Subject: [issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect In-Reply-To: <1330382649.62.0.524230876085.issue14144@psf.upfronthosting.co.za> Message-ID: <1330715934.87.0.231080083892.issue14144@psf.upfronthosting.co.za> Jay Deiman added the comment: Senthil, The HTTPRedirectHandler is already breaking RFC2616 by it's own admission in the code comments (from the source): # Strictly (according to RFC 2616), 301 or 302 in response # to a POST MUST NOT cause a redirection without confirmation # from the user (of urllib2, in this case). In practice, # essentially all clients do redirect in this case, so we # do the same. # be conciliant with URIs containing a space I can definitely understand the issue with changing the default behavior to redirect the POST data. However, an added option which leaves the current behavior as the default shouldn't hurt. I'm submitting a new patch file (urllib2.py.redirect_option.patch), which will do exactly that. ---------- Added file: http://bugs.python.org/file24711/urllib2.py.redirect_option.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 20:27:28 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Mar 2012 19:27:28 +0000 Subject: [issue14163] tkinter: problems with hello doc example In-Reply-To: <1330560048.21.0.5556738264.issue14163@psf.upfronthosting.co.za> Message-ID: <1330716448.82.0.864144371197.issue14163@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Do you know anything about spaces in the button text causing the addition of {bra ces}? I would prefer not to have to use an underscore in Hello_World. I fixed the long line and also updated pack calls pass options by name instead of a dict. ---------- Added file: http://bugs.python.org/file24712/tk_hello.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 20:27:50 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Mar 2012 19:27:50 +0000 Subject: [issue14163] tkinter: problems with hello doc example In-Reply-To: <1330560048.21.0.5556738264.issue14163@psf.upfronthosting.co.za> Message-ID: <1330716470.01.0.508422025134.issue14163@psf.upfronthosting.co.za> Changes by Terry J. Reedy : Removed file: http://bugs.python.org/file24693/tk_hello.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 20:40:59 2012 From: report at bugs.python.org (Roger Serwy) Date: Fri, 02 Mar 2012 19:40:59 +0000 Subject: [issue14163] tkinter: problems with hello doc example In-Reply-To: <1330560048.21.0.5556738264.issue14163@psf.upfronthosting.co.za> Message-ID: <1330717259.77.0.982701605665.issue14163@psf.upfronthosting.co.za> Roger Serwy added the comment: Ah, that's subtle. There's a comma at the end of that ["text"] line which is making the string a one-element tuple. Removing it fixes the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 21:04:46 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Mar 2012 20:04:46 +0000 Subject: [issue14163] tkinter: problems with hello doc example In-Reply-To: <1330560048.21.0.5556738264.issue14163@psf.upfronthosting.co.za> Message-ID: <1330718686.38.0.538730193116.issue14163@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Grrrr, another but in the original ;-) Thank you! I will incorporate into the doc now. ---------- Added file: http://bugs.python.org/file24713/tk_hello.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 21:04:55 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Mar 2012 20:04:55 +0000 Subject: [issue14163] tkinter: problems with hello doc example In-Reply-To: <1330560048.21.0.5556738264.issue14163@psf.upfronthosting.co.za> Message-ID: <1330718695.91.0.874675220328.issue14163@psf.upfronthosting.co.za> Changes by Terry J. Reedy : Removed file: http://bugs.python.org/file24712/tk_hello.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 21:08:41 2012 From: report at bugs.python.org (Jean-Michel Fauth) Date: Fri, 02 Mar 2012 20:08:41 +0000 Subject: [issue14176] Fix unicode literals (for PEP 414) In-Reply-To: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> Message-ID: <1330718921.57.0.156363468547.issue14176@psf.upfronthosting.co.za> Jean-Michel Fauth added the comment: I deliberately hid the information about the used interactive interpreter; just to show you the "experience" of new Python user. (This is what I'm showing to potential Python devs who are interested in this tool; I know Python and use it since v. 1.5.6 as a non computer scientist). The interactive interpreter was: 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. >>> In that precise case, it was Windws 7 Pro (Windows 7 Professionnel, in French because of a Swiss French version) and IDLE is just the IDLE an end user see after a fresh installation. I can ensure you, such a behaviour exists / existed on all Windows versions I used (from Win98, win2000, ...) with all the Python 2 versions since the unicode introduction. The technical reasons/aspects: "sys.defaultencoding", non iso-8859-1 chars [#], *non working unicode literals*, sys.stdout.encoding = 'cp1252' and so on. [#] For those who do not know, one can not write text in French with Latin-1. Please do not take my aggressive (I recognize it), but sometimes necessary message badly. IDLE is not the cause, I use here IDLE to show as an example the disaster of code containing *unicode literals*. I'm not really happy to see this mess again in Py3.3 [?]; the key point beeing *unicode literals*. The Pandora's box is opened. [?] In fact, I will somehow never see or suffer from it. Decisions have been taken. jmf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 21:13:12 2012 From: report at bugs.python.org (Georg Brandl) Date: Fri, 02 Mar 2012 20:13:12 +0000 Subject: [issue14176] Fix unicode literals (for PEP 414) In-Reply-To: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> Message-ID: <1330719192.38.0.758074018865.issue14176@psf.upfronthosting.co.za> Georg Brandl added the comment: Well, let me soothe your mind then: in Python 3, '...' and u'...' will be absolutely equal, so you won't find any more "mess" with the changes from PEP 414. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 21:32:27 2012 From: report at bugs.python.org (R. David Murray) Date: Fri, 02 Mar 2012 20:32:27 +0000 Subject: [issue14176] Fix unicode literals (for PEP 414) In-Reply-To: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> Message-ID: <1330720347.57.0.674179813279.issue14176@psf.upfronthosting.co.za> R. David Murray added the comment: Unless I'm misunderstanding, this is a duplicate of issue 1602. You will note that the problem is *not* with Python (or open source software in general), the problem is that Microsoft treats the command line as a second (or third, or fourth) class citizen. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 21:35:18 2012 From: report at bugs.python.org (Merlijn van Deen) Date: Fri, 02 Mar 2012 20:35:18 +0000 Subject: [issue6784] byte/unicode pickle incompatibilities between python2 and python3 In-Reply-To: <1251287773.44.0.222300610244.issue6784@psf.upfronthosting.co.za> Message-ID: <1330720518.26.0.550313188207.issue6784@psf.upfronthosting.co.za> Merlijn van Deen added the comment: And a complete patch that implements the tests, the python implementation and the C implementation. I'm not completely happy with the code duplication in read_string/read_binstring/read_short_binstring C implementation, so that might be an improvement (however, there is already a lot of code duplication there at the moment). Again: comments would be very welcome... ---------- Added file: http://bugs.python.org/file24714/pickle_bytestr.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 21:35:50 2012 From: report at bugs.python.org (Jean-Michel Fauth) Date: Fri, 02 Mar 2012 20:35:50 +0000 Subject: [issue14176] Fix unicode literals (for PEP 414) In-Reply-To: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> Message-ID: <1330720550.96.0.128066338603.issue14176@psf.upfronthosting.co.za> Jean-Michel Fauth added the comment: Sorry, I neglected the most important information. Python 3.2 is working perfectly. It is simply impossible to create non valid strings (type/class 'str') from a keyboard. (non programmatically created). Like the limited characters set I used when I wrote my first program on a PDP-8. Porting Py 2 code was a child play. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 21:40:59 2012 From: report at bugs.python.org (R. David Murray) Date: Fri, 02 Mar 2012 20:40:59 +0000 Subject: [issue14176] Fix unicode literals (for PEP 414) In-Reply-To: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> Message-ID: <1330720859.94.0.147401107321.issue14176@psf.upfronthosting.co.za> R. David Murray added the comment: OK, so I still don't understand what problem it is you are reporting. What do you mean by "can't craete non-valid strings"? Of course you can't. (I don't see how you could do that programatically, either, although that depends heavily on your definition of non-valid.) Are you reporting that cmd.exe has no support for entering French characters? That wouldn't be a Python bug. Are you reporting that idle lacks the keyboard support for French? (I don't use Idle, so I don't know if that is true or not.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 21:41:44 2012 From: report at bugs.python.org (R. David Murray) Date: Fri, 02 Mar 2012 20:41:44 +0000 Subject: [issue14176] Fix unicode literals In-Reply-To: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> Message-ID: <1330720904.74.0.630343682571.issue14176@psf.upfronthosting.co.za> R. David Murray added the comment: I'm changing the title since PEP 414 has no bearing here. ---------- title: Fix unicode literals (for PEP 414) -> Fix unicode literals _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 22:18:29 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Mar 2012 21:18:29 +0000 Subject: [issue14126] Speed up list comprehensions by preallocating the list where possible In-Reply-To: <1330212567.11.0.0699848649478.issue14126@psf.upfronthosting.co.za> Message-ID: <1330723109.31.0.605324234903.issue14126@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I think this proposal should be rejected for three reasons. 1. I believe the idea is faulty in that it can only work if the single source iterable *has* a known length. The compiler cannot, in general, determine that and in practice seldom would be able to. For a comprehension within a function, the source typically is or depends on a passed arg. What happens if you replace 'range(10000)' with 'iter(range(10000))' in your patched version and rerun? As I remember, Guido has rejected the idea of iterators having length information because in general it is not possible. 2. It adds an opcode for an extremely limited case. In 3.x, there are list, set, dict, and generator expression-comprehensions. Many 2.x uses of list comprehensions are (can be, increasingly will be) replaced by one of the others. In particular, lists long enough for there to be a real time saving tend to be replaced by generator expressions if possible. 3. The relative time saving in this limited case is at best 16% (.9/5.7) in a toy 2.7 example. I suspect it would be less in the more complex 3.x implementation and know it would be less in any realistic example with a real, slower target expression (at minimum try '2*j+1' or 'float(j)') and a slower source producer (such as a file object). And to repeat, a source with millions of items will likely be processed an item at a time without creating an explicit list. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 22:33:56 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Mar 2012 21:33:56 +0000 Subject: [issue14141] 2.7.2 64-bit Windows library has __impt_Py* for several symbols instead of __imp__Py* In-Reply-To: <1330360352.45.0.311661027338.issue14141@psf.upfronthosting.co.za> Message-ID: <1330724036.5.0.623108122944.issue14141@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I am building and running 2.7.2 on 64-bit Win 7 from the repository but not linking to anything else. Please look at the 2.7.3 release candidate. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 22:34:52 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Mar 2012 21:34:52 +0000 Subject: [issue14146] IDLE: source line in editor doesn't highlight when debugging In-Reply-To: <1330401708.67.0.511106941359.issue14146@psf.upfronthosting.co.za> Message-ID: <1330724092.1.0.0916684731712.issue14146@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 22:38:36 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Mar 2012 21:38:36 +0000 Subject: [issue13882] PEP 410: Use decimal.Decimal type for timestamps In-Reply-To: <1327611637.79.0.902972785006.issue13882@psf.upfronthosting.co.za> Message-ID: <1330724316.54.0.279461139791.issue13882@psf.upfronthosting.co.za> STINNER Victor added the comment: The PEP has been rejected, so I close the issue. ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 22:39:04 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Mar 2012 21:39:04 +0000 Subject: [issue14126] Speed up list comprehensions by preallocating the list where possible In-Reply-To: <1330212567.11.0.0699848649478.issue14126@psf.upfronthosting.co.za> Message-ID: <1330724344.18.0.318667134213.issue14126@psf.upfronthosting.co.za> Raymond Hettinger added the comment: This seems like a reasonable optimization to me. ---------- assignee: rhettinger -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 22:40:31 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Mar 2012 21:40:31 +0000 Subject: [issue14169] compiler.compile fails on "if" statement in attached file In-Reply-To: <1330624985.96.0.952704814324.issue14169@psf.upfronthosting.co.za> Message-ID: <1330724431.11.0.873121421314.issue14169@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Please provide a *minimal* example that exhibits the problem. 'Minimal' means that if a single line is removed, the problem disappears. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 22:40:59 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Mar 2012 21:40:59 +0000 Subject: [issue13981] time.sleep() should use nanosleep() if available In-Reply-To: <1328828434.41.0.993247720876.issue13981@psf.upfronthosting.co.za> Message-ID: <1330724459.24.0.632497046633.issue13981@psf.upfronthosting.co.za> STINNER Victor added the comment: The PEP 410 has been rejected, so I close the issue. ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 22:54:45 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 02 Mar 2012 21:54:45 +0000 Subject: [issue13964] os.utimensat() and os.futimes() should accept Decimal, drop os.futimens() In-Reply-To: <1328663994.2.0.189878263913.issue13964@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 67d9595a833c by Victor Stinner in branch 'default': Issue #13964: signal.sigtimedwait() timeout is now a float instead of a tuple http://hg.python.org/cpython/rev/67d9595a833c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 23:01:35 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Mar 2012 22:01:35 +0000 Subject: [issue14176] Fix unicode literals In-Reply-To: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> Message-ID: <1330725695.66.0.0878241905386.issue14176@psf.upfronthosting.co.za> Terry J. Reedy added the comment: As I explained to J-M when he posted much the same to python-list, Idle's French keyboard support is faulty because tcl/tk's French keyboard support is faulty. A patch for this was recently applied to tcl/tk. I hope it will be in a released version that we can incorporate in 3.3. I am sure we all wish that Microsoft (and Apple) would take more of a lead in moving to a one Unicode world from a 200 encodings and codepages world. I am sometimes as frustrated at the current situation as J-M. But unless he can identify a valid *Python* bug, we should close this. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 2 23:10:58 2012 From: report at bugs.python.org (Jean-Michel Fauth) Date: Fri, 02 Mar 2012 22:10:58 +0000 Subject: [issue14176] Fix unicode literals In-Reply-To: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> Message-ID: <1330726258.18.0.147926990537.issue14176@psf.upfronthosting.co.za> Jean-Michel Fauth added the comment: You do not get it or I do not explain it correctly. I do not care if Py 3.3 accepts '...' ou u'...'. I'm only affraid, Py 3.3 is suffering from the same non working behaviour Python 2 is suffering. I have seen so many things... I can only use an Py2/Py3 analogy, the types beeing differnt. In Python 2, the u'...' and the unicode('...', 'coding') are not equivalent. This leads and has lead to a lot of non working code. unicode() is always working, while u'...' may not work. A lot of libs, are accepting unicode() and are failing in having to accept u'...'. That would mean in Python 3, '...' works and u'...' will not work. Once again, an *illustration* with IDLE / Py2. >>> import unicodedata as ud >>> for c in u'abc???': print ud.name(c) LATIN SMALL LETTER A LATIN SMALL LETTER B LATIN SMALL LETTER C LATIN SMALL LETTER E WITH ACUTE Traceback (most recent call last): File "", line 2, in print ud.name(c) ValueError: no such name >>> # but >>> import sys >>> for c in unicode('abc???', sys.stdout.encoding): print ud.name(c) LATIN SMALL LETTER A LATIN SMALL LETTER B LATIN SMALL LETTER C LATIN SMALL LETTER E WITH ACUTE LATIN SMALL LIGATURE OE EURO SIGN >>> A course, this is actually a no problem with Py 3. I know nothing about the internal of Python. I have however noticed this guilty behaviour happen especially with non iso-8859-1 chars, valid byte string chars but equivalent chars with unicode code point > 255. Infortunately, all these chars which are so important in French. (I heared about similar problems with the mac-roman coding. I do not know the status). So, if this (u'...') works in Py 3.3, the problem can be considered as "solved". At least you have been informed about this potential issue. It still remains that this is a serious problem on Py 2. jmf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 00:21:06 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Mar 2012 23:21:06 +0000 Subject: [issue14176] Fix unicode literals In-Reply-To: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> Message-ID: <1330730466.69.0.361613004793.issue14176@psf.upfronthosting.co.za> Terry J. Reedy added the comment: > That would mean in Python 3, '...' works and u'...' will not work. You misunderstand the PEP: in 3.3, '...' and u'...' will be *exactly* the same. The only change is that the interpreter will ignore the u prefix instead of raising SyntaxError. It will be as if 'u' were not there. The only purpose is to let 2.x code run in 3.x without requiring the user to erase the 'u'. I can see how you could misunderstand and think that the 'u' prefix must have some meaning. But is does not. The addition is a bit controversial but Guido approved it with the expectation that it will encourage more conversion of 2.x libraries to run on 3.3. In any case, the tracker is not the place for further discussion of the value of the PEP. > Once again, an *illustration* with IDLE / Py2. ... > Of course, this is actually a no problem with Py 3. ... > It still remains that this is a serious problem on Py 2. We are painfully aware that 2.x has problems with unicode. You do not need to tell us. I believe that most of the problems that could be sensibly fixed in 2.x have been fixed. 3.0 fixed more problems by changing the language. 3.3 fixes still more problems by changing the internal implementation of unicode, along with the C api, and the meaning of the language on some systems. People who want to avoid all the problems that have been fixed should use 3.3 either from the repository or when it is released. > So, if this (u'...') works in Py 3.3, the problem can be considered as "solved". I am glad you agree and I will close the issue. Please use python-list for any further discussion or questions. ---------- resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 00:49:01 2012 From: report at bugs.python.org (guilherme-pg) Date: Fri, 02 Mar 2012 23:49:01 +0000 Subject: [issue14177] marshal.loads accepts unicode strings In-Reply-To: <1330705512.68.0.880632816673.issue14177@psf.upfronthosting.co.za> Message-ID: <1330732141.95.0.345222532496.issue14177@psf.upfronthosting.co.za> guilherme-pg added the comment: The attached patch attempts to solve the issue. It makes sure marshal.loads only accepts objects conforming to the buffer protocol, updates the documentation for the method accordingly, adds a test case and updates existing test cases that rely on this issue. Please excuse any obvious mistakes in the patch, this is my first contribution and I'll be glad to iterate until it's good. ---------- keywords: +patch nosy: +guilherme-pg Added file: http://bugs.python.org/file24715/14177-marshal-loads-deny-strings.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 00:55:55 2012 From: report at bugs.python.org (Philip Jenvey) Date: Fri, 02 Mar 2012 23:55:55 +0000 Subject: [issue14161] python2 file __repr__ does not escape filename In-Reply-To: <1330533810.56.0.673512322833.issue14161@psf.upfronthosting.co.za> Message-ID: <1330732555.22.0.0981936007939.issue14161@psf.upfronthosting.co.za> Philip Jenvey added the comment: I think you want to decref the result of PyObject_Repr after the fact, too ---------- nosy: +pjenvey _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 01:10:24 2012 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Mar 2012 00:10:24 +0000 Subject: [issue14180] Factorize code to convert int/float to time_t, timeval or timespec Message-ID: <1330733422.24.0.352066771242.issue14180@psf.upfronthosting.co.za> New submission from STINNER Victor : There are various ways to convert a Python int/float to a C time_t, timeval or timespec structure. Attached patch factorize code by adding functions to convert a Python object to a C type (time_t, timeval or timespec). My patch changes how datetime rounds microsecond: round towards zero instead of rounding to nearest with ties going away from zero. I chose this rounding method because it is the method used by int(float) and int(time.time()) is a common in programs (more than round(time.time()). Rounding towards zero avoids also producing timestamps in the future. On overflow, an OverflowError is now raises instead of a ValueError. I prefer OverflowError over ValueError because it is an implementation detail. For example, time_t is 32 bits on Linux 32 bits, 64 bits on Linux 64 bits or on Windows (32 or 64 bits). PyTime_ObjectToXXX() functions are part of Python and so can be used by the posix, time, datetime and select modules. The patch removes _time.c, _time.h and timefunc.h because these files were only used for one function (_PyTime_DoubleToTime_t) which is no more used and it required to link a module to _time.c to get this function. -- If it is a problem to replace ValueError with OverflowError for backward compatibility, it is easy to adapt the patch to raise ValueError instead. timedelta*float and timedelta/float rounding method may also be changed. ---------- components: Library (Lib) files: pytime.patch keywords: patch messages: 154811 nosy: belopolsky, georg.brandl, gregory.p.smith, haypo priority: normal severity: normal status: open title: Factorize code to convert int/float to time_t, timeval or timespec versions: Python 3.3 Added file: http://bugs.python.org/file24716/pytime.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 01:11:16 2012 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Mar 2012 00:11:16 +0000 Subject: [issue13964] os.utimensat() and os.futimes() should accept Decimal, drop os.futimens() In-Reply-To: <1328663994.2.0.189878263913.issue13964@psf.upfronthosting.co.za> Message-ID: <1330733476.0.0.40651435627.issue13964@psf.upfronthosting.co.za> STINNER Victor added the comment: I created the issue #14180 to prepare a refactoring before changing os.*utime*() functions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 01:12:35 2012 From: report at bugs.python.org (Larry Hastings) Date: Sat, 03 Mar 2012 00:12:35 +0000 Subject: [issue13964] os.utimensat() and os.futimes() should accept Decimal, drop os.futimens() In-Reply-To: <1328663994.2.0.189878263913.issue13964@psf.upfronthosting.co.za> Message-ID: <1330733555.78.0.134662037024.issue13964@psf.upfronthosting.co.za> Larry Hastings added the comment: Um, doesn't the rejection of PEP 410 mean this should be discontinued? ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 01:17:25 2012 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Mar 2012 00:17:25 +0000 Subject: [issue13964] os.utimensat() and os.futimes() should accept Decimal, drop os.futimens() In-Reply-To: <1328663994.2.0.189878263913.issue13964@psf.upfronthosting.co.za> Message-ID: <1330733845.11.0.394951732384.issue13964@psf.upfronthosting.co.za> STINNER Victor added the comment: > Um, doesn't the rejection of PEP 410 mean this should be discontinued? There is an issue in shutil.copystat() on copying the timestamp: in this specific use case, we need nanosecond resolution. Guido proposes (in a private mail thread) to add st_atime_ns, st_mtime_ns, st_ctime_ns fields to os.stat() and make os.*utime*() functions accept a (sec, nsec) tuple. It would still be possible to pass a number or seconds as an int or float. I plan to implement this request. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 01:35:32 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 03 Mar 2012 00:35:32 +0000 Subject: [issue13550] Rewrite logging hack of the threading module In-Reply-To: <1323297626.55.0.00727033353184.issue13550@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 8ec51b2e57c2 by Victor Stinner in branch 'default': Close #13550: Remove the debug machinery from the threading module: remove http://hg.python.org/cpython/rev/8ec51b2e57c2 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 01:37:06 2012 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Mar 2012 00:37:06 +0000 Subject: [issue13964] os.utimensat() and os.futimes() should accept (sec, nsec), drop os.futimens() In-Reply-To: <1328663994.2.0.189878263913.issue13964@psf.upfronthosting.co.za> Message-ID: <1330735026.58.0.208656065826.issue13964@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: os.utimensat() and os.futimes() should accept Decimal, drop os.futimens() -> os.utimensat() and os.futimes() should accept (sec, nsec), drop os.futimens() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 01:59:39 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Mar 2012 00:59:39 +0000 Subject: [issue14177] marshal.loads accepts unicode strings In-Reply-To: <1330705512.68.0.880632816673.issue14177@psf.upfronthosting.co.za> Message-ID: <1330736379.99.0.289083785034.issue14177@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Thank you. The patch looks almost perfect, just one nit: apparently you changed the documentation for marshal.dumps. Is that intended? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 02:03:19 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 03 Mar 2012 01:03:19 +0000 Subject: [issue14171] warnings from valgrind about openssl as used by CPython In-Reply-To: <1330670900.9.0.919434132567.issue14171@psf.upfronthosting.co.za> Message-ID: <1330736599.18.0.773075913777.issue14171@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Why are you reporting this issue here? ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 02:19:00 2012 From: report at bugs.python.org (guilherme-pg) Date: Sat, 03 Mar 2012 01:19:00 +0000 Subject: [issue14177] marshal.loads accepts unicode strings In-Reply-To: <1330705512.68.0.880632816673.issue14177@psf.upfronthosting.co.za> Message-ID: <1330737540.53.0.650883431812.issue14177@psf.upfronthosting.co.za> guilherme-pg added the comment: Oops, sorry, that was unintended. I uploaded a new version of the patch with the correct documentation update, making it explicit that loads() expects a bytes object. ---------- Added file: http://bugs.python.org/file24717/14177-marshal-loads-deny-strings-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 02:31:38 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Mar 2012 01:31:38 +0000 Subject: [issue14177] marshal.loads accepts unicode strings In-Reply-To: <1330705512.68.0.880632816673.issue14177@psf.upfronthosting.co.za> Message-ID: <1330738298.46.0.329038243099.issue14177@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Thank you! What is your full name, for credits? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 02:36:20 2012 From: report at bugs.python.org (guilherme-pg) Date: Sat, 03 Mar 2012 01:36:20 +0000 Subject: [issue14177] marshal.loads accepts unicode strings In-Reply-To: <1330705512.68.0.880632816673.issue14177@psf.upfronthosting.co.za> Message-ID: <1330738580.1.0.27949210319.issue14177@psf.upfronthosting.co.za> guilherme-pg added the comment: Guilherme Gon?alves Thanks for the quick review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 02:43:21 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Mar 2012 01:43:21 +0000 Subject: [issue14169] compiler.compile fails on "if" statement in attached file In-Reply-To: <1330624985.96.0.952704814324.issue14169@psf.upfronthosting.co.za> Message-ID: <1330739001.89.0.993193929814.issue14169@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 02:44:49 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 03 Mar 2012 01:44:49 +0000 Subject: [issue14177] marshal.loads accepts unicode strings In-Reply-To: <1330705512.68.0.880632816673.issue14177@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 4966907d3661 by Antoine Pitrou in branch '3.2': Issue #14177: marshal.loads() now raises TypeError when given an unicode string. http://hg.python.org/cpython/rev/4966907d3661 New changeset e67b3a9bd2dc by Antoine Pitrou in branch 'default': - Issue #14177: marshal.loads() now raises TypeError when given an unicode http://hg.python.org/cpython/rev/e67b3a9bd2dc ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 02:47:59 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Mar 2012 01:47:59 +0000 Subject: [issue14177] marshal.loads accepts unicode strings In-Reply-To: <1330705512.68.0.880632816673.issue14177@psf.upfronthosting.co.za> Message-ID: <1330739279.76.0.636928061952.issue14177@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I've committed the patch in 3.2 and 3.3. ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 04:33:32 2012 From: report at bugs.python.org (Zooko O'Whielacronx) Date: Sat, 03 Mar 2012 03:33:32 +0000 Subject: [issue14171] warnings from valgrind about openssl as used by CPython In-Reply-To: <1330670900.9.0.919434132567.issue14171@psf.upfronthosting.co.za> Message-ID: <1330745612.01.0.467482955006.issue14171@psf.upfronthosting.co.za> Zooko O'Whielacronx added the comment: Oh, I'm sorry I didn't make that clear at first. First of all, so that others who encounter these warnings can see how I worked-around them so that they can do that as well. Second, because Python comes with a valgrind suppressions file. Here is a patch to that file to suppress these warnings. --- a/Misc/valgrind-python.supp Wed Feb 22 00:28:46 2012 +0100 +++ b/Misc/valgrind-python.supp Fri Mar 02 20:31:55 2012 -0700 @@ -286,6 +286,38 @@ ### fun:MD5_Update ###} +# Fedora's package "openssl-1.0.1-0.1.beta2.fc17.x86_64" on x86_64 +# See http://bugs.python.org/issue14171 +{ + openssl 1.0.1 prng 1 + Memcheck:Cond + fun:bcmp + fun:fips_get_entropy + fun:FIPS_drbg_instantiate + fun:RAND_init_fips + fun:OPENSSL_init_library + fun:SSL_library_init + fun:init_hashlib +} + +{ + openssl 1.0.1 prng 2 + Memcheck:Cond + fun:fips_get_entropy + fun:FIPS_drbg_instantiate + fun:RAND_init_fips + fun:OPENSSL_init_library + fun:SSL_library_init + fun:init_hashlib +} + +{ + openssl 1.0.1 prng 3 + Memcheck:Value8 + fun:_x86_64_AES_encrypt_compact + fun:AES_encrypt +} + # # All of these problems come from using test_socket_ssl # ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 06:02:18 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 03 Mar 2012 05:02:18 +0000 Subject: [issue14178] Failing tests for ElementTree In-Reply-To: <1330706183.38.0.536130831322.issue14178@psf.upfronthosting.co.za> Message-ID: <1330750938.07.0.903269875991.issue14178@psf.upfronthosting.co.za> Eli Bendersky added the comment: I can confirm that this indeed fails for the C implementation, while succeeding for the Python implementation. The C implementation doesn't appear to support extended slices for getting and setting items. Looking into it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 06:21:01 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 03 Mar 2012 05:21:01 +0000 Subject: [issue14178] Failing tests for ElementTree In-Reply-To: <1330706183.38.0.536130831322.issue14178@psf.upfronthosting.co.za> Message-ID: <1330752061.56.0.333148081255.issue14178@psf.upfronthosting.co.za> Eli Bendersky added the comment: Correction: extended slices are supported. The problem appears to be just with 'del', because element_ass_subscr doesn't treat it specially and thinks we just want to assign a 0-len value to a non-0-len slice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 08:28:01 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 03 Mar 2012 07:28:01 +0000 Subject: [issue14065] Element should support cyclic GC In-Reply-To: <1329755208.03.0.143933032526.issue14065@psf.upfronthosting.co.za> Message-ID: <1330759681.69.0.950777198079.issue14065@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- nosy: +eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 09:29:23 2012 From: report at bugs.python.org (Stefan Krah) Date: Sat, 03 Mar 2012 08:29:23 +0000 Subject: [issue14181] Support getbuffer redirection scheme in memoryview Message-ID: <1330763362.99.0.43231376241.issue14181@psf.upfronthosting.co.za> New submission from Stefan Krah : Supporting chained objects that redirect getbuffer requests to a single exporter rather than re-exporting the buffer is a matter of removing an assert, but it needs tests and documentation updates. ---------- assignee: skrah messages: 154826 nosy: ncoghlan, pitrou, scoder, skrah priority: normal severity: normal stage: test needed status: open title: Support getbuffer redirection scheme in memoryview type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 11:10:04 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 03 Mar 2012 10:10:04 +0000 Subject: [issue14182] collections.Counter equality test thrown-off by zero counts Message-ID: <1330769404.28.0.817906963132.issue14182@psf.upfronthosting.co.za> New submission from Raymond Hettinger : >>> from collections import Counter >>> x=Counter(a=10,b=0,c=3) >>> y=Counter(a=10,c=3) >>> x == y False >>> all(x[k]==y[k] for k in set(x) | set(y)) True ---------- assignee: rhettinger components: Library (Lib) messages: 154827 nosy: rhettinger priority: normal severity: normal status: open title: collections.Counter equality test thrown-off by zero counts type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 11:16:11 2012 From: report at bugs.python.org (=?utf-8?q?Francisco_Mart=C3=ADn_Brugu=C3=A9?=) Date: Sat, 03 Mar 2012 10:16:11 +0000 Subject: [issue12659] Add tests for packaging.tests.support In-Reply-To: <1312033884.07.0.964621452644.issue12659@psf.upfronthosting.co.za> Message-ID: <1330769771.83.0.180662815055.issue12659@psf.upfronthosting.co.za> Francisco Mart?n Brugu? added the comment: I've updated the patch with a test case for 'create_distribution' and one minor rename. I personally don't like too much the structure of 'LoggingCatcherTestCase' so improvements are welcome. Cheers, francis ---------- Added file: http://bugs.python.org/file24718/issue12659_e67b3a9bd2dc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 12:03:40 2012 From: report at bugs.python.org (Jean-Michel Fauth) Date: Sat, 03 Mar 2012 11:03:40 +0000 Subject: [issue14176] Fix unicode literals In-Reply-To: <1330730466.69.0.361613004793.issue14176@psf.upfronthosting.co.za> Message-ID: Jean-Michel Fauth added the comment: 2012/3/3 Terry J. Reedy > > Terry J. Reedy added the comment: > > > That would mean in Python 3, '...' works and u'...' will not work. > > You misunderstand the PEP: in 3.3, '...' and u'...' will be *exactly* the > same. The only change is that the interpreter will ignore the u prefix > instead of raising SyntaxError. It will be as if 'u' were not there. The > only purpose is to let 2.x code run in 3.x without requiring the user to > erase the 'u'. > > I can see how you could misunderstand and think that the 'u' prefix must > have some meaning. But is does not. The addition is a bit controversial but > Guido approved it with the expectation that it will encourage more > conversion of 2.x libraries to run on 3.3. In any case, the tracker is not > the place for further discussion of the value of the PEP. > > > Once again, an *illustration* with IDLE / Py2. > ... > > Of course, this is actually a no problem with Py 3. > ... > > It still remains that this is a serious problem on Py 2. > > We are painfully aware that 2.x has problems with unicode. You do not need > to tell us. I believe that most of the problems that could be sensibly > fixed in 2.x have been fixed. 3.0 fixed more problems by changing the > language. 3.3 fixes still more problems by changing the internal > implementation of unicode, along with the C api, and the meaning of the > language on some systems. People who want to avoid all the problems that > have been fixed should use 3.3 either from the repository or when it is > released. > > > So, if this (u'...') works in Py 3.3, the problem can > be considered as "solved". > > I am glad you agree and I will close the issue. > > Preliminary remark. I'm sending this via gmail, so it may happen the glyphs you see are illformed or transfomred by Google. Be ensured I'm typing the "right" glyphs. No, no and no. This is not a tkinter issue. This "strange" behaviour, I do not find a better word, happens with many libraries, can be Python core libs or external libs. To tell you the truth and dispite my experience, I never succeeded to narrow excatly the problem. In Python 2 sometimes, understand with some pieces of code / software, it "works" and somtimes it simply does not. The libs used here a just the first ones, that came to my mind. ----- wxPython 2.8-ansi build. Traceback (most recent call last): File "", line 1, in File "c:\python27\lib\site-packages\wx-2.8-msw-ansi\wx\py\shell.py", line 1242, in writeOut self.write(text) File "c:\python27\lib\site-packages\wx-2.8-msw-ansi\wx\py\shell.py", line 1000, in write self.AddText(text) File "c:\python27\lib\site-packages\wx-2.8-msw-ansi\wx\stc.py", line 1425, in AddText return _stc.StyledTextCtrl_AddText(*args, **kwargs) File "c:\python27\lib\encodings\cp1252.py", line 12, in encode return codecs.charmap_encode(input,errors,encoding_table) UnicodeEncodeError: 'charmap' codec can't encode characters in position 4-5: character maps to abc??? >>> ---- PySide, passing "unicode" to a text widdget. Passing u'abc???' works. Passing unicode('abc???', 'cp1252') works. Passing 'abc???' doesn't ! '??' are missing. --- My interactive wx interpreter using wxPython. Strings as frame title. True ok Traceback (most recent call last): File "", line 1, in File "c:\Python27\lib\site-packages\wx-2.8-msw-ansi\wx\_windows.py", line 505, in __init__ _windows_.Frame_swiginit(self,_windows_.new_Frame(*args, **kwargs)) File "c:\Python27\lib\encodings\cp1252.py", line 12, in encode return codecs.charmap_encode(input,errors,encoding_table) UnicodeEncodeError: 'charmap' codec can't encode characters in position 5-6: character maps to True ok --- And so on with many libs. You may argue that these libs are guilty. I may argue that Python is somehow guilty, because it let users write non working code. And practically in all the cases, the main problem is due to the usage of unicode literals. Just to show you, I'm quite comfortable with all this coding stuff. The results my interactive intepreter. Special hack, unfortunatelly non portable, works only with Windows and cp1252. abc??? >>> unicode('abc???', sys.stdout.encoding) abc??? >>> print u'abc???' abc??? >>> print unicode('abc???', sys.stdout.encoding) abc??? As I am aware of this "feature", all my code is perfectly working. I'm paying attention to the necessity of the usage of u'...' or unicode(...). Unfortunatelly, this not a general case in a lot of code I see, supposed to deal with texts. To draw a conclusion. You are wise enough to understand that, when I'm saying "Python just does not work", I'm unforunatelly not so far away form the reality. I really, very really, expect all this mess (sorry for the word) will not reappear in Py 3.3. Let's wait. 'abc???' >>> print('abc???') abc??? >>> Regards, Jean-Michel Fauth PS The u() trick does not help. ---------- nosy: +jmfauth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 12:44:54 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 03 Mar 2012 11:44:54 +0000 Subject: [issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect In-Reply-To: <1330382649.62.0.524230876085.issue14144@psf.upfronthosting.co.za> Message-ID: <1330775094.23.0.374847776774.issue14144@psf.upfronthosting.co.za> ?ric Araujo added the comment: > However, an added option which leaves the current behavior as the default shouldn't hurt. My opinion too. urllib is sometimes a client, sometimes a library used to build clients, which need a knob to implement their own decisions or possibly ask the user for confirmation. A new argument being a new feature, this patch must target 3.3. Some comments on the patch: + # NOTE: Setting redirect_post_data to True *can* introduce security + # issues and is not recommended unless you are sure of where the + # POST data is being redirected! I would tone down this note, for example: # setting redirect_post_data to True can introduce security # issues, use with caution + redirect_post_data = False Is an attribute okay or should methods (__init__, maybe methods that do the requests too) grow a new parameter? ---------- stage: -> patch review type: behavior -> enhancement versions: +Python 3.3 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 12:45:48 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 03 Mar 2012 11:45:48 +0000 Subject: [issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect In-Reply-To: <1330382649.62.0.524230876085.issue14144@psf.upfronthosting.co.za> Message-ID: <1330775148.99.0.27158887285.issue14144@psf.upfronthosting.co.za> ?ric Araujo added the comment: Also, new tests and a doc update would be needed, but you may want to wait for Senthil?s approval before doing more work on this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 13:06:21 2012 From: report at bugs.python.org (Merlijn van Deen) Date: Sat, 03 Mar 2012 12:06:21 +0000 Subject: [issue6784] byte/unicode pickle incompatibilities between python2 and python3 In-Reply-To: <1251287773.44.0.222300610244.issue6784@psf.upfronthosting.co.za> Message-ID: <1330776381.97.0.827741784756.issue6784@psf.upfronthosting.co.za> Changes by Merlijn van Deen : Removed file: http://bugs.python.org/file24567/test_bytestrpickle.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 13:37:39 2012 From: report at bugs.python.org (Merlijn van Deen) Date: Sat, 03 Mar 2012 12:37:39 +0000 Subject: [issue6784] byte/unicode pickle incompatibilities between python2 and python3 In-Reply-To: <1251287773.44.0.222300610244.issue6784@psf.upfronthosting.co.za> Message-ID: <1330778259.48.0.271865394727.issue6784@psf.upfronthosting.co.za> Merlijn van Deen added the comment: OK, and now a version that's not broken... I forgot to initialize self->bytestr for PicklerObject/UnpicklerObject. *puts on the you-broke-the-build-hat* Except for test_packaging.test_caches, this version passes all tests -- test_packaging.test_caches, which seems to fail because I make install'd python and installed {distribute,pip,setuptools,virtualenv}. ---------- Added file: http://bugs.python.org/file24719/pickle_bytestr.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 13:37:53 2012 From: report at bugs.python.org (Merlijn van Deen) Date: Sat, 03 Mar 2012 12:37:53 +0000 Subject: [issue6784] byte/unicode pickle incompatibilities between python2 and python3 In-Reply-To: <1251287773.44.0.222300610244.issue6784@psf.upfronthosting.co.za> Message-ID: <1330778273.59.0.599546637855.issue6784@psf.upfronthosting.co.za> Changes by Merlijn van Deen : Removed file: http://bugs.python.org/file24714/pickle_bytestr.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 13:38:44 2012 From: report at bugs.python.org (zulla) Date: Sat, 03 Mar 2012 12:38:44 +0000 Subject: [issue14036] urlparse insufficient port property validation In-Reply-To: <1329435639.39.0.341536822512.issue14036@psf.upfronthosting.co.za> Message-ID: <1330778324.38.0.486940071962.issue14036@psf.upfronthosting.co.za> zulla added the comment: >>> u("http://www.google.com:99999999999999999999999999").port 99999999999999999999999999L ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 14:03:38 2012 From: report at bugs.python.org (Georg Brandl) Date: Sat, 03 Mar 2012 13:03:38 +0000 Subject: [issue14176] Fix unicode literals In-Reply-To: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> Message-ID: <1330779818.84.0.165608980151.issue14176@psf.upfronthosting.co.za> Georg Brandl added the comment: I'd like to encourage you to not try this sort of thing out from an interactive interpreter (incidentally, where does "" come from? It doesn't look like Python's REPL). As David and Terry noted, interactions with such a console, be it Windows' "cmd" or IDLE, have their very own idiosyncrasies and bugs. That said, in Python 2.x *source files* the following two expressions are identical: * u'abc???' * unicode('abc???', 'encoding the file is in') Both result in a Unicode string with the six characters/codepoints you mentioned. There won't be any code that works with one but not the other. Of course there are libraries that do not handle Unicode strings in general (nothing to do with literals!) correctly, but as you yourself said, that is a problem with the libraries. Lastly, please read PEP 414 if you are not completely sure what it is proposing. You will see that it merely affects the available syntax for Unicode literals and allows the "u" again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 14:18:44 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 03 Mar 2012 13:18:44 +0000 Subject: [issue4773] HTTPMessage not documented and has inconsistent API across Py2/Py3 In-Reply-To: <1230586952.45.0.591912771259.issue4773@psf.upfronthosting.co.za> Message-ID: <1330780724.8.0.623185620694.issue4773@psf.upfronthosting.co.za> ?ric Araujo added the comment: Now that two Python 3 releases have been made, I don?t know if changing the code is still an option. The doc can certainly still be improved. Adding Ezio to nosy; I think it?s you who opened a bug report about removing superfluous getter methods in the addinfourl class (and other ugliness). ---------- nosy: +ezio.melotti resolution: accepted -> stage: test needed -> patch review title: HTTPMessage not documented and has inconsistent API across 2.6/3.0 -> HTTPMessage not documented and has inconsistent API across Py2/Py3 versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6, Python 3.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 14:18:59 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 03 Mar 2012 13:18:59 +0000 Subject: [issue4773] HTTPMessage not documented and has inconsistent API across Py2/Py3 In-Reply-To: <1230586952.45.0.591912771259.issue4773@psf.upfronthosting.co.za> Message-ID: <1330780739.57.0.103116540736.issue4773@psf.upfronthosting.co.za> Changes by ?ric Araujo : Removed file: http://bugs.python.org/file13430/unnamed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 14:31:32 2012 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 03 Mar 2012 13:31:32 +0000 Subject: [issue14122] operator: div() instead of truediv() in documention since 3.1.2 In-Reply-To: <1330190947.0.0.577940760696.issue14122@psf.upfronthosting.co.za> Message-ID: <1330781492.61.0.901808205399.issue14122@psf.upfronthosting.co.za> Ezio Melotti added the comment: This was fixed in 8de95f3b2404 (3.2) and d4b17c478e49 (default). Thanks for the report and the patch! ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 14:38:27 2012 From: report at bugs.python.org (Stefan Krah) Date: Sat, 03 Mar 2012 13:38:27 +0000 Subject: [issue14171] warnings from valgrind about openssl as used by CPython In-Reply-To: <1330670900.9.0.919434132567.issue14171@psf.upfronthosting.co.za> Message-ID: <1330781907.74.0.760778652944.issue14171@psf.upfronthosting.co.za> Stefan Krah added the comment: > # generated on buildbot.rubenkerkhof.com, which had, according to Ruben > # Fedora's package "openssl-1.0.1-0.1.beta2.fc17.x86_64" I think openssl needs to be compiled with -DPURIFY to avoid this. ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 14:45:20 2012 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 03 Mar 2012 13:45:20 +0000 Subject: [issue14126] Speed up list comprehensions by preallocating the list where possible In-Reply-To: <1330212567.11.0.0699848649478.issue14126@psf.upfronthosting.co.za> Message-ID: <1330782320.91.0.441883618598.issue14126@psf.upfronthosting.co.za> Ezio Melotti added the comment: You should try to port the patch to 3.3 and do some benchmark there. Having some additional tests to make sure that it works fine in all the cases would be nice too (even if listcomps are already used elsewhere in the code/tests). ---------- nosy: +ezio.melotti stage: -> needs patch versions: +Python 3.3 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 14:50:21 2012 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 03 Mar 2012 13:50:21 +0000 Subject: [issue14135] check for locale changes in test.regrtest In-Reply-To: <1330296468.42.0.0463135348779.issue14135@psf.upfronthosting.co.za> Message-ID: <1330782621.31.0.334289689173.issue14135@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti stage: -> needs patch type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 14:55:35 2012 From: report at bugs.python.org (=?utf-8?q?Francisco_Mart=C3=ADn_Brugu=C3=A9?=) Date: Sat, 03 Mar 2012 13:55:35 +0000 Subject: [issue14183] Test coverage for lib/packaging.install and lib/packaging/pypi/wrapper Message-ID: <1330782935.14.0.67461963587.issue14183@psf.upfronthosting.co.za> New submission from Francisco Mart?n Brugu? : I've added a test to Lib/packaging/tests/test_install.py to increase the line test coverage of lib/packaging.install (and lib/packaging/pypi/wrapper indirectly from 14% to 80%). ---------- components: Tests files: packaging_get_infos_coverage_e67b3a9bd2dc.patch keywords: patch messages: 154839 nosy: francismb priority: normal severity: normal status: open title: Test coverage for lib/packaging.install and lib/packaging/pypi/wrapper versions: Python 3.3 Added file: http://bugs.python.org/file24720/packaging_get_infos_coverage_e67b3a9bd2dc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 14:56:20 2012 From: report at bugs.python.org (=?utf-8?q?Francisco_Mart=C3=ADn_Brugu=C3=A9?=) Date: Sat, 03 Mar 2012 13:56:20 +0000 Subject: [issue14183] Test coverage for lib/packaging.install and lib/packaging/pypi/wrapper In-Reply-To: <1330782935.14.0.67461963587.issue14183@psf.upfronthosting.co.za> Message-ID: <1330782980.12.0.791332036444.issue14183@psf.upfronthosting.co.za> Changes by Francisco Mart?n Brugu? : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 15:01:42 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Sat, 03 Mar 2012 14:01:42 +0000 Subject: [issue14183] Test coverage for lib/packaging.install and lib/packaging/pypi/wrapper In-Reply-To: <1330782935.14.0.67461963587.issue14183@psf.upfronthosting.co.za> Message-ID: <1330783302.6.0.598968495259.issue14183@psf.upfronthosting.co.za> Changes by Nadeem Vawda : ---------- nosy: +eric.araujo, nadeem.vawda stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 17:25:40 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 03 Mar 2012 16:25:40 +0000 Subject: [issue14183] Test coverage for packaging.install and packaging.pypi.wrapper In-Reply-To: <1330782935.14.0.67461963587.issue14183@psf.upfronthosting.co.za> Message-ID: <1330791940.3.0.115777733733.issue14183@psf.upfronthosting.co.za> ?ric Araujo added the comment: Thanks for the patch. - # Test that the isntalled raises an exception if the project does not + # Test that the installed raises an exception if the project does not It took me many seconds to find the change :) + def test_installation_get_infos_with_ClientWrapper(self): + # Test the use of get_infos default index Hm, I don?t like the method name, and don?t really understand from the comment what it is exactly that you?re testing (I?m not very familiar with p7g.pypi). - install.install_dists = lambda x, y=None: None + install.install_dists = lambda x, y = None: None PEP 8: Never put spaces in a function (or lambda) signature. Let me remark that even if we get to 100% line coverage, or even 100% branch coverage, that won?t mean that we have covered everything. Two personal anecdotes to illustrate my point. In one project, I had a branch covered but actually untested, because I used a ternary operator (something like ?flags = 0 if case_sensitive else re.I?). Another project was a Pylons web app; I had full coverage, and then I tried using non-ASCII and saw that my app was incomplete. So I think that full code coverage is mainly useful in a new project, where you can have 100% all the time and use that metric to avoid adding code without sufficient tests. For a codebase like distutils2 that?s half legacy, half new stuff, it?s harder to achieve that, and maybe less useful than working on other things. If you grep packaging tests for XXX|TODO|FIXME, you?ll find 22 entries. Fixing those may not have an impact on coverage numbers, but will definitely improve things. There are also XXX notes in the code itself, open bugs on this tracker, and some dozen more in my todo lists. For example, packaging.database is supposed to handle zipped eggs, but does it? I really appreciate your contributions, and think that you know enough of the code now to take on a larger bug if you want to. :) ---------- assignee: -> eric.araujo components: +Distutils2 -Tests nosy: +alexis, tarek title: Test coverage for lib/packaging.install and lib/packaging/pypi/wrapper -> Test coverage for packaging.install and packaging.pypi.wrapper versions: +3rd party _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 18:44:11 2012 From: report at bugs.python.org (=?utf-8?q?Francisco_Mart=C3=ADn_Brugu=C3=A9?=) Date: Sat, 03 Mar 2012 17:44:11 +0000 Subject: [issue14183] Test coverage for packaging.install and packaging.pypi.wrapper In-Reply-To: <1330782935.14.0.67461963587.issue14183@psf.upfronthosting.co.za> Message-ID: <1330796651.22.0.100292835093.issue14183@psf.upfronthosting.co.za> Francisco Mart?n Brugu? added the comment: Hi ?ric, > - # Test that the isntalled raises an exception if the project does not > + # Test that the installed raises an exception if the project does not > It took me many seconds to find the change :) The editor told me :) > > + def test_installation_get_infos_with_ClientWrapper(self): > + # Test the use of get_infos default index > Hm, I don?t like the method name, and don?t really understand from the > comment what it is exactly that you?re testing (I?m not very familiar with > p7g.pypi). All the test with get_infos use the index=something. The default is for that parameter is None. If that ocurrs than ClientWrapper will be used. You're right, is not interesting here. May be a new name could be test_installation_get_infos_with_default_index ... or what you wish :) > > - install.install_dists = lambda x, y=None: None > + install.install_dists = lambda x, y = None: None > PEP 8: Never put spaces in a function (or lambda) signature. I cannot find that exactly in pep8. Are you saying is now OK or it was OK? (if it was OK then the editor pep8 has a bug because that was changed when saving) > Let me remark that even if we get to 100% line coverage, or even 100% > branch coverage, that won?t mean that we have covered everything. I'm aware of that but it's a good exercise to learn something about the package. > Two personal anecdotes to illustrate my point. In one project, I had > a branch covered but actually untested, because I used a ternary > operator (something like ?flags = 0 if case_sensitive else re.I?). Pairwise Testing could help :) but of course getting all combinations tested can be impossible. > Another project was a Pylons web app; I had full coverage, and then I > tried using non-ASCII and saw that my app was incomplete. Well if "non-ASCII" was part of the specification then is a bug in the implementation but if not then is a feature :P > So I think that full code coverage is mainly useful in a new project, > where you can have 100% all the time and use that metric to avoid > adding code without sufficient tests. For a codebase like distutils2 > that?s half legacy, half new stuff, it?s harder to achieve that, > and maybe less useful than working on other things. > If you grep packaging tests for XXX|TODO|FIXME, you?ll find 22 > entries. Fixing those may not have an > impact on coverage numbers, but will definitely improve things. > There are also XXX notes in the code itself, > open bugs on this tracker, and some dozen more in my todo lists. For > example, packaging.database is supposed to > handle zipped eggs, but does it? I really appreciate your > contributions, and think that you know enough of the code > now to take on a larger bug if you want to. :) > Well I wanted to try with more line coverage (packging.run) and I got to a point where I have to ask about (just adding another XXX and I prefer to ask first before opening a bug): I'm getting 0 or None as return value for help (and the behavior is different from the command line or from subprocess and directly calling main). -----8<-----8<-----8<-----8<-----8<----- diff -r e67b3a9bd2dc Lib/packaging/tests/test_run.py --- a/Lib/packaging/tests/test_run.py Sat Mar 03 02:38:37 2012 +0100 +++ b/Lib/packaging/tests/test_run.py Sat Mar 03 18:01:35 2012 +0100 @@ -2,6 +2,7 @@ import os import sys +import logging from io import StringIO from packaging import install @@ -9,6 +10,7 @@ from packaging.run import main from test.script_helper import assert_python_ok +from test.support import captured_stdout, captured_stderr # setup script that uses __file__ setup_using___file__ = """\ @@ -67,6 +69,16 @@ self.assertGreater(out, b'') self.assertEqual(err, b'') + # from main directly + args = ('--help',) + with captured_stdout() as out, captured_stderr() as err: + status = main(args) + self.assertGreater(out.getvalue(), '') + self.assertEqual(err.getvalue(), '') + # XXX shouldn't be 0 (no error) to be consistent with the above? + # notice also that the all the messages are in stdout not error + self.assertEqual(status, None) + def test_list_commands(self): status, out, err = assert_python_ok('-m', 'packaging.run', 'run', '--list-commands') @@ -84,6 +96,23 @@ # TODO test that custom commands don't break --list-commands + def test_no_commands(self): + self.assertEqual(main(), 1) + + def test_no_existent_action(self): + args = ('NO_EXISTENT',) + self.assertEqual(main(args), 1) + self.assertIn('NO_EXISTENT', self.get_logs(level=logging.ERROR)[-1]) + + def test_command_help(self): + args = ('list', '--help') + with captured_stdout() as out, captured_stderr() as err: + status = main(args) + # XXX shouldn't be 0 (no error) to be consistent with the + # test_show_help above ? + self.assertEqual(status, None) + self.assertGreater(out.getvalue(), '') + self.assertEqual(err.getvalue(), '') def test_suite(): return unittest.makeSuite(RunTestCase) -----8<-----8<-----8<-----8<-----8<----- Thanks in advance, francis ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 18:47:12 2012 From: report at bugs.python.org (Philip Jenvey) Date: Sat, 03 Mar 2012 17:47:12 +0000 Subject: [issue14126] Speed up list comprehensions by preallocating the list where possible In-Reply-To: <1330212567.11.0.0699848649478.issue14126@psf.upfronthosting.co.za> Message-ID: <1330796832.6.0.6598885062.issue14126@psf.upfronthosting.co.za> Philip Jenvey added the comment: iter(range(10000)) should also see a speedup because range's iter supports __length_hint__ ---------- nosy: +pjenvey _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 18:56:35 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Sat, 03 Mar 2012 17:56:35 +0000 Subject: [issue14183] Test coverage for packaging.install and packaging.pypi.wrapper In-Reply-To: <1330782935.14.0.67461963587.issue14183@psf.upfronthosting.co.za> Message-ID: <1330797395.58.0.120170613609.issue14183@psf.upfronthosting.co.za> Nadeem Vawda added the comment: >> >> - install.install_dists = lambda x, y=None: None >> + install.install_dists = lambda x, y = None: None >> PEP 8: Never put spaces in a function (or lambda) signature. > > I cannot find that exactly in pep8. >From the section "Whitespace in Expressions and Statements": - Don't use spaces around the '=' sign when used to indicate a keyword argument or a default parameter value. Yes: def complex(real, imag=0.0): return magic(r=real, i=imag) No: def complex(real, imag = 0.0): return magic(r = real, i = imag) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 19:24:10 2012 From: report at bugs.python.org (Dionysios Kalofonos) Date: Sat, 03 Mar 2012 18:24:10 +0000 Subject: [issue14184] test_recursion_limit Message-ID: <1330799050.76.0.964372531449.issue14184@psf.upfronthosting.co.za> Changes by Dionysios Kalofonos : ---------- nosy: dk priority: normal severity: normal status: open title: test_recursion_limit _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 19:26:15 2012 From: report at bugs.python.org (Dionysios Kalofonos) Date: Sat, 03 Mar 2012 18:26:15 +0000 Subject: [issue14184] test_recursion_limit Message-ID: <1330799175.64.0.584066086457.issue14184@psf.upfronthosting.co.za> New submission from Dionysios Kalofonos : python compiled with ./configure --with-pydebug CC=clang MACOSX_DEPLOYMENT_TARGET=10.7 make EXTRA_CFLAGS="-Wno-unused-value -Wno-empty-body -Qunused-arguments" ---------- components: +Tests versions: +Python 3.3 Added file: http://bugs.python.org/file24721/test _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 20:00:55 2012 From: report at bugs.python.org (=?utf-8?q?Westley_Mart=C3=ADnez?=) Date: Sat, 03 Mar 2012 19:00:55 +0000 Subject: [issue14185] Failure to build _dbm with ndbm on Arch Linux Message-ID: <1330801255.84.0.367469513946.issue14185@psf.upfronthosting.co.za> New submission from Westley Mart?nez : When building Python I get this: "building dbm using ndbm *** WARNING: renaming "_dbm" since importing it failed: build/lib.linux-i686-3.3-pydebug/_dbm.cpython-33dm.so: undefined symbol: dbm_nextkey Failed to build these modules: _dbm " I'm running Arch and I have gdbm installed so shouldn't it be building dbm with gdbm? ---------- messages: 154845 nosy: anikom15 priority: normal severity: normal status: open title: Failure to build _dbm with ndbm on Arch Linux type: compile error versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 20:20:54 2012 From: report at bugs.python.org (=?utf-8?q?Francisco_Mart=C3=ADn_Brugu=C3=A9?=) Date: Sat, 03 Mar 2012 19:20:54 +0000 Subject: [issue14183] Test coverage for packaging.install and packaging.pypi.wrapper In-Reply-To: <1330782935.14.0.67461963587.issue14183@psf.upfronthosting.co.za> Message-ID: <1330802454.33.0.33260524264.issue14183@psf.upfronthosting.co.za> Francisco Mart?n Brugu? added the comment: Nadeem: > - Don't use spaces around the '=' sign when used to indicate a > keyword argument or a default parameter value. ok, "code formating" is not working as expected (at least for lambdas...) ?ric : > If you grep packaging tests for XXX|TODO|FIXME, you?ll find 22 > entries. Fixing those may not have an impact on coverage numbers, > but will definitely improve things. > There are also XXX notes in the code itself, > open bugs on this tracker, and some dozen more in my todo lists. I've, at least one of your wishes under the radar: 14140 but right now I lack of the time for it and I prefer to get the open issues where I'm helping closed or rejected first (otherwise these is too much open ?fronts? :) ). That one was just curiosity: I've tried with coverage against the whole stdlib and then sorted things in ascending coverage % order and took one: Lib/packaging/pypi/wrapper :) . After looking a bit I came to the default parameter of 'get_infos' ... Cheers, francis ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 20:56:48 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Mar 2012 19:56:48 +0000 Subject: [issue14166] private dispatch table for picklers In-Reply-To: <1330612450.14.0.527502526549.issue14166@psf.upfronthosting.co.za> Message-ID: <1330804608.5.0.444366265398.issue14166@psf.upfronthosting.co.za> Antoine Pitrou added the comment: That looks like a good idea. I don't understand the following code: + try: + self._dispatch_table = self.dispatch_table + except AttributeError: + self._dispatch_table = dispatch_table ... since self.dispatch_table is a property returning self._dispatch_table. Did you mean type(self).dispatch_table? Also, you need to update the docs (which will also make the intended semantics of the patch clearer :-)). ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 20:57:16 2012 From: report at bugs.python.org (=?utf-8?q?Westley_Mart=C3=ADnez?=) Date: Sat, 03 Mar 2012 19:57:16 +0000 Subject: [issue13951] Seg Fault in .so called by ctypes causes the interpreter to Seg Fault In-Reply-To: <1328535030.63.0.73417525944.issue13951@psf.upfronthosting.co.za> Message-ID: <1330804636.6.0.865375441063.issue13951@psf.upfronthosting.co.za> Westley Mart?nez added the comment: Hi I found this bug randomly and have made two small patches to change the documentation. One assumes that the faulthandler module is available for 3.3. The other patch is for earlier versions of Python. ---------- keywords: +patch nosy: +anikom15 versions: +Python 3.3 Added file: http://bugs.python.org/file24722/cpython-13951.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 20:57:35 2012 From: report at bugs.python.org (=?utf-8?q?Westley_Mart=C3=ADnez?=) Date: Sat, 03 Mar 2012 19:57:35 +0000 Subject: [issue13951] Seg Fault in .so called by ctypes causes the interpreter to Seg Fault In-Reply-To: <1328535030.63.0.73417525944.issue13951@psf.upfronthosting.co.za> Message-ID: <1330804655.18.0.674648740376.issue13951@psf.upfronthosting.co.za> Changes by Westley Mart?nez : Added file: http://bugs.python.org/file24723/cpython-13951-pre3.3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 21:00:06 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 03 Mar 2012 20:00:06 +0000 Subject: [issue12328] multiprocessing's overlapped PipeConnection on Windows In-Reply-To: <1307991196.59.0.849860111943.issue12328@psf.upfronthosting.co.za> Message-ID: <1330804806.64.0.583065722119.issue12328@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Hmm, I tried to apply the latest patch to the default branch and it failed. It also seems the patch was done against a changeset (508bc675af63) which doesn't exist in the repo... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 21:09:38 2012 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 03 Mar 2012 20:09:38 +0000 Subject: [issue4773] HTTPMessage not documented and has inconsistent API across Py2/Py3 In-Reply-To: <1230586952.45.0.591912771259.issue4773@psf.upfronthosting.co.za> Message-ID: <1330805378.09.0.843003504471.issue4773@psf.upfronthosting.co.za> Ezio Melotti added the comment: Yep, #12707. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 21:15:12 2012 From: report at bugs.python.org (Chris Rebert) Date: Sat, 03 Mar 2012 20:15:12 +0000 Subject: [issue14186] Link to PEP 3107 in "def" part of Language Reference Message-ID: <1330805711.99.0.463703521532.issue14186@psf.upfronthosting.co.za> New submission from Chris Rebert : The part of the Language Reference concerning the `def` statement (http://docs.python.org/dev/reference/compound_stmts.htm#function-definitions ) should include a See Also link to PEP 3107 "Function Annotations". ---------- assignee: docs at python components: Documentation messages: 154851 nosy: cvrebert, docs at python priority: normal severity: normal status: open title: Link to PEP 3107 in "def" part of Language Reference versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 21:19:17 2012 From: report at bugs.python.org (Chris Rebert) Date: Sat, 03 Mar 2012 20:19:17 +0000 Subject: [issue14187] add "annotation" entry to Glossary Message-ID: <1330805957.18.0.748865462478.issue14187@psf.upfronthosting.co.za> New submission from Chris Rebert : The Glossary should include an entry for "annotation" and/or "function annotation" regarding the language feature introduced by PEP 3107. ---------- assignee: docs at python components: Documentation messages: 154852 nosy: cvrebert, docs at python priority: normal severity: normal status: open title: add "annotation" entry to Glossary versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 21:36:37 2012 From: report at bugs.python.org (Chris Rebert) Date: Sat, 03 Mar 2012 20:36:37 +0000 Subject: [issue13703] Hash collision security issue In-Reply-To: <1325619410.45.0.862265945379.issue13703@psf.upfronthosting.co.za> Message-ID: <1330806997.51.0.595924512566.issue13703@psf.upfronthosting.co.za> Chris Rebert added the comment: The Design and History FAQ (will) need a minor corresponding update: http://docs.python.org/dev/faq/design.html#how-are-dictionaries-implemented ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 22:19:48 2012 From: report at bugs.python.org (Mark Shannon) Date: Sat, 03 Mar 2012 21:19:48 +0000 Subject: [issue14126] Speed up list comprehensions by preallocating the list where possible In-Reply-To: <1330212567.11.0.0699848649478.issue14126@psf.upfronthosting.co.za> Message-ID: <1330809588.85.0.541690874806.issue14126@psf.upfronthosting.co.za> Mark Shannon added the comment: Could you run the benchamrks at http://hg.python.org/benchmarks/ and report the results, for 3.3 (rather than 2.7), please? Adding a new bytecode because it speeds up one 4 line program does not seem such a good idea. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 22:24:25 2012 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Mar 2012 21:24:25 +0000 Subject: [issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers In-Reply-To: <1326709751.32.0.965094376059.issue13797@psf.upfronthosting.co.za> Message-ID: <1330809865.89.0.600841737053.issue13797@psf.upfronthosting.co.za> Stefan Behnel added the comment: FWIW, Cython lets user code implement the buffer interface for extension types using the special methods "__getbuffer__()" and "__releasebuffer__()", so providing the same methods (although with a different signature) also for normal Python types would IMHO fit nicely. ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 23:30:43 2012 From: report at bugs.python.org (=?utf-8?q?Westley_Mart=C3=ADnez?=) Date: Sat, 03 Mar 2012 22:30:43 +0000 Subject: [issue14135] check for locale changes in test.regrtest In-Reply-To: <1330296468.42.0.0463135348779.issue14135@psf.upfronthosting.co.za> Message-ID: <1330813843.73.0.0316213114964.issue14135@psf.upfronthosting.co.za> Westley Mart?nez added the comment: Here's a test that checks for changes to the locale. ---------- nosy: +anikom15 Added file: http://bugs.python.org/file24724/test_14135.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 3 23:34:18 2012 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 03 Mar 2012 22:34:18 +0000 Subject: [issue14135] check for locale changes in test.regrtest In-Reply-To: <1330296468.42.0.0463135348779.issue14135@psf.upfronthosting.co.za> Message-ID: <1330814058.91.0.573365111677.issue14135@psf.upfronthosting.co.za> Ezio Melotti added the comment: Thanks for the patch, but I think Brett meant to say that this should be added to Lib/test/regrtest.py:750, among the other resources. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 00:18:17 2012 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Mar 2012 23:18:17 +0000 Subject: [issue14171] warnings from valgrind about openssl as used by CPython In-Reply-To: <1330670900.9.0.919434132567.issue14171@psf.upfronthosting.co.za> Message-ID: <1330816697.59.0.783486137512.issue14171@psf.upfronthosting.co.za> STINNER Victor added the comment: It remembers me a funny story. http://wiki.debian.org/SSLkeys ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 00:18:54 2012 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Mar 2012 23:18:54 +0000 Subject: [issue14126] Speed up list comprehensions by preallocating the list where possible In-Reply-To: <1330212567.11.0.0699848649478.issue14126@psf.upfronthosting.co.za> Message-ID: <1330816734.04.0.474853794014.issue14126@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 00:56:19 2012 From: report at bugs.python.org (Barry Alan Scott) Date: Sat, 03 Mar 2012 23:56:19 +0000 Subject: [issue14188] Sharing site-packages between Apply and python.org builds breaks extensions Message-ID: <1330818978.97.0.545598673172.issue14188@psf.upfronthosting.co.za> New submission from Barry Alan Scott : I'm testing on Mac OS X 10.7.3 http://bugs.python.org/issue4865 added /Library/Python/2.7/site-packages to the path for python.org built 2.7. This will work for .py files but .so cannot be shared. pysvn will SEGV python.org 2.7 when it is built against apple 2.7. Because /Library/Python/2.7/site-packages is before /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages it is not possible to work around by install two binary kits. To reproduce: Install pysvn 1.7.6 for python.org Then run python.org 2.7 and import pysvn. This will work. Install pysvn 1.7.6 for Apple python. python.org 2.7 import pysvn is now broken. $ /usr/bin/python Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import pysvn >>> pysvn >>> ^D $ /usr/local/bin/python2.7 Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import pysvn Segmentation fault: 11 ---------- components: None messages: 154859 nosy: barry-scott priority: normal severity: normal status: open title: Sharing site-packages between Apply and python.org builds breaks extensions type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:01:02 2012 From: report at bugs.python.org (STINNER Victor) Date: Sun, 04 Mar 2012 00:01:02 +0000 Subject: [issue13964] os.utimensat() and os.futimes() should accept (sec, nsec), drop os.futimens() In-Reply-To: <1328663994.2.0.189878263913.issue13964@psf.upfronthosting.co.za> Message-ID: <1330819262.81.0.518570662117.issue13964@psf.upfronthosting.co.za> STINNER Victor added the comment: utime.patch: ugly draft to add support of (sec, nsec) tuple to os.*utime*() functions. ---------- Added file: http://bugs.python.org/file24725/utime.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:07:37 2012 From: report at bugs.python.org (Barry Alan Scott) Date: Sun, 04 Mar 2012 00:07:37 +0000 Subject: [issue14188] Sharing site-packages between Apply and python.org builds breaks extensions In-Reply-To: <1330818978.97.0.545598673172.issue14188@psf.upfronthosting.co.za> Message-ID: <1330819657.41.0.150856059786.issue14188@psf.upfronthosting.co.za> Barry Alan Scott added the comment: Pysvn binary kits can be downloaded from http://pysvn.tigris.org/files/documents/1233/49180/py27_python_org_pysvn_svn1617-1.7.6-1457-intel.dmg and http://pysvn.tigris.org/files/documents/1233/49178/py27_apple_com_pysvn_svn1617-1.7.6-1457-intel.dmg ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:09:36 2012 From: report at bugs.python.org (Larry Hastings) Date: Sun, 04 Mar 2012 00:09:36 +0000 Subject: [issue13964] os.utimensat() and os.futimes() should accept (sec, nsec), drop os.futimens() In-Reply-To: <1328663994.2.0.189878263913.issue13964@psf.upfronthosting.co.za> Message-ID: <1330819776.9.0.223131187168.issue13964@psf.upfronthosting.co.za> Larry Hastings added the comment: After Guido rejected 410 and said "let's just do nanoseconds, take it to the bug tracker" I created issue #14127. Your having changed this issue to be the same thing means that at least one of 'em is redundant. Could you engage on that issue, or close it, or something? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:19:15 2012 From: report at bugs.python.org (STINNER Victor) Date: Sun, 04 Mar 2012 00:19:15 +0000 Subject: [issue14127] os.stat and os.utime: allow preserving exact metadata In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1330820355.6.0.34275772598.issue14127@psf.upfronthosting.co.za> STINNER Victor added the comment: Because the use case is to copy the access and modification time from a file to another, I would prefer to use the timespec structure: (sec: int, nsec: int). st_atime_ns and st_mtime_ns fields would be added to os.stat() structure: int in range [0; 999999999]. Copy atime and mtime from src to dst: st = os.stat(src) atime = (math.floor(st.st_atime), st.st_atime_ns) mtime = (math.floor(st.st_mtime), st.st_mtime_ns) os.utime(dst, (atime, mtime)) os.utime() would accept int, float or (sec: int, nsec: int) for atime and mtime. Examples: os.utime(name, (1, 1)) os.utime(name, (1.0, 1.0)) os.utime(name, ((1, 0), (1, 0))) ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:21:09 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 04 Mar 2012 00:21:09 +0000 Subject: [issue14127] os.stat and os.utime: allow preserving exact metadata In-Reply-To: <1330820355.6.0.34275772598.issue14127@psf.upfronthosting.co.za> Message-ID: <1330820233.3362.1.camel@localhost.localdomain> Antoine Pitrou added the comment: > os.utime() would accept int, float or (sec: int, nsec: int) for atime and mtime. That's not future-proof for when we have better-than-nanosecond timestamps. See my suggestion above. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:24:24 2012 From: report at bugs.python.org (Larry Hastings) Date: Sun, 04 Mar 2012 00:24:24 +0000 Subject: [issue14127] os.stat and os.utime: allow preserving exact metadata In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1330820664.37.0.722687223014.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: Actually, I'm hoping that by the time we get better than nanosecond resolution, we can also switch to 128-bit floats, and then the existing st_[acm]time field will become the preferred representation once more. What goes around comes around! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:37:59 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 04 Mar 2012 00:37:59 +0000 Subject: [issue14127] os.stat and os.utime: allow preserving exact metadata In-Reply-To: <1330820664.37.0.722687223014.issue14127@psf.upfronthosting.co.za> Message-ID: <1330821242.3362.4.camel@localhost.localdomain> Antoine Pitrou added the comment: > Actually, I'm hoping that by the time we get better than nanosecond > resolution, we can also switch to 128-bit floats, and then the > existing st_[acm]time field will become the preferred representation > once more. What if your hope isn't fulfilled? That doesn't sound like a reasonable decision-making strategy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:38:54 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 04 Mar 2012 00:38:54 +0000 Subject: [issue14085] PyUnicode_WRITE: "comparison is always true" warnings In-Reply-To: <1329900692.24.0.951186261982.issue14085@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset ba0bd949ddf5 by Victor Stinner in branch 'default': Close #14085: remove assertions from PyUnicode_WRITE macro http://hg.python.org/cpython/rev/ba0bd949ddf5 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:40:23 2012 From: report at bugs.python.org (Larry Hastings) Date: Sun, 04 Mar 2012 00:40:23 +0000 Subject: [issue14127] os.stat and os.utime: allow preserving exact metadata In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1330821623.92.0.41442786008.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: Well, Guido has already nixed future-proof formats, see his comments above: "I take full responsibility for fixing the precision at ns." So hope is all I have left. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:43:13 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 04 Mar 2012 00:43:13 +0000 Subject: [issue14127] os.stat and os.utime: allow preserving exact metadata In-Reply-To: <1330821623.92.0.41442786008.issue14127@psf.upfronthosting.co.za> Message-ID: <1330821556.3362.7.camel@localhost.localdomain> Antoine Pitrou added the comment: > Well, Guido has already nixed future-proof formats, see his comments > above: I don't think Guido is *against* future-proof formats per se, he's against them when they have a cost compared to non future-proof ones. The proposal I made (a (integral part, float fractional part) tuple) doesn't have a cost compared to the plain (int seconds, int nanoseconds) tuple proposal. (of course, you can also have nanoseconds as a float, but that starts being weird) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:48:38 2012 From: report at bugs.python.org (Larry Hastings) Date: Sun, 04 Mar 2012 00:48:38 +0000 Subject: [issue14127] os.stat and os.utime: allow preserving exact metadata In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1330822118.97.0.901425898721.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: I grant you that (int, float) is probably, theoretically better than (int, int). But it's academic as Guido has ruled against anything but a straight int representing nanoseconds, and I doubt he's gonna change his mind. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:50:33 2012 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 04 Mar 2012 00:50:33 +0000 Subject: [issue14127] os.stat and os.utime: allow preserving exact metadata In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1330822233.11.0.0397753592848.issue14127@psf.upfronthosting.co.za> Guido van Rossum added the comment: Any solution involving tuple is too ugly. Please stick with the plan. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:50:53 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 04 Mar 2012 00:50:53 +0000 Subject: [issue14127] os.stat and os.utime: allow preserving exact metadata In-Reply-To: <1330822118.97.0.901425898721.issue14127@psf.upfronthosting.co.za> Message-ID: <1330822016.3362.10.camel@localhost.localdomain> Antoine Pitrou added the comment: > I grant you that (int, float) is probably, theoretically better than > (int, int). But it's academic as Guido has ruled against anything but > a straight int representing nanoseconds, and I doubt he's gonna change > his mind. Why not let Guido speak out? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:52:29 2012 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sun, 04 Mar 2012 00:52:29 +0000 Subject: [issue14127] os.stat and os.utime: allow preserving exact metadata In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1330822349.41.0.820668664025.issue14127@psf.upfronthosting.co.za> Arfrever Frehtes Taifersar Arahesis added the comment: The following solution might be compatible with Guido's suggestion: os.stat(path).st_atime_ns -> nanoseconds_since_epoch_as_int os.stat(path).st_ctime_ns -> nanoseconds_since_epoch_as_int os.stat(path).st_mtime_ns -> nanoseconds_since_epoch_as_int atime = os.stat(path).st_atime_ns mtime = os.stat(path).st_mtime_ns os.utime(path, (atime, mtime), resolution="ns") ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 01:57:03 2012 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 04 Mar 2012 00:57:03 +0000 Subject: [issue14127] os.stat and os.utime: allow preserving exact metadata In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1330822623.37.0.900669794685.issue14127@psf.upfronthosting.co.za> Guido van Rossum added the comment: I don't see how that's better than os.utime(path, ns=(atime, mtime)) If you think that in the future you could add resolution="fs", well, you could just as easily add fs=(atime, mtime). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 03:22:57 2012 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Mar 2012 02:22:57 +0000 Subject: [issue14188] Sharing site-packages between Apply and python.org builds breaks extensions In-Reply-To: <1330818978.97.0.545598673172.issue14188@psf.upfronthosting.co.za> Message-ID: <1330827777.12.0.789291348939.issue14188@psf.upfronthosting.co.za> Ned Deily added the comment: Sorry, I can't reproduce the problem. By default and by design, Library/Python/2.7/site-packages comes last in sys.path for the python.org installed Pythons. Are you sure you aren't overriding sys.path with a PYTHONPATH environment variable or some change to site.py? $ /usr/bin/python2.7 Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys; from pprint import pprint as pp ; pp(sys.path) ['', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Users/pyi/Library/Python/2.7/lib/python/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages'] >>> import pysvn >>> pysvn >>> ^D pyb7:~ pyi$ /usr/local/bin/python2.7 Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys; from pprint import pprint as pp ; pp(sys.path) ['', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Users/pyi/Library/Python/2.7/lib/python/site-packages', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages', '/Library/Python/2.7/site-packages'] >>> import pysvn >>> pysvn >>> ---------- assignee: -> ned.deily nosy: +ned.deily resolution: -> works for me stage: -> committed/rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 03:25:22 2012 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Mar 2012 02:25:22 +0000 Subject: [issue14188] Sharing site-packages between Apply and python.org builds breaks extensions In-Reply-To: <1330818978.97.0.545598673172.issue14188@psf.upfronthosting.co.za> Message-ID: <1330827922.22.0.332711729214.issue14188@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 03:35:05 2012 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Mar 2012 02:35:05 +0000 Subject: [issue14184] test_recursion_limit fails on OS X when compiled with clang In-Reply-To: <1330799175.64.0.584066086457.issue14184@psf.upfronthosting.co.za> Message-ID: <1330828505.41.0.0500978394541.issue14184@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- assignee: -> ned.deily nosy: +ned.deily stage: -> needs patch title: test_recursion_limit -> test_recursion_limit fails on OS X when compiled with clang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 04:43:16 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 04 Mar 2012 03:43:16 +0000 Subject: [issue14128] _elementtree should expose types and factory functions consistently with ElementTree In-Reply-To: <1330248620.3.0.71621144947.issue14128@psf.upfronthosting.co.za> Message-ID: <1330832596.68.0.112562281566.issue14128@psf.upfronthosting.co.za> Eli Bendersky added the comment: I'll go on and commit this. The test suite of ET is not bad and all tests keep passing. Stylistic issues and best practices can be fixed later. I want to have other work done on _elementtree, and having several patches to the same source file is very inconvenient. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 05:18:59 2012 From: report at bugs.python.org (Baruch Sterin) Date: Sun, 04 Mar 2012 04:18:59 +0000 Subject: [issue14189] Documentation for some C APIs is missing clear specification of the type of reference they return Message-ID: <1330834739.26.0.103894619612.issue14189@psf.upfronthosting.co.za> New submission from Baruch Sterin : In addition to the description text, most C API functions have a one-line, emphasized specification whether they return a new or a borrowed reference. (e.g. 'Return value: New reference.'). The following API functions are missing that. Some of them, like PyMemoryView_FromBuffer(), have descriptions that are clear, but it would still be nice to have an unambiguous statement like most other API functions have. The list has been generated automatically, so it might contain some errors. Doc/c-api/arg.rst: Py_VaBuildValue Doc/c-api/buffer.rst: PyMemoryView_FromBuffer Doc/c-api/buffer.rst: PyMemoryView_FromObject Doc/c-api/buffer.rst: PyMemoryView_GetContiguous Doc/c-api/bytearray.rst: PyByteArray_Concat Doc/c-api/bytearray.rst: PyByteArray_FromObject Doc/c-api/bytearray.rst: PyByteArray_FromStringAndSize Doc/c-api/code.rst: PyCode_New Doc/c-api/codec.rst: PyCodec_BackslashReplaceErrors Doc/c-api/codec.rst: PyCodec_Decode Doc/c-api/codec.rst: PyCodec_Decoder Doc/c-api/codec.rst: PyCodec_Encode Doc/c-api/codec.rst: PyCodec_Encoder Doc/c-api/codec.rst: PyCodec_IgnoreErrors Doc/c-api/codec.rst: PyCodec_IncrementalDecoder Doc/c-api/codec.rst: PyCodec_IncrementalEncoder Doc/c-api/codec.rst: PyCodec_LookupError Doc/c-api/codec.rst: PyCodec_ReplaceErrors Doc/c-api/codec.rst: PyCodec_StreamReader Doc/c-api/codec.rst: PyCodec_StreamWriter Doc/c-api/codec.rst: PyCodec_StrictErrors Doc/c-api/codec.rst: PyCodec_XMLCharRefReplaceErrors Doc/c-api/exceptions.rst: PyUnicodeDecodeError_Create Doc/c-api/exceptions.rst: PyUnicodeDecodeError_GetEncoding Doc/c-api/exceptions.rst: PyUnicodeDecodeError_GetObject Doc/c-api/exceptions.rst: PyUnicodeDecodeError_GetReason Doc/c-api/exceptions.rst: PyUnicodeEncodeError_Create Doc/c-api/exceptions.rst: PyUnicodeTranslateError_Create Doc/c-api/float.rst: PyFloat_GetInfo Doc/c-api/import.rst: PyImport_GetImporter Doc/c-api/import.rst: PyImport_ImportModuleNoBlock Doc/c-api/import.rst: _PyImport_FindExtension Doc/c-api/import.rst: _PyImport_FixupExtension Doc/c-api/init.rst: PyEval_GetCallStats Doc/c-api/int.rst: PyInt_FromSize_t Doc/c-api/long.rst: PyLong_FromSize_t Doc/c-api/long.rst: PyLong_FromSsize_t Doc/c-api/number.rst: PyNumber_Index Doc/c-api/number.rst: PyNumber_ToBase Doc/c-api/object.rst: PyObject_Bytes Doc/c-api/object.rst: PyObject_GenericGetAttr Doc/c-api/unicode.rst: PyUnicode_AsUTF32String Doc/c-api/unicode.rst: PyUnicode_DecodeMBCSStateful Doc/c-api/unicode.rst: PyUnicode_DecodeUTF32 Doc/c-api/unicode.rst: PyUnicode_DecodeUTF32Stateful Doc/c-api/unicode.rst: PyUnicode_DecodeUTF7 Doc/c-api/unicode.rst: PyUnicode_DecodeUTF7Stateful Doc/c-api/unicode.rst: PyUnicode_EncodeUTF32 Doc/c-api/unicode.rst: PyUnicode_EncodeUTF7 Doc/c-api/veryhigh.rst: PyEval_EvalCodeEx Doc/c-api/veryhigh.rst: PyEval_EvalFrame Doc/c-api/veryhigh.rst: PyEval_EvalFrameEx ---------- assignee: docs at python components: Documentation messages: 154877 nosy: baruch.sterin, docs at python priority: normal severity: normal status: open title: Documentation for some C APIs is missing clear specification of the type of reference they return type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 06:15:58 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 04 Mar 2012 05:15:58 +0000 Subject: [issue14128] _elementtree should expose types and factory functions consistently with ElementTree In-Reply-To: <1330248620.3.0.71621144947.issue14128@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset ce1c26cbe5fb by Eli Bendersky in branch 'default': Issue #14128: Exposing Element as an actual type from _elementtree, rather than a factory function. http://hg.python.org/cpython/rev/ce1c26cbe5fb ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 07:07:08 2012 From: report at bugs.python.org (Baruch Sterin) Date: Sun, 04 Mar 2012 06:07:08 +0000 Subject: [issue14190] Minor C API documentation bugs Message-ID: <1330841228.13.0.736937779561.issue14190@psf.upfronthosting.co.za> New submission from Baruch Sterin : The following functions are documented, but do not exist in the code: * PyCodec_KnownEncoding * PyRun_SimpleFileFlags The following function is documented and exists in the code, but is not exposed through any of the header files: PyParser_SimpleParseStringFlagsFilename The prototype in the documentation is incorrect: * PyOS_stricmp returns int, not char* * PyOS_strnicmp returns int, not char* * PyCode_GetNumFree accepts a PyCodeObject* not PyObject* * PyCode_NewEmpty returns a PyCodeObject* not PyObject* * PyFile_SetBufSize accepts a PyObject*, not PyCodeObject * PyGILState_GetThisThreadState returns PyThreadState* not PyThreadState * PyUnicode_EncodeRawUnicodeEscape accepts 2, not 3 arguments * PyUnicode_RichCompare returns PyObject*, not int * PyType_IS_GC needs a PyTypeObject*, not PyObject* * PyType_HasFeature needs a PyTypeObject*, not PyObject* In addition, PyLong_FromSsize_t and PyLong_FromSsize_t are documented twice in long.html. ---------- assignee: docs at python components: Documentation messages: 154879 nosy: baruch.sterin, docs at python priority: normal severity: normal status: open title: Minor C API documentation bugs type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 07:32:21 2012 From: report at bugs.python.org (Eric Snow) Date: Sun, 04 Mar 2012 06:32:21 +0000 Subject: [issue11477] Bug in code dispatching based on internal slots In-Reply-To: <1299965091.63.0.267715976543.issue11477@psf.upfronthosting.co.za> Message-ID: <1330842741.39.0.944591406568.issue11477@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 07:37:33 2012 From: report at bugs.python.org (Glenn Linderman) Date: Sun, 04 Mar 2012 06:37:33 +0000 Subject: [issue14191] argparse: nargs='*' doesn't parse all positional parameters Message-ID: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> New submission from Glenn Linderman : To me, "all positional parameters" mean whether they are in the front, back or middle, as long as they are not diriectly preceded by an option that can accept an unlimited number of parameters. from argparse import ArgumentParser, SUPPRESS, REMAINDER import sys print( sys.version ) parser = ArgumentParser() parser.add_argument('--foo', dest='foo') parser.add_argument('--bar', dest='bar') parser.add_argument('baz', nargs='*') print( parser.parse_args('a b --foo x --bar 1 c d'.split())) # expected: Namespace(bar='1', baz=['a', 'b', 'c', 'd'], foo='x') # actual: error: unrecognized arguments: c d Above also supplied as a test file, t12.py ---------- components: Library (Lib) files: t12.py messages: 154880 nosy: v+python priority: normal severity: normal status: open title: argparse: nargs='*' doesn't parse all positional parameters type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file24726/t12.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 09:29:05 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 04 Mar 2012 08:29:05 +0000 Subject: [issue14140] packaging tests: add helpers to create and inspect a tree of files In-Reply-To: <1330341730.18.0.549794058583.issue14140@psf.upfronthosting.co.za> Message-ID: <1330849745.53.0.9629155376.issue14140@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 09:39:37 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 04 Mar 2012 08:39:37 +0000 Subject: [issue14128] _elementtree should expose types and factory functions consistently with ElementTree In-Reply-To: <1330248620.3.0.71621144947.issue14128@psf.upfronthosting.co.za> Message-ID: <1330850377.32.0.74189879513.issue14128@psf.upfronthosting.co.za> ?ric Araujo added the comment: An aside: Your commit made me realize that ET tests use monkey-patching instead of now more common idioms like using support.import_fresh_module and using subclasses to run the same tests for a Python and a C module. There is also a doctest that is not executed. You may want to streamline these tests. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 09:51:26 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 04 Mar 2012 08:51:26 +0000 Subject: [issue14188] Sharing site-packages between Apply and python.org builds breaks extensions In-Reply-To: <1330818978.97.0.545598673172.issue14188@psf.upfronthosting.co.za> Message-ID: <1330851086.88.0.474456722352.issue14188@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 09:54:23 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 04 Mar 2012 08:54:23 +0000 Subject: [issue14128] _elementtree should expose types and factory functions consistently with ElementTree In-Reply-To: <1330248620.3.0.71621144947.issue14128@psf.upfronthosting.co.za> Message-ID: <1330851263.22.0.0242055536536.issue14128@psf.upfronthosting.co.za> Eli Bendersky added the comment: ?ric, The tests *do* use import_fresh_module, actually. Moreover, while monkeypatching exists it's rather limited (just setting the module name for test_main). The biggest problem with these tests is that they're based on doctest, which wasn't designed to be too flexible for this purpose. All new tests I'm adding use the unittest infrastructure in a saner way. Rewriting all existing tests from doctest to unittest, while a worthy goal, would be probably too time consuming at this point. If you have any specific suggestions for improvement, please open a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 09:55:27 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 04 Mar 2012 08:55:27 +0000 Subject: [issue14128] _elementtree should expose types and factory functions consistently with ElementTree In-Reply-To: <1330248620.3.0.71621144947.issue14128@psf.upfronthosting.co.za> Message-ID: <1330851327.55.0.318473674255.issue14128@psf.upfronthosting.co.za> Eli Bendersky added the comment: ?ric, The tests *do* use import_fresh_module, actually. Moreover, while monkeypatching exists it's rather limited (just setting the module name for test_main). The biggest problem with these tests is that they're based on doctest, which wasn't designed to be too flexible for this purpose. All new tests I'm adding use the unittest infrastructure in a saner way. Rewriting all existing tests from doctest to unittest, while a worthy goal, would be probably too time consuming at this point. If you have any specific suggestions for improvement, please open a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 09:57:01 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 04 Mar 2012 08:57:01 +0000 Subject: [issue14128] _elementtree should expose types and factory functions consistently with ElementTree In-Reply-To: <1330248620.3.0.71621144947.issue14128@psf.upfronthosting.co.za> Message-ID: <1330851421.47.0.0314158297136.issue14128@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- Removed message: http://bugs.python.org/msg154883 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 09:59:53 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 04 Mar 2012 08:59:53 +0000 Subject: [issue14190] Minor C API documentation bugs In-Reply-To: <1330841228.13.0.736937779561.issue14190@psf.upfronthosting.co.za> Message-ID: <1330851593.54.0.488929106085.issue14190@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- nosy: +eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 10:02:52 2012 From: report at bugs.python.org (Baruch Sterin) Date: Sun, 04 Mar 2012 09:02:52 +0000 Subject: [issue14190] Minor C API documentation bugs In-Reply-To: <1330841228.13.0.736937779561.issue14190@psf.upfronthosting.co.za> Message-ID: <1330851772.02.0.477767917701.issue14190@psf.upfronthosting.co.za> Baruch Sterin added the comment: A few additional ones: The prototype in the documentation is incorrect: * PyFile_SetEncoding accepts PyObject*, not PyFileObject* * PyFile_SetEncodingAndErrors accepts PyObject*, not PyFileObject* PyLong_AsSsize_t is also duplicated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 10:15:55 2012 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Mar 2012 09:15:55 +0000 Subject: [issue14188] Sharing site-packages between Apple and python.org builds breaks extensions In-Reply-To: <1330818978.97.0.545598673172.issue14188@psf.upfronthosting.co.za> Message-ID: <1330852555.89.0.83500887545.issue14188@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- status: open -> pending title: Sharing site-packages between Apply and python.org builds breaks extensions -> Sharing site-packages between Apple and python.org builds breaks extensions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 10:42:34 2012 From: report at bugs.python.org (Redoute) Date: Sun, 04 Mar 2012 09:42:34 +0000 Subject: [issue14192] stdout.encoding not set when redirecting windows command line output Message-ID: <1330854154.2.0.961318278787.issue14192@psf.upfronthosting.co.za> New submission from Redoute : When running a python script from windows command line (cmd.exe) and redirecting its output, stdout.encoding is set to None and printing non-ascii chars fails. Encoding should be the same as without redirecting. Example: [Code unictest.py] # -*- coding: utf-8 -*- from sys import stdout, stderr print >> stderr, 'stdout.encoding: ', stdout.encoding print u'????' [/Code] [windows command prompt] C:\Daten>testunic.py stdout.encoding: cp850 ???? C:\Daten>testunic.py > testunic.txt stdout.encoding: None Traceback (most recent call last): File "C:\Daten\Cmd\testunic.py", line 5, in print u'????????' UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordin al not in range(128) [/windows command prompt] ---------- components: Windows messages: 154885 nosy: Redoute priority: normal severity: normal status: open title: stdout.encoding not set when redirecting windows command line output type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 11:50:14 2012 From: report at bugs.python.org (Barry Alan Scott) Date: Sun, 04 Mar 2012 10:50:14 +0000 Subject: [issue14188] Sharing site-packages between Apple and python.org builds breaks extensions In-Reply-To: <1330818978.97.0.545598673172.issue14188@psf.upfronthosting.co.za> Message-ID: <1330858214.62.0.601046691813.issue14188@psf.upfronthosting.co.za> Barry Alan Scott added the comment: I have wxPython installed. Uninstalling it changes the order of sys.path to this: ['', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages', '/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7', '/Library/Python/2.7/site-packages', '/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7'] I'll take this up with the wxPython folks. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 12:44:49 2012 From: report at bugs.python.org (=?utf-8?q?Francisco_Mart=C3=ADn_Brugu=C3=A9?=) Date: Sun, 04 Mar 2012 11:44:49 +0000 Subject: [issue14183] Test coverage for packaging.install and packaging.pypi.wrapper In-Reply-To: <1330782935.14.0.67461963587.issue14183@psf.upfronthosting.co.za> Message-ID: <1330861489.85.0.525275185584.issue14183@psf.upfronthosting.co.za> Francisco Mart?n Brugu? added the comment: I've updated the patch. Let me know if something has to be changed. ---------- Added file: http://bugs.python.org/file24727/issue14183_fbb9847b8f43.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 12:51:37 2012 From: report at bugs.python.org (Florian M) Date: Sun, 04 Mar 2012 11:51:37 +0000 Subject: [issue14179] Test coverage for lib/re.py In-Reply-To: <1330711634.92.0.5841595214.issue14179@psf.upfronthosting.co.za> Message-ID: <1330861897.5.0.561835862364.issue14179@psf.upfronthosting.co.za> Changes by Florian M : Added file: http://bugs.python.org/file24728/re_coverage.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 13:05:49 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 04 Mar 2012 12:05:49 +0000 Subject: [issue14192] stdout.encoding not set when redirecting windows command line output In-Reply-To: <1330854154.2.0.961318278787.issue14192@psf.upfronthosting.co.za> Message-ID: <1330862749.16.0.748268505751.issue14192@psf.upfronthosting.co.za> Martin v. L?wis added the comment: That is impossible to implement. When outputting to a terminal window, the terminal's encoding is queried and used. When the Python script is run on its own, there may not even exist a terminal encoding. In any case, this issue is resolved in Python 3 (not by setting the encoding to the terminal's encoding, but to the system code page). For 2.7, changing this would be a new feature, so I'm closing this as resolved - please upgrade to Python 3. ---------- nosy: +loewis resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 13:13:35 2012 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 04 Mar 2012 12:13:35 +0000 Subject: [issue13183] pdb skips frames after hitting a breakpoint and running step In-Reply-To: <1318618591.85.0.940577569218.issue13183@psf.upfronthosting.co.za> Message-ID: <1330863215.05.0.486252135598.issue13183@psf.upfronthosting.co.za> Xavier de Gaye added the comment: This message is just a reminder that this 4 months old issue raises the point that the step command in pdb is broken. A patch and test case have been proposed. No comment so far. As the author of pyclewn, a Vim front end to pdb and gdb, I would be grateful for any progress on this problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 13:53:57 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 04 Mar 2012 12:53:57 +0000 Subject: [issue14193] broken link on PEP 385 Message-ID: <1330865637.77.0.994112450027.issue14193@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : The pymigr link on pep385 is broken. ---------- assignee: docs at python components: Documentation messages: 154890 nosy: docs at python, tshepang priority: normal severity: normal status: open title: broken link on PEP 385 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 14:28:48 2012 From: report at bugs.python.org (Georg Brandl) Date: Sun, 04 Mar 2012 13:28:48 +0000 Subject: [issue14193] broken link on PEP 385 In-Reply-To: <1330865637.77.0.994112450027.issue14193@psf.upfronthosting.co.za> Message-ID: <1330867728.86.0.86071055681.issue14193@psf.upfronthosting.co.za> Georg Brandl added the comment: Thanks, fixed in 636320b98756. ---------- nosy: +georg.brandl resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 14:32:50 2012 From: report at bugs.python.org (Redoute) Date: Sun, 04 Mar 2012 13:32:50 +0000 Subject: [issue14192] stdout.encoding not set when redirecting windows command line output In-Reply-To: <1330854154.2.0.961318278787.issue14192@psf.upfronthosting.co.za> Message-ID: <1330867970.99.0.664139618535.issue14192@psf.upfronthosting.co.za> Redoute added the comment: Martin, thanks for your response. I have to take it, although I am not really convinced. The system codepage probably differs from the console codepage (here 1152 vs. 850). Print statements on the other hand are typical for console programs. Calling python.exe (vs. pythonw.exe) means console program means print output has to use console codepage as default. It is disappointing that output changes and programs fail because of a command line redirection. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 14:49:27 2012 From: report at bugs.python.org (sbt) Date: Sun, 04 Mar 2012 13:49:27 +0000 Subject: [issue14166] private dispatch table for picklers In-Reply-To: <1330612450.14.0.527502526549.issue14166@psf.upfronthosting.co.za> Message-ID: <1330868967.44.0.0956939513309.issue14166@psf.upfronthosting.co.za> sbt added the comment: > I don't understand the following code: > ... > since self.dispatch_table is a property returning > self._dispatch_table. Did you mean type(self).dispatch_table? More or less. That code was a botched attempt to match the behaviour of the C implementation. The C implementation does not expose the dispatch table unless it has been explicitly set (on the pickler or the pickler class), and it ignores any "dispatch_table" (or "persistent_id") attribute on the metaclass. I will do a fixed patch with docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 14:49:36 2012 From: report at bugs.python.org (sbt) Date: Sun, 04 Mar 2012 13:49:36 +0000 Subject: [issue12328] multiprocessing's overlapped PipeConnection on Windows In-Reply-To: <1307991196.59.0.849860111943.issue12328@psf.upfronthosting.co.za> Message-ID: <1330868976.95.0.589964055573.issue12328@psf.upfronthosting.co.za> sbt added the comment: > Hmm, I tried to apply the latest patch to the default branch and it > failed. It also seems the patch was done against a changeset > (508bc675af63) which doesn't exist in the repo... I will do an updated patch against a "public" changeset. (I usually use a patch for the project files to disable those extensions which my windows setup cannot compile.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 15:47:24 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 04 Mar 2012 14:47:24 +0000 Subject: [issue14194] typo in pep414 Message-ID: <1330872444.33.0.601967914335.issue14194@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : in pep414: "in additional to" --> "in addition to" ---------- messages: 154895 nosy: tshepang priority: normal severity: normal status: open title: typo in pep414 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 15:47:45 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 04 Mar 2012 14:47:45 +0000 Subject: [issue14194] typo in pep414 In-Reply-To: <1330872444.33.0.601967914335.issue14194@psf.upfronthosting.co.za> Message-ID: <1330872465.16.0.19193194887.issue14194@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 15:50:27 2012 From: report at bugs.python.org (Georg Brandl) Date: Sun, 04 Mar 2012 14:50:27 +0000 Subject: [issue14194] typo in pep414 In-Reply-To: <1330872444.33.0.601967914335.issue14194@psf.upfronthosting.co.za> Message-ID: <1330872627.6.0.727353735495.issue14194@psf.upfronthosting.co.za> Georg Brandl added the comment: Fixed, thanks. ---------- nosy: +georg.brandl resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 15:51:04 2012 From: report at bugs.python.org (sbt) Date: Sun, 04 Mar 2012 14:51:04 +0000 Subject: [issue14166] private dispatch table for picklers In-Reply-To: <1330612450.14.0.527502526549.issue14166@psf.upfronthosting.co.za> Message-ID: <1330872664.85.0.500381373057.issue14166@psf.upfronthosting.co.za> sbt added the comment: Updated patch with docs. ---------- Added file: http://bugs.python.org/file24729/pickle_dispatch.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 15:54:44 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 04 Mar 2012 14:54:44 +0000 Subject: [issue14192] stdout.encoding not set when redirecting windows command line output In-Reply-To: <1330867970.99.0.664139618535.issue14192@psf.upfronthosting.co.za> Message-ID: <20120304155443.Horde.PTDyecL8999PU4IzQIVnG9A@webmail.df.eu> Martin v. L?wis added the comment: > I have to take it, although I am not really convinced. The system > codepage probably differs from the console codepage (here 1152 vs. > 850). Print statements on the other hand are typical for console > programs. Calling python.exe (vs. pythonw.exe) means console program > means print output has to use console codepage as default. I think in practice, this statement is incorrect for most applications. When they use print, they want to create text files, and those will be opened with notepad (or some other text editor on Windows), and will have to be in cp1252. So guessing that it should be cp850 will be incorrect most of the time. In any case, you have perfectly described why the initial design decision in Python 2 was to refuse to guess. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 16:00:43 2012 From: report at bugs.python.org (Georg Brandl) Date: Sun, 04 Mar 2012 15:00:43 +0000 Subject: [issue13704] Random number generator in Python core In-Reply-To: <1325622273.87.0.90076525746.issue13704@psf.upfronthosting.co.za> Message-ID: <1330873243.28.0.224009454882.issue13704@psf.upfronthosting.co.za> Georg Brandl added the comment: Demoting from release blocker since the hash collision issue got remedied differently. If this is not needed anymore, please close. ---------- priority: release blocker -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 16:02:21 2012 From: report at bugs.python.org (Georg Brandl) Date: Sun, 04 Mar 2012 15:02:21 +0000 Subject: [issue12346] Python source code build fails with old mercurial In-Reply-To: <1308212064.93.0.160132143903.issue12346@psf.upfronthosting.co.za> Message-ID: <1330873341.53.0.458440518294.issue12346@psf.upfronthosting.co.za> Georg Brandl added the comment: Is there anything left to do here? It doesn't appear to be a release blocker anymore. ---------- priority: release blocker -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 18:33:29 2012 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Mar 2012 17:33:29 +0000 Subject: [issue14188] Sharing site-packages between Apple and python.org builds breaks extensions In-Reply-To: <1330818978.97.0.545598673172.issue14188@psf.upfronthosting.co.za> Message-ID: <1330882409.04.0.0987194993358.issue14188@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 18:35:50 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 04 Mar 2012 17:35:50 +0000 Subject: [issue14166] private dispatch table for picklers In-Reply-To: <1330612450.14.0.527502526549.issue14166@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset f7a9a10ae0c0 by Antoine Pitrou in branch 'default': Issue #14166: Pickler objects now have an optional `dispatch_table` attribute which allows to set custom per-pickler reduction functions. http://hg.python.org/cpython/rev/f7a9a10ae0c0 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 18:39:05 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 04 Mar 2012 17:39:05 +0000 Subject: [issue14166] private dispatch table for picklers In-Reply-To: <1330612450.14.0.527502526549.issue14166@psf.upfronthosting.co.za> Message-ID: <1330882745.73.0.655018360681.issue14166@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I've replaced occurrences of "pickle.Pickler" with "self.pickler_class" in the tests. Otherwise, the patch looks perfect and I've now committed it. Thank you! ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 18:43:28 2012 From: report at bugs.python.org (sbt) Date: Sun, 04 Mar 2012 17:43:28 +0000 Subject: [issue12328] multiprocessing's overlapped PipeConnection on Windows In-Reply-To: <1307991196.59.0.849860111943.issue12328@psf.upfronthosting.co.za> Message-ID: <1330883008.66.0.755839716789.issue12328@psf.upfronthosting.co.za> sbt added the comment: Updated patch against 2822765e48a7. ---------- Added file: http://bugs.python.org/file24730/pipe_poll_fix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 19:55:51 2012 From: report at bugs.python.org (Christian Heimes) Date: Sun, 04 Mar 2012 18:55:51 +0000 Subject: [issue13704] Random number generator in Python core In-Reply-To: <1325622273.87.0.90076525746.issue13704@psf.upfronthosting.co.za> Message-ID: <1330887351.27.0.289005218166.issue13704@psf.upfronthosting.co.za> Christian Heimes added the comment: Yes, this ticket can be closed unless there is an interest to include the PRNG in the core. ---------- resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 20:09:06 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 04 Mar 2012 19:09:06 +0000 Subject: [issue1040439] Missing documentation on how to link with libpython Message-ID: <1330888146.7.0.0770386695328.issue1040439@psf.upfronthosting.co.za> Eli Bendersky added the comment: ?ric, go ahead :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 20:11:14 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 04 Mar 2012 19:11:14 +0000 Subject: [issue14190] Minor C API documentation bugs In-Reply-To: <1330841228.13.0.736937779561.issue14190@psf.upfronthosting.co.za> Message-ID: <1330888274.89.0.274688169602.issue14190@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- keywords: +easy versions: +Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 20:39:32 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 04 Mar 2012 19:39:32 +0000 Subject: [issue13704] Random number generator in Python core In-Reply-To: <1325622273.87.0.90076525746.issue13704@psf.upfronthosting.co.za> Message-ID: <1330889972.06.0.0800319696931.issue13704@psf.upfronthosting.co.za> Martin v. L?wis added the comment: This is indeed out-of-date. ---------- status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 21:09:56 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 04 Mar 2012 20:09:56 +0000 Subject: [issue14176] Fix unicode literals In-Reply-To: <1330691816.89.0.158769455512.issue14176@psf.upfronthosting.co.za> Message-ID: <1330891796.03.0.869527048282.issue14176@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I propose to close this issue as invalid (although out-of-date might be fine as well). Jean-Michel is apparently unable to describe what issue *precisely* he wants to see fixed, rather than just complaining that open source is a disaster. I don't think we can anything do about open source being a disaster, and I'm not able to reproduce that perception. Jean-Michel: please try to use this bug tracker in the way it is intended, i.e. report one bug at time, following this structure: - this is what I did - this is what happened - this is what should have happened instead ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 21:16:48 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 04 Mar 2012 20:16:48 +0000 Subject: [issue14171] warnings from valgrind about openssl as used by CPython In-Reply-To: <1330670900.9.0.919434132567.issue14171@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 9a69b47f194e by Martin v. L?wis in branch 'default': Issue #14171: Add valgrind suppressions for OpenSSL issue. http://hg.python.org/cpython/rev/9a69b47f194e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 21:17:46 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 04 Mar 2012 20:17:46 +0000 Subject: [issue14171] warnings from valgrind about openssl as used by CPython In-Reply-To: <1330670900.9.0.919434132567.issue14171@psf.upfronthosting.co.za> Message-ID: <1330892266.05.0.816327056951.issue14171@psf.upfronthosting.co.za> Martin v. L?wis added the comment: It may indeed be that recompiling OpenSSL properly could fix this. I added this anyway since it probably doesn't cause harm. Thanks for the patch. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 21:28:40 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 04 Mar 2012 20:28:40 +0000 Subject: [issue14195] WeakSet has ordering relations wrong Message-ID: <1330892920.08.0.914795848044.issue14195@psf.upfronthosting.co.za> New submission from Antoine Pitrou : >>> a = weakref.WeakSet() >>> a < a True >>> a > a True ---------- components: Library (Lib) messages: 154910 nosy: pitrou priority: normal severity: normal stage: needs patch status: open title: WeakSet has ordering relations wrong type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 21:39:13 2012 From: report at bugs.python.org (Evgeny Kapun) Date: Sun, 04 Mar 2012 20:39:13 +0000 Subject: [issue1508475] transparent gzip compression in urllib Message-ID: <1330893553.84.0.5945873092.issue1508475@psf.upfronthosting.co.za> Changes by Evgeny Kapun : ---------- nosy: +abacabadabacaba _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 21:51:31 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 04 Mar 2012 20:51:31 +0000 Subject: [issue14168] Bug in minidom 3.3 after optimization patch In-Reply-To: <1330622499.39.0.488658908154.issue14168@psf.upfronthosting.co.za> Message-ID: <1330894291.49.0.346973220812.issue14168@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Instead of calling _ensure_attributes (which creates the attribute dictionaries), getAttribute should return "" immediately if there are no attributes at all, to avoid creating those dictionaries. I'll do a patch shortly, unless somebody beats me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 22:27:04 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 04 Mar 2012 21:27:04 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1330896424.24.0.19751063393.issue2377@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I have taken a look at the latest code again, and I'm worried that import.c still has large chunks of code dealing with module finding and loading. These functionalities should be redirected to the corresponding importlib code instead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 4 23:16:58 2012 From: report at bugs.python.org (Ralf Schmitt) Date: Sun, 04 Mar 2012 22:16:58 +0000 Subject: [issue13719] bdist_msi upload fails In-Reply-To: <1325855918.9.0.207720990162.issue13719@psf.upfronthosting.co.za> Message-ID: <1330899418.86.0.220338113535.issue13719@psf.upfronthosting.co.za> Ralf Schmitt added the comment: sorry, I'm currently short on time and don't use windows at the moment. bdist_msi runs without user interaction. just let the buildbots test it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 00:40:59 2012 From: report at bugs.python.org (Jay Deiman) Date: Sun, 04 Mar 2012 23:40:59 +0000 Subject: [issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect In-Reply-To: <1330382649.62.0.524230876085.issue14144@psf.upfronthosting.co.za> Message-ID: <1330904459.32.0.493513521744.issue14144@psf.upfronthosting.co.za> Jay Deiman added the comment: I have no problem making doc and test changes. I'll probably need a pointer as to where these changes need to be made and submitted to, but like you said, I'll wait until the patch is accepted before doing that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 01:14:09 2012 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 05 Mar 2012 00:14:09 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1330906449.65.0.985166161939.issue2377@psf.upfronthosting.co.za> Nick Coghlan added the comment: Yes, the import related C API should be turned into a mere wrapper around the appropriate importlib code wherever possible. I don't think that needs to be a gating criteria for the initial commit, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 01:15:16 2012 From: report at bugs.python.org (Simon Chopin) Date: Mon, 05 Mar 2012 00:15:16 +0000 Subject: [issue14196] Unhandled exceptions in pdb return value display Message-ID: <1330906516.74.0.432612109172.issue14196@psf.upfronthosting.co.za> New submission from Simon Chopin : This issue occurred at least in Python 2.7, I haven't checked in other versions. When stepping on a return statement, pdb calls the return value __str__() method to display it at the end of the line. Only, it doesn't handle the potential exceptions raised within those functions. An exemple would be: import pdb class A(object): def __new__(cls): pdb.set_trace() return super(A, cls).__new__() def __init__(self): self.value = "Foo" def __str__(self): return self.value pdb.run("A()") When using the step by step, pdb will be interrupted by an unhandled AttributeError. ---------- components: Library (Lib) messages: 154916 nosy: Simon.Chopin priority: normal severity: normal status: open title: Unhandled exceptions in pdb return value display versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 01:23:03 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 05 Mar 2012 00:23:03 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1330906449.65.0.985166161939.issue2377@psf.upfronthosting.co.za> Message-ID: <1330906744.3434.0.camel@localhost.localdomain> Antoine Pitrou added the comment: > I don't think that needs to be a gating criteria for the initial commit, though. I think it should, otherwise we will end up in a situation worse than currently (we will have two competing default implementations of import, depending which API you invoke). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 01:45:11 2012 From: report at bugs.python.org (Meador Inge) Date: Mon, 05 Mar 2012 00:45:11 +0000 Subject: [issue14195] WeakSet has ordering relations wrong In-Reply-To: <1330892920.08.0.914795848044.issue14195@psf.upfronthosting.co.za> Message-ID: <1330908311.02.0.438583743546.issue14195@psf.upfronthosting.co.za> Meador Inge added the comment: Ouch, WeakSet.__lt__ and WeakSet.__gt__ are defined in terms of set.issubset and set.issuperset, respectively. set.issubset and set.issuperset are *not* proper subset and superset operations, thus the error. The attached patch fixes this. ---------- keywords: +patch nosy: +meador.inge Added file: http://bugs.python.org/file24731/issue14195-v1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 01:55:13 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Mar 2012 00:55:13 +0000 Subject: [issue14195] WeakSet has ordering relations wrong In-Reply-To: <1330892920.08.0.914795848044.issue14195@psf.upfronthosting.co.za> Message-ID: <1330908913.16.0.693632627897.issue14195@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 thanks for fixing this ---------- nosy: +rhettinger priority: normal -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 05:43:35 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 04:43:35 +0000 Subject: [issue14195] WeakSet has ordering relations wrong In-Reply-To: <1330892920.08.0.914795848044.issue14195@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 4b3f1decb1af by Meador Inge in branch '2.7': Issue #14195: Make WeakSet.__lt__ and WeakSet.__gt__ irreflexive. http://hg.python.org/cpython/rev/4b3f1decb1af New changeset 5b88475aae96 by Meador Inge in branch '3.2': Issue #14195: Make WeakSet.__lt__ and WeakSet.__gt__ irreflexive. http://hg.python.org/cpython/rev/5b88475aae96 New changeset 31dc8fe15b02 by Meador Inge in branch 'default': Issue #14195: Make WeakSet.__lt__ and WeakSet.__gt__ irreflexive. http://hg.python.org/cpython/rev/31dc8fe15b02 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 05:44:55 2012 From: report at bugs.python.org (Meador Inge) Date: Mon, 05 Mar 2012 04:44:55 +0000 Subject: [issue14195] WeakSet has ordering relations wrong In-Reply-To: <1330892920.08.0.914795848044.issue14195@psf.upfronthosting.co.za> Message-ID: <1330922696.0.0.424633794427.issue14195@psf.upfronthosting.co.za> Changes by Meador Inge : ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 05:50:39 2012 From: report at bugs.python.org (Meador Inge) Date: Mon, 05 Mar 2012 04:50:39 +0000 Subject: [issue14189] Documentation for some C APIs is missing clear specification of the type of reference they return In-Reply-To: <1330834739.26.0.103894619612.issue14189@psf.upfronthosting.co.za> Message-ID: <1330923039.68.0.959175080197.issue14189@psf.upfronthosting.co.za> Changes by Meador Inge : ---------- nosy: +meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 05:51:16 2012 From: report at bugs.python.org (Meador Inge) Date: Mon, 05 Mar 2012 04:51:16 +0000 Subject: [issue14184] test_recursion_limit fails on OS X when compiled with clang In-Reply-To: <1330799175.64.0.584066086457.issue14184@psf.upfronthosting.co.za> Message-ID: <1330923076.58.0.262959831996.issue14184@psf.upfronthosting.co.za> Changes by Meador Inge : ---------- nosy: +meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 05:54:43 2012 From: report at bugs.python.org (Meador Inge) Date: Mon, 05 Mar 2012 04:54:43 +0000 Subject: [issue13951] Seg Fault in .so called by ctypes causes the interpreter to Seg Fault In-Reply-To: <1328535030.63.0.73417525944.issue13951@psf.upfronthosting.co.za> Message-ID: <1330923283.01.0.805748225324.issue13951@psf.upfronthosting.co.za> Changes by Meador Inge : ---------- nosy: +meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 05:56:25 2012 From: report at bugs.python.org (Meador Inge) Date: Mon, 05 Mar 2012 04:56:25 +0000 Subject: [issue14181] Support getbuffer redirection scheme in memoryview In-Reply-To: <1330763362.99.0.43231376241.issue14181@psf.upfronthosting.co.za> Message-ID: <1330923385.67.0.789993081589.issue14181@psf.upfronthosting.co.za> Changes by Meador Inge : ---------- nosy: +meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 05:57:08 2012 From: report at bugs.python.org (shibingli) Date: Mon, 05 Mar 2012 04:57:08 +0000 Subject: [issue14197] MacOS10.7 compiled uWSGI the issue. Message-ID: <1330923428.91.0.0488366772742.issue14197@psf.upfronthosting.co.za> New submission from shibingli : Artificial libpython3.2.a soft links to libpython3.2m.a ---------- components: None messages: 154921 nosy: shibingli priority: normal severity: normal status: open title: MacOS10.7 compiled uWSGI the issue. type: compile error versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 05:57:20 2012 From: report at bugs.python.org (Meador Inge) Date: Mon, 05 Mar 2012 04:57:20 +0000 Subject: [issue14169] compiler.compile fails on "if" statement in attached file In-Reply-To: <1330624985.96.0.952704814324.issue14169@psf.upfronthosting.co.za> Message-ID: <1330923440.92.0.0841110312083.issue14169@psf.upfronthosting.co.za> Changes by Meador Inge : ---------- nosy: +meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 06:17:35 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 05 Mar 2012 05:17:35 +0000 Subject: [issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect In-Reply-To: <1330382649.62.0.524230876085.issue14144@psf.upfronthosting.co.za> Message-ID: <1330924655.02.0.706511940474.issue14144@psf.upfronthosting.co.za> ?ric Araujo added the comment: > I have no problem making doc and test changes. I'll probably need a > pointer as to where these changes need to be made Great! I think the right test file is Lib/test/test_urllib2.py (the test files were not renamed in Python 3 when some modules were renamed); there is a test_redirect method that should be the right place. Senthil will confirm. Remember to work from a 3.3 checkout (i.e. the default branch of http://hg.python.org/cpython). More help about contributing (like where to find files) is at http://docs.python.org/devguide. > and submitted to, Just as a patch on this report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 06:18:43 2012 From: report at bugs.python.org (Ned Deily) Date: Mon, 05 Mar 2012 05:18:43 +0000 Subject: [issue14197] MacOS10.7 compiled uWSGI the issue. In-Reply-To: <1330923428.91.0.0488366772742.issue14197@psf.upfronthosting.co.za> Message-ID: <1330924723.88.0.682134684992.issue14197@psf.upfronthosting.co.za> Ned Deily added the comment: Sorry, can you explain better what problem you are seeing including specific error messages? ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 06:21:20 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 05 Mar 2012 05:21:20 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1330924880.72.0.730559575393.issue11379@psf.upfronthosting.co.za> ?ric Araujo added the comment: This alternate version of my patch (a) merges the first two paragraphs to make the intro less redundant and heavy, and (b) reorganizes a bit the list of modules in Doc/library/markup.rst to have xml.etree first and pyexpat (less interesting for most people) at the end. Tell me if you prefer this version, or if I should commit the first one (possibly with the (b) change). ---------- Added file: http://bugs.python.org/file24732/minidom-desc-2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 06:29:31 2012 From: report at bugs.python.org (shibingli) Date: Mon, 05 Mar 2012 05:29:31 +0000 Subject: [issue14197] MacOS10.7 compiled uWSGI the issue. In-Reply-To: <1330923428.91.0.0488366772742.issue14197@psf.upfronthosting.co.za> Message-ID: <1330925371.37.0.196190158222.issue14197@psf.upfronthosting.co.za> shibingli added the comment: Use the Mac OS 10.7 compiler uWSGI Makefile.Py32 (make-f), will report a compile error. Information in the annex.Artificially will the soft libpython3.2.a / Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config-3.2m under connection to a libpython3.2m.a, the problem-solving. ---------- Added file: http://bugs.python.org/file24733/py32_uWSGI.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 06:30:55 2012 From: report at bugs.python.org (shibingli) Date: Mon, 05 Mar 2012 05:30:55 +0000 Subject: [issue14197] MacOS10.7 compiled uWSGI the issue. In-Reply-To: <1330924723.88.0.682134684992.issue14197@psf.upfronthosting.co.za> Message-ID: shibingli added the comment: Has been revised to permit BUG Description ? 2012-3-5???1:18? Ned Deily ??? > > Ned Deily added the comment: > > Sorry, can you explain better what problem you are seeing including specific error messages? > > ---------- > nosy: +ned.deily > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 07:01:58 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 06:01:58 +0000 Subject: [issue14168] Bug in minidom 3.3 after optimization patch In-Reply-To: <1330622499.39.0.488658908154.issue14168@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 73c76466cf44 by Martin v. L?wis in branch 'default': Issue #14168: Check for presence of _attrs before accessing it. http://hg.python.org/cpython/rev/73c76466cf44 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 07:02:34 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 05 Mar 2012 06:02:34 +0000 Subject: [issue14168] Bug in minidom 3.3 after optimization patch In-Reply-To: <1330622499.39.0.488658908154.issue14168@psf.upfronthosting.co.za> Message-ID: <1330927354.56.0.231505238014.issue14168@psf.upfronthosting.co.za> Changes by Martin v. L?wis : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 07:06:17 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 05 Mar 2012 06:06:17 +0000 Subject: [issue14114] 2.7.3rc1 chm gives JS error In-Reply-To: <1330114530.4.0.50026951866.issue14114@psf.upfronthosting.co.za> Message-ID: <1330927577.09.0.255709019162.issue14114@psf.upfronthosting.co.za> Martin v. L?wis added the comment: It worked fine in the 3.3a1 chm, so I consider it indeed fixed. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 07:44:27 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 05 Mar 2012 06:44:27 +0000 Subject: [issue14174] argparse.REMAINDER fails to parse remainder correctly In-Reply-To: <1330690090.15.0.511487898244.issue14174@psf.upfronthosting.co.za> Message-ID: <1330929867.18.0.637714701849.issue14174@psf.upfronthosting.co.za> ?ric Araujo added the comment: Thanks for the report. Could you edit your script to add the expected results, for example Namespace(foo=..., command=[...])? ---------- nosy: +eric.araujo stage: -> needs patch versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 07:46:37 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 05 Mar 2012 06:46:37 +0000 Subject: [issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters In-Reply-To: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> Message-ID: <1330929997.6.0.507225499816.issue14191@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +bethard title: argparse: nargs='*' doesn't parse all positional parameters -> argparse: nargs='*' doesn't get out-of-order positional parameters versions: +Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 07:47:46 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 05 Mar 2012 06:47:46 +0000 Subject: [issue14190] Minor C API documentation bugs In-Reply-To: <1330841228.13.0.736937779561.issue14190@psf.upfronthosting.co.za> Message-ID: <1330930066.13.0.600725273473.issue14190@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +haypo, loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 09:09:22 2012 From: report at bugs.python.org (Ned Deily) Date: Mon, 05 Mar 2012 08:09:22 +0000 Subject: [issue14197] OS X framework builds do not create ABI-suffixed libpython3.x In-Reply-To: <1330923428.91.0.0488366772742.issue14197@psf.upfronthosting.co.za> Message-ID: <1330934962.55.0.0188434293089.issue14197@psf.upfronthosting.co.za> Ned Deily added the comment: Thank you for the additional information. It appears the problem is that, for OS X framework builds, the ABI suffix (added in PEP 3149) is not used to create the shared library dylib name in the framework lib directory. For example, $ cd Library/Frameworks/Python.framework/Versions/3.2 $ ./bin/python3.2-config --libs -ldl -framework CoreFoundation -lpython3.2m $ ls -l ./lib total 8 lrwxr-xr-x 1 root wheel 9 Feb 24 09:44 libpython3.2.dylib@ -> ../Python drwxrwxr-x 2 root admin 170 Feb 24 08:49 pkgconfig/ drwxrwxr-x 32 root admin 6290 Feb 24 08:49 python3.2/ But in an --enable-shared --with-pydebug build: $ ./bin/python3.2-config --libs -ldl -framework CoreFoundation -lpython3.2dm $ ls -l ./lib total 6920 -r-xr-xr-x 1 nad pyd 3541320 Mar 4 23:40 libpython3.2dm.dylib* drwxr-xr-x 2 nad pyd 170 Mar 4 23:40 pkgconfig/ drwxr-xr-x 32 nad pyd 6290 Mar 4 23:40 python3.2/ Looks like target frameworkinstallmaclib in Makefile.pre.in needs to be changed to include SOABI in the name for the lib symlink. ---------- assignee: -> ned.deily components: +Macintosh stage: -> needs patch title: MacOS10.7 compiled uWSGI the issue. -> OS X framework builds do not create ABI-suffixed libpython3.x versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 09:37:29 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 08:37:29 +0000 Subject: [issue14181] Support getbuffer redirection scheme in memoryview In-Reply-To: <1330763362.99.0.43231376241.issue14181@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset f1441971b621 by Stefan Krah in branch 'default': Issue #14181: Allow memoryview construction from an object that uses the http://hg.python.org/cpython/rev/f1441971b621 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 09:41:26 2012 From: report at bugs.python.org (=?utf-8?q?Lars_Gust=C3=A4bel?=) Date: Mon, 05 Mar 2012 08:41:26 +0000 Subject: [issue14160] TarFile.extractfile fails to extract targets of top-level relative symlinks In-Reply-To: <1330530660.51.0.926091322087.issue14160@psf.upfronthosting.co.za> Message-ID: <1330936886.6.0.479801618103.issue14160@psf.upfronthosting.co.za> Changes by Lars Gust?bel : ---------- assignee: -> lars.gustaebel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 10:02:38 2012 From: report at bugs.python.org (Stefan Krah) Date: Mon, 05 Mar 2012 09:02:38 +0000 Subject: [issue14181] Support getbuffer redirection scheme in memoryview In-Reply-To: <1330763362.99.0.43231376241.issue14181@psf.upfronthosting.co.za> Message-ID: <1330938158.88.0.731183009672.issue14181@psf.upfronthosting.co.za> Stefan Krah added the comment: I didn't ask for review since in the production code only the assert() line is removed. There are a couple of new tests and I have a private version of test_buffer that runs most tests with an ndarray chain using either redirection or re-exporting. As expected, there are no problems in allowing getbuffer redirection. Leaving this open as a documentation issue. ---------- components: +Documentation stage: test needed -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 10:19:40 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 05 Mar 2012 09:19:40 +0000 Subject: [issue13183] pdb skips frames after hitting a breakpoint and running step In-Reply-To: <1318618591.85.0.940577569218.issue13183@psf.upfronthosting.co.za> Message-ID: <1330939180.3.0.459120311437.issue13183@psf.upfronthosting.co.za> Senthil Kumaran added the comment: It's an interesting issue. Thanks for the report and patch, Xavier. I am setting patch to needing review. ---------- keywords: +needs review -patch nosy: +orsenthil versions: +Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 10:30:16 2012 From: report at bugs.python.org (Stefan Krah) Date: Mon, 05 Mar 2012 09:30:16 +0000 Subject: [issue14198] Backport parts of the new memoryview documentation Message-ID: <1330939816.35.0.731110214123.issue14198@psf.upfronthosting.co.za> New submission from Stefan Krah : Nick's comment from #10181: "It occurs to me that one thing that *could* be backported to early versions are some of the documentation improvements on how to correctly handle the lifecycle of fields in Py_buffer. That gets messy though because memoryview doesn't behave nicely in those versions, so we'd be violating our own guidelines. Perhaps the relevant sections should be updated with a reference saying that the semantics have been cleaned up in 3.3, and if in doubt, try to follow the 3.3 documentation?" ---------- assignee: skrah components: Documentation messages: 154934 nosy: ncoghlan, pitrou, skrah priority: normal severity: normal status: open title: Backport parts of the new memoryview documentation type: enhancement versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 10:43:03 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 09:43:03 +0000 Subject: [issue14007] xml.etree.ElementTree - XMLParser and TreeBuilder's doctype() method missing In-Reply-To: <1329193190.72.0.667201124226.issue14007@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 39cc025968f1 by Florent Xicluna in branch 'default': Issue #14007: drop unused TreeBuilder().xml. http://hg.python.org/cpython/rev/39cc025968f1 New changeset 47016103185f by Florent Xicluna in branch 'default': Issue #14007: accept incomplete TreeBuilder objects (missing start/end/data/close) for the Python implementation as well. Add disabled tests for the doctype() method. http://hg.python.org/cpython/rev/47016103185f ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 10:44:34 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 09:44:34 +0000 Subject: [issue12151] test_logging fails sometimes In-Reply-To: <1306106163.56.0.790245092521.issue12151@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 0457fb8bf39c by Vinay Sajip in branch 'default': Added more diagnostics for diagnosing #12151. http://hg.python.org/cpython/rev/0457fb8bf39c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 10:51:06 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 09:51:06 +0000 Subject: [issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?) In-Reply-To: <1287858158.95.0.0752296181045.issue10181@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 373f6cdc6d08 by Stefan Krah in branch 'default': Issue #10181: The decision was to raise a buffer error in memory_exit() http://hg.python.org/cpython/rev/373f6cdc6d08 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 10:51:30 2012 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 05 Mar 2012 09:51:30 +0000 Subject: [issue14098] provide public C-API for reading/setting sys.exc_info() In-Reply-To: <1329983921.26.0.0291312337524.issue14098@psf.upfronthosting.co.za> Message-ID: <1330941090.86.0.520656211368.issue14098@psf.upfronthosting.co.za> Changes by Stefan Behnel : Added file: http://bugs.python.org/file24734/pyerr_getexcinfo.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 10:56:07 2012 From: report at bugs.python.org (=?utf-8?q?Lars_Gust=C3=A4bel?=) Date: Mon, 05 Mar 2012 09:56:07 +0000 Subject: [issue14160] TarFile.extractfile fails to extract targets of top-level relative symlinks In-Reply-To: <1330530660.51.0.926091322087.issue14160@psf.upfronthosting.co.za> Message-ID: <1330941367.16.0.255989947136.issue14160@psf.upfronthosting.co.za> Lars Gust?bel added the comment: Thanks for the report. Attached is a patch (against 3.2) that is supposed to fix the problem. ---------- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file24735/issue14160.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 10:56:43 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Mon, 05 Mar 2012 09:56:43 +0000 Subject: [issue1531415] parsetok.c emits warnings by writing to stderr Message-ID: <1330941403.47.0.858783737013.issue1531415@psf.upfronthosting.co.za> Michele Orr? added the comment: For what I saw these days, Parser/tokenizer.c should import warnings.h (in order to use PyErr_WarnEx()), but Python/_warnings.c imports Python.h, that requires pgen ready. This leads to a circular dependency. Am I wrong / missing something? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 11:10:55 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 05 Mar 2012 10:10:55 +0000 Subject: [issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect In-Reply-To: <1330382649.62.0.524230876085.issue14144@psf.upfronthosting.co.za> Message-ID: <1330942255.5.0.389627781673.issue14144@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Hi Jay & ?ric, I understand your points and providing an extra argument seems like an idea that could be useful to circumvent , what you see as a problem. The RFC section states that - "The action required MAY be carried out by the user agent without interaction with the user if and only if the method used in the second request is GET or HEAD". By this, I understand, RFC means, for the POST data, the user is made aware and is conscious of the redirect which is happening and is "permitting" to POST the data to new location. The interaction happens like this: User: Post to /a Browser: Posts to /a and Server says oh /a is /b Browser: Hello user! Server says /a is now /b. Shall I post to /b? User: Yes, you may. This is different from what you are saying, which is like with having an option in the browser settings which will enable following redirect on POST. User: Post to /a (and if there is redirect follow that post to the corresponding site). Browser: Posts to /a and Server says /a is /b. Browser: Posts to /b But do you know if any such browser setting exist? No. Browsers for good reasons do not provide such a setting and they prompt user if they want to follow the redirect with POST. In a similar way, developers using urllib as library in their applications can obtain the redirected URL and then POST to the redirected URL. That would be equivalent behavior. Providing an automatic follow redirect on POST could serious security issue, both for clients/libraries and browser. Even with a word of caution, it has a high chance of being misused. So, I am -1 on this proposal. I hope you understand my argument. I had thought about this earlier a for a similar issue and I remember we made the decision to drop the data following the redirected POST. If my argument is not convincing enough, then I think, it would be good idea to bring this bug to discussion on python-dev or web-sig and provide some concrete real world examples. That could bring some use cases for/against this issue and might be helpful. Thanks, Senthil ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 11:54:29 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 05 Mar 2012 10:54:29 +0000 Subject: [issue2403] Add figleaf coverage metrics In-Reply-To: <1205869378.43.0.216108511876.issue2403@psf.upfronthosting.co.za> Message-ID: <1330944869.72.0.0718502066514.issue2403@psf.upfronthosting.co.za> ?ric Araujo added the comment: Adding people interested in code coverage to nosy. ---------- nosy: +giampaolo.rodola, ncoghlan versions: +Python 3.3 -Python 2.7, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 12:15:38 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 05 Mar 2012 11:15:38 +0000 Subject: [issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect In-Reply-To: <1330382649.62.0.524230876085.issue14144@psf.upfronthosting.co.za> Message-ID: <1330946138.57.0.239974308717.issue14144@psf.upfronthosting.co.za> ?ric Araujo added the comment: > "The action required MAY be carried out by the user agent without interaction with the user if and > only if the method used in the second request is GET or HEAD". > > By this, I understand, RFC means, for the POST data, the user is made aware and is conscious of the > redirect which is happening and is "permitting" to POST the data to new location. My reading too. > The interaction happens like this: > User: Post to /a > Browser: Posts to /a and Server says oh /a is /b > Browser: Hello user! Server says /a is now /b. Shall I post to /b? > User: Yes, you may. > > This is different from what you are saying, which is like with having an option in the browser settings > which will enable following redirect on POST. The big difference that I see is that urllib is a library, not a browser. A browser could be implemented on top of urllib, and it is the browser?s responsibility to ask the user if they want POST data to be sent again. The browser then needs to tell urllib to forward POST data: this is the piece that?s missing. > In a similar way, developers using urllib as library in their applications can obtain the redirected URL > and then POST to the redirected URL. That would be equivalent behavior. Ah, so there is a way to achieve it! If Jay is satisfied by this, we could add an example of using that in the urllib howto, with the appropriate warnings. That would have much less risk than a new parameter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 13:33:28 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Mar 2012 12:33:28 +0000 Subject: [issue14199] Keep a refence to mro in _PyType_Lookup() and super_getattro() Message-ID: <1330950808.29.0.801414525121.issue14199@psf.upfronthosting.co.za> New submission from STINNER Victor : Lib/test/crashers/losing_mro_ref.py does crash Python: _PyType_Lookup() borrows a reference to the type MRO, but the type MRO is replaced during the lookup. Python crashs because it reads an item from a tuple that was destroyed (in the specific test, it reads an item from a newly created tuple which is not the type MRO). Attached patch keeps a strong reference to the type MRO during the lookup to workaround this crasher. It fixes Lib/test/crashers/losing_mro_ref.py. If changing temporary has an impact on performances, a guard can be used to check that the type MRO has not been changed during the lookup. ---------- components: Interpreter Core files: type_lookup_mro.patch keywords: patch messages: 154943 nosy: haypo priority: normal severity: normal status: open title: Keep a refence to mro in _PyType_Lookup() and super_getattro() type: crash versions: Python 3.3 Added file: http://bugs.python.org/file24736/type_lookup_mro.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 13:39:36 2012 From: report at bugs.python.org (Vlastimil Brom) Date: Mon, 05 Mar 2012 12:39:36 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character Message-ID: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> New submission from Vlastimil Brom : Hi, while testing python 3.3a1 a bit, especially the new string handling of non-BMP characters, I noticed a problem in Idle in this regard: Python 3.3.0a1 (default, Mar 4 2012, 17:27:59) [MSC v.1500 32 bit (Intel)] on win32 ... [using win XPp SP3 Czech] >>> got_ahsa = "\N{GOTHIC LETTER AHSA}" >>> len(got_ahsa) 1 >>> got_ahsa.encode("unicode-escape") b'\\U00010330' >>> got_ahsa [crash - idle shell window closes immediately without any visible error message or traceback] I realised later, that tkinter probably won't be able to print wide-unicode characters anyway (according to http://bugs.python.org/issue12342 ), but Idle should probably just print the exception introduced there, e.g. ValueError: character U+10330 is above the range (U+0000-U+FFFF) allowed by Tcl Regards vbr ---------- components: IDLE, Tkinter, Unicode messages: 154944 nosy: ezio.melotti, vbr priority: normal severity: normal status: open title: Idle shell crash on printing non-BMP unicode character versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 13:48:54 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 12:48:54 +0000 Subject: [issue12151] test_logging fails sometimes In-Reply-To: <1306106163.56.0.790245092521.issue12151@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset a495c41c1e13 by Vinay Sajip in branch 'default': Issue #12151: Added more info to diagnostics. http://hg.python.org/cpython/rev/a495c41c1e13 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 13:58:05 2012 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 05 Mar 2012 12:58:05 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1330952285.51.0.785952379273.issue14200@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +haypo, loewis, ned.deily, terry.reedy type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 14:40:15 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 13:40:15 +0000 Subject: [issue14181] Support getbuffer redirection scheme in memoryview In-Reply-To: <1330763362.99.0.43231376241.issue14181@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 3a1f7c9f0b25 by Stefan Krah in branch 'default': Issue #14181: Test creating memoryviews from a static exporter with both http://hg.python.org/cpython/rev/3a1f7c9f0b25 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 14:48:03 2012 From: report at bugs.python.org (Stefan Krah) Date: Mon, 05 Mar 2012 13:48:03 +0000 Subject: [issue14181] Support getbuffer redirection scheme in memoryview In-Reply-To: <1330763362.99.0.43231376241.issue14181@psf.upfronthosting.co.za> Message-ID: <1330955283.82.0.505068371131.issue14181@psf.upfronthosting.co.za> Stefan Krah added the comment: I'm abusing the issue to settle all concerns that came up on python-dev: The tests added in the latest commit show that it's indeed no problem if an atypical static exporter sets view.obj to NULL. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 15:17:28 2012 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 05 Mar 2012 14:17:28 +0000 Subject: [issue14181] Support getbuffer redirection scheme in memoryview In-Reply-To: <1330763362.99.0.43231376241.issue14181@psf.upfronthosting.co.za> Message-ID: <1330957048.87.0.987021764594.issue14181@psf.upfronthosting.co.za> Stefan Behnel added the comment: Then I'm abusing this ticket to say: thanks for verifying this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 15:23:41 2012 From: report at bugs.python.org (Erik Johansson) Date: Mon, 05 Mar 2012 14:23:41 +0000 Subject: [issue14201] libc.time != libc['time'] Message-ID: <1330957421.08.0.5889949548.issue14201@psf.upfronthosting.co.za> New submission from Erik Johansson : I would expect that the following code would give True as result: >>> from ctypes import * >>> libc = CDLL("libc.so.6") >>> libc.time == libc['time'] False Is it by design that libc['time'] always returns a different _FuncPtr object? It is a bit confusing when doing things like: libc['time'].restype = ... libc['time'].argtypes = [...] # python --version Python 2.7.2+ Ubunutu version 2.7.2-5ubuntu1. ---------- components: ctypes messages: 154949 nosy: erijo priority: normal severity: normal status: open title: libc.time != libc['time'] type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 15:48:48 2012 From: report at bugs.python.org (sbt) Date: Mon, 05 Mar 2012 14:48:48 +0000 Subject: [issue12328] multiprocessing's overlapped PipeConnection on Windows In-Reply-To: <1307991196.59.0.849860111943.issue12328@psf.upfronthosting.co.za> Message-ID: <1330958928.66.0.445848105113.issue12328@psf.upfronthosting.co.za> sbt added the comment: Updated patch addressing Antoine's comments. ---------- Added file: http://bugs.python.org/file24737/pipe_poll_fix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 16:04:07 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 15:04:07 +0000 Subject: [issue13970] frameobject should not have f_yieldfrom attribute In-Reply-To: <1328722917.98.0.121121534686.issue13970@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 84620bca0e35 by Benjamin Peterson in branch 'default': remove f_yieldfrom access from Python (closes #13970) http://hg.python.org/cpython/rev/84620bca0e35 ---------- nosy: +python-dev resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 16:11:49 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 05 Mar 2012 15:11:49 +0000 Subject: [issue14201] libc.time != libc['time'] In-Reply-To: <1330957421.08.0.5889949548.issue14201@psf.upfronthosting.co.za> Message-ID: <1330960309.52.0.746094182538.issue14201@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +amaury.forgeotdarc, belopolsky, meador.inge versions: +Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 16:20:44 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 05 Mar 2012 15:20:44 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1330960844.27.0.232301728561.issue14200@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +serwy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 16:26:03 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 15:26:03 +0000 Subject: [issue13719] bdist_msi upload fails In-Reply-To: <1325855918.9.0.207720990162.issue13719@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 3d1362fa07c3 by ?ric Araujo in branch '3.2': Make distutils? upload command work with bdist_msi products (#13719). http://hg.python.org/cpython/rev/3d1362fa07c3 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 16:26:10 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 15:26:10 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset d99c0a4b66f3 by ?ric Araujo in branch '3.2': Move xml.etree higher and xml.parsers.expat lower in the markup ToC. http://hg.python.org/cpython/rev/d99c0a4b66f3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 16:48:29 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 15:48:29 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset fc32753feb0a by ?ric Araujo in branch '2.7': Move xml.etree higher and xml.parsers.expat lower in the markup ToC. http://hg.python.org/cpython/rev/fc32753feb0a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 16:48:29 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 15:48:29 +0000 Subject: [issue13719] bdist_msi upload fails In-Reply-To: <1325855918.9.0.207720990162.issue13719@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 7671932c98d3 by ?ric Araujo in branch '2.7': Make distutils? upload command work with bdist_msi products (#13719). http://hg.python.org/cpython/rev/7671932c98d3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 17:04:49 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 16:04:49 +0000 Subject: [issue13719] bdist_msi upload fails In-Reply-To: <1325855918.9.0.207720990162.issue13719@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 4cfcda9e80cb by ?ric Araujo in branch '3.2': Fix NameError from #13719 fix http://hg.python.org/cpython/rev/4cfcda9e80cb New changeset 449c9fc2fc2d by ?ric Araujo in branch 'default': Make packaging? upload command work with bdist_msi products (#13719) http://hg.python.org/cpython/rev/449c9fc2fc2d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 17:13:29 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 05 Mar 2012 16:13:29 +0000 Subject: [issue14201] libc.time != libc['time'] In-Reply-To: <1330957421.08.0.5889949548.issue14201@psf.upfronthosting.co.za> Message-ID: <1330964009.29.0.795697229487.issue14201@psf.upfronthosting.co.za> Martin v. L?wis added the comment: This is intentional; the caching was removed in 214b28d7a999. Thomas, can you remember the rationale for this change? ---------- nosy: +loewis, theller _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 17:19:35 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 05 Mar 2012 16:19:35 +0000 Subject: [issue14170] print unicode string error in win8 cmd console In-Reply-To: <1330659811.63.0.966664432837.issue14170@psf.upfronthosting.co.za> Message-ID: <1330964375.88.0.447993480055.issue14170@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Victor: why do you think this is a duplicate of #11395? That issue deals with long output strings, which doesn't seem to be the case here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 17:25:19 2012 From: report at bugs.python.org (Eli Bendersky) Date: Mon, 05 Mar 2012 16:25:19 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent Message-ID: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> New submission from Eli Bendersky : http://docs.python.org/dev/library/xml.dom.pulldom.html "embarrassing" is the word I wanted to use, but it's too strong for the title ;-) Seriously, this module is part of the stdlib, it should at least have *some* documentation. ---------- assignee: docs at python components: Documentation keywords: easy messages: 154959 nosy: docs at python, eli.bendersky, eric.araujo, flox priority: normal severity: normal stage: needs patch status: open title: The docs of xml.dom.pulldom are almost nonexistent type: behavior versions: Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 17:26:00 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 05 Mar 2012 16:26:00 +0000 Subject: [issue13719] bdist_msi upload fails In-Reply-To: <1325855918.9.0.207720990162.issue13719@psf.upfronthosting.co.za> Message-ID: <1330964760.76.0.378232807439.issue13719@psf.upfronthosting.co.za> ?ric Araujo added the comment: Will watch buildbots tomorrow and close if they are OK. Will backport to distutils2 later. ---------- resolution: -> fixed stage: test needed -> committed/rejected status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 17:33:29 2012 From: report at bugs.python.org (Roger Serwy) Date: Mon, 05 Mar 2012 16:33:29 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1330965209.21.0.0322839121007.issue14200@psf.upfronthosting.co.za> Roger Serwy added the comment: Hi Vlastimil, Can you repeat your test case while running IDLE from the command prompt and report the error you see? python -m idlelib.idle IDLE closes suddenly on Windows because IDLE uses pythonw.exe which has no stdout or stderr. When Tkinter encounters an error and tries to write to stderr, an error is raised in the Tkinter eventloop and the eventloop terminates. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 17:40:35 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Mar 2012 16:40:35 +0000 Subject: [issue14170] print unicode string error in win8 cmd console In-Reply-To: <1330964375.88.0.447993480055.issue14170@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > Victor: why do you think this is a duplicate of #11395? That issue deals with long output strings, which doesn't seem to be the case here. IOError('[Errno 28] No space left on device') was exactly the #11395 error message. Without the full test script, i cannot be sure that it's a duplicate. "C:\Users\__test.py, line 96": it looks like the program has ~100 lines and so may write something else to the console. There are buffers in TextIOWrapper, BufferedWriter and the Windows console itself. By the way, Python maps the Windows error ERROR_DISK_FULL (112) to ENOSPC (28). It's maybe something completly different. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 17:51:48 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 16:51:48 +0000 Subject: [issue14181] Support getbuffer redirection scheme in memoryview In-Reply-To: <1330763362.99.0.43231376241.issue14181@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 9f7d06a9eabe by Stefan Krah in branch 'default': Issue #14181: Preserve backwards compatibility for getbufferprocs that a) do http://hg.python.org/cpython/rev/9f7d06a9eabe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 17:56:33 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 05 Mar 2012 16:56:33 +0000 Subject: [issue14170] print unicode string error in win8 cmd console In-Reply-To: <1330659811.63.0.966664432837.issue14170@psf.upfronthosting.co.za> Message-ID: <1330966593.9.0.0543587335499.issue14170@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +brian.curtin, tim.golden _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 18:19:25 2012 From: report at bugs.python.org (Luke-Jr) Date: Mon, 05 Mar 2012 17:19:25 +0000 Subject: [issue13637] binascii.a2b_* functions could accept unicode strings In-Reply-To: <1324312244.97.0.383716057437.issue13637@psf.upfronthosting.co.za> Message-ID: <1330967965.77.0.328255318363.issue13637@psf.upfronthosting.co.za> Luke-Jr added the comment: Has this been fixed in 3.2 yet? Somehow it seems to have been "reclassified" as an enhancement when it's really a regression. str worked fine in these functions in 3.1. ---------- nosy: +luke-jr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 18:44:12 2012 From: report at bugs.python.org (Vlastimil Brom) Date: Mon, 05 Mar 2012 17:44:12 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1330969452.87.0.23453250692.issue14200@psf.upfronthosting.co.za> Vlastimil Brom added the comment: Hi, thanks for the pointer, after invoking idle using python.exe, I don't see the crash mentioned in the report: Python 3.3.0a1 (default, Mar 4 2012, 17:27:59) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> got_ahsa = "\N{GOTHIC LETTER AHSA}" >>> len(got_ahsa) 1 >>> got_ahsa.encode("unicode-escape") b'\\U00010330' >>> got_ahsa >>> print(got_ahsa) >>> I just get empty line as "answer" but no crash. The console indeed contains the traceback with the error I expected vbr ============ Microsoft Windows XP [Verze 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Python33>python.exe -m idlelib.idle *** Internal Error: rpc.py:SocketIO.localcall() Object: stdout Method: > Args: ("'\U00010330'",) Traceback (most recent call last): File "C:\Python33\lib\idlelib\rpc.py", line 188, in localcall ret = method(*args, **kwargs) File "C:\Python33\lib\idlelib\PyShell.py", line 1244, in write self.shell.write(s, self.tags) File "C:\Python33\lib\idlelib\PyShell.py", line 1226, in write OutputWindow.write(self, s, tags, "iomark") File "C:\Python33\lib\idlelib\OutputWindow.py", line 40, in write self.text.insert(mark, s, tags) File "C:\Python33\lib\idlelib\Percolator.py", line 25, in insert self.top.insert(index, chars, tags) File "C:\Python33\lib\idlelib\ColorDelegator.py", line 80, in insert self.delegate.insert(index, chars, tags) File "C:\Python33\lib\idlelib\PyShell.py", line 322, in insert UndoDelegator.insert(self, index, chars, tags) File "C:\Python33\lib\idlelib\UndoDelegator.py", line 81, in insert self.addcmd(InsertCommand(index, chars, tags)) File "C:\Python33\lib\idlelib\UndoDelegator.py", line 116, in addcmd cmd.do(self.delegate) File "C:\Python33\lib\idlelib\UndoDelegator.py", line 219, in do text.insert(self.index1, self.chars, self.tags) File "C:\Python33\lib\idlelib\ColorDelegator.py", line 80, in insert self.delegate.insert(index, chars, tags) File "C:\Python33\lib\idlelib\WidgetRedirector.py", line 104, in __call__ return self.tk_call(self.orig_and_operation + args) ValueError: character U+10330 is above the range (U+0000-U+FFFF) allowed by Tcl ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 18:59:56 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 05 Mar 2012 17:59:56 +0000 Subject: [issue12342] characters with ord above 65535 fail to display in IDLE In-Reply-To: <1308171600.34.0.388895530939.issue12342@psf.upfronthosting.co.za> Message-ID: <1330970396.73.0.0448893502288.issue12342@psf.upfronthosting.co.za> Terry J. Reedy added the comment: In responding to #14200, it occurred to me that better than an exception would be doing what the interpreter does in Command Prompt window, which is expand high chars to '\U0001xxxx' escaped form. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 19:00:15 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 05 Mar 2012 18:00:15 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1330970415.83.0.0500569891289.issue14200@psf.upfronthosting.co.za> Terry J. Reedy added the comment: On 3.2.2, Win7, the length is 2 and printing in Idle prints a square, as it usually does for chars it cannot print. I presume Tk recognizes surrogate pairs. Printing to the screen should not raise an exception, so the square would be better. Even better would be to do what the 3.2 and 3.3 Command Prompt Interpreters do, which is to print an evaluable representation: >>> c '\U00010330' I assume that this string is produced by python.exe rather than Windows. If so, neither of the two pythonw processes is currently doing the same conversion. My understanding is that the user pythonw process uses idlelib.rpc.RPCproxy objects to ship i/o calls to the idle pythonw process. I presume we could find the idle process window .write methods and change lines like self.text.insert(mark, s, tags) to try: self.text.insert(mark, s, tags) except SomeTkError: self.text.insert(mark, expand(s), tags) But it seems to me that the expansion should really be done in C in _tkinter, where the internal .kind attribute of strings is available. --- There is also an input crash. On 3.2, I tried to cut the square char and paste it into "ord('')" (both shell and edit window) to see what unicode char it is and IDLE fades away as you describe. That puzzles me, as I am normally able to paste BMP chars into idle without problem. In any case, I presume the problem is not idle-specific and would best be handled in _tkinter. Or does the crash happen in Windows or tcl/tk code before _tkinter ever sees the input? When I paste the same into the 3.2 or 3.2 interpreter, it is converted to ascii '?'. I presume this is done by Windows Command Prompt before sending anything to python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 19:32:43 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 05 Mar 2012 18:32:43 +0000 Subject: [issue12328] multiprocessing's overlapped PipeConnection on Windows In-Reply-To: <1307991196.59.0.849860111943.issue12328@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 75c27daa592e by Antoine Pitrou in branch 'default': Issue #12328: Fix multiprocessing's use of overlapped I/O on Windows. http://hg.python.org/cpython/rev/75c27daa592e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 19:32:49 2012 From: report at bugs.python.org (Stefan Krah) Date: Mon, 05 Mar 2012 18:32:49 +0000 Subject: [issue14203] bytearray_getbuffer: unnecessary code Message-ID: <1330972369.17.0.543217676638.issue14203@psf.upfronthosting.co.za> New submission from Stefan Krah : bytearray_getbuffer() checks for view==NULL. But this has never been allowed: PEP: "The second argument is the address to a bufferinfo structure. Both arguments must never be NULL." DOCS (3.2): "view must point to an existing Py_buffer structure allocated by the caller". A quick grep through the source tree shows no instances where the middle argument of either PyObject_GetBuffer of bf_getbuffer is NULL or 0. Patch attached, all tests pass. I wouldn't be comfortable to commit it without review though (it's just too strange). BTW, the next conditional in bytearray_getbuffer ... if (ret >= 0) { obj->ob_exports++; } is also superfluous, since PyBuffer_FillInfo() cannot fail if readonly==0. ---------- components: Interpreter Core files: bytearray_getbuffer.diff keywords: needs review, patch messages: 154969 nosy: ncoghlan, pitrou, skrah priority: normal severity: normal stage: patch review status: open title: bytearray_getbuffer: unnecessary code type: resource usage versions: Python 3.3 Added file: http://bugs.python.org/file24738/bytearray_getbuffer.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 19:33:14 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 05 Mar 2012 18:33:14 +0000 Subject: [issue12328] multiprocessing's overlapped PipeConnection on Windows In-Reply-To: <1307991196.59.0.849860111943.issue12328@psf.upfronthosting.co.za> Message-ID: <1330972394.58.0.674818635952.issue12328@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Committed, thanks! ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 19:56:15 2012 From: report at bugs.python.org (Stefan Krah) Date: Mon, 05 Mar 2012 18:56:15 +0000 Subject: [issue14203] bytearray_getbuffer: unnecessary code In-Reply-To: <1330972369.17.0.543217676638.issue14203@psf.upfronthosting.co.za> Message-ID: <1330973775.31.0.842785044628.issue14203@psf.upfronthosting.co.za> Stefan Krah added the comment: array_buffer_getbuf does a similar thing: if (view==NULL) goto finish; finish: self->ob_exports++; // ??? return 0 Where does this view==NULL thing come from? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 20:24:52 2012 From: report at bugs.python.org (Stefan Krah) Date: Mon, 05 Mar 2012 19:24:52 +0000 Subject: [issue13860] PyBuffer_FillInfo() return value In-Reply-To: <1327513279.1.0.452976234811.issue13860@psf.upfronthosting.co.za> Message-ID: <1330975492.78.0.718227653019.issue13860@psf.upfronthosting.co.za> Changes by Stefan Krah : ---------- dependencies: +bytearray_getbuffer: unnecessary code _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 20:25:31 2012 From: report at bugs.python.org (Stefan Krah) Date: Mon, 05 Mar 2012 19:25:31 +0000 Subject: [issue14203] bytearray_getbuffer: unnecessary code In-Reply-To: <1330972369.17.0.543217676638.issue14203@psf.upfronthosting.co.za> Message-ID: <1330975531.58.0.0549646364061.issue14203@psf.upfronthosting.co.za> Stefan Krah added the comment: I seems to be a feature to get a "lock" on an exporter without the exporter filling in a buffer. It was there from the beginning: http://svn.python.org/view/python/branches/release30-maint/Objects/bytearrayobject.c?r1=56849&r2=57181 Last use that I can see is here: http://hg.python.org/cpython/file/df3b2b5db900/Modules/posixmodule.c#l561 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 21:21:02 2012 From: report at bugs.python.org (Colin Marc) Date: Mon, 05 Mar 2012 20:21:02 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL Message-ID: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> New submission from Colin Marc : Recent versions of OpenSSL (1.0.1 and greater) support a new extension to SSL/TLS called Next Protocol Negotiation, defined here: http://tools.ietf.org/html/draft-agl-tls-nextprotoneg-02. The extension allows servers and clients to advertise which protocols they support (for example, both HTTP and SPDY) and then agree on one during the handshake according to a simple algorithm. This patch to 2.7 adds support for the NPN extension via another parameter to ssl.wrap_socket, called 'npn_protocols', and by using the OpenSSL API. It should fail gracefully if the linked version of OpenSSL has no support for NPN, using a macro guard. Once the handshake is completed, SSLSocket.selected_protocol() returns whatever was agreed upon. Although I included client/server tests with the patch, testing this functionality in real-life situations proved difficult. Google chrome has SPDY and NPN functionality baked in, so I wrote a simple socket server that advertises SPDY/2 in addition to HTTP/1.1. Chrome, pointed at this server, correctly completed the handshake and started merrily sending SPDY control frames. ---------- files: npn_patch.diff keywords: patch messages: 154973 nosy: colinmarc priority: normal severity: normal status: open title: Support for the NPN extension to TLS/SSL type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file24739/npn_patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 21:53:12 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 05 Mar 2012 20:53:12 +0000 Subject: [issue13719] bdist_msi upload fails In-Reply-To: <1325855918.9.0.207720990162.issue13719@psf.upfronthosting.co.za> Message-ID: <1330980792.21.0.466944585492.issue13719@psf.upfronthosting.co.za> ?ric Araujo added the comment: Buildbots fail when calling listdir; will try to fix this or revert tomorrow. Help would be appreciated. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 22:13:57 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 05 Mar 2012 21:13:57 +0000 Subject: [issue14170] print unicode string error in win8 cmd console In-Reply-To: Message-ID: <4F552C94.6040507@v.loewis.de> Martin v. L?wis added the comment: > IOError('[Errno 28] No space left on device') was exactly the #11395 > error message. I read that report differently: IOError: [Errno 12] Not enough space ENOMEM != ENOSPC ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 22:19:55 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Mar 2012 21:19:55 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup Message-ID: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> New submission from STINNER Victor : Lib/test/crashers/nasty_eq_vs_dict.py does crash Python because of an infinite loop in the dictionary lookup. The script modifies the dictionary at each lookup, whereas Python tries a new lookup each time that the dictionary is modified. I proposed to make the lookup fail with a RuntimeError if the dictionary has been modified during a lookup. It should not occur if you are not doing something evil. ---------- components: Interpreter Core files: dict_lookup.patch keywords: patch messages: 154976 nosy: haypo priority: normal severity: normal status: open title: Raise an error if a dict is modified during a lookup versions: Python 3.3 Added file: http://bugs.python.org/file24740/dict_lookup.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 22:20:59 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Mar 2012 21:20:59 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: <1330982459.52.0.803879989444.issue14205@psf.upfronthosting.co.za> STINNER Victor added the comment: Another possibility is to avoid the modification of a dictionary during a lookup: nomodify.patch. ---------- Added file: http://bugs.python.org/file24741/nomodify.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 22:23:07 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 05 Mar 2012 21:23:07 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: <1330982587.7.0.00235341940202.issue14204@psf.upfronthosting.co.za> Martin v. L?wis added the comment: There is zero chance that this can go into 2.7. So if you want to see it included, please port it to Python 3, and it may become part of Python 3.3 or 3.4. ---------- nosy: +loewis versions: +Python 3.3 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 22:30:24 2012 From: report at bugs.python.org (Colin Marc) Date: Mon, 05 Mar 2012 21:30:24 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: <1330983024.0.0.359298464672.issue14204@psf.upfronthosting.co.za> Colin Marc added the comment: If I ported it to 3.3 or 3.4, would it then be backported to 2.7? Or is there zero chance of that either? If so, why? I apologize, I'm new to the process. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 22:39:41 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 05 Mar 2012 21:39:41 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330983024.0.0.359298464672.issue14204@psf.upfronthosting.co.za> Message-ID: <4F55329B.9000706@v.loewis.de> Martin v. L?wis added the comment: > If I ported it to 3.3 or 3.4, would it then be backported to 2.7? Or > is there zero chance of that either? If so, why? I apologize, I'm new > to the process. It won't be backported. Python 2.7 is in bug-fix mode; no new features are allowed it it. In addition, there won't be another 2.x release (see PEP 404), so new features can only be added to Python 3. If this means that you'll lose interest in this issue - that's fine. Let us know whether you then would rather withdraw the patch, or leave it open in case someone is motivated to port it. In the latter case, please submit a contributor's form to the PSF. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 22:50:14 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 05 Mar 2012 21:50:14 +0000 Subject: [issue14133] improved PEP 409 implementation In-Reply-To: <1330269562.83.0.382343969435.issue14133@psf.upfronthosting.co.za> Message-ID: <1330984214.87.0.89684684787.issue14133@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Now with implicit setting of __suppress_context__! ---------- Added file: http://bugs.python.org/file24742/pep415.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 22:54:27 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 05 Mar 2012 21:54:27 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: <1330984467.84.0.450984490948.issue14204@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Hello Marc, > Recent versions of OpenSSL (1.0.1 and greater) support a new extension > to SSL/TLS called Next Protocol Negotiation, defined here: > http://tools.ietf.org/html/draft-agl-tls-nextprotoneg-02. Apparently this is an IETF draft. Do you know if it is stabilized enough that it won't change significantly? Also, please notice that the ssl module (starting from Python 3.2) now exposes the notion of an SSL context. The setting of NPN parameters should probably be exposed as a context method and/or a parameter to SSLContext.wrap_socket(). (see http://docs.python.org/dev/library/ssl.html#ssl-contexts for docs) ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 23:10:09 2012 From: report at bugs.python.org (Colin Marc) Date: Mon, 05 Mar 2012 22:10:09 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: <1330985409.92.0.709374039856.issue14204@psf.upfronthosting.co.za> Colin Marc added the comment: Re the IETF draft: I'm not sure. However, I didn't actually have to implement the specification at all - that was all handled by OpenSSL. My patch just calls the appropriate SSL_CTX_* methods. Thanks for the tip. I'm still interested in this getting included, so I'll work on porting it over. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 23:14:40 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 05 Mar 2012 22:14:40 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: <1330985680.99.0.0475498710852.issue14205@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 23:41:39 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Mar 2012 22:41:39 +0000 Subject: [issue14180] Factorize code to convert int/float to time_t, timeval or timespec In-Reply-To: <1330733422.24.0.352066771242.issue14180@psf.upfronthosting.co.za> Message-ID: <1330987299.7.0.345660446613.issue14180@psf.upfronthosting.co.za> STINNER Victor added the comment: Alexander: No complain if I remove _time.c? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 23:43:19 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Mar 2012 22:43:19 +0000 Subject: [issue6715] xz compressor support In-Reply-To: <1250502444.31.0.107447392137.issue6715@psf.upfronthosting.co.za> Message-ID: <1330987399.25.0.392943018347.issue6715@psf.upfronthosting.co.za> STINNER Victor added the comment: Why is this issue still open? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 23:47:17 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Mar 2012 22:47:17 +0000 Subject: [issue14071] allow more than one hash seed per process (move _Py_HashSecret into PyInterpreterState) In-Reply-To: <1329807287.0.0.916593271901.issue14071@psf.upfronthosting.co.za> Message-ID: <1330987637.26.0.0344889734799.issue14071@psf.upfronthosting.co.za> STINNER Victor added the comment: I close the issue as wontfix because of technical issues. Reopen it if you have an idea to solve them. ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 5 23:49:35 2012 From: report at bugs.python.org (Sandro Tosi) Date: Mon, 05 Mar 2012 22:49:35 +0000 Subject: [issue2403] Add figleaf coverage metrics In-Reply-To: <1205869378.43.0.216108511876.issue2403@psf.upfronthosting.co.za> Message-ID: <1330987775.28.0.472369447972.issue2403@psf.upfronthosting.co.za> Sandro Tosi added the comment: The devguide reports a long section about code convering cpython: http://docs.python.org/devguide/coverage.html . It uses Ned's coverege.py and has a lot of details about how to use it and how to generate nice reports out of it. do we need an internal tool for cpython coverage? ---------- nosy: +sandro.tosi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 00:15:55 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Mar 2012 23:15:55 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1330989355.43.0.694884986324.issue7652@psf.upfronthosting.co.za> STINNER Victor added the comment: How can I help to integrate this module into CPython? The test suite pass in debug and release mode without any failure on my Linux box (64 bits, running Ubuntu 11.10). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 00:28:57 2012 From: report at bugs.python.org (Mark Shannon) Date: Mon, 05 Mar 2012 23:28:57 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: <1330990137.29.0.550303366069.issue14205@psf.upfronthosting.co.za> Mark Shannon added the comment: I much prefer dict_lookup.patch to nomodify.patch. It doesn't increase the memory use of dict. One extra word per dict could be a lot of memory for a large application. There is a very subtle semantic change, but I think it is a positive one. Raising a runtimne seesm sensible as the dict iterators already raise a RuntimeError if the size of the dict changes. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 00:39:00 2012 From: report at bugs.python.org (Mark Shannon) Date: Mon, 05 Mar 2012 23:39:00 +0000 Subject: [issue14199] Keep a refence to mro in _PyType_Lookup() and super_getattro() In-Reply-To: <1330950808.29.0.801414525121.issue14199@psf.upfronthosting.co.za> Message-ID: <1330990740.7.0.47234538594.issue14199@psf.upfronthosting.co.za> Mark Shannon added the comment: Looks good to me. The INCREF/DECREFs are outside of the loops so will have negligible performance impact. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 00:43:13 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Mar 2012 23:43:13 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: <1330990993.56.0.282893631163.issue14205@psf.upfronthosting.co.za> STINNER Victor added the comment: > I much prefer dict_lookup.patch to nomodify.patch. > It doesn't increase the memory use of dict. One extra word > per dict could be a lot of memory for a large application. nomodify.patch is the correct fix, but I agree that dict_lookup.patch is better (and sufficient) in practive. > Raising a runtimne seesm sensible as the dict iterators already > raise a RuntimeError if the size of the dict changes. Yes, that's how I chose the exception. >>> d={k: str(k) for k in range(10)} >>> for k in d: ... del d[k] ... RuntimeError: dictionary changed size during iteration >>> d={k for k in range(10)} >>> for k in d: ... d.remove(k) ... RuntimeError: Set changed size during iteration >>> d=list(range(10)) >>> def keyfunc(x): ... d.append(1) ... return x ... >>> d.sort(key=keyfunc) ValueError: list modified during sort ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 00:47:20 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Mar 2012 23:47:20 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1330991240.06.0.799237102525.issue7652@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Victor, yes, the decimal module needs a C implementation. Without it, the pure Python code is abysmally slow. Other MP implementations don't fill the need or come close to implementing the decimal arithmetic spec. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 00:49:20 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Mar 2012 23:49:20 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: <1330991360.72.0.815732077521.issue14205@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> rhettinger priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 00:50:47 2012 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 05 Mar 2012 23:50:47 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: <1330991447.61.0.262445330458.issue14205@psf.upfronthosting.co.za> Guido van Rossum added the comment: Yeah, dict_lookup.patch seems fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 01:13:03 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 06 Mar 2012 00:13:03 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 934aaf2191d0 by Victor Stinner in branch 'default': Close #14205: dict lookup raises a RuntimeError if the dict is modified during http://hg.python.org/cpython/rev/934aaf2191d0 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 01:32:42 2012 From: report at bugs.python.org (Garrett Moore) Date: Tue, 06 Mar 2012 00:32:42 +0000 Subject: [issue14206] multiprocessing.Queue documentation is lacking important details Message-ID: <1330993962.13.0.893864771053.issue14206@psf.upfronthosting.co.za> New submission from Garrett Moore : 1) If cancel_join_thread() is called, data may be lost. This is not explicitly stated. I had multiple writers put() data in a Queue, and wanted to have the workers finish before I began consuming the data. This caused a deadlock because my Queue was not empty, and it seemed like the a way to force my workers finish was to use cancel_join_thread(). This caused data loss. 2) multiprocessing.Queue states "The Queue class is a near clone of Queue.Queue." Queue.Queue states "If maxsize is less than or equal to zero, the queue size is infinite." mp.Queue provides no information on queue size. It is reasonable to assume then that it inherits the property of Queue.Queue. After discussion on IRC, it seems that mp.Queue maximum size is implementation-dependent and likely relies on how much data Pipes can hold on your platform. If this is the case there should be some mention of the fact that mp.Queue does NOT function like Queue.Queue does for maximum size. ---------- assignee: docs at python components: Documentation messages: 154995 nosy: Garrett.Moore, docs at python priority: normal severity: normal status: open title: multiprocessing.Queue documentation is lacking important details versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 01:39:11 2012 From: report at bugs.python.org (Vlastimil Brom) Date: Tue, 06 Mar 2012 00:39:11 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1330994351.32.0.963677093559.issue14200@psf.upfronthosting.co.za> Vlastimil Brom added the comment: I'd like to add some further observations to the mentioned issue; it seems, that the crash is indeed not specific to idle. In a sample tkinter app, where I just display e.g. chr(66352) in an Entry widget, I also get the same immediate crash via pythonw.exe and the previously mentioned "proper" ValueError without a crash with python.exe. I also tried to explicitly display surrogate pair, which were used automatically until python 3.2; these can be used in tkinter in 3.3, but there are limitations and discrepancies: >>> >>> got_ahsa = "\N{GOTHIC LETTER AHSA}" >>> def wide_char_to_surrog_pair(char): code_point = ord(char) if code_point <= 0xFFFF: return char else: high_surr = (code_point - 0x10000) // 0x400 + 0xD800 low_surr = (code_point - 0x10000) % 0x400 + 0xDC00 return chr(high_surr)+chr(low_surr) >>> ahsa_surrog = wide_char_to_surrog_pair(got_ahsa) >>> print(ahsa_surrog) ? >>> repr(ahsa_surrog) "'_ud800\x00udf30'" >>> ahsa_surrog 'Pud800 udf30' [the space in the middle of the last item might be \x00, as it terminates the clipboard content, the rest is copied separately] the printed square corresponds with the given character and can be used in other programs etc. (whereas in py 3.2, the same value was used for repr and a direct "display" of the string in the interpreter, there are three different formats in py 3.3. I also noticed that surogate pair is not supported as input for unicodedata.name(...) anymore: >>> import unicodedata >>> unicodedata.name(ahsa_surrog) Traceback (most recent call last): File "", line 1, in unicodedata.name(ahsa_surrog) TypeError: need a single Unicode character as parameter >>> (in 3.2 and probably others it returns the expected 'GOTHIC LETTER AHSA') (I for my part would think, that e.g. keeping a bit liberal (but still non-ambiguous) input possibilities for unicodedata wouldn't hurt. Also, if tkinter is not going to support wide unicode natively any time soon, the output conversion using surrogates, which are also understandable for other programs, seems the most usable option in this regard. Hopefully, this is somehow relevant for the original issue - I am somehow not sure, whether some parts would be better posted as separate issues, or whether this is the planned and expected behaviour anyway. regards, vbr ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 02:35:07 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 06 Mar 2012 01:35:07 +0000 Subject: [issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect In-Reply-To: <1330946138.57.0.239974308717.issue14144@psf.upfronthosting.co.za> Message-ID: <20120306013500.GD11762@mathmagic> Senthil Kumaran added the comment: On Mon, Mar 05, 2012 at 11:15:38AM +0000, ?ric Araujo wrote: > Ah, so there is a way to achieve it! If Jay is satisfied by this, > we could add an example of using that in the urllib howto, with the > appropriate warnings. That would have much less risk than a new > parameter. Yeah. This could be cookbook recipe style example, if it's utility value is high. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 05:53:10 2012 From: report at bugs.python.org (Eli Bendersky) Date: Tue, 06 Mar 2012 04:53:10 +0000 Subject: [issue14178] Failing tests for ElementTree In-Reply-To: <1330706183.38.0.536130831322.issue14178@psf.upfronthosting.co.za> Message-ID: <1331009590.86.0.19034471797.issue14178@psf.upfronthosting.co.za> Eli Bendersky added the comment: Attaching a patch that fixes the slice deletion problems. The approach I've taken is follow a similar implementation in Objects/listobject.c; when a slice is deleted, it can be done efficiently by using memmove to shift whole blocks of leftover children. Also added a new test class to test_xml_etree specifically to test slicing with Element objects and deleting slices with strange steps. I'll leave it up for review for a couple of days before committing. ---------- keywords: +patch nosy: +effbot Added file: http://bugs.python.org/file24743/issue14178.1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 05:53:37 2012 From: report at bugs.python.org (Eli Bendersky) Date: Tue, 06 Mar 2012 04:53:37 +0000 Subject: [issue14178] Failing tests for ElementTree In-Reply-To: <1330706183.38.0.536130831322.issue14178@psf.upfronthosting.co.za> Message-ID: <1331009617.18.0.836362814338.issue14178@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- assignee: -> eli.bendersky stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 06:05:33 2012 From: report at bugs.python.org (Eli Bendersky) Date: Tue, 06 Mar 2012 05:05:33 +0000 Subject: [issue14207] ElementTree.ParseError - needs documentation and consistent C&Py implementations Message-ID: <1331010333.9.0.736082311251.issue14207@psf.upfronthosting.co.za> New submission from Eli Bendersky : Following issue #14178: The ElementTree.ParseError is not documented and its behavior seems to differ between the C and Python implementations. In particular, the C module doesn't assign the 'code' attribute when raising a ParseError. ---------- components: Extension Modules, Library (Lib) messages: 154999 nosy: effbot, eli.bendersky, flox, scoder priority: normal severity: normal stage: needs patch status: open title: ElementTree.ParseError - needs documentation and consistent C&Py implementations versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 06:06:39 2012 From: report at bugs.python.org (Eli Bendersky) Date: Tue, 06 Mar 2012 05:06:39 +0000 Subject: [issue14178] _elementtree problem deleting slices with steps != +1 In-Reply-To: <1330706183.38.0.536130831322.issue14178@psf.upfronthosting.co.za> Message-ID: <1331010399.18.0.214709368261.issue14178@psf.upfronthosting.co.za> Eli Bendersky added the comment: WRT the ParseError problem, I've opened issue #14207 for it since the problems are quite unrelated. ---------- title: Failing tests for ElementTree -> _elementtree problem deleting slices with steps != +1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 06:47:37 2012 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Tue, 06 Mar 2012 05:47:37 +0000 Subject: [issue13637] binascii.a2b_* functions could accept unicode strings In-Reply-To: <1324312244.97.0.383716057437.issue13637@psf.upfronthosting.co.za> Message-ID: <1331012857.59.0.411795480104.issue13637@psf.upfronthosting.co.za> Arfrever Frehtes Taifersar Arahesis added the comment: I confirm that it works in Python 3.1 and doesn't work in Python 3.2. ---------- nosy: +Arfrever resolution: fixed -> stage: committed/rejected -> status: closed -> open type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 07:53:23 2012 From: report at bugs.python.org (Ben Darnell) Date: Tue, 06 Mar 2012 06:53:23 +0000 Subject: [issue14208] No way to recover original argv with python -m Message-ID: <1331016803.5.0.715499259579.issue14208@psf.upfronthosting.co.za> New submission from Ben Darnell : I have a script which attempts to re-invoke itself using sys.argv, but it fails when run with "python -m package.module". The problem is that the handling of -m (via the runpy module) rewrites sys.argv as if it were run as "python package/module.py", but the two command lines are not equivalent: With -m the current directory is inserted at the head of sys.path, but without -m it's the directory containing module.py. The net effect is that the initial run of "python -m package.module" works as expected, but when it re-runs itself as "python package/module.py" the imports from module.py are effectively relative instead of absolute. One possible solution would be to provide an immutable sys.__argv__ (by analogy with sys.__stdout__ and friends). ---------- messages: 155002 nosy: Ben.Darnell priority: normal severity: normal status: open title: No way to recover original argv with python -m type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 08:09:20 2012 From: report at bugs.python.org (Georg Brandl) Date: Tue, 06 Mar 2012 07:09:20 +0000 Subject: [issue14208] No way to recover original argv with python -m In-Reply-To: <1331016803.5.0.715499259579.issue14208@psf.upfronthosting.co.za> Message-ID: <1331017760.7.0.315043925822.issue14208@psf.upfronthosting.co.za> Georg Brandl added the comment: I agree this would be useful. It would be even more useful to have an __argv__ that includes all command-line flags given to Python, such as -Wi. ---------- nosy: +georg.brandl, pitrou versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 08:31:57 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 06 Mar 2012 07:31:57 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331019117.19.0.873518539336.issue14200@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Vlastimil: you are mixing issues. Some of your observations are actually correct behaviour; please don't clutter the report with that, but report each separate behavior in a separate report. In Python 3.3, surrogate pairs do *not* substitute for the the actual character, since the internal representation is not UTF-16 anymore. Also, when you run a Tkinter app in IDLE: while you get a "proper" traceback output, your conclusion that python.exe does not "crash" is incorrect: it crashes just in the very same way that IDLE crashes. Except when run inside IDLE, it is a subprocess that "crashes" (i.e. terminates with a traceback output), not IDLE itself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 08:42:25 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 06 Mar 2012 07:42:25 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset d916145b20c3 by Martin v. L?wis in branch 'default': Issue #14200: Add benchmark results to text flow. http://hg.python.org/cpython/rev/d916145b20c3 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 08:42:50 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 06 Mar 2012 07:42:50 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331019770.69.0.660447041436.issue14200@psf.upfronthosting.co.za> Changes by Martin v. L?wis : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 08:43:58 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 06 Mar 2012 07:43:58 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331019838.46.0.293459898534.issue14200@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Oops, wrong issue. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 08:44:57 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 06 Mar 2012 07:44:57 +0000 Subject: [issue14100] Add a missing info to PEP 393 + link from whatsnew 3.3 In-Reply-To: <1330009090.66.0.133471342458.issue14100@psf.upfronthosting.co.za> Message-ID: <1331019897.76.0.561769070003.issue14100@psf.upfronthosting.co.za> Martin v. L?wis added the comment: This is now fixed with d916145b20c3. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 08:45:25 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 06 Mar 2012 07:45:25 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331019925.37.0.471314010079.issue14200@psf.upfronthosting.co.za> Changes by Martin v. L?wis : ---------- Removed message: http://bugs.python.org/msg155005 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 08:45:36 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 06 Mar 2012 07:45:36 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331019936.94.0.517869690407.issue14200@psf.upfronthosting.co.za> Changes by Martin v. L?wis : ---------- Removed message: http://bugs.python.org/msg155006 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 09:47:49 2012 From: report at bugs.python.org (Florent Xicluna) Date: Tue, 06 Mar 2012 08:47:49 +0000 Subject: [issue14208] No way to recover original argv with python -m In-Reply-To: <1331016803.5.0.715499259579.issue14208@psf.upfronthosting.co.za> Message-ID: <1331023669.3.0.47561838566.issue14208@psf.upfronthosting.co.za> Changes by Florent Xicluna : ---------- nosy: +flox _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 10:34:26 2012 From: report at bugs.python.org (Steven Bethard) Date: Tue, 06 Mar 2012 09:34:26 +0000 Subject: [issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters In-Reply-To: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> Message-ID: <1331026466.56.0.914808458774.issue14191@psf.upfronthosting.co.za> Steven Bethard added the comment: This behavior is intentional - positional arguments must be sequential, not broken up with optional (flag) arguments between. So this is a documentation bug. Allowing positional arguments to be broken up with optional (flag) arguments between them would be a new feature. It would also break many current parsers, so it couldn't be turned on by default. A new constructor parameter or method or something would have to be added to ArgumentParser. Patches welcome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 10:46:39 2012 From: report at bugs.python.org (Vlastimil Brom) Date: Tue, 06 Mar 2012 09:46:39 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331027199.57.0.628208377085.issue14200@psf.upfronthosting.co.za> Vlastimil Brom added the comment: Sorry for mixing the different problems, these were somehow things I noticed "at once" in the new python version, but I should have noticed the different domains myself. I still might not understand the term "crash" properly - I just meant to distinguish between a single appropriate exception on an invalid operation (while the app is staying alive and works on next valid input) - as is the case with calling through python.exe, and - on the other hand - the immediate termination on encountering the invalid input, which happens with pythonw.exe. Now I see, that with pythonw a tk app terminates with the first exception (in general) in py 3.3 and also 3.2 (as opposed to py 2.7, where it just swallows the exception and stays alive, as one would probably expect). Should this be reported in a separate issue, or is this what remains relevant in *this* report? (Sorry for the confusion.) vbr ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 11:10:17 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Tue, 06 Mar 2012 10:10:17 +0000 Subject: [issue13183] pdb skips frames after hitting a breakpoint and running step In-Reply-To: <1318618591.85.0.940577569218.issue13183@psf.upfronthosting.co.za> Message-ID: <1331028617.43.0.583336110925.issue13183@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 11:11:29 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Tue, 06 Mar 2012 10:11:29 +0000 Subject: [issue14196] Unhandled exceptions in pdb return value display In-Reply-To: <1330906516.74.0.432612109172.issue14196@psf.upfronthosting.co.za> Message-ID: <1331028689.57.0.720430042014.issue14196@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 11:19:45 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Tue, 06 Mar 2012 10:19:45 +0000 Subject: [issue12913] Add a debugging howto In-Reply-To: <1315323088.65.0.459623812563.issue12913@psf.upfronthosting.co.za> Message-ID: <1331029185.75.0.472074288661.issue12913@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 11:23:52 2012 From: report at bugs.python.org (=?utf-8?q?Lars_Gust=C3=A4bel?=) Date: Tue, 06 Mar 2012 10:23:52 +0000 Subject: [issue10369] tarfile requires an actual file on disc; a file-like object is insufficient In-Reply-To: <1289259727.33.0.210981520326.issue10369@psf.upfronthosting.co.za> Message-ID: <1331029432.06.0.365731534562.issue10369@psf.upfronthosting.co.za> Changes by Lars Gust?bel : ---------- resolution: -> invalid stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 12:30:59 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Tue, 06 Mar 2012 11:30:59 +0000 Subject: [issue6715] xz compressor support In-Reply-To: <1250502444.31.0.107447392137.issue6715@psf.upfronthosting.co.za> Message-ID: <1331033459.18.0.808323155688.issue6715@psf.upfronthosting.co.za> Nadeem Vawda added the comment: I had intended to wait until the code had been tested on all of the buildbots before closing it. However, it's taking a while to get xz-utils installed on the last few bots, so it doesn't make sense to keep the issue open for this. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 12:32:17 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Tue, 06 Mar 2012 11:32:17 +0000 Subject: [issue5689] Support xz compression in tarfile module In-Reply-To: <1238861315.81.0.348941469726.issue5689@psf.upfronthosting.co.za> Message-ID: <1331033537.47.0.586565949304.issue5689@psf.upfronthosting.co.za> Changes by Nadeem Vawda : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 13:28:37 2012 From: report at bugs.python.org (sbt) Date: Tue, 06 Mar 2012 12:28:37 +0000 Subject: [issue14206] multiprocessing.Queue documentation is lacking important details In-Reply-To: <1330993962.13.0.893864771053.issue14206@psf.upfronthosting.co.za> Message-ID: <1331036917.64.0.574146881806.issue14206@psf.upfronthosting.co.za> sbt added the comment: What you were told on IRC was wrong. By default the queue *does* have infinite size. When a process puts an item on the queue for the first time, a background thread is started which is responsible for writing items to the underlying pipe. This does mean that, on exit, the process should wait for the background thread to flush all the data to the pipe. This happens automatically unless you specifically prevent it by calling cancel_join_thread() method. If you stick to those methods supported by standard queue objects, then things should work correctly. (Maybe cancel_join_thread() would be better named allow_exit_without_flush().) ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 13:59:16 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 06 Mar 2012 12:59:16 +0000 Subject: [issue14181] Support getbuffer redirection scheme in memoryview In-Reply-To: <1330763362.99.0.43231376241.issue14181@psf.upfronthosting.co.za> Message-ID: <1331038756.61.0.673591930189.issue14181@psf.upfronthosting.co.za> Stefan Krah added the comment: > Then I'm abusing this ticket to say: thanks for verifying this. I would still like to sweep this fact under the rug. :) Could you have a look at the documentation patch and see if it's clearer? ---------- keywords: +patch Added file: http://bugs.python.org/file24744/issue14181-doc.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 14:07:56 2012 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 06 Mar 2012 13:07:56 +0000 Subject: [issue14181] Support getbuffer redirection scheme in memoryview In-Reply-To: <1330763362.99.0.43231376241.issue14181@psf.upfronthosting.co.za> Message-ID: <1331039276.02.0.58108071077.issue14181@psf.upfronthosting.co.za> Stefan Behnel added the comment: Yes, I think this is much clearer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 14:22:29 2012 From: report at bugs.python.org (Eli Bendersky) Date: Tue, 06 Mar 2012 13:22:29 +0000 Subject: [issue14006] Improve the documentation of xml.etree.ElementTree In-Reply-To: <1329190125.69.0.69162565954.issue14006@psf.upfronthosting.co.za> Message-ID: <1331040149.26.0.217232834604.issue14006@psf.upfronthosting.co.za> Eli Bendersky added the comment: > BTW, the issue 6488 is still opened. I did not check if there's something left to do before to close it. The fundamental problem issue #6488 was opened for still exists - the docs use the term "path" without defining it. This should be addressed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 14:55:45 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 06 Mar 2012 13:55:45 +0000 Subject: [issue14181] Support getbuffer redirection scheme in memoryview In-Reply-To: <1330763362.99.0.43231376241.issue14181@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset da2aaced21bd by Stefan Krah in branch 'default': Issue #14181: Improve clarity in the documentation for the multi-purpose http://hg.python.org/cpython/rev/da2aaced21bd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 15:12:44 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Tue, 06 Mar 2012 14:12:44 +0000 Subject: [issue1641544] rlcompleter tab completion in pdb Message-ID: <1331043164.78.0.305726944597.issue1641544@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 15:19:55 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 06 Mar 2012 14:19:55 +0000 Subject: [issue14181] Support getbuffer redirection scheme in memoryview In-Reply-To: <1330763362.99.0.43231376241.issue14181@psf.upfronthosting.co.za> Message-ID: <1331043595.52.0.581145528082.issue14181@psf.upfronthosting.co.za> Stefan Krah added the comment: OK, for me the view->obj issues are done. The new tests indicate that we can silently keep backwards compatibility for view->obj==NULL, but I suppressed that fact in the documentation because it's already complicated enough. Perhaps we might want to deprecate (if one can deprecate an undocumented feature) view->obj==NULL at some point. Stefan, thanks for bringing all this up on python-dev! ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 15:32:13 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 06 Mar 2012 14:32:13 +0000 Subject: [issue14208] No way to recover original argv with python -m In-Reply-To: <1331016803.5.0.715499259579.issue14208@psf.upfronthosting.co.za> Message-ID: <1331044333.98.0.0734227114497.issue14208@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +brett.cannon, eric.araujo, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 15:50:59 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 06 Mar 2012 14:50:59 +0000 Subject: [issue13719] bdist_msi upload fails In-Reply-To: <1325855918.9.0.207720990162.issue13719@psf.upfronthosting.co.za> Message-ID: <1331045459.17.0.311631061665.issue13719@psf.upfronthosting.co.za> ?ric Araujo added the comment: I?m working on this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 16:02:24 2012 From: report at bugs.python.org (James Pickering) Date: Tue, 06 Mar 2012 15:02:24 +0000 Subject: [issue14209] pkgutil.iter_zipimport_modules ignores the prefix parameter for packages Message-ID: <1331046144.89.0.833633660995.issue14209@psf.upfronthosting.co.za> New submission from James Pickering : If you run pkgutil.iter_zipimport_modules with a prefix parameter, and the module in question is a package, then the prefix parameter is ignored. The most visible symptom of this is when running pkgutil.walk_packages for a zipfile. Imagine we have a module structure like this (or create one): a/ a/__init__.py a/b/ a/b/__init.__py If we put this structure in a directory, add the directory to sys.path, and run pkgutil.walk_packages(), it will find modules "a" and "a.b". If we put this structure in a zipfile, however, we add this file to sys.path, and run pkgutil.walk_packages(), it will find modules "a" and "b". This is because pkgutil.iter_zipimport_modules ignores the prefix parameter "a.". This is incorrect. This can be fixed by changing line ~344 of Lib/pkgutil.py from: yield fn[0], True to yield prefix + fn[0], True Thanks, James P.s, This is my first Python bug report. I apologise in advance for any poor etiquette. ---------- components: Library (Lib) messages: 155018 nosy: James.Pickering priority: normal severity: normal status: open title: pkgutil.iter_zipimport_modules ignores the prefix parameter for packages type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 16:11:22 2012 From: report at bugs.python.org (guilherme-pg) Date: Tue, 06 Mar 2012 15:11:22 +0000 Subject: [issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters In-Reply-To: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> Message-ID: <1331046682.52.0.546159934997.issue14191@psf.upfronthosting.co.za> guilherme-pg added the comment: I uploaded an incomplete patch that might address the issue so it can be discussed. This patch introduces 'greedy_star', a new constructor parameter to ArgumentParser that makes "*" positional arguments behave as expected in the test case. The patch doesn't yet update the documentation and doesn't include test cases, but I'll be glad to provide those changes in a next version. It is admittedly hackish, but I haven't found a better solution so far. Looking forward for your comments. ---------- keywords: +patch nosy: +guilherme-pg Added file: http://bugs.python.org/file24745/14191.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 16:36:47 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Tue, 06 Mar 2012 15:36:47 +0000 Subject: [issue14210] add filename completion to pdb Message-ID: <1331048207.84.0.206422925925.issue14210@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : This would be extra nice because I would not have to fill in the entire path manually when I'm setting a b(reak). ---------- components: Library (Lib) messages: 155020 nosy: tshepang priority: normal severity: normal status: open title: add filename completion to pdb type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 17:35:37 2012 From: report at bugs.python.org (Jim Jewett) Date: Tue, 06 Mar 2012 16:35:37 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: <1331051737.81.0.0806691062949.issue14205@psf.upfronthosting.co.za> Jim Jewett added the comment: Can't this be triggered by non-malicious code that just happened to have a python comparison and get hit with a thread switch? I'm not sure how often it happens, but today it would not be visible to the user; after the patch, users will see a sporadic failure that they can't easily defend against. Would it be worth adding a counter to lookdict, so that one modification is OK, but 5 aren't? ---------- nosy: +Jim.Jewett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 17:39:09 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 06 Mar 2012 16:39:09 +0000 Subject: [issue13860] PyBuffer_FillInfo() return value In-Reply-To: <1327513279.1.0.452976234811.issue13860@psf.upfronthosting.co.za> Message-ID: <1331051949.56.0.527768375045.issue13860@psf.upfronthosting.co.za> Changes by Stefan Krah : ---------- dependencies: -bytearray_getbuffer: unnecessary code resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> adapt sphinx-quickstart for windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 17:39:42 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 06 Mar 2012 16:39:42 +0000 Subject: [issue13860] PyBuffer_FillInfo() return value In-Reply-To: <1327513279.1.0.452976234811.issue13860@psf.upfronthosting.co.za> Message-ID: <1331051982.36.0.014759808301.issue13860@psf.upfronthosting.co.za> Changes by Stefan Krah : ---------- superseder: adapt sphinx-quickstart for windows -> bytearray_getbuffer: unnecessary code _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 17:54:11 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Mar 2012 16:54:11 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1331051737.81.0.0806691062949.issue14205@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > Can't this be triggered by non-malicious code that just happened to have a python comparison and get hit with a thread switch? The issue was triggered without threads.If the __eq__ method of the objects used for keys use C functions releasing the GIL, you may trigger the issue. > Would it be worth adding a counter to lookdict, so that one modification is OK, but 5 aren't? If you implement a special type modifying the dict that contains the object, you should implement your own retry function on lookup failure (catch RuntimeError). Honestly, if you get RuntimeError, you should change your program, not retry the lookup! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 17:56:29 2012 From: report at bugs.python.org (Mark Shannon) Date: Tue, 06 Mar 2012 16:56:29 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1331051737.81.0.0806691062949.issue14205@psf.upfronthosting.co.za> Message-ID: <4F5641BE.40301@hotpy.org> Mark Shannon added the comment: Jim Jewett wrote: > Jim Jewett added the comment: > > Can't this be triggered by non-malicious code that just happened to have a python comparison and get hit with a thread switch? So, they are writing to a dict in one thread while reading from the same dict in another thread, without any external locks and with keys written in Python. > > I'm not sure how often it happens, but today it would not be visible to the user; after the patch, users will see a sporadic failure that they can't easily defend against. > I suspect, they are already seeing sporadic failures. I think raising an exception is better than weird failures. We should document the new behaviour, as it is a change in semantics. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 17:59:20 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Mar 2012 16:59:20 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: Message-ID: STINNER Victor added the comment: > If the __eq__ method of the > objects used for keys use C functions releasing the GIL, you may > trigger the issue. Oh, I mean: trigger the issue with threads. I hope that your objects don't call C functions like open() in their __eq__() method! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 18:19:05 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Mar 2012 17:19:05 +0000 Subject: [issue14211] Don't rely on borrowed _PyType_Lookup() reference in PyObject_GenericSetAttr() Message-ID: <1331054345.96.0.65871889242.issue14211@psf.upfronthosting.co.za> New submission from STINNER Victor : PyObject_GenericSetAttr() doesn't keep a reference to the descriptor: Python does crash if the descriptor is destroyed while the attribute is set. Attached patch keeps a reference to the desriptor to avoid the crash. A smililar was done in PyObject_GenericGetAttr() 8 years with the changelog "fix obscure crash in descriptor handling", see the changeset 941d49a65f06. The patch fixes Lib/test/crashers/borrowed_ref_2.py and so removes it. ---------- files: type_lookup_ref.patch keywords: patch messages: 155025 nosy: haypo priority: normal severity: normal status: open title: Don't rely on borrowed _PyType_Lookup() reference in PyObject_GenericSetAttr() Added file: http://bugs.python.org/file24746/type_lookup_ref.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 18:19:56 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Mar 2012 17:19:56 +0000 Subject: [issue14211] Don't rely on borrowed _PyType_Lookup() reference in PyObject_GenericSetAttr() In-Reply-To: <1331054345.96.0.65871889242.issue14211@psf.upfronthosting.co.za> Message-ID: <1331054396.35.0.406313395045.issue14211@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 18:20:03 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Mar 2012 17:20:03 +0000 Subject: [issue14211] Don't rely on borrowed _PyType_Lookup() reference in PyObject_GenericSetAttr() In-Reply-To: <1331054345.96.0.65871889242.issue14211@psf.upfronthosting.co.za> Message-ID: <1331054403.65.0.558603189287.issue14211@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- components: +Interpreter Core versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 18:21:44 2012 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 06 Mar 2012 17:21:44 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <4F5641BE.40301@hotpy.org> Message-ID: Guido van Rossum added the comment: On Tue, Mar 6, 2012 at 8:56 AM, Mark Shannon wrote: > > Mark Shannon added the comment: > > Jim Jewett wrote: >> Jim Jewett added the comment: >> >> Can't this be triggered by non-malicious code that just happened to have a python comparison and get hit with a thread switch? > > So, they are writing to a dict in one thread while reading from the same > dict in another thread, without any external locks and with keys written > in Python. >> >> I'm not sure how often it happens, but today it would not be visible to the user; after the patch, users will see a sporadic failure that they can't easily defend against. >> > I suspect, they are already seeing sporadic failures. > I think raising an exception is better than weird failures. > > We should document the new behaviour, as it is a change in semantics. +1 on everything you said. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 18:29:08 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Mar 2012 17:29:08 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: <1331054948.34.0.136068089018.issue14205@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 18:43:11 2012 From: report at bugs.python.org (Jim Jewett) Date: Tue, 06 Mar 2012 17:43:11 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <4F5641BE.40301@hotpy.org> Message-ID: Jim Jewett added the comment: On Tue, Mar 6, 2012 at 11:56 AM, Mark Shannon wrote: > Jim Jewett: >> Can't this be triggered by non-malicious code that just happened >> to have a python comparison and get hit with a thread switch? > So, they are writing to a dict in one thread while reading from the > same dict in another thread, without any external locks and with > keys written in Python. Correct. For example, it could be a configuration manager, or a cache, or even a worklist. If they're just adding new keys, or even deleting other (==> NOT the one being looked up) keys, why should that keep them from finding the existing, unchanged keys? >> I'm not sure how often it happens, but today it would not be visible >> to the user; after the patch, users will see a sporadic failure that >> they can't easily defend against. > I suspect, they are already seeing sporadic failures. How? The chain terminates as soon as the dict doesn't resize; without malicious intent, the odds of hitting several resizes in a row are so miniscule that it probably hasn't even slowed them down. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 19:00:16 2012 From: report at bugs.python.org (Maciej Fijalkowski) Date: Tue, 06 Mar 2012 18:00:16 +0000 Subject: [issue14212] Segfault when using re.finditer over mmap Message-ID: <1331056816.2.0.964506318301.issue14212@psf.upfronthosting.co.za> New submission from Maciej Fijalkowski : Example to get a segfault attached. Crashes under python3 as well. ---------- files: x.py messages: 155028 nosy: fijall priority: normal severity: normal status: open title: Segfault when using re.finditer over mmap type: crash versions: Python 2.7 Added file: http://bugs.python.org/file24747/x.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 19:05:10 2012 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 06 Mar 2012 18:05:10 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: Message-ID: Guido van Rossum added the comment: On Tue, Mar 6, 2012 at 9:43 AM, Jim Jewett wrote: > > Jim Jewett added the comment: > > On Tue, Mar 6, 2012 at 11:56 AM, Mark Shannon wrote: > >> Jim Jewett: >>> Can't this be triggered by non-malicious code that just happened >>> to have a python comparison and get hit with a thread switch? > >> So, they are writing to a dict in one thread while reading from the >> same dict in another thread, without any external locks and with >> keys written in Python. > > Correct. ?For example, it could be a configuration manager, or a > cache, or even a worklist. ?If they're just adding new keys, or even > deleting other (==> NOT the one being looked up) keys, why should that > keep them from finding the existing, unchanged keys? Use a lock or a built-in key class. I realize that neither is ideal, but then, neither was the old situation. >>> I'm not sure how often it happens, but today it would not be visible >>> to the user; after the patch, users will see a sporadic failure that >>> they can't easily defend against. > >> I suspect, they are already seeing sporadic failures. > > How? > > The chain terminates as soon as the dict doesn't resize; without > malicious intent, the odds of hitting several resizes in a row are so > miniscule that it probably hasn't even slowed them down. Now I'm torn. If we'd have this RuntimeError from the start, would we consider it a flaw in the dict implementation or a feature? The RuntimeError when changing a dict's size while iterating over it is definitely a feature (so as to allow the implementation to rehash everything upon insert/delete). But this is not quite the same. Or is it? On the one hand I think the scenario is pretty unlikely (mostly because it involves a user-defined comparison); OTOH it would be quite nasty to debug. Or would it? You do get a decent error message... Note that Victor's alternate fix (nomodify.diff) has the same problem -- it just raises RuntimeError in the mutating thread rather than in the lookup thread. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 19:18:36 2012 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 06 Mar 2012 18:18:36 +0000 Subject: [issue14213] python33.dll not removed on uninstallation Message-ID: <1331057916.51.0.575841714998.issue14213@psf.upfronthosting.co.za> New submission from Vinay Sajip : I built an MSI for Python 3.3 on Windows 7 and installed from it - the resulting installation seems to work OK in that it passes all tests except test_tcl (intermittent failure). However, when I uninstall, python33.dll is left behind in System32. If I rebuild Python and the MSI after some changes and reinstall, the old python33.dll is not overwritten with the new one. ---------- components: Installation, Windows messages: 155030 nosy: loewis, vinay.sajip priority: normal severity: normal status: open title: python33.dll not removed on uninstallation type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 19:23:12 2012 From: report at bugs.python.org (Jim Jewett) Date: Tue, 06 Mar 2012 18:23:12 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1331058192.41.0.698368281361.issue7652@psf.upfronthosting.co.za> Jim Jewett added the comment: (1) I think this module would benefit greatly from a map explaining what each file does, and perhaps from some reorganization. As best I can yet tell, there are about ~130 files, over a dozen directories, but the only ones that directly affect the implementation are a subset (~33) of the *.c and *h files in Modules/_decimal/ (and not subdirectories). Even files that do affect the implementation, such as mpdecimal.c, also seem to have functions thrown in just for testing small pieces of functionality, such as Newton Division. There may also be some code that really isn't needed, except possibly for backwards compatibility, and could be #ifdef'ed or at least commented. For example, the comments above io.c function _mpd_strneq(const char *s, const char *l, const char *u, size_t n) mention working around the Turkish un/dotted-i problem when lowercasing -- but why is a decimal library even worried about casing? (2) Is assembly allowed? If not, please make it clear that vcdiv64.asm is just an optional speedup, and that the code doesn't rely upon it. (3) Are there parts of this library that provide functionality NOT in the current decimal library? If so, this should be at least documented, and perhaps either removed or exposed. ---------- nosy: +Jim.Jewett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 19:36:04 2012 From: report at bugs.python.org (Brian Curtin) Date: Tue, 06 Mar 2012 18:36:04 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1331058964.4.0.713821243499.issue7652@psf.upfronthosting.co.za> Changes by Brian Curtin : ---------- nosy: -brian.curtin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 19:53:25 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 06 Mar 2012 18:53:25 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331060005.44.0.23218454398.issue14200@psf.upfronthosting.co.za> Martin v. L?wis added the comment: That pythonw suddenly closes is a separate issue: if pythonw attempts to write to stderr, it crashes. To get your example to "run" in pythonw.exe, try pythonw.exe Lib\idlelib\idle.py 2> out.txt I think the behavior of pythonw terminating when it can't write to stderr is actually correct: an exception is raised on attempting to write to stderr, which then can be printed (because there is no stderr). So the real fault here is the traceback that python.exe reports. To fix this, I think rpc.py should learn to marshal exceptions back to the subprocess. Then the initial sys.stdout.write should raise a UnicodeError (which it currently doesn't, either). This would get into the displayhook, which would then run use sys_displayhook_unencodable to backslashescape the unsupported character. I'll attach a patch that at least makes the exception UnicodeEncodeError. ---------- keywords: +patch Added file: http://bugs.python.org/file24748/unicodeerror.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 20:09:31 2012 From: report at bugs.python.org (Matthew Barnett) Date: Tue, 06 Mar 2012 19:09:31 +0000 Subject: [issue14212] Segfault when using re.finditer over mmap In-Reply-To: <1331056816.2.0.964506318301.issue14212@psf.upfronthosting.co.za> Message-ID: <1331060971.82.0.0312627548218.issue14212@psf.upfronthosting.co.za> Matthew Barnett added the comment: It segfaults because it attempts to access the buffer of an mmap that has been closed. It would be certainly be more friendly if it checked whether the mmap was still open and, if not, raised an exception instead. ---------- nosy: +mrabarnett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 21:07:35 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 06 Mar 2012 20:07:35 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1331058192.41.0.698368281361.issue7652@psf.upfronthosting.co.za> Message-ID: <20120306200733.GA744@sleipnir.bytereef.org> Stefan Krah added the comment: Jim, thanks for taking a look at this. Jim Jewett wrote: > (1) I think this module would benefit greatly from a map explaining > what each file does, and perhaps from some reorganization. Just MAP.txt in the top level directory? Amaury suggested moving the library into a subdirectory. I'm not sure about that. The library would be out of sight, but is that a good thing? > As best I can yet tell, there are about ~130 files, over a dozen directories, > but the only ones that directly affect the implementation are a subset (~33) > of the *.c and *h files in Modules/_decimal/ (and not subdirectories). Indeed the top level directory contains _decimal.c and all files from libmpdec. Almost all files are required. The three subdirectories contain: tests/ -> library tests python/ -> extended module tests literature/ -> pointers to papers and explanations for trickier algorithms. > Even files that do affect the implementation, such as mpdecimal.c, > also seem to have functions thrown in just for testing small pieces > of functionality, such as Newton Division. That is correct. They were deliberately added in that place because they rely on a couple of inline functions and I have a policy of testing the exact code that the original function relies on. The alternative is to extract all functions needed, move them to the test directory and hope that the code doesn't get stale. But if you have a better idea, I'd be glad to hear it: I don't like the test functions in that place either. The reason that Newton Division is tested for ridiculously small precisions like prec=1 is that it should pass IBM's test suite just like the regular division function. (Also, small precisions are most likely to expose problems). > There may also be some code that really isn't needed, except possibly for > backwards compatibility, and could be #ifdef'ed or at least commented. I'm not aware of any except for whole files: mpsignal.c -> signaling wrappers for the mpdecimal.c functions, not needed for _decimal.c but part of libmpdec. mptest.h -> header for running the tests. bench.c -> library benchmark. > Turkish un/dotted-i problem when lowercasing -- but why is a decimal > library even worried about casing? "Infinity", "InFinItY", "iNF" are all allowed by the specification. > (2) Is assembly allowed? I was under the assumption that it is allowed: Python/pymath.c:23: __asm__ __volatile__ ("fnstcw %0" : "=m" (cw)); Python/pymath.c:28: __asm__ __volatile__ ("fldcw %0" : : "m" (cw)); Python/ceval.c:43: asm volatile ("mftbu %0" : "=r" (tbu) ); Python/ceval.c:44: asm volatile ("mftb %0" : "=r" (tb) ); Python/ceval.c:45: asm volatile ("mftbu %0" : "=r" (tbu2)); Python/ceval.c:59: __asm__ __volatile__("rdtsc" : "=A" (val)) Python/ceval.c:69: __asm__ __volatile__("rdtsc" : \ > If not, please make it clear that vcdiv64.asm is just an optional speedup, > and that the code doesn't rely upon it. No code relies on asm. Assembly is only used for the double word mul/divmod primitives in typearith.h and the Pentium PRO modular multiplication in umodarith.h, and there are ANSI versions for everything. The library really compiles with any compiler I have tested, including compilers without uint64_t like CompCert (CompCert does not compile Python for example, but for other reasons). > (3) Are there parts of this library that provide functionality NOT > in the current decimal library? If so, this should be at least > documented, and perhaps either removed or exposed. Apart from mpsignal.c (see above), there are probably a couple of things in the header files like mpd_invroot(). _mpd_qinvroot() from mpdecimal.c *is* needed because the square root is calculated in terms of the inverse square root. Are these (probably) minor instances of additional functionality a big problem for you? Because for me it would be a hassle to maintain diverging versions of libmpdec and the Python version of libmpdec. This is also related to testing: The complete test suite (all tests against decNumber and decimal.py) under Valgrind takes 8 months to run. My question is: Where should I document these things and in what detail? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 21:08:10 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 06 Mar 2012 20:08:10 +0000 Subject: [issue14158] test_mailbox fails if file or dir named by support.TESTFN exists In-Reply-To: <1330523782.18.0.210760102045.issue14158@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 1112c2f602b3 by Vinay Sajip in branch '2.7': Closes #14158: We now track test_support.TESTFN cleanup, and test_mailbox uses shutil.rmtree for simpler code. http://hg.python.org/cpython/rev/1112c2f602b3 ---------- status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 21:14:52 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 06 Mar 2012 20:14:52 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1330989355.43.0.694884986324.issue7652@psf.upfronthosting.co.za> Message-ID: <20120306201451.GB744@sleipnir.bytereef.org> Stefan Krah added the comment: STINNER Victor wrote: > How can I help to integrate this module into CPython? It would be fantastic if you could take a look at _decimal.c, for example to find some incompatibilities between _decimal.c and decimal.py. mpdecimal.c could also always profit from another audit. That's the only file that still needs to go through my second self-audit round. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 21:33:48 2012 From: report at bugs.python.org (Jim Jewett) Date: Tue, 06 Mar 2012 20:33:48 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: Message-ID: Jim Jewett added the comment: On Tue, Mar 6, 2012 at 1:05 PM, Guido van Rossum Jim Jewett: >>... ?If they're just adding new keys, or even deleting other >> (==> NOT the one being looked up) keys, why should that >> keep them from finding the existing, unchanged keys? >> ... The chain terminates as soon as the dict doesn't resize; without >> malicious intent, the odds of hitting several resizes in a row are so >> miniscule that it probably hasn't even slowed them down. > Now I'm torn. If we'd have this RuntimeError from the start, would we > consider it a flaw in the dict implementation or a feature? I would personally have considered it a flaw. Wrapping all dict access just in case some other code added a weird key seems ugly and inefficient. > RuntimeError when changing a dict's size while iterating over it is > definitely a feature (so as to allow the implementation to rehash > everything upon insert/delete). In that case, you've explicitly asked for the whole set (or at least a snapshot); the RuntimeError indicates that you can't get it. Maybe there should be a way to say "I don't need the set to be perfect", but there isn't, and you aren't getting what you actually did ask for, so an Error is appropriate. But in this case, you're asking for a specific key, and the key is there. It may even be a perfectly normal string, that just happened to hash-collide with something some other code inserted. The RuntimeError exposes a race condition to user code -- and it may not be the code that stuck the oddball class in the dict in the first place. > Note that Victor's alternate fix (nomodify.diff) has the same problem > -- it just raises RuntimeError in the mutating thread rather than in > the lookup thread. Right; I'm saying that raising an error is the wrong thing to do. But there is an analogy to the hash-code change vs collision counting. Breaking an application that got unlucky once is wrong. But if the bad luck *continues* to the point where it would only occur one time in a zillion, RuntimeError is better than a likely infinite loop. (It really was a question initially, but I've now convinced at least myself.) I would rather see something like replacing 349 else { 350 /* The compare did major nasty stuff to the 351 * dict: start over. 352 * XXX A clever adversary could prevent this 353 * XXX from terminating. 354 */ 355 return lookdict(mp, key, hash); with 349 else { 350 /* The compare did major nasty stuff to the 351 * dict: start over. 352 * XXX A clever adversary could prevent this 353 * XXX from terminating. 354 */ 355 return lookdict_paranoid(mp, key, hash, 1); where lookdict_paranoid is a near-copy of lookdict that adds a paranoia parameter and replaces those same lines with else { /* The compare did major nasty stuff *again*. */ if (paranoia < PARANOIA_LEVEL) { return lookdict_paranoid(mp, key, hash, paranoia+1); } /* Something is wrong; raise a RuntimeError. */ } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 22:55:12 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 06 Mar 2012 21:55:12 +0000 Subject: [issue14213] python33.dll not removed on uninstallation In-Reply-To: <1331057916.51.0.575841714998.issue14213@psf.upfronthosting.co.za> Message-ID: <1331070912.75.0.915422582531.issue14213@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I guess this is a misconfiguration for your system. This DLL is reference-counted, and you must have arranged the reference count to be >1 somehow. Inspect the MSI log for details. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 23:04:45 2012 From: report at bugs.python.org (Glenn Linderman) Date: Tue, 06 Mar 2012 22:04:45 +0000 Subject: [issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters In-Reply-To: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> Message-ID: <1331071485.22.0.769678692488.issue14191@psf.upfronthosting.co.za> Glenn Linderman added the comment: Interesting that the behavior is intentional, yet it accepts positional parameters either before, or after, or between optional (flag) parameters. This seems to me to be a case where proper documentation of the intention would have led to the realization that it is easier to fix the code than the documentation. The only definition of positional parameters I could find in the present documentation is: When parse_args() is called, optional arguments will be identified by the - prefix, and the remaining arguments will be assumed to be positional: This is simple and succinct, but leads to my interpretation that they can be anywhere, intermixed with optional arguments. Further, optparse, which argparse attempts to replace, permitted positional arguments to be intermixed with optional arguments, see new file t13.py which demonstrates that. To document that positional parameters must be grouped together, yet can appear anywhere, the documentation would have to get much more verbose... something like All positional parameters must be grouped together in a single sequence. However, that group of parameters may have optional parameters either before it or after it, or there may be optional parameter both before it and after it. ---------- Added file: http://bugs.python.org/file24749/t13.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 6 23:36:44 2012 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 06 Mar 2012 22:36:44 +0000 Subject: [issue14213] python33.dll not removed on uninstallation In-Reply-To: <1331057916.51.0.575841714998.issue14213@psf.upfronthosting.co.za> Message-ID: <1331073404.86.0.441170521185.issue14213@psf.upfronthosting.co.za> Vinay Sajip added the comment: Yes, the refcount was 1 after uninstallation - possibly it's been like that for a long time. I'll close the issue, but one thing occurs to me - isn't the DLL's version resource updated when you rebuild? Why wouldn't the newer version in an MSI being installed overwrite the older one in Windows\System32? ---------- resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 00:32:37 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 06 Mar 2012 23:32:37 +0000 Subject: [issue14213] python33.dll not removed on uninstallation In-Reply-To: <1331057916.51.0.575841714998.issue14213@psf.upfronthosting.co.za> Message-ID: <1331076757.1.0.704482852814.issue14213@psf.upfronthosting.co.za> Martin v. L?wis added the comment: The version number is not changed on every rebuild, only when patchlevel.h changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 01:34:50 2012 From: report at bugs.python.org (Florian M) Date: Wed, 07 Mar 2012 00:34:50 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: <1331080490.25.0.364181608207.issue14202@psf.upfronthosting.co.za> Florian M added the comment: I wrote some documentation with the information I found on http://wiki.python.org/moin/PullDom and some custom examples. ---------- nosy: +flomm Added file: http://bugs.python.org/file24750/xml.dom.pulldom.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 01:46:02 2012 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Wed, 07 Mar 2012 00:46:02 +0000 Subject: [issue14208] No way to recover original argv with python -m In-Reply-To: <1331016803.5.0.715499259579.issue14208@psf.upfronthosting.co.za> Message-ID: <1331081162.38.0.658912483066.issue14208@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 02:30:50 2012 From: report at bugs.python.org (Miki Tebeka) Date: Wed, 07 Mar 2012 01:30:50 +0000 Subject: [issue14214] test_concurrent_futures hangs Message-ID: <1331083850.64.0.939496340029.issue14214@psf.upfronthosting.co.za> New submission from Miki Tebeka : Running "make test" on 3.3a source tree on Ubuntu 11.10 (64bit) hangs at test_concurrent_futures ---------- components: Tests messages: 155043 nosy: tebeka priority: normal severity: normal status: open title: test_concurrent_futures hangs versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 02:38:34 2012 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 07 Mar 2012 01:38:34 +0000 Subject: [issue14208] No way to recover original argv with python -m In-Reply-To: <1331016803.5.0.715499259579.issue14208@psf.upfronthosting.co.za> Message-ID: <1331084314.27.0.985813954267.issue14208@psf.upfronthosting.co.za> Nick Coghlan added the comment: This is closely related to PEP 395, since multiprocessing currently hits the same issue in trying to figure out the correct setting for sys.argv0. I quite like the sys.__argv__ idea for preserving the *exact* underlying command line (Alex Gaynor was recently asking for something similar to this). In the meantime, it should be possible to work around the problem by running the affected subprocess invocations (i.e. when __main__.__package__ exists and is not empty) with something like: launch_template = """ import runpy, sys sys.argv[:] = {argv} sys.path[:] = {path} runpy._run_module_as_main({main}) """ import sys, subprocess, os.path, __main__ main_base = os.path.basename(__main.__file__).splitext()[0] main_ref = __main__.__package__ + "." + main_base launch = launch_template.format(argv=sys.argv, path=sys.path, main=main_ref) subprocess.call(launch, shell=True, executable=sys.executable) Note: the above isn't tested code, since it's an approach that only occurred to me recently and I haven't had a chance to fully explore it myself. However, if it works, we could make use of it in 2.7 and 3.2 to fix multiprocessing's current misbehaviour on Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 04:49:18 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 07 Mar 2012 03:49:18 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1331092158.54.0.241055711835.issue7652@psf.upfronthosting.co.za> Benjamin Peterson added the comment: The scripts for generating code would preferably go in a Tools/decimal directory. ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 05:04:03 2012 From: report at bugs.python.org (Jim Jewett) Date: Wed, 07 Mar 2012 04:04:03 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <20120306200733.GA744@sleipnir.bytereef.org> Message-ID: Jim Jewett added the comment: On Tue, Mar 6, 2012 at 3:07 PM, Stefan Krah > Jim Jewett wrote: >> (1) ?I think this module would benefit greatly from a map explaining >> ? ? ?what each file does, and perhaps from some reorganization. > Just MAP.txt in the top level directory? That should work. There may be better names, but I can't think of any just now. > Amaury suggested moving > the library into a subdirectory. I'm not sure about that. The > library would be out of sight, but is that a good thing? cdecimal certainly needs a subdirectory similar to those for _io, _ctypes, _multiprocessing, and _sqlite. It *may* make sense to move some of the subdirectories around. (On the other hand, it may not; if the tests in Lib/test/ end up delegating back, that is probably OK.) I believe it would be helpful to move non-code (project files, etc) to separate directories. Whether you need *additional* subdirectories within _cdecimal to subcategorize the .c and .h files, I'm not sure -- because I didn't get in deep enough to know what they should be. If the categorization let people focus on the core, that would be helpful, but it wasn't clear to me which files were part of the exported API and which were implementation details. Are there are clear distinctions (type info/python bindings/basic arithmetic/advanced algorithms/internal-use-only/???) >> As best I can yet tell, there are about ~130 files, over a dozen directories, >> but the only ones that directly affect the implementation are a subset (~33) >> of the *.c and *h files in Modules/_decimal/ (and not subdirectories). > Indeed the top level directory contains _decimal.c and all files > from libmpdec. Almost all files are required. Would it make sense to integrate only cdecimal, and to treat libmpdec as an external dependency that (usually) gets updated with each Python feature release, the way that sqlite is? > The three subdirectories contain: > ?tests/ ? ? ? -> ?library tests > ?python/ ? ? ?-> ?extended module tests I would really expect that to still be under tests, and I would expect a directory called python to contain code written in python, or at least python bindings. > ?literature/ ?-> ?pointers to papers and explanations for trickier algorithms. >> Even files that do affect the implementation, such as mpdecimal.c, >> also seem to have functions thrown in just for testing small pieces >> of functionality, such as Newton Division. > That is correct. They were deliberately added in that place because they rely > on a couple of inline functions and I have a policy of testing the exact code > that the original function relies on. How important is it that these functions be inline? Would it at least be OK to wrap them in stubs for exporting, so that the test logic could be places with the others tests? (I worry that some tests may stop getting run if someone else modifies the build process and doesn't notice the unusual location.) > The alternative is to extract all functions needed, move them to the test > directory and hope that the code doesn't get stale. I agree that copying is bad. I'll trust your judgement on the need for inline. But given: ALWAYS_INLINE int mpd_word_digits(mpd_uint_t word) I don't see anything wrong with exporting: int _testhelp_mpd_word_digits(mpd_uint_t word) { return mpd_word_digits(word); } >> Turkish un/dotted-i problem when lowercasing -- but why is a decimal >> library even worried about casing? > "Infinity", "InFinItY", "iNF" are all allowed by the specification. OK; so is io.c part of the library, or part of the python binding? Given that this is targeted at 3.3 or later, would it make sense to either use casefolding, or check the kind? (If it isn't ASCII, it can't be the word "INF".) Are there only a certain number of strings that will ever matter, such as INF, NAN, and INFINITY, so that a case statement would work? tolower() with an extra check for the turkish undotted lower case i? What you have may well be the best compromise, but it bothers me to see text processing tools redone in a numeric type -- particularly without knowing why they are needed. >> (2) ?Is assembly allowed? > I was under the assumption that it is allowed: I'm honestly not sure, but I think that was one of the reasons stackless was never integrated. >> If not, please make it clear that vcdiv64.asm is just an optional speedup, >> and that the code doesn't rely upon it. > No code relies on asm. Assembly is only used for the double word mul/divmod > primitives in typearith.h and the Pentium PRO modular multiplication in > umodarith.h, and there are ANSI versions for everything. Good enough, though I would rather see that as a comment near the assembly. >> (3) Are there parts of this library that provide functionality NOT >> ? ? in the current decimal library? ?If so, this should be at least >> ? ? documented, and perhaps either removed or exposed. > Apart from mpsignal.c (see above), there are probably a couple of things > in the header files like mpd_invroot(). _mpd_qinvroot() from mpdecimal.c > *is* needed because the square root is calculated in terms of the > inverse square root. > Are these (probably) minor instances of additional functionality a > big problem for you? Because for me it would be a hassle to maintain > diverging versions of libmpdec and the Python version of libmpdec. I'm not worried about the header files. I am worried about what is exposed to python, but just documenting it (docstrings and the module .rst) may be OK. But I'm also worried that there may be fair amounts of code that are effectively dead after the "remove any names not in decimal.py" importing trick. If so, I would at least like that in some sort of #ifdef, so that people don't spend too much time trying to make sense of it. That said, if you plan to maintain an external libmpdec regardless of what happens, then it makes even more sense to integrate (at most) the bindings, and to treat libmpdec as an external dependency. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 05:09:43 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 07 Mar 2012 04:09:43 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1331093383.53.0.464429203652.issue7652@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Speaking of inline, the "inline" keyword will have to go because it's not C89. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 05:53:09 2012 From: report at bugs.python.org (Eli Bendersky) Date: Wed, 07 Mar 2012 04:53:09 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: <1331095989.73.0.923951467283.issue14202@psf.upfronthosting.co.za> Eli Bendersky added the comment: Thanks, Florian - I will review the patch. At first sight it looks much better than what exists. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 06:10:18 2012 From: report at bugs.python.org (Jim Jewett) Date: Wed, 07 Mar 2012 05:10:18 +0000 Subject: [issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate In-Reply-To: <1327767887.13.0.0676848614688.issue13897@psf.upfronthosting.co.za> Message-ID: <1331097018.28.0.356824358453.issue13897@psf.upfronthosting.co.za> Jim Jewett added the comment: I think the latest patch is indeed cleaner. ---------- nosy: +Jim.Jewett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 07:40:53 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Wed, 07 Mar 2012 06:40:53 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1331102453.28.0.208631879384.issue7652@psf.upfronthosting.co.za> Ramchandra Apte added the comment: But we could check if the compiler supports the inline keyword and use it if available. ---------- nosy: +ramchandra.apte _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 07:43:21 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Wed, 07 Mar 2012 06:43:21 +0000 Subject: [issue14215] http://www.python.org/dev/peps/ title is python.org Message-ID: <1331102600.96.0.801989456091.issue14215@psf.upfronthosting.co.za> New submission from Ramchandra Apte : The http://www.python.org/dev/peps browser title is python.org I suggest it should be changed to "PEP Index". ---------- messages: 155051 nosy: ramchandra.apte priority: normal severity: normal status: open title: http://www.python.org/dev/peps/ title is python.org type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 08:22:21 2012 From: report at bugs.python.org (Nicholas Cole) Date: Wed, 07 Mar 2012 07:22:21 +0000 Subject: [issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode) In-Reply-To: <1250855012.37.0.745791721367.issue6755@psf.upfronthosting.co.za> Message-ID: <1331104941.45.0.241697290828.issue6755@psf.upfronthosting.co.za> Nicholas Cole added the comment: I hope that this is the right bug to file this on (I'm getting lost in all of the curses bugs!). I'm testing out the 3.3a1, and I've run into the following issue. On previous releases addch() could accept curses.ACS_HLINE and similar. Attempting to use the same code now raises the exception: OverflowError: byte doesn't fit in chtype. I'm sure this is related to the new code that uses addwstr(), but currently code that used to work will crash. I can't work out a fix myself, because I don't fully understand the problem, but I'm happy to provide sample code if it will help. Nicholas ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 08:36:19 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 07 Mar 2012 07:36:19 +0000 Subject: [issue14208] No way to recover original argv with python -m In-Reply-To: <1331016803.5.0.715499259579.issue14208@psf.upfronthosting.co.za> Message-ID: <1331105779.01.0.609136012262.issue14208@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Instead of sys.__argv__, may I suggest sys.argv_original or somesuch. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 08:40:27 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 07 Mar 2012 07:40:27 +0000 Subject: [issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode) In-Reply-To: <1250855012.37.0.745791721367.issue6755@psf.upfronthosting.co.za> Message-ID: <1331106027.78.0.996302341774.issue6755@psf.upfronthosting.co.za> R. David Murray added the comment: Since this bug is about adding a new feature, it is unlikely to be the correct bug for this to be against. Given that you've identified a regression, I suggest you open a new bug with a reproducer, and we'll set it to release blocker. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 08:47:18 2012 From: report at bugs.python.org (Qian Liu) Date: Wed, 07 Mar 2012 07:47:18 +0000 Subject: [issue14216] ImportError: No module named binascii Message-ID: <1331106438.0.0.366139924133.issue14216@psf.upfronthosting.co.za> New submission from Qian Liu : File "~/PythonInstall/lib/python2.7/multiprocessing/process.py", line 129, in start from .forking import Popen File "~/PythonInstall/lib/python2.7/multiprocessing/forking.py", line 58, in from pickle import Pickler File "~/PythonInstall/lib/python2.7/pickle.py", line 1266, in import binascii as _binascii ImportError: No module named binascii The used OS is: [GCC 3.4.6 20060404 (Red Hat 3.4.6-9)] on linux2 NOTED: There is no error when I import "binascii" in Python 2.7.2 on Window XP. How to solve it? Many thanks. ---------- components: Library (Lib) messages: 155055 nosy: liuqianhn priority: normal severity: normal status: open title: ImportError: No module named binascii type: crash versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 09:19:11 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 07 Mar 2012 08:19:11 +0000 Subject: [issue14217] text output pretends to be code Message-ID: <1331108351.7.0.269278733631.issue14217@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : The attached patch removes the highlighting. I hope there's a better way to do this, instead of this hack. I searched the Sphinx and docutils docs and failed to find something better. ---------- assignee: docs at python components: Documentation files: tis-not-code.patch keywords: patch messages: 155056 nosy: docs at python, tshepang priority: normal severity: normal status: open title: text output pretends to be code versions: Python 3.1, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24751/tis-not-code.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 09:23:02 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Wed, 07 Mar 2012 08:23:02 +0000 Subject: [issue14216] ImportError: No module named binascii In-Reply-To: <1331106438.0.0.366139924133.issue14216@psf.upfronthosting.co.za> Message-ID: <1331108582.64.0.487466677486.issue14216@psf.upfronthosting.co.za> Martin v. L?wis added the comment: You probably did something wrong when installing Python. How exactly did you get it into ~/PythonInstall? ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 09:23:45 2012 From: report at bugs.python.org (Mark Shannon) Date: Wed, 07 Mar 2012 08:23:45 +0000 Subject: [issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate In-Reply-To: <1331097018.28.0.356824358453.issue13897@psf.upfronthosting.co.za> Message-ID: <4F571B0F.5020309@hotpy.org> Mark Shannon added the comment: Jim Jewett wrote: > http://bugs.python.org/review/13897/diff/4186/14521 > File Python/sysmodule.c (right): > > http://bugs.python.org/review/13897/diff/4186/14521#newcode211 > Python/sysmodule.c:211: while ((exc_info->exc_type == NULL || > exc_info->exc_type == Py_None) && > This while loop is new, but it isn't clear how it is related to > encapsulating the exception state. Is this fixing an unrelated bug, or > is it from generators, or ..? > > http://bugs.python.org/review/13897/show Running generators form a stack, much like frames. Calling a generator with next or send, pushes it onto the stack, yielding pops it. Now consider, if you will, the threadstate object as a sort of non-yielding (it cannot be popped) generator which forms the base of this stack. In this patch, rather than swapping the exception state between generator-owned frame and threadstate whenever entering or leaving a generator, each generator (and the threadstate) has its own exception state. It order to find the topmost exception state, sys.exc_info searches the stack of generators until it finds one. In practice the generator stack will be very shallow, only 1 or 2 deep, as it is rare to have generators calling other generators (although this will become a bit more common with PEP 380). ---------- title: Move fields relevant to sys.exc_info out of frame into generator/threadstate -> Move fields relevant to sys.exc_info out of frame into generator/threadstate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 09:30:01 2012 From: report at bugs.python.org (Case Van Horsen) Date: Wed, 07 Mar 2012 08:30:01 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1331109001.85.0.604470016125.issue7652@psf.upfronthosting.co.za> Case Van Horsen added the comment: I've found some differences between decimal and cdecimal. cdecimal 2.3 does not support the __ceil__ and __floor__ methods that exist in decimal. math.ceil converts a cdecimal.Decimal instance into a float before finding the ceiling. This can generate incorrect results. >>> import decimal >>> import math >>> math.ceil(decimal.Decimal("12345678901234567890.1")) 12345678901234567168 The decimal module in previous versions returns the correct answer 12345678901234567891 cdecimal.Decimal instances do not emulate the various single-underscore methods of a decimal.Decimal instance. In gmpy2, I use _int, _exp, _sign, and _is_special to convert a decimal.Decimal into an exact fraction. I realize the issue is with gmpy2 and I will fix gmpy2, but there may be other code that uses those methods. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 09:48:29 2012 From: report at bugs.python.org (Qian Liu) Date: Wed, 07 Mar 2012 08:48:29 +0000 Subject: [issue14216] ImportError: No module named binascii In-Reply-To: <1331108582.64.0.487466677486.issue14216@psf.upfronthosting.co.za> Message-ID: Qian Liu added the comment: Dear Martin, Thanks for your reply. I went to the folder of python after "tar -zxvf Python-2.7.2.tgz" and do the following operations: ./configure --prefix="~/PythonInstall" make make install where "~" represent the path in my computer and it is long in the report; so, I replaced it by ~. Then, I put "~/PythonInstall"bin and "~/PythonInstall/lib/python2.7/"site-packages into PATH and PYTHONPATH. Anything wrong here? Thanks for your help. Best regards, Qian Liu On Wed, Mar 7, 2012 at 4:23 PM, Martin v. L?wis wrote: > > Martin v. L?wis added the comment: > > You probably did something wrong when installing Python. How exactly did > you get it into ~/PythonInstall? > > ---------- > nosy: +loewis > > _______________________________________ > Python tracker > > _______________________________________ > > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 09:49:58 2012 From: report at bugs.python.org (Eric Snow) Date: Wed, 07 Mar 2012 08:49:58 +0000 Subject: [issue992389] attribute error due to circular import Message-ID: <1331110198.59.0.832878428919.issue992389@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 10:06:34 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 07 Mar 2012 09:06:34 +0000 Subject: [issue14218] include rendered output in addition to markup Message-ID: <1331111194.08.0.943407781198.issue14218@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : For devguide/documenting, If you show me markup, also show me what output it gives me. It's kinda tedious to keep building the markup just to verify how it's rendered. ---------- components: Devguide messages: 155061 nosy: ezio.melotti, tshepang priority: normal severity: normal status: open title: include rendered output in addition to markup type: enhancement versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 10:06:48 2012 From: report at bugs.python.org (Steven Bethard) Date: Wed, 07 Mar 2012 09:06:48 +0000 Subject: [issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters In-Reply-To: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> Message-ID: <1331111208.1.0.942593790703.issue14191@psf.upfronthosting.co.za> Steven Bethard added the comment: > optparse, which argparse attempts to replace, permitted positional > arguments to be intermixed with optional arguments Sure, but optparse didn't actually parse positional arguments - it just threw them into a bag, and then you had to group them and convert them however you wanted afterwards. Argparse, instead, was designed to let you specify the groups of positional arguments. Your situation is a little different because you just want to throw all the positional arguments into a bag again. Not that there's anything wrong with that - it's just not the primary use case argparse had in mind. > The only definition of positional parameters I could find... Yeah, it looks like there's no good documentation on positional vs. optional parameters. Somewhere obvious, perhaps right at the beginning of the add_argument() documentation, there should probably be something like: Argparse groups the command line argument strings into two types of groups: optional arguments, which are a sequence of command line strings that begin with a flag like "-v" or "--verbose", and positional arguments, which are a sequence of command line strings that do not begin with a flag. The add_argument() method allows you to specify how many command line strings each of your optional or positional arguments should consume, how those strings should be converted into Python objects, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 10:07:00 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Wed, 07 Mar 2012 09:07:00 +0000 Subject: [issue14216] ImportError: No module named binascii In-Reply-To: <1331106438.0.0.366139924133.issue14216@psf.upfronthosting.co.za> Message-ID: <1331111220.15.0.184213019008.issue14216@psf.upfronthosting.co.za> Martin v. L?wis added the comment: There are some minor errors indeed: the syntax for PATH and PYTHONPATH is wrong (don't use quotes (") in the middle of the value). Also, putting site-packages into PYTHONPATH should not be necessary. I think the main cause might be the incorrect --prefix argument. Don't use "~/PythonInstall", but "$HOME/PythonInstall". Also, when I try this, I get configure: error: expected an absolute directory name for --prefix: ~/PythonInstall so you must have made something different (or you have used a shell different from bash), else you would have gotten the same error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 10:12:42 2012 From: report at bugs.python.org (Qian Liu) Date: Wed, 07 Mar 2012 09:12:42 +0000 Subject: [issue14216] ImportError: No module named binascii In-Reply-To: <1331111220.15.0.184213019008.issue14216@psf.upfronthosting.co.za> Message-ID: Qian Liu added the comment: Dear Martin, Many thanks for your help and your reply. I will correct the errors and let you know the result. best regards, Qian Liu On Wed, Mar 7, 2012 at 5:07 PM, Martin v. L?wis wrote: > > Martin v. L?wis added the comment: > > There are some minor errors indeed: the syntax for PATH and PYTHONPATH is > wrong (don't use quotes (") in the middle of the value). Also, putting > site-packages into PYTHONPATH should not be necessary. > > I think the main cause might be the incorrect --prefix argument. Don't use > "~/PythonInstall", but "$HOME/PythonInstall". Also, when I try this, I get > > configure: error: expected an absolute directory name for --prefix: > ~/PythonInstall > > so you must have made something different (or you have used a shell > different from bash), else you would have gotten the same error. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 10:13:39 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 07 Mar 2012 09:13:39 +0000 Subject: [issue14219] start the Class tutorial in a more gentle manner Message-ID: <1331111619.2.0.272575522063.issue14219@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : Looking at Doc/tutorial/classes, the section "Python Scopes and Namespaces" is full of heavy/deep information. I expect that people who would be able to properly digest that info are people who are already advanced at Python, and therefore maybe it should be moved to some cookbook (or language reference). I would prefer something gentler, since the tutorial is for Python newbies who aren't necessarily conversant with OO concepts. There can of course be links to heavier material for deeper understanding. ---------- assignee: docs at python components: Documentation messages: 155065 nosy: docs at python, tshepang priority: normal severity: normal status: open title: start the Class tutorial in a more gentle manner type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 10:15:33 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 07 Mar 2012 09:15:33 +0000 Subject: [issue14219] start the Class tutorial in a more gentle manner In-Reply-To: <1331111619.2.0.272575522063.issue14219@psf.upfronthosting.co.za> Message-ID: <1331111733.05.0.353084960486.issue14219@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 10:35:22 2012 From: report at bugs.python.org (Qian Liu) Date: Wed, 07 Mar 2012 09:35:22 +0000 Subject: [issue14216] ImportError: No module named binascii In-Reply-To: Message-ID: Qian Liu added the comment: Dear Martin, I did the following operations ./configure --prefix= "/img01/home/liuqian1/PLAprediction/software/PythonInstall" make make install and then MPYTHONHOME="/img01/home/liuqian1/PLAprediction/software/PythonInstall" PATH="$MPYTHONHOME/bin":$PATH However, when I try ' python -c "import binascii;" ', *I still got the same error.* By the way, I can run ' python -c "import binascii;" ' on Window XP and in python 2.5.5. Our technician also installed python 3.0 in our Linux server without the 'prefex' in the "./configure" but we got the same error also. Any more comments about this? Thanks for your help in advance. Best regards, Qian Liu On Wed, Mar 7, 2012 at 5:12 PM, Qian Liu wrote: > > Qian Liu added the comment: > > Dear Martin, > > Many thanks for your help and your reply. I will correct the errors and let > you know the result. > > best regards, > Qian Liu > > On Wed, Mar 7, 2012 at 5:07 PM, Martin v. L?wis >wrote: > > > > > Martin v. L?wis added the comment: > > > > There are some minor errors indeed: the syntax for PATH and PYTHONPATH is > > wrong (don't use quotes (") in the middle of the value). Also, putting > > site-packages into PYTHONPATH should not be necessary. > > > > I think the main cause might be the incorrect --prefix argument. Don't > use > > "~/PythonInstall", but "$HOME/PythonInstall". Also, when I try this, I > get > > > > configure: error: expected an absolute directory name for --prefix: > > ~/PythonInstall > > > > so you must have made something different (or you have used a shell > > different from bash), else you would have gotten the same error. > > > > ---------- > > > > _______________________________________ > > Python tracker > > > > _______________________________________ > > > > > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 11:06:00 2012 From: report at bugs.python.org (Sandro Tosi) Date: Wed, 07 Mar 2012 10:06:00 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: <1331111194.08.0.943407781198.issue14218@psf.upfronthosting.co.za> Message-ID: <1331114760.57.0.200656507649.issue14218@psf.upfronthosting.co.za> Sandro Tosi added the comment: 3.1 and 2.6 as in security fix only: please don't add those versions for non-sec issue ---------- nosy: +sandro.tosi versions: -Python 2.6, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 11:06:34 2012 From: report at bugs.python.org (Sandro Tosi) Date: Wed, 07 Mar 2012 10:06:34 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: <1331111194.08.0.943407781198.issue14218@psf.upfronthosting.co.za> Message-ID: <1331114794.41.0.646773979448.issue14218@psf.upfronthosting.co.za> Sandro Tosi added the comment: additionally, devguide has no version associated with it. ---------- versions: -Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 11:07:13 2012 From: report at bugs.python.org (Sandro Tosi) Date: Wed, 07 Mar 2012 10:07:13 +0000 Subject: [issue14219] start the Class tutorial in a more gentle manner In-Reply-To: <1331111619.2.0.272575522063.issue14219@psf.upfronthosting.co.za> Message-ID: <1331114833.04.0.218454290969.issue14219@psf.upfronthosting.co.za> Sandro Tosi added the comment: see msg155067 ---------- nosy: +sandro.tosi versions: -Python 2.6, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 11:28:58 2012 From: report at bugs.python.org (Stefan Krah) Date: Wed, 07 Mar 2012 10:28:58 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: Message-ID: <20120307102856.GA3236@sleipnir.bytereef.org> Stefan Krah added the comment: Jim Jewett wrote: > Whether you need *additional* subdirectories within _cdecimal to > subcategorize the .c and .h files, I'm not sure -- because I didn't > get in deep enough to know what they should be. If the categorization > let people focus on the core, that would be helpful, but it wasn't > clear to me which files were part of the exported API and which were > implementation details. Are there are clear distinctions (type > info/python bindings/basic arithmetic/advanced > algorithms/internal-use-only/???) OK, as a basis for discussion I've added: http://hg.python.org/features/cdecimal/file/8b75c2825508/Modules/_decimal/FILEMAP.txt I didn't mention the main reason why _decimal.c and libmpdec are in a flat directory: Building the library first and then the module from the library led to problems on at least Windows and AIX. That's why I started to treat all libmpdec files as part of the module, list them as dependencies in setup.py and let distutils figure everything out. Distutils also can figure out automatically if a Mac OS build happens to be a "universal" build and things like that. The build process is very well tested by now and it took quite a while to figure everything out, so I'd be reluctant to change the flat hierarchy. > > ??python/ ?? ?? ??-> ??extended module tests > > I would really expect that to still be under tests, and I would expect > a directory called python to contain code written in python, or at > least python bindings. Could you explain? The python/ directory contains deccheck.py, formathelper.py etc. > Would it at least be OK to wrap them in stubs for exporting, so that > the test logic could be places with the others tests? (I worry that > some tests may stop getting run if someone else modifies the build > process and doesn't notice the unusual location.) tests/runtest.c won't compile then. I'll look into the stub and also the _testhelp suggestions. > > "Infinity", "InFinItY", "iNF" are all allowed by the specification. > > OK; so is io.c part of the library, or part of the python binding? I see a potential source of confusion: io.c is firmly part of the library. All PEP 3101 formatting is part of libmpdec, because I like the mini language. io.c only understands ASCII and UTF-8 fill characters. It is the *library* tests that would fail under the Turkish locale (if not for _mpd_strneq). > Good enough, though I would rather see that as a comment near the assembly. Comments how to enforce an ANSI build (much slower!) are in LIBTEST.txt and now also in FILEMAP.txt. > I'm not worried about the header files. I am worried about what is > exposed to python, but just documenting it (docstrings and the module > .rst) may be OK. > > But I'm also worried that there may be fair amounts of code that are > effectively dead after the "remove any names not in decimal.py" > importing trick. If so, I would at least like that in some sort of > #ifdef, so that people don't spend too much time trying to make sense > of it. It's the opposite: names from decimal.py starting with an underscore that are not in _decimal are removed. If I don't use that trick, I end up with about 50 additional symbols from decimal.py: import decimal # the C version dir(decimal) ... '_ContextManager', '_Infinity', '_Log10Memoize', ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 11:37:54 2012 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 07 Mar 2012 10:37:54 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <20120307102856.GA3236@sleipnir.bytereef.org> Message-ID: <4F573A7C.9060609@egenix.com> Marc-Andre Lemburg added the comment: Does the C version have a C API importable as capsule ? If not, could you add one and a decimal.h to go with it ? This makes integration in 3rd party modules a lot easier. Thanks, -- Marc-Andre Lemburg eGenix.com ________________________________________________________________________ 2012-02-13: Released eGenix pyOpenSSL 0.13 http://egenix.com/go26 2012-02-09: Released mxODBC.Zope.DA 2.0.2 http://egenix.com/go25 ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 12:09:03 2012 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 07 Mar 2012 11:09:03 +0000 Subject: [issue14220] "yield from" kills generator on re-entry Message-ID: <1331118543.05.0.972821091665.issue14220@psf.upfronthosting.co.za> New submission from Stefan Behnel : Based on the existing "test_attempted_yield_from_loop" in Lib/test/test_pep380.py, I wrote this test and I wonder why it does not work: """ def test_attempted_reentry(): """ >>> for line in test_attempted_reentry(): print(line) g1: starting Yielded: y1 g1: about to yield from g2 g2: starting Yielded: y2 g2: about to yield from g1 g2: caught ValueError Yielded: y3 g1: after delegating to g2 Yielded: y4 """ trace = [] def g1(): trace.append("g1: starting") yield "y1" trace.append("g1: about to yield from g2") yield from g2() trace.append("g1: after delegating to g2") yield "y4" def g2(): trace.append("g2: starting") yield "y2" trace.append("g2: about to yield from g1") try: yield from gi except ValueError: trace.append("g2: caught ValueError") else: trace.append("g1 did not raise ValueError on reentry") yield "y3" gi = g1() for y in gi: trace.append("Yielded: %s" % (y,)) return trace """ In current CPython, I get this: """ Failed example: for line in test_attempted_reentry(): print(line) Expected: g1: starting Yielded: y1 g1: about to yield from g2 g2: starting Yielded: y2 g2: about to yield from g1 g2: caught ValueError Yielded: y3 g1: after delegating to g2 Yielded: y4 Got: g1: starting Yielded: y1 g1: about to yield from g2 g2: starting Yielded: y2 g2: about to yield from g1 g2: caught ValueError Yielded: y3 """ Even though I catch the ValueError (raised on generator reentry) at the position where I run the "yield from", the outer generator (g1) does not continue to run after the termination of g2. It shouldn't normally have an impact on the running g1 that someone attempts to jump back into it, but it clearly does here. I noticed this while trying to adapt the implementation for Cython, because the original test was one of the few failing cases and it made the code jump through the generator support code quite wildly. ---------- components: Interpreter Core messages: 155072 nosy: scoder priority: normal severity: normal status: open title: "yield from" kills generator on re-entry type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 12:35:56 2012 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 07 Mar 2012 11:35:56 +0000 Subject: [issue14208] No way to recover original argv with python -m In-Reply-To: <1331016803.5.0.715499259579.issue14208@psf.upfronthosting.co.za> Message-ID: <1331120156.91.0.359970014947.issue14208@psf.upfronthosting.co.za> Nick Coghlan added the comment: In framing a question for Raymond regarding his preference for avoiding the __argv__ name, I realised I agreed with him. My reasoning is that, when a Python process starts, sys.stdin is sys.__stdin__, sys.stdout is sys.__stdout__ and sys.stderr is sys.__stderr__. The dunder versions capture the original values as created by the interpreter initialisation, not the raw OS level file descriptors. The new attribute proposed here is different - it's not an immutable copy of the original value of sys.argv, it's a *different* sequence altogether. The analogy with the standard stream initial value capture created by the use of sys.__argv__ would actually be misleading rather than helpful. For the same reason, Raymond's specific argv_original suggestion doesn't really work for me. Alas, I can think of several other possible colours for that particular bikeshed (such as argv_os, argv_main, argv_raw, argv_platform, argv_executable) without having any particular good way of choosing between them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 12:37:42 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Mar 2012 11:37:42 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1331120262.34.0.732302308921.issue11379@psf.upfronthosting.co.za> ?ric Araujo added the comment: FYI, note that http://wiki.python.org/moin/MiniDom says this about minidom: ?slow and very memory hungry DOM implementation?. As you have seen, I have applied my ToC order change. Now in order to commit my s/lightweight/minimal/ change and close this report, can you Eli say if minidom-desc-2 is okay (I?m asking you because this patch touches text you just added, contrary to minidom-desc)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 12:39:46 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Mar 2012 11:39:46 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: <1331120386.41.0.255679936885.issue14202@psf.upfronthosting.co.za> ?ric Araujo added the comment: Merged Florian?s version with the original file to create a patch. ---------- Added file: http://bugs.python.org/file24752/pulldom-documentation.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 12:44:18 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 07 Mar 2012 11:44:18 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: <1331114760.57.0.200656507649.issue14218@psf.upfronthosting.co.za> Message-ID: Tshepang Lekhonkhobe added the comment: > Sandro Tosi added the comment: > > 3.1 and 2.6 as in security fix only: please don't add those versions for non-sec issue Sorry, I thought there was an exception for documentation issues. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 12:44:38 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Wed, 07 Mar 2012 11:44:38 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1331120262.34.0.732302308921.issue11379@psf.upfronthosting.co.za> Message-ID: <20120307124436.Horde.3YtJfKGZi1VPV0ok77ejpgA@webmail.df.eu> Martin v. L?wis added the comment: > FYI, note that http://wiki.python.org/moin/MiniDom says this about > minidom: ?slow and very memory hungry DOM implementation?. Thanks for the notice; I have now fixed that wording. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 12:53:50 2012 From: report at bugs.python.org (Eli Bendersky) Date: Wed, 07 Mar 2012 11:53:50 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1331121230.48.0.918068362401.issue11379@psf.upfronthosting.co.za> Eli Bendersky added the comment: ?ric, I'm ok with replacing "lightweight" by "minimal", unless others have objections. Regarding the specifics of the minidom-desc-2.diff patch: "proficient with the DOM" I'm not sure "the DOM" is semantically correct. "the W3C-DOM interface" is more precise. Also, I still think that a note would be more appropriate, but I don't care enough to argue about it :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 13:18:47 2012 From: report at bugs.python.org (Stefan Krah) Date: Wed, 07 Mar 2012 12:18:47 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1331092158.54.0.241055711835.issue7652@psf.upfronthosting.co.za> Message-ID: <20120307121846.GA4311@sleipnir.bytereef.org> Stefan Krah added the comment: Benjamin Peterson wrote: > The scripts for generating code would preferably go in a Tools/decimal directory. Hmm, do you mean the gen*.py scripts? The output is generated by decimal.py and used for testing libmpdec. While the syntax resembles that of the *.decTest files, only tests/runtest can handle the format. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 13:22:15 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Wed, 07 Mar 2012 12:22:15 +0000 Subject: [issue14214] test_concurrent_futures hangs In-Reply-To: <1331083850.64.0.939496340029.issue14214@psf.upfronthosting.co.za> Message-ID: <1331122935.04.0.770390474689.issue14214@psf.upfronthosting.co.za> Nadeem Vawda added the comment: Is this a single failure that you encountered, or have you been able to reproduce it on subsequent runs? I haven't seen a failure in test_concurrent_futures in 10-15 runs of "make test" (also on Ubuntu 11.10 64-bit). ---------- nosy: +nadeem.vawda stage: -> needs patch type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 13:27:24 2012 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 07 Mar 2012 12:27:24 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1331123244.75.0.904354074481.issue11379@psf.upfronthosting.co.za> Stefan Behnel added the comment: Oh, right, I missed that part. I also think that a visible note is better. And +1 for "W3C DOM interface". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 13:29:10 2012 From: report at bugs.python.org (Stefan Krah) Date: Wed, 07 Mar 2012 12:29:10 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1331093383.53.0.464429203652.issue7652@psf.upfronthosting.co.za> Message-ID: <20120307122909.GB4311@sleipnir.bytereef.org> Stefan Krah added the comment: Benjamin Peterson wrote: > Speaking of inline, the "inline" keyword will have to go because it's not C89. Do you happen to know a free compiler that builds Python but does not understand "inline"? I'm asking because without testing you can never really be sure: For example I added support for compilers without uint64_t, but all major compilers (gcc, suncc, icc, VS) of course have uint64_t. Then I finally found CompCert, and discovered that a couple of things were missing in the headers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 13:43:14 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 07 Mar 2012 12:43:14 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <20120307122909.GB4311@sleipnir.bytereef.org> Message-ID: <1331123950.3435.5.camel@localhost.localdomain> Antoine Pitrou added the comment: > Do you happen to know a free compiler that builds Python but does not > understand "inline"? I'm asking because without testing you can never > really be sure: You could use Py_LOCAL_INLINE, but most compilers should inline small functions automatically, AFAIK. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 13:52:30 2012 From: report at bugs.python.org (=?utf-8?b?SHJ2b2plIE5pa8WhacSH?=) Date: Wed, 07 Mar 2012 12:52:30 +0000 Subject: [issue1469629] __dict__ = self in subclass of dict causes a memory leak? Message-ID: <1331124750.33.0.843684628683.issue1469629@psf.upfronthosting.co.za> Hrvoje Nik?i? added the comment: Could this patch please be committed to Python? We have just run into this problem in production, where our own variant of AttrDict was shown to be leaking. It is possible to work around the problem by implementing explicit __getattr__ and __setattr__, but that is both slower and trickier to get right. ---------- nosy: +hniksic _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 13:59:27 2012 From: report at bugs.python.org (Florent Xicluna) Date: Wed, 07 Mar 2012 12:59:27 +0000 Subject: [issue1469629] __dict__ = self in subclass of dict causes a memory leak Message-ID: <1331125167.58.0.359898231532.issue1469629@psf.upfronthosting.co.za> Changes by Florent Xicluna : ---------- nosy: +flox title: __dict__ = self in subclass of dict causes a memory leak? -> __dict__ = self in subclass of dict causes a memory leak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 14:23:00 2012 From: report at bugs.python.org (Stefan Krah) Date: Wed, 07 Mar 2012 13:23:00 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1331109001.85.0.604470016125.issue7652@psf.upfronthosting.co.za> Message-ID: <20120307132258.GA4435@sleipnir.bytereef.org> Stefan Krah added the comment: Case Van Horsen wrote: > cdecimal 2.3 does not support the __ceil__ and __floor__ Thanks. I'll look into that. > cdecimal.Decimal instances do not emulate the various single-underscore methods of a decimal.Decimal instance. In gmpy2, I use _int, _exp, _sign, and _is_special to convert a decimal.Decimal into an exact fraction. I realize the issue is with gmpy2 and I will fix gmpy2, but there may be other code that uses those methods. There seems to be a real need for getting (sign, coeff, exp). I think psycopg2 uses a painful way to get an integer coefficient via as_tuple(). What should really be added is either as_triple(), which would return (sign, coeff, exp) with an integer coefficient or make these attributes official: Decimal.sign Decimal.coeff Decimal.exp I have to think about implementing Decimal._int etc. Somehow I feel that doing so would send a wrong signal: People shouldn't assume that they'll get away with using private methods and attributes. Also, of course they'll keep using these private methods until they are finally deprecated, and *then* they'll have to change things. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 14:49:45 2012 From: report at bugs.python.org (Stefan Krah) Date: Wed, 07 Mar 2012 13:49:45 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1331123950.3435.5.camel@localhost.localdomain> Message-ID: <20120307134943.GA4928@sleipnir.bytereef.org> Stefan Krah added the comment: Antoine Pitrou wrote: > You could use Py_LOCAL_INLINE, but most compilers should inline small > functions automatically, AFAIK. At the time I wrote it I benchmarked everything. I'm pretty sure that gcc did not inline larger functions like mpd_qresize_zero() and mpd_word_digits() and even some smaller ones that are declared ALWAYS_INLINE. Also, the static inline functions in the header files are absolutely crucial for speed. I recall that Mark initially said that in the Modules hierarchy not every module would need to compile. Now, _decimal is already tested with gcc, clang, icc, suncc, Visual Studio, and success has been reported with xlc[1]. CompCert compiles libmpdec but not Python. _ctypes does not compile with icc and suncc. Unlike _ctypes, _decimal has a fallback in the form of decimal.py. So, perhaps as an alternative we could leave the inlines and wait for build failure reports? [1] compilation success, one of the numerous AIX issues on bugs.python.org with loading the module was encountered IIRC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 14:52:06 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 07 Mar 2012 13:52:06 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <20120307134943.GA4928@sleipnir.bytereef.org> Message-ID: <1331128081.3435.8.camel@localhost.localdomain> Antoine Pitrou added the comment: > _ctypes does not compile with icc and suncc. Unlike _ctypes, _decimal > has a fallback in the form of decimal.py. So, perhaps as an alternative > we could leave the inlines and wait for build failure reports? Sounds good to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 14:54:23 2012 From: report at bugs.python.org (Stefan Krah) Date: Wed, 07 Mar 2012 13:54:23 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: Message-ID: <20120307135422.GA4951@sleipnir.bytereef.org> Stefan Krah added the comment: Jim Jewett wrote: > implementation details. Are there are clear distinctions (type > info/python bindings/basic arithmetic/advanced > algorithms/internal-use-only/???) I failed to mention that libmpdec also has complete documentation. Perhaps that can answer some questions: http://www.bytereef.org/mpdecimal/doc/libmpdec/index.html http://www.bytereef.org/mpdecimal/doc/libmpdec/functions.html#quiet-functions ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 15:02:18 2012 From: report at bugs.python.org (Thomas Heller) Date: Wed, 07 Mar 2012 14:02:18 +0000 Subject: [issue14201] libc.time != libc['time'] In-Reply-To: <1330957421.08.0.5889949548.issue14201@psf.upfronthosting.co.za> Message-ID: <1331128938.56.0.736804976042.issue14201@psf.upfronthosting.co.za> Thomas Heller added the comment: The rationale was to allow different packages (for example) in the same process to have their own private instance of a foreign function, with possibly different definitions of restype, argtypes and/or errcheck. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 15:53:14 2012 From: report at bugs.python.org (Miki Tebeka) Date: Wed, 07 Mar 2012 14:53:14 +0000 Subject: [issue14214] test_concurrent_futures hangs In-Reply-To: <1331083850.64.0.939496340029.issue14214@psf.upfronthosting.co.za> Message-ID: <1331131994.35.0.186786344022.issue14214@psf.upfronthosting.co.za> Miki Tebeka added the comment: I happended several times. Ran it this morning an got passed it, however other tests failed though: ====================================================================== ERROR: test_anydbm_creation (test.test_dbm.TestCase-dbm.ndbm) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/miki/src/Python-3.3.0a1/Lib/test/test_dbm.py", line 70, in test_anydbm_creation self.read_helper(f) File "/home/miki/src/Python-3.3.0a1/Lib/test/test_dbm.py", line 111, in read_helper self.assertEqual(self._dict[key], f[key.encode("ascii")]) KeyError: b'0' ====================================================================== ERROR: test_anydbm_modification (test.test_dbm.TestCase-dbm.ndbm) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/miki/src/Python-3.3.0a1/Lib/test/test_dbm.py", line 85, in test_anydbm_modification self.read_helper(f) File "/home/miki/src/Python-3.3.0a1/Lib/test/test_dbm.py", line 111, in read_helper self.assertEqual(self._dict[key], f[key.encode("ascii")]) KeyError: b'0' ====================================================================== ERROR: test_anydbm_read (test.test_dbm.TestCase-dbm.ndbm) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/miki/src/Python-3.3.0a1/Lib/test/test_dbm.py", line 91, in test_anydbm_read self.read_helper(f) File "/home/miki/src/Python-3.3.0a1/Lib/test/test_dbm.py", line 111, in read_helper self.assertEqual(self._dict[key], f[key.encode("ascii")]) KeyError: b'0' ---------------------------------------------------------------------- Ran 18 tests in 0.149s FAILED (errors=3) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 15:56:41 2012 From: report at bugs.python.org (Erik Johansson) Date: Wed, 07 Mar 2012 14:56:41 +0000 Subject: [issue14201] libc.time != libc['time'] In-Reply-To: <1330957421.08.0.5889949548.issue14201@psf.upfronthosting.co.za> Message-ID: <1331132201.56.0.060891261987.issue14201@psf.upfronthosting.co.za> Erik Johansson added the comment: Perhaps this behaviour should be documented somewhere (unless it already is)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 16:06:02 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 07 Mar 2012 15:06:02 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: <1331132762.04.0.818237052572.issue14205@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: rhettinger -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 16:08:30 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Mar 2012 15:08:30 +0000 Subject: [issue14201] libc.time != libc['time'] In-Reply-To: <1330957421.08.0.5889949548.issue14201@psf.upfronthosting.co.za> Message-ID: <1331132910.71.0.150247391857.issue14201@psf.upfronthosting.co.za> ?ric Araujo added the comment: Item access is documented in this section: http://docs.python.org/library/ctypes#loading-shared-libraries (scroll a bit down looking for __getitem__); the wording about caching is ambiguous with respect to the current behavior. ---------- assignee: -> docs at python components: +Documentation keywords: +easy nosy: +docs at python, eric.araujo stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 16:32:27 2012 From: report at bugs.python.org (Stefan Krah) Date: Wed, 07 Mar 2012 15:32:27 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <4F573A7C.9060609@egenix.com> Message-ID: <20120307153226.GA5702@sleipnir.bytereef.org> Stefan Krah added the comment: Marc-Andre Lemburg wrote: > Does the C version have a C API importable as capsule ? Not yet. I'll try to make a list with proposed function names and post it here. > If not, could you add one and a decimal.h to go with it ? Yes, sure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 16:34:01 2012 From: report at bugs.python.org (Erik Johansson) Date: Wed, 07 Mar 2012 15:34:01 +0000 Subject: [issue14201] Documented caching for shared library's __getattr__ and __getitem__ is incorrect In-Reply-To: <1330957421.08.0.5889949548.issue14201@psf.upfronthosting.co.za> Message-ID: <1331134441.91.0.928537627917.issue14201@psf.upfronthosting.co.za> Erik Johansson added the comment: Ah, I see. I modified the title to reflect this. Perhaps adding this simple example as well can help people (e.g. me) see it? >>> libc.time == libc.time True >>> libc['time'] == libc['time'] False ---------- title: libc.time != libc['time'] -> Documented caching for shared library's __getattr__ and __getitem__ is incorrect _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 17:17:45 2012 From: report at bugs.python.org (Stefan Krah) Date: Wed, 07 Mar 2012 16:17:45 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1331137065.09.0.673206469993.issue7652@psf.upfronthosting.co.za> Stefan Krah added the comment: This issue was raised by Jim on Rietveld: Currently, the order of arguments in Context.__init__() differs from repr(Context): >>> Context() Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-999999999, Emax=999999999, capitals=1, flags=[], traps=[DivisionByZero, Overflow, InvalidOperation]) >>> >>> Context(28, ROUND_HALF_EVEN, -999999999, 999999999, 1, [], [DivisionByZero, Overflow, InvalidOperation]) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.2/decimal.py", line 3774, in __init__ flags = dict([(s, int(s in flags)) for s in _signals]) File "/usr/lib/python3.2/decimal.py", line 3774, in flags = dict([(s, int(s in flags)) for s in _signals]) TypeError: argument of type 'int' is not iterable >>> I find this quite ugly. The repr() order is the good one, since it moves the flag dictionaries to the end. I wanted to change the order in Context.__init__() to match repr(), but I'm not sure if such a change is possible. I don't think Python code would initialize a context without keywords, but C extensions might. ---------- versions: +Python 3.3 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 17:40:57 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Wed, 07 Mar 2012 16:40:57 +0000 Subject: [issue14214] test_concurrent_futures hangs In-Reply-To: <1331083850.64.0.939496340029.issue14214@psf.upfronthosting.co.za> Message-ID: <1331138457.1.0.758266534773.issue14214@psf.upfronthosting.co.za> Nadeem Vawda added the comment: > I happended several times. Hmm. If you hit another failure, can you post the random seed and any other interesting info that might help figure this out? The test_dbm failures look like issue 14120. You might want to follow up there. ---------- nosy: +bquinlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 17:59:17 2012 From: report at bugs.python.org (Max Franks) Date: Wed, 07 Mar 2012 16:59:17 +0000 Subject: [issue9592] Limitations in objects returned by multiprocessing Pool In-Reply-To: <1281726168.11.0.648826556363.issue9592@psf.upfronthosting.co.za> Message-ID: <1331139557.9.0.186757679283.issue9592@psf.upfronthosting.co.za> Max Franks added the comment: Issue 3 is not related to the other 2. See this post http://bugs.python.org/issue5370. As haypo said, it has to do with unpickling objects. The post above gives a solution by using the __setstate__ function. ---------- nosy: +eliquious _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 18:00:08 2012 From: report at bugs.python.org (Brian Quinlan) Date: Wed, 07 Mar 2012 17:00:08 +0000 Subject: [issue14214] test_concurrent_futures hangs In-Reply-To: <1331083850.64.0.939496340029.issue14214@psf.upfronthosting.co.za> Message-ID: <1331139608.7.0.37694045445.issue14214@psf.upfronthosting.co.za> Brian Quinlan added the comment: Could you run just the test_concurrent_futures test, hit ctrl-C at the point where it hangs, and send the traceback here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 18:08:20 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 07 Mar 2012 17:08:20 +0000 Subject: [issue10951] gcc 4.6 warnings In-Reply-To: <1295474318.57.0.129834114348.issue10951@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 2f10c1ad4b21 by Ross Lagerwall in branch 'default': Issue #10951: Fix warnings in the socket module. http://hg.python.org/cpython/rev/2f10c1ad4b21 New changeset 1dd43e939c07 by Ross Lagerwall in branch 'default': Issue #10951: Fix compiler warnings in _sre.c http://hg.python.org/cpython/rev/1dd43e939c07 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 18:28:34 2012 From: report at bugs.python.org (Phillip Feldman) Date: Wed, 07 Mar 2012 17:28:34 +0000 Subject: [issue14221] re.sub backreferences to numbered groups produce garbage Message-ID: <1331141314.19.0.206090274406.issue14221@psf.upfronthosting.co.za> New submission from Phillip Feldman : The first example below works; the second one produces output containing garbage characters. (This came up while I was creating a set of examples for a tutorial on regular expressions). import re text= "The cat ate the rat." print("before: %s" % text) m= re.search("The (\w+) ate the (\w+)", text) text= "The %s ate the %s." % (m.group(2), m.group(1)) print("after : %s" % text) text= "The cat ate the rat." print("before: %s" % text) text= re.sub("(\w+) ate the (\w+)", "\2 ate the \1", text) print("after : %s" % text) ---------- components: Regular Expressions messages: 155100 nosy: Phillip.M.Feldman, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: re.sub backreferences to numbered groups produce garbage type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 18:40:31 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 07 Mar 2012 17:40:31 +0000 Subject: [issue14187] add "annotation" entry to Glossary In-Reply-To: <1330805957.18.0.748865462478.issue14187@psf.upfronthosting.co.za> Message-ID: <1331142031.81.0.350409000513.issue14187@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I'm not sure this would be a worthwhile addition. This language feature is not widely referenced outside the docs for the feature itself. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 18:41:28 2012 From: report at bugs.python.org (Georg Brandl) Date: Wed, 07 Mar 2012 17:41:28 +0000 Subject: [issue14208] No way to recover original argv with python -m In-Reply-To: <1331016803.5.0.715499259579.issue14208@psf.upfronthosting.co.za> Message-ID: <1331142088.84.0.997102704755.issue14208@psf.upfronthosting.co.za> Georg Brandl added the comment: I agree. Maybe I may throw "full_argv" or "executable_argv" (i.e. to be used with exec([sys.executable] + sys.executable_arg)) in the air? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 18:41:32 2012 From: report at bugs.python.org (Ezio Melotti) Date: Wed, 07 Mar 2012 17:41:32 +0000 Subject: [issue14187] add "annotation" entry to Glossary In-Reply-To: <1330805957.18.0.748865462478.issue14187@psf.upfronthosting.co.za> Message-ID: <1331142092.57.0.223766238818.issue14187@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 18:44:02 2012 From: report at bugs.python.org (Glenn Linderman) Date: Wed, 07 Mar 2012 17:44:02 +0000 Subject: [issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters In-Reply-To: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> Message-ID: <1331142242.68.0.00862057646613.issue14191@psf.upfronthosting.co.za> Glenn Linderman added the comment: Improved documentation would certainly help the situation. And yes, I understand that optparse simply returned the set of positional parameters without giving them names, types, or groups. So does getopt, and pretty much all previous art in the arena of command line parsing that I am familiar with. To successfully replace optparse and other prior art, though, there should be an equivalent, although perhaps improved, functionality in argparse. This lack of documentation for the idea that the ordered set of all positional parameters is not treated as a sequence certainly slipped under the covers of optparse functionality when I first read about it when optparse was being added to the stdlib. I had no clue that the specification of positional parameters would do anything other than process the positional parameters sequentially, without being disrupted by intervening optional parameters. The capabilities for naming, and typing those parameters are nice enhancements, but were not seen as redefining what positional parameters are, from its historical definition. Is there wording in the PEP that describes such? Naming and typing and even grouping positional parameters are all nice features... but there should be no undocumented boundaries between positional parameters (or groups of them), and presently there are no documented boundaries, and with prior art there were no boundaries. Having no boundaries among positional parameters is a capability and expectation that has a long history, and tools ported from prior art to argparse need the capability to preserve command line compatibility. Hence, I conclude that, unless this was spelled out in the PEP and I missed it, that having such boundaries is a bug, even if your intentions were otherwise, and that the test case I provided should work. My test was only meant to demonstrate the issue, not to be a particular use case, but there are use cases that would be affected in the same manner as the demonstration. Regarding your suggested documentation, it is more complete than my suggestion, but "sequence" should probably be replaced by "sequence of adjacent" if that is what is meant, because with positional parameters, the historical perspective is that the sequence of positional parameters may be interrupted by optional parameters, but that makes it no less a sequence. I believe that the present syntax for parsing positional parameters should be fixed to handle all positional parameters, because of the history of prior art, and that if there is a need, benefit, or demand for treating positional parameters in groups, then that should be documented and created as additional features. I further cannot figure out how to even parse the additional positional parameters as a separate group, using the current capabilities. My attempt to do so in t14.py failed. ---------- Added file: http://bugs.python.org/file24753/t14.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 18:47:43 2012 From: report at bugs.python.org (Ezio Melotti) Date: Wed, 07 Mar 2012 17:47:43 +0000 Subject: [issue14221] re.sub backreferences to numbered groups produce garbage In-Reply-To: <1331141314.19.0.206090274406.issue14221@psf.upfronthosting.co.za> Message-ID: <1331142463.7.0.654875996244.issue14221@psf.upfronthosting.co.za> Ezio Melotti added the comment: You forgot to use raw strings: >>> text = "The cat ate the rat." >>> print("before: %s" % text) before: The cat ate the rat. >>> text = re.sub("(\w+) ate the (\w+)", r"\2 ate the \1", text) >>> print("after : %s" % text) after : The rat ate the cat. >>> (Maybe you should reconsider writing yet another tutorial about regular expressions, and possibly submit patches to improve the official regex howto if you think it's not good enough.) ---------- assignee: -> ezio.melotti resolution: -> invalid stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 19:58:13 2012 From: report at bugs.python.org (Matthew Barnett) Date: Wed, 07 Mar 2012 18:58:13 +0000 Subject: [issue14212] Segfault when using re.finditer over mmap In-Reply-To: <1331056816.2.0.964506318301.issue14212@psf.upfronthosting.co.za> Message-ID: <1331146693.31.0.878267466642.issue14212@psf.upfronthosting.co.za> Matthew Barnett added the comment: In the function "getstring" in _sre.c, the code obtains a pointer to the characters of the buffer and then releases the buffer. There's a comment before the release: /* Release the buffer immediately --- possibly dangerous but doing something else would require some re-factoring */ PyBuffer_Release(&view); What's happening is that after the mmap is closed the pointer is no longer valid. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 20:01:36 2012 From: report at bugs.python.org (Alex Gaynor) Date: Wed, 07 Mar 2012 19:01:36 +0000 Subject: [issue14212] Segfault when using re.finditer over mmap In-Reply-To: <1331056816.2.0.964506318301.issue14212@psf.upfronthosting.co.za> Message-ID: <1331146896.43.0.74598387463.issue14212@psf.upfronthosting.co.za> Changes by Alex Gaynor : ---------- nosy: +alex _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 20:23:17 2012 From: report at bugs.python.org (Stefan Krah) Date: Wed, 07 Mar 2012 19:23:17 +0000 Subject: [issue14212] Segfault when using re.finditer over mmap In-Reply-To: <1331056816.2.0.964506318301.issue14212@psf.upfronthosting.co.za> Message-ID: <1331148197.75.0.909733315114.issue14212@psf.upfronthosting.co.za> Changes by Stefan Krah : ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 20:38:40 2012 From: report at bugs.python.org (Tasslehoff Kjappfot) Date: Wed, 07 Mar 2012 19:38:40 +0000 Subject: [issue14222] Using time.time() in Queue.get breaks when system time is changed Message-ID: <1331149120.51.0.79082225225.issue14222@psf.upfronthosting.co.za> New submission from Tasslehoff Kjappfot : Queue.get([block[, timeout]]) uses time.time() for calculations of the timeout. If someone changes the system time this breaks. If a timeout of 1 second is set and someone (on a unix system) uses date to set the time 1 hour back, Queue.get will use 1 hour and 1 second to time out. I'm guessing the fix is just to use another library function to measure time, but I don't know if one exists that works on all platforms. ---------- components: Library (Lib) messages: 155106 nosy: tasslehoff priority: normal severity: normal status: open title: Using time.time() in Queue.get breaks when system time is changed type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 20:42:26 2012 From: report at bugs.python.org (Jim Jewett) Date: Wed, 07 Mar 2012 19:42:26 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <20120307102856.GA3236@sleipnir.bytereef.org> Message-ID: Jim Jewett added the comment: On Wed, Mar 7, 2012 at 5:28 AM, Stefan Krah added the comment: > OK, as a basis for discussion I've added: > http://hg.python.org/features/cdecimal/file/8b75c2825508/Modules/_decimal/FILEMAP.txt That is indeed very helpful. So helpful that now I understand well enough to have additional gripes. :D Starting from that URL, I don't actually find setup.py. I am assuming (but would prefer to have the file explicitly state) that _decimal.c and docstrings.h are the only source files, and that setup.py would be the only build infrastructure needed if you already had libmpdec.a. I'm not sure what sort of failures building in the normal order led to, but that is certainly something worth documenting, and (ideally) fixing. I didn't see any mention of the literature subdirectory, which makes me wonder if there were other files not listed in the map. (Not yet curious enough to verify for myself, though.) (*.txt files?) I suppose a subdirectory name like "python" makes sense when you look at the library as a C/C++ project that happens to provide python bindings; as part of the python core, it is misleading. It sounds like it should be named "extended_tests" or some such. (Note that this assumes it is strictly for tests; if you are also using it to provide extra functionality, or to generate some of the source code, then I agree with Benjamin that it should move to tools, and the generated code should have clear comments right at the top warning that it is generated.) Within the library, does io.[ch] really limit itself to ASCII? If so, then I don't know why you're worried about the Turkish i. If you mean generic text, then please don't specify ASCII. Within memory.[ch], how much of this configurability is useful (or even available) to a python user, as opposed to an extension writer? Or is it really just for testing? As in, would it be reasonable to just have a single header with a half-dozen #defines, but to replace that header when doing a memory-test build? Or at least to hide the alternative function definitions inside an obvious #ifdef, so that they don't take up memory and attention when they aren't applicable? Under the Bignum section, it mentions that functions from these files are ultimately used in _mpd_fntmul, but doesn't mention where that is (in the main _cdecimal.c) Also, when it talks about "large arrays", could you clarify that it isn't talking about arrays of values or even matrixes, it is just talking about numbers large enough that even representing them takes at least N bytes? >> Would it at least be OK to wrap them in stubs for exporting, so that >> the test logic could be places with the others tests? ?(I worry that >> some tests may stop getting run if someone else modifies the build >> process and doesn't notice the unusual location.) > tests/runtest.c won't compile then. I'll look into the stub and also > the _testhelp suggestions. OK, let me rephrase. Is newton division exported to users, or used internally, or is it just for testing purposes? _mpd_qtest_newtondiv is documented as a testcase; I would rather see it move to a test file. Why can't it? If it is because of _mpd_qdiv_inf, _settriple, _mpd_qbarrett_divmod, _mpd_real_size (the only apparently internal things it uses), then why are these internal? Could they be exposed at least to test functions? If not, could they at least be wrapped in something that could exposed, such as _testhelp_mpd_qdiv_inf? >> > "Infinity", "InFinItY", "iNF" are all allowed by the specification. >> OK; so is io.c part of the library, or part of the python binding? > I see a potential source of confusion: io.c is firmly part of the > library. [And should therefore be available when used without python?] > All PEP 3101 formatting is part of libmpdec, because I like > the mini language. io.c only understands ASCII and UTF-8 fill characters. > It is the *library* tests that would fail under the Turkish locale > (if not for _mpd_strneq). Are those tests relevant to a _cdecimal built in to python itself? If not, then the comment is at least misleading. Would it make sense to have a directory for files that are used only for the standalone C library, but not when built as part of python? >> Good enough, though I would rather see that as a comment near the assembly. > Comments how to enforce an ANSI build (much slower!) are in LIBTEST.txt > and now also in FILEMAP.txt. I would not have made the leap from that to "What to do if the assembly code needs to be replaced or even just changed." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 20:55:29 2012 From: report at bugs.python.org (Brett Cannon) Date: Wed, 07 Mar 2012 19:55:29 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1331150129.5.0.465086875237.issue2377@psf.upfronthosting.co.za> Brett Cannon added the comment: The finding/loading code in import.c is purely because of the imp module's public API (e.g. imp.find_module()). I have been waiting to find out if importlib would get bootstrapped before making the current module _imp and then creating an imp.py which handles most of the high-level stuff (e.g. imp.py containing find_module() and have it use importlib). That would let all of that C code go away since I already tie into the low-level C API for C-level import function calls. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 20:56:48 2012 From: report at bugs.python.org (Brett Cannon) Date: Wed, 07 Mar 2012 19:56:48 +0000 Subject: [issue8754] quote bad module name in ImportError-like messages In-Reply-To: <1274202200.16.0.392487565261.issue8754@psf.upfronthosting.co.za> Message-ID: <1331150208.91.0.341129238716.issue8754@psf.upfronthosting.co.za> Brett Cannon added the comment: It technically doesn't depend, but it potentially would make this moot. But stuff is going on at the language summit which is going to shift stuff around. ---------- dependencies: -ImportError needs attributes for module and file name _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:00:56 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 07 Mar 2012 20:00:56 +0000 Subject: [issue13719] bdist_msi upload fails In-Reply-To: <1325855918.9.0.207720990162.issue13719@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 077b42a54803 by ?ric Araujo in branch '2.7': Backout buggy patch for #13719 http://hg.python.org/cpython/rev/077b42a54803 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:03:33 2012 From: report at bugs.python.org (Brett Cannon) Date: Wed, 07 Mar 2012 20:03:33 +0000 Subject: [issue1531415] parsetok.c emits warnings by writing to stderr Message-ID: <1331150613.47.0.19883481209.issue1531415@psf.upfronthosting.co.za> Brett Cannon added the comment: It's quite possible you are right, Michele. I don't know if anyone has looked at what exactly is required for _warnings.c compared to pgen. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:06:11 2012 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 07 Mar 2012 20:06:11 +0000 Subject: [issue14220] "yield from" kills generator on re-entry In-Reply-To: <1331118543.05.0.972821091665.issue14220@psf.upfronthosting.co.za> Message-ID: <1331150771.44.0.642968674247.issue14220@psf.upfronthosting.co.za> Stefan Behnel added the comment: Here is an analysis of this (less verbose) code: def g1(): yield "y1" yield from g2() yield "y4" def g2(): yield "y2" try: yield from gi except ValueError: pass # catch "already running" error yield "y3" gi = g1() for y in gi: print("Yielded: %s" % (y,)) This is what it currently does: 1) g1() delegates to a new g2() 2) g2 delegates back to the g1 instance and asks for its next value 3) Python sees the active delegation in g1 and asks g2 for its next value 4) g2 sees that it's already running and throws an exception Ok so far. Now: 5) the exception is propagated into g1 at call level 3), not at level 1)! 6) g1 undelegates and terminates by the exception 7) g2 catches the exception, yields "y3" and then terminates normally 8) g1 gets control back but has already terminated and does nothing Effect: "y4" is not yielded anymore. The problem is in steps 5) and 6), which are handled by g1 at the wrong call level. They shouldn't lead to undelegation and termination in g1, just to an exception being raised in g2. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:08:23 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 07 Mar 2012 20:08:23 +0000 Subject: [issue13719] bdist_msi upload fails In-Reply-To: <1325855918.9.0.207720990162.issue13719@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 7e629bacec87 by ?ric Araujo in branch '3.2': Backout buggy patch committed for #13719 http://hg.python.org/cpython/rev/7e629bacec87 New changeset 17106d7d34b4 by ?ric Araujo in branch 'default': Remove buggy change for #13719 in packaging http://hg.python.org/cpython/rev/17106d7d34b4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:09:12 2012 From: report at bugs.python.org (Brian Quinlan) Date: Wed, 07 Mar 2012 20:09:12 +0000 Subject: [issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks In-Reply-To: <1298300689.71.0.822605356721.issue11271@psf.upfronthosting.co.za> Message-ID: <1331150952.8.0.239241107814.issue11271@psf.upfronthosting.co.za> Brian Quinlan added the comment: I'm closing this since tbrink didn't respond to pitrou's comments. ---------- resolution: -> out of date _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:11:59 2012 From: report at bugs.python.org (Brian Quinlan) Date: Wed, 07 Mar 2012 20:11:59 +0000 Subject: [issue14119] Ability to adjust queue size in Executors In-Reply-To: <1330129142.34.0.452763799677.issue14119@psf.upfronthosting.co.za> Message-ID: <1331151119.63.0.356727783233.issue14119@psf.upfronthosting.co.za> Changes by Brian Quinlan : ---------- assignee: -> bquinlan nosy: +bquinlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:12:38 2012 From: report at bugs.python.org (Brian Quinlan) Date: Wed, 07 Mar 2012 20:12:38 +0000 Subject: [issue14148] Option to kill "stuck" workers in a multiprocessing pool In-Reply-To: <1330429380.32.0.0524478586738.issue14148@psf.upfronthosting.co.za> Message-ID: <1331151158.17.0.858884249107.issue14148@psf.upfronthosting.co.za> Changes by Brian Quinlan : ---------- nosy: +bquinlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:14:06 2012 From: report at bugs.python.org (Brian Quinlan) Date: Wed, 07 Mar 2012 20:14:06 +0000 Subject: [issue13785] Make concurrent.futures.Future state public In-Reply-To: <1326560835.55.0.282912980665.issue13785@psf.upfronthosting.co.za> Message-ID: <1331151246.59.0.19509115345.issue13785@psf.upfronthosting.co.za> Brian Quinlan added the comment: I guess the question is: why do you need to know the state in that form? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:27:53 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Mar 2012 20:27:53 +0000 Subject: [issue13719] bdist_msi upload fails In-Reply-To: <1325855918.9.0.207720990162.issue13719@psf.upfronthosting.co.za> Message-ID: <1331152073.36.0.438861822242.issue13719@psf.upfronthosting.co.za> ?ric Araujo added the comment: I finally got a virtual machine up and running and was able to diagnose the problem. There are two things. First, the dist directory (where the msi file will be created) is created relative to the current working directory, which explains why listdir in the temporary project directory caused the test to fail. Second, after your patch bdist_wininst puts a full path in the dist.dist_files list, but it should use a relative path, like other bdist commands do. (This choice comes from the fact that setup scripts must be run from their parent directory.) Fixing the first problem is just a matter of adding os.chdir(project_dir) in the test; the second problem is also easy, using os.path.join and self.dist_dir. I chose to backout the commits because I won?t be able to make a correct patch right now, I have to configure file sharing between my host and my VM. Let?s have the buildbots green for a while and then break them again (not :). Debugging this made me realize that all tests should use os.path.join('dist', filename) instead of e.g. 'dist/blah-1.0.rpm' in test_bdist_rpm; I?ll do that in another commit. ---------- resolution: fixed -> stage: committed/rejected -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:30:20 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Mar 2012 20:30:20 +0000 Subject: [issue13719] bdist_msi upload fails In-Reply-To: <1325855918.9.0.207720990162.issue13719@psf.upfronthosting.co.za> Message-ID: <1331152220.11.0.791163185744.issue13719@psf.upfronthosting.co.za> ?ric Araujo added the comment: I forgot to mention two other problems in my test: - need to pass name and version keyword arguments to self.create_dist or to change the expected filename to UNKNOWN-UNKNOWN - need to embed the result of distutils.util.get_platform() into the expected filename ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:44:54 2012 From: report at bugs.python.org (Nicholas Cole) Date: Wed, 07 Mar 2012 20:44:54 +0000 Subject: [issue14223] curses addch broken on Python3.3a1 Message-ID: <1331153094.15.0.871612927682.issue14223@psf.upfronthosting.co.za> New submission from Nicholas Cole : The following code works on Python versions prior to 3.3a1: import curses def test_screen(screen): screen.addch(5,5, curses.ACS_HLINE) screen.refresh() curses.wrapper(test_screen) On python3.3, the program produces the following traceback: Traceback (most recent call last): File "/tmp/p.py", line 7, in curses.wrapper(test_screen) File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/curses/__init__.py", line 94, in wrapper return func(stdscr, *args, **kwds) File "/tmp/p.py", line 4, in test_screen screen.addch(5,5, curses.ACS_HLINE) OverflowError: byte doesn't fit in chtype ---------- components: Library (Lib) messages: 155118 nosy: Nicholas.Cole priority: normal severity: normal status: open title: curses addch broken on Python3.3a1 versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:47:08 2012 From: report at bugs.python.org (Nicholas Cole) Date: Wed, 07 Mar 2012 20:47:08 +0000 Subject: [issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode) In-Reply-To: <1331106027.78.0.996302341774.issue6755@psf.upfronthosting.co.za> Message-ID: Nicholas Cole added the comment: On Wed, Mar 7, 2012 at 7:40 AM, R. David Murray wrote: > > R. David Murray added the comment: > > Since this bug is about adding a new feature, it is unlikely to be the correct bug for this to be against. > > Given that you've identified a regression, I suggest you open a new bug with a reproducer, and we'll set it to release blocker. I've created issue 14223. I hope I've done so correctly. Best wishes, Nicholas ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:50:08 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Mar 2012 20:50:08 +0000 Subject: [issue5926] bdist_msi: add support for minimum Python version for pure Python projects In-Reply-To: <1241465384.5.0.639061880588.issue5926@psf.upfronthosting.co.za> Message-ID: <1331153408.66.0.627936320528.issue5926@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- assignee: tarek -> eric.araujo title: bdist_msi - add support for minimum Python version for pure Python packages -> bdist_msi: add support for minimum Python version for pure Python projects versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:54:47 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Mar 2012 20:54:47 +0000 Subject: [issue11122] bdist_rpm fails In-Reply-To: <1296854362.61.0.538085175842.issue11122@psf.upfronthosting.co.za> Message-ID: <1331153687.24.0.0503582096939.issue11122@psf.upfronthosting.co.za> ?ric Araujo added the comment: More info on rpm vs. rpmbuild: http://bugs.python.org/issue1533164#msg82592 ---------- keywords: +easy stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:55:03 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Mar 2012 20:55:03 +0000 Subject: [issue11122] bdist_rpm should use rpmbuild, not rpm In-Reply-To: <1296854362.61.0.538085175842.issue11122@psf.upfronthosting.co.za> Message-ID: <1331153703.83.0.19345976191.issue11122@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- title: bdist_rpm fails -> bdist_rpm should use rpmbuild, not rpm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 21:59:28 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 07 Mar 2012 20:59:28 +0000 Subject: [issue14212] Segfault when using re.finditer over mmap In-Reply-To: <1331056816.2.0.964506318301.issue14212@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 10a79a33d09b by Benjamin Peterson in branch '3.2': keep the buffer object around while we're using it (closes #14212) http://hg.python.org/cpython/rev/10a79a33d09b New changeset 17dfe24e5107 by Benjamin Peterson in branch 'default': merge 3.2 (#14212) http://hg.python.org/cpython/rev/17dfe24e5107 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 22:00:15 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 07 Mar 2012 21:00:15 +0000 Subject: [issue14212] Segfault when using re.finditer over mmap In-Reply-To: <1331056816.2.0.964506318301.issue14212@psf.upfronthosting.co.za> Message-ID: <1331154015.82.0.0610876593866.issue14212@psf.upfronthosting.co.za> Benjamin Peterson added the comment: I think 2.7 might be hopeless. ---------- nosy: +benjamin.peterson resolution: fixed -> stage: committed/rejected -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 22:01:36 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 07 Mar 2012 21:01:36 +0000 Subject: [issue14212] Segfault when using re.finditer over mmap In-Reply-To: <1331056816.2.0.964506318301.issue14212@psf.upfronthosting.co.za> Message-ID: <1331154096.17.0.0798438226213.issue14212@psf.upfronthosting.co.za> Changes by Benjamin Peterson : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 22:53:54 2012 From: report at bugs.python.org (Johannes Kolb) Date: Wed, 07 Mar 2012 21:53:54 +0000 Subject: [issue14224] packaging: path description of resources is mixed up Message-ID: <1331157234.71.0.528832694178.issue14224@psf.upfronthosting.co.za> New submission from Johannes Kolb : The documentation for "files" section of the setup.cfg file causes confusion: The examples don't match the description. Obviously the order of "destination" and "source" part in the generated filenames was mixed up in some places. ---------- assignee: docs at python components: Documentation files: packaging-docfixes.diff keywords: patch messages: 155123 nosy: docs at python, jokoala priority: normal severity: normal status: open title: packaging: path description of resources is mixed up type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file24754/packaging-docfixes.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 23:03:08 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Mar 2012 22:03:08 +0000 Subject: [issue14224] packaging: path description of resources is mixed up In-Reply-To: <1331157234.71.0.528832694178.issue14224@psf.upfronthosting.co.za> Message-ID: <1331157788.02.0.78499070111.issue14224@psf.upfronthosting.co.za> ?ric Araujo added the comment: Thanks, will apply. ---------- assignee: docs at python -> eric.araujo nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 23:06:45 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Mar 2012 22:06:45 +0000 Subject: [issue14209] pkgutil.iter_zipimport_modules ignores the prefix parameter for packages In-Reply-To: <1331046144.89.0.833633660995.issue14209@psf.upfronthosting.co.za> Message-ID: <1331158005.47.0.998424161009.issue14209@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +ncoghlan, pje stage: -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 23:08:21 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 07 Mar 2012 22:08:21 +0000 Subject: [issue14223] curses addch broken on Python3.3a1 In-Reply-To: <1331153094.15.0.871612927682.issue14223@psf.upfronthosting.co.za> Message-ID: <1331158101.18.0.58111485222.issue14223@psf.upfronthosting.co.za> R. David Murray added the comment: Marking as release blocker since this is a regression. Added people from the other curses issue as being likely to be interested in this one. ---------- nosy: +cben, gpolo, haypo, inigoserna, jcea, phep, pitrou, python-dev, r.david.murray, schodet, zeha priority: normal -> release blocker stage: -> needs patch type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 23:15:49 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Mar 2012 22:15:49 +0000 Subject: [issue14216] ImportError: No module named binascii In-Reply-To: <1331106438.0.0.366139924133.issue14216@psf.upfronthosting.co.za> Message-ID: <1331158549.73.0.181982980792.issue14216@psf.upfronthosting.co.za> ?ric Araujo added the comment: I suggest you do two things: - first, run ?make -s? to reduce messages and see if the binascii module is compiled correctly or skipped - second, avoid possible misleading issues with PATH entirely by starting your Python with an absolute path, like ~/path/to/python (Sidenote: It would be kind of you to edit your replies to remove unneeded quotes from previous messages. They just clobber the bug report. Thanks in advance.) ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 23:16:05 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Mar 2012 22:16:05 +0000 Subject: [issue14215] http://www.python.org/dev/peps/ title is python.org In-Reply-To: <1331102600.96.0.801989456091.issue14215@psf.upfronthosting.co.za> Message-ID: <1331158565.83.0.628534584161.issue14215@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 23:32:48 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Mar 2012 22:32:48 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: <1331111194.08.0.943407781198.issue14218@psf.upfronthosting.co.za> Message-ID: <1331159568.21.0.101536538277.issue14218@psf.upfronthosting.co.za> ?ric Araujo added the comment: > For devguide/documenting, If you show me markup, also show me what output it gives me. Would this really be useful? If you?re looking at that page, you want to know what markup to use for what situation; why do you care about output? > It's kinda tedious to keep building the markup just to verify how it's rendered. I?m not sure I understand; if there were example output in the doc, you?d only have to build the devguide once to see how markup is rendered, wouldn?t you? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 23:33:13 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 07 Mar 2012 22:33:13 +0000 Subject: [issue14217] text output pretends to be code In-Reply-To: <1331108351.7.0.269278733631.issue14217@psf.upfronthosting.co.za> Message-ID: <1331159593.31.0.411497891189.issue14217@psf.upfronthosting.co.za> ?ric Araujo added the comment: Use this: .. code-block:: none output etc. ---------- nosy: +eric.araujo versions: +Python 2.7 -Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 23:37:12 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 07 Mar 2012 22:37:12 +0000 Subject: [issue14220] "yield from" kills generator on re-entry In-Reply-To: <1331118543.05.0.972821091665.issue14220@psf.upfronthosting.co.za> Message-ID: <1331159832.31.0.548809418652.issue14220@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 23:40:26 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 07 Mar 2012 22:40:26 +0000 Subject: [issue14222] Using time.time() in Queue.get breaks when system time is changed In-Reply-To: <1331149120.51.0.79082225225.issue14222@psf.upfronthosting.co.za> Message-ID: <1331160026.94.0.871481453327.issue14222@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Well, in 3.3 we could use clock_gettime(CLOCK_MONOTONIC) where available. That said, this is not specific to Queue.get() and will probably happen with many similar functions taking a timeout parameter. ---------- nosy: +haypo, neologix, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 7 23:59:46 2012 From: report at bugs.python.org (Ned Deily) Date: Wed, 07 Mar 2012 22:59:46 +0000 Subject: [issue14225] _cursesmodule compile error in OS X 32-bit-only installer build Message-ID: <1331161185.98.0.75427514561.issue14225@psf.upfronthosting.co.za> New submission from Ned Deily : ./Modules/_cursesmodule.c:279: error: syntax error before 'cchar_t' /Users/sysadmin/build/v3.3.0a1/Modules/_cursesmodule.c: In function 'PyCurses_ConvertToCchar_t': ./Modules/_cursesmodule.c:289: error: 'obj' undeclared (first use in this function)/Users/sysadmin/build/v3.3.0a1/Modules/_cursesmodule.c:279: error: syntax error before 'cchar_t' Note to self, this installer build builds its own version of ncurses. It may need adjusting for 3.3. ---------- assignee: ned.deily components: Build, Macintosh messages: 155130 nosy: ned.deily priority: release blocker severity: normal status: open title: _cursesmodule compile error in OS X 32-bit-only installer build type: compile error versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 00:02:44 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 07 Mar 2012 23:02:44 +0000 Subject: [issue1469629] __dict__ = self in subclass of dict causes a memory leak Message-ID: <1331161364.81.0.999122181124.issue1469629@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 00:35:40 2012 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9_Malo?=) Date: Wed, 07 Mar 2012 23:35:40 +0000 Subject: [issue14226] Expose dict_proxy type from descrobject.c Message-ID: <1331163340.11.0.494916770875.issue14226@psf.upfronthosting.co.za> New submission from Andr? Malo : As discussed in the dev-thread about frozendicts, it would be helpful for providing advisory read-only-dicts, to just expose the dict_proxy type. I suppose, the collections module would be a good place (it just needs to provide the interface to the type, not the whole implementation). ---------- components: Extension Modules, Interpreter Core messages: 155131 nosy: ndparker priority: normal severity: normal status: open title: Expose dict_proxy type from descrobject.c type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 00:48:22 2012 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 07 Mar 2012 23:48:22 +0000 Subject: [issue14220] "yield from" kills generator on re-entry In-Reply-To: <1331118543.05.0.972821091665.issue14220@psf.upfronthosting.co.za> Message-ID: <1331164102.44.0.709003408719.issue14220@psf.upfronthosting.co.za> Nick Coghlan added the comment: Added Mark Shannon to the nosy list - he's been tinkering with this area of the interpreter lately. This definitely needs to be fixed though (even if that does mean major surgery on the implementation, up to and including the introduction of an __iter_from__ method) ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 00:52:06 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 07 Mar 2012 23:52:06 +0000 Subject: [issue14220] "yield from" kills generator on re-entry In-Reply-To: <1331118543.05.0.972821091665.issue14220@psf.upfronthosting.co.za> Message-ID: <1331164326.57.0.505787752052.issue14220@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Don't worry! I'll be fixing it in a moment... ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 00:57:16 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 07 Mar 2012 23:57:16 +0000 Subject: [issue14220] "yield from" kills generator on re-entry In-Reply-To: <1331118543.05.0.972821091665.issue14220@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 3357eac1ba62 by Benjamin Peterson in branch 'default': make delegating generators say they running (closes #14220) http://hg.python.org/cpython/rev/3357eac1ba62 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 01:06:14 2012 From: report at bugs.python.org (Stefan Krah) Date: Thu, 08 Mar 2012 00:06:14 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: Message-ID: <20120308000613.GA12278@sleipnir.bytereef.org> Stefan Krah added the comment: Jim Jewett wrote: > > OK, as a basis for discussion I've added: > > http://hg.python.org/features/cdecimal/file/8b75c2825508/Modules/_decimal/FILEMAP.txt > > Starting from that URL, I don't actually find setup.py. It's the setup.py from the Python top level directory. > I'm not sure what sort of failures building in the normal order led > to, but that is certainly something worth documenting, and (ideally) > fixing. I do not have access to AIX. On Windows the failures were locale related when mixing the dynamic and static runtimes. > I didn't see any mention of the literature subdirectory, which makes > me wonder if there were other files not listed in the map. (Not yet > curious enough to verify for myself, though.) (*.txt files?) FILEMAP.txt was intended to get people started, not to be a polished work. > I suppose a subdirectory name like "python" makes sense when you look > at the library as a C/C++ project that happens to provide python > bindings; as part of the python core, it is misleading. OK. > provide extra functionality, or to generate some of the source code, There is no source code generation. I'm not sure where this idea comes from. genlocale.py e.g. has this comment: Usage: ../../../python genlocale.py | ../tests/runtest - > Within the library, does io.[ch] really limit itself to ASCII? If so, > then I don't know why you're worried about the Turkish i. If you mean > generic text, then please don't specify ASCII. I do mean ASCII. Please run this gdb session: diff --git a/Modules/_decimal/io.c b/Modules/_decimal/io.c --- a/Modules/_decimal/io.c +++ b/Modules/_decimal/io.c @@ -245,7 +245,7 @@ if (digits > (size_t)(ctx->prec-ctx->clamp)) goto conversion_error; } - else if (_mpd_strneq(s, "inf", "INF", 3)) { + else if (strncasecmp(s, "inf", 3) == 0) { s += 3; if (*s == '\0' || _mpd_strneq(s, "inity", "INITY", 6)) { /* numeric-value: infinity */ gdb ../../python b mpd_qset_string r >>> locale.setlocale(locale.LC_ALL, 'tr_TR.utf8') 'tr_TR.utf8' >>> from decimal import * >>> Decimal("Infinity") (gdb) 248 else if (strncasecmp(s, "inf", 3) == 0) { (gdb) p s $1 = 0x7ffff7191280 "Infinity" (gdb) p s[0] $2 = 73 'I' (gdb) n 259 if ((coeff = scan_dpoint_exp(s, &dpoint, &exp, &end)) == NULL) Clearly 'I' is ASCII and strncasecmp fails, exactly as written in the comment above _mpd_strneq(). > Within memory.[ch], how much of this configurability is useful (or > even available) to a python user, as opposed to an extension writer? Since it is in the libmpdec section, "User" refers to the extension writer. I can simply drop the "User". > Under the Bignum section, it mentions that functions from these files > are ultimately used in _mpd_fntmul, but doesn't mention where that is > (in the main _cdecimal.c) OK. > Also, when it talks about "large arrays", could you clarify that it > isn't talking about arrays of values or even matrixes, it is just > talking about numbers large enough that even representing them takes > at least N bytes? But it is referring to abstract sequences or arrays of values less than a certain prime. These values happen to be the coefficient of an mpd_t, but you could perform the transform on any sequence. I thought 'Bignum' would already imply an array of machine words representing a number. > >> Would it at least be OK to wrap them in stubs for exporting, so that > >> the test logic could be places with the others tests? ??(I worry that > >> some tests may stop getting run if someone else modifies the build > >> process and doesn't notice the unusual location.) > > > tests/runtest.c won't compile then. I'll look into the stub and also > > the _testhelp suggestions. > > OK, let me rephrase. Is newton division exported to users, or used > internally, or is it just for testing purposes? It's used internally as _mpd_qbarrett_divmod(). When the coefficient has more than MPD_NEWTONDIV_CUTOFF words, the division functions dispatch to _mpd_qbarrett_divmod(). > _mpd_qtest_newtondiv is documented as a testcase; I would rather see > it move to a test file. Why can't it? I said in my last mail that I'll look into it. > >> > "Infinity", "InFinItY", "iNF" are all allowed by the specification. > > >> OK; so is io.c part of the library, or part of the python binding? > > > I see a potential source of confusion: io.c is firmly part of the > > library. > > [And should therefore be available when used without python?] I meant: Despite the fact that io.c might /appear/ to be specifically written for the module because of the presence of PEP 3101 references, it is part of the standalone (moduleless) library. However, _decimal.c uses all parts of io.c except for a couple of functions at the bottom of the file that are useful for debugging. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 01:08:06 2012 From: report at bugs.python.org (Larry Hastings) Date: Thu, 08 Mar 2012 00:08:06 +0000 Subject: [issue13964] os.utimensat() and os.futimes() should accept (sec, nsec), drop os.futimens() In-Reply-To: <1328663994.2.0.189878263913.issue13964@psf.upfronthosting.co.za> Message-ID: <1331165286.36.0.145779737893.issue13964@psf.upfronthosting.co.za> Larry Hastings added the comment: I just asked Guido in person, and he says he never intended to suggest accepting a (sec, nsec) tuple. os.*utime* may accept atime and mtime as either float seconds-since-the-epoch, or int nanoseconds-since-the-epoch when passed in using the ns= named parameter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 01:15:21 2012 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 08 Mar 2012 00:15:21 +0000 Subject: [issue14209] pkgutil.iter_zipimport_modules ignores the prefix parameter for packages In-Reply-To: <1331046144.89.0.833633660995.issue14209@psf.upfronthosting.co.za> Message-ID: <1331165721.11.0.338566689751.issue14209@psf.upfronthosting.co.za> Nick Coghlan added the comment: Adding Brett, since the plan is to clear out a lot of the redundant code in pkgutil once importlib is fully bootstrapped as the standard import implementation. (although this will still affect the older versions directly) ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 01:21:30 2012 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 08 Mar 2012 00:21:30 +0000 Subject: [issue14127] os.stat and os.utime: allow preserving exact metadata In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331166090.45.0.821116942303.issue14127@psf.upfronthosting.co.za> Nick Coghlan added the comment: FWIW, +1 on using the *name* of the keyword arg to define the format/resolution of the argument. It's simple and clear right now, and is easily updated to handle higher resolutions in the future. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 01:38:57 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Mar 2012 00:38:57 +0000 Subject: [issue14222] Using time.time() in Queue.get breaks when system time is changed In-Reply-To: <1331160026.94.0.871481453327.issue14222@psf.upfronthosting.co.za> Message-ID: <4F57FFA3.9080601@gmail.com> STINNER Victor added the comment: > Well, in 3.3 we could use clock_gettime(CLOCK_MONOTONIC) where available. It's better to use time.monotonic(). > That said, this is not specific to Queue.get() and will probably happen with many similar functions taking a timeout parameter. Yep, it may be used for lock.acquire(timeout=timeout) for example. It would help to have a portable monotonic clock API in C. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 01:53:08 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 08 Mar 2012 00:53:08 +0000 Subject: [issue3787] Make PyInstanceMethod_Type available or remove it In-Reply-To: <1220640720.16.0.546689222531.issue3787@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset b595e1ad5722 by Benjamin Peterson in branch 'default': merge 3.2 (#3787e896dbe9) http://hg.python.org/cpython/rev/b595e1ad5722 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 01:53:08 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 08 Mar 2012 00:53:08 +0000 Subject: [issue1469629] __dict__ = self in subclass of dict causes a memory leak Message-ID: Roundup Robot added the comment: New changeset 3787e896dbe9 by Benjamin Peterson in branch '3.2': allow cycles throught the __dict__ slot to be cleared (closes #1469629) http://hg.python.org/cpython/rev/3787e896dbe9 ---------- nosy: +python-dev resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 02:08:48 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 08 Mar 2012 01:08:48 +0000 Subject: [issue14223] curses addch broken on Python3.3a1 In-Reply-To: <1331153094.15.0.871612927682.issue14223@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 861a5f3e7453 by Victor Stinner in branch 'default': Close #14223: curses.addch() is no more limited to the range 0-255 when the http://hg.python.org/cpython/rev/861a5f3e7453 ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 02:09:46 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 08 Mar 2012 01:09:46 +0000 Subject: [issue3787] Make PyInstanceMethod_Type available or remove it In-Reply-To: <1220640720.16.0.546689222531.issue3787@psf.upfronthosting.co.za> Message-ID: <1331168986.62.0.94748584467.issue3787@psf.upfronthosting.co.za> Changes by Benjamin Peterson : ---------- Removed message: http://bugs.python.org/msg155140 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 02:10:59 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Mar 2012 01:10:59 +0000 Subject: [issue14223] curses addch broken on Python3.3a1 In-Reply-To: <1331153094.15.0.871612927682.issue14223@psf.upfronthosting.co.za> Message-ID: <1331169059.7.0.234209508695.issue14223@psf.upfronthosting.co.za> STINNER Victor added the comment: I introduced the arbitrary limit when I added support of the curses Unicode API (libncursesw). The limit is useless if libncursesw is used, whereas it blocks legal "characters" like KEY_xxx constants. So I just removed the check and it should not be ok. The real issue is that Python curses is not linked to libncursesw on Mac OS X! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 02:15:43 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 08 Mar 2012 01:15:43 +0000 Subject: [issue1469629] __dict__ = self in subclass of dict causes a memory leak Message-ID: Roundup Robot added the comment: New changeset c7623da4e2af by Benjamin Peterson in branch '2.7': allow cycles throught the __dict__ slot to be cleared (closes #1469629) http://hg.python.org/cpython/rev/c7623da4e2af ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 02:18:00 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Mar 2012 01:18:00 +0000 Subject: [issue13552] Compilation issues of the curses module on OpenIndiana In-Reply-To: <1323305598.14.0.0193622635558.issue13552@psf.upfronthosting.co.za> Message-ID: <1331169480.11.0.4307938338.issue13552@psf.upfronthosting.co.za> STINNER Victor added the comment: Jes?s Cea Avi?n also noticed in msg143798 from the issue #6755: I have compiled ncurses myself, supporting wide characters. I get this warnings in the buildbots: """ /export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Modules/_cursesmodule.c:920: warning: implicit declaration of function 'wget_wch' /export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Modules/_cursesmodule.c:927: warning: implicit declaration of function 'mvwget_wch' /export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Modules/_cursesmodule.c:2760: warning: implicit declaration of function 'unget_wch' """ Studying the "ncurses.h", I see the definition of "wget_wch" and others. But these definitions are created only if "_XOPEN_SOURCE_EXTENDED" is defined. Something to be explored?. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 02:18:42 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Mar 2012 01:18:42 +0000 Subject: [issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode) In-Reply-To: <1250855012.37.0.745791721367.issue6755@psf.upfronthosting.co.za> Message-ID: <1331169522.96.0.494011298217.issue6755@psf.upfronthosting.co.za> STINNER Victor added the comment: Antoine's issue has been fixed: "Modules/_cursesmodule.c:919:9: attention : implicit declaration of function ?wget_wch?" It looks like Jes?s's issue is specific to Solaris (or is already fixed?), and so I added a comment to the issue #13552: "Modules/_cursesmodule.c:920: warning: implicit declaration of function 'wget_wch'". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 02:18:55 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Mar 2012 01:18:55 +0000 Subject: [issue6755] Patch: new method get_wch for ncurses bindings: accept wide characters (unicode) In-Reply-To: <1250855012.37.0.745791721367.issue6755@psf.upfronthosting.co.za> Message-ID: <1331169535.11.0.784701508522.issue6755@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 02:50:33 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 08 Mar 2012 01:50:33 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 0255bafbccf2 by Victor Stinner in branch 'default': Issue #14205: document the change of dict[key] behaviour if dict is modified http://hg.python.org/cpython/rev/0255bafbccf2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 04:23:32 2012 From: report at bugs.python.org (Meador Inge) Date: Thu, 08 Mar 2012 03:23:32 +0000 Subject: [issue13370] test_ctypes fails when building python with clang In-Reply-To: <1320761474.93.0.268896325495.issue13370@psf.upfronthosting.co.za> Message-ID: <1331177012.89.0.612165482293.issue13370@psf.upfronthosting.co.za> Meador Inge added the comment: LLVM/clang bug report here: http://llvm.org/bugs/show_bug.cgi?id=12207. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 05:35:33 2012 From: report at bugs.python.org (Mark Tolonen) Date: Thu, 08 Mar 2012 04:35:33 +0000 Subject: [issue14227] console w/ cp65001 displays extra characters for non-ascii strings. Message-ID: <1331181333.28.0.535514339767.issue14227@psf.upfronthosting.co.za> New submission from Mark Tolonen : This is on Windows 7 SP1. Run 'chcp 65001' then Python from a console. Note the extra characters when non-ASCII characters are in the string. At a guess it appears to be using the UTF-8 byte length of the internal representation instead of the character count. Python 3.3.0a1 (default, Mar 4 2012, 17:27:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> print('hello') hello >>> print('p\u012bny\u012bn') p?ny?n n >>> print('\u012b'*10) ?????????? ????? ?? ---------- components: IO, Unicode, Windows messages: 155149 nosy: ezio.melotti, metolone priority: normal severity: normal status: open title: console w/ cp65001 displays extra characters for non-ascii strings. type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 06:26:42 2012 From: report at bugs.python.org (Qian Liu) Date: Thu, 08 Mar 2012 05:26:42 +0000 Subject: [issue14216] ImportError: No module named binascii In-Reply-To: <1331158549.73.0.181982980792.issue14216@psf.upfronthosting.co.za> Message-ID: Qian Liu added the comment: Hi, Eric Araujo, Thanks for your help. I run "make -s" and found the following message. It seems that binascii cannot be built correctly. What should I do? Many thanks. libpython2.7.a(posixmodule.o)(.text+0x47e1): In function `posix_tmpnam': ./Modules/posixmodule.c:7370: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp' libpython2.7.a(posixmodule.o)(.text+0x46c7): In function `posix_tempnam': ./Modules/posixmodule.c:7317: warning: the use of `tempnam' is dangerous, better use `mkstemp' building dbm using gdbm /usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libz.a: could not read symbols: Bad value collect2: ld returned 1 exit status /usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libz.a: could not read symbols: Bad value collect2: ld returned 1 exit status Python build finished, but the necessary bits to build these modules were not found: _sqlite3 bsddb185 dl imageop sunaudiodev To find the necessary bits, look in setup.py in detect_modules() for the module's name. *Failed to build these modules:* *binascii zlib* Best regards, Qian Liu ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 07:32:06 2012 From: report at bugs.python.org (Stefan Behnel) Date: Thu, 08 Mar 2012 06:32:06 +0000 Subject: [issue14220] "yield from" kills generator on re-entry In-Reply-To: <1331118543.05.0.972821091665.issue14220@psf.upfronthosting.co.za> Message-ID: <1331188326.19.0.876308246824.issue14220@psf.upfronthosting.co.za> Stefan Behnel added the comment: Ah, yes, that should work in both implementations. I'll give it a try. Thanks! ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 10:05:37 2012 From: report at bugs.python.org (telmich) Date: Thu, 08 Mar 2012 09:05:37 +0000 Subject: [issue14228] SIGINT (Ctrl-C) not caught at startup Message-ID: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> New submission from telmich : Hello, pressing ctrl-c or having sigint delivered to the python process in its startup phase results in random tracebacks displayed. This is related to issue3137, but actually happening in Python 3.2.2 on archlinux. We noticed this during development of the cdist project (http://www.nico.schottelius.org/software/cdist/), where we call a shell via subprocess.check_call() which calls us again (under a different name and thus different behaviour. So the call chain is like this: cdist => /bin/sh -e script => cdist_as_different_name (i.e. __file) A simple test case to reproduce the problem needs the two files caller.py and shellpart.sh in a directory: % ln -s caller.py __testpython % chmod a+x * % ./caller.py Indirect child being called Indirect child being called Indirect child being called Indirect child being called ^Ccaught signint in parent Traceback (most recent call last): File "/usr/lib/python3.2/site.py", line 58, in import traceback File "/usr/lib/python3.2/traceback.py", line 3, in import linecache File "/usr/lib/python3.2/linecache.py", line 10, in import tokenize File "/usr/lib/python3.2/tokenize.py", line 28, in import re File "/usr/lib/python3.2/re.py", line 121, in [10:02] brief:python-traceback-test% import functools File "/usr/lib/python3.2/functools.py", line 2, in """ KeyboardInterrupt Pressing Ctrl-C results in various different tracebacks and I don't see any way to catch the SIGINT reliably currently, as the code executed seems to be *before* my code is being executed. There is another related bug at debian that references the same problem: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652926 ---------- files: shellpart.sh messages: 155152 nosy: telmich priority: normal severity: normal status: open title: SIGINT (Ctrl-C) not caught at startup type: crash versions: Python 3.2 Added file: http://bugs.python.org/file24755/shellpart.sh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 10:06:27 2012 From: report at bugs.python.org (telmich) Date: Thu, 08 Mar 2012 09:06:27 +0000 Subject: [issue14228] SIGINT (Ctrl-C) not caught at startup In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1331197587.07.0.500465630038.issue14228@psf.upfronthosting.co.za> telmich added the comment: And here's the actual python code ---------- Added file: http://bugs.python.org/file24756/caller.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 10:20:16 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Thu, 08 Mar 2012 09:20:16 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: <1331159568.21.0.101536538277.issue14218@psf.upfronthosting.co.za> Message-ID: Tshepang Lekhonkhobe added the comment: > ?ric Araujo added the comment: >> For devguide/documenting, If you show me markup, also show me what output it gives me. > Would this really be useful? ?If you?re looking at that page, you want to know what markup to use for what situation; why do you care about output? I want to see how it looks like. >> It's kinda tedious to keep building the markup just to verify how it's rendered. > I?m not sure I understand; if there were example output in the doc, you?d only have to build the devguide once to see how markup is rendered, wouldn?t you? Yes you didn't understand, sorry for my inadequate explanation. I want to see how the output of the markup looks like, without having to do the rendering (running sphinx-build) myself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 10:40:16 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Thu, 08 Mar 2012 09:40:16 +0000 Subject: [issue14216] ImportError: No module named binascii In-Reply-To: <1331106438.0.0.366139924133.issue14216@psf.upfronthosting.co.za> Message-ID: <1331199616.7.0.315257913875.issue14216@psf.upfronthosting.co.za> Ramchandra Apte added the comment: See http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3. What it says might be the cause of the problem. ---------- nosy: +ramchandra.apte _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 11:06:17 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Thu, 08 Mar 2012 10:06:17 +0000 Subject: [issue14217] text output pretends to be code In-Reply-To: <1331159593.31.0.411497891189.issue14217@psf.upfronthosting.co.za> Message-ID: Tshepang Lekhonkhobe added the comment: > ?ric Araujo added the comment: > > Use this: > > .. code-block:: none > > ? output etc. Thanks much. I've attached a patch. ---------- Added file: http://bugs.python.org/file24757/tis-not-code-2.patch _______________________________________ Python tracker _______________________________________ -------------- next part -------------- diff -r b8be6ac4395d Doc/tutorial/classes.rst --- a/Doc/tutorial/classes.rst Wed Mar 07 08:55:52 2012 +0100 +++ b/Doc/tutorial/classes.rst Thu Mar 08 12:03:20 2012 +0200 @@ -180,7 +180,9 @@ scope_test() print("In global scope:", spam) -The output of the example code is:: +The output of the example code is: + +.. code-block:: none After local assignment: test spam After nonlocal assignment: nonlocal spam From report at bugs.python.org Thu Mar 8 11:16:20 2012 From: report at bugs.python.org (Steven Bethard) Date: Thu, 08 Mar 2012 10:16:20 +0000 Subject: [issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters In-Reply-To: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> Message-ID: <1331201780.4.0.298775189789.issue14191@psf.upfronthosting.co.za> Steven Bethard added the comment: > Hence, I conclude that, unless this was spelled out in the PEP and I > missed it, that having such boundaries is a bug Practically speaking, we just can't change this because it will break existing argparse scripts. Argparse has had this behavior since 2006 when it was first released, and I guarantee you that many scripts expect and rely on this behavior. As I said earlier, the only reasonable solution is to document the current behavior more explicitly, and then add a new constructor parameter or method or something to enable the behavior you want. I looked a bit a guilherme's patch, and I think it's not really the right direction. We definitely shouldn't be modifying the action classes like _StoreAction. All changes should be within _parse_known_args. The parsing algorithm is so different for the proposed behavior, that I wonder if it wouldn't be easier to just create a new ArgumentParser subclass, ArgumentParserAllowingOptionalsInsidePositionals (or whatever), that just overrides _parse_known_args and rewrites it entirely. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 11:28:00 2012 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 08 Mar 2012 10:28:00 +0000 Subject: [issue14227] console w/ cp65001 displays extra characters for non-ascii strings. In-Reply-To: <1331181333.28.0.535514339767.issue14227@psf.upfronthosting.co.za> Message-ID: <1331202480.3.0.443142098899.issue14227@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +haypo, loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 11:32:57 2012 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 08 Mar 2012 10:32:57 +0000 Subject: [issue14217] text output pretends to be code In-Reply-To: <1331108351.7.0.269278733631.issue14217@psf.upfronthosting.co.za> Message-ID: <1331202777.65.0.526355851248.issue14217@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti stage: -> patch review type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 12:48:58 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Mar 2012 11:48:58 +0000 Subject: [issue14227] console w/ cp65001 displays extra characters for non-ascii strings. In-Reply-To: <1331181333.28.0.535514339767.issue14227@psf.upfronthosting.co.za> Message-ID: <1331207338.34.0.49597873728.issue14227@psf.upfronthosting.co.za> STINNER Victor added the comment: See the issue #1602. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 15:40:45 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 08 Mar 2012 14:40:45 +0000 Subject: [issue6727] ImportError when package is symlinked on Windows In-Reply-To: <1250608383.93.0.471187637916.issue6727@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 6c218b9c5c4c by Jason R. Coombs in branch '2.7': Extracted Windows directory detection from NullImporter.__init__. This greatly simplifies the code and fixes issue6727. http://hg.python.org/cpython/rev/6c218b9c5c4c New changeset 92f4d4eebed1 by Jason R. Coombs in branch '2.7': Adding regression test for issue6727 http://hg.python.org/cpython/rev/92f4d4eebed1 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 15:43:58 2012 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 08 Mar 2012 14:43:58 +0000 Subject: [issue6727] ImportError when package is symlinked on Windows In-Reply-To: <1250608383.93.0.471187637916.issue6727@psf.upfronthosting.co.za> Message-ID: <1331217838.17.0.305370202502.issue6727@psf.upfronthosting.co.za> Changes by Jason R. Coombs : ---------- hgrepos: -104 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 15:44:12 2012 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 08 Mar 2012 14:44:12 +0000 Subject: [issue6727] ImportError when package is symlinked on Windows In-Reply-To: <1250608383.93.0.471187637916.issue6727@psf.upfronthosting.co.za> Message-ID: <1331217852.76.0.428666525549.issue6727@psf.upfronthosting.co.za> Jason R. Coombs added the comment: I've gone ahead and pushed the changesets for Python 2.7. I'll continue to hold off on Python 3.2/3.3 until I can review. Perhaps Brian and I can review these changes at PyCon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 15:51:29 2012 From: report at bugs.python.org (Florent Xicluna) Date: Thu, 08 Mar 2012 14:51:29 +0000 Subject: [issue6727] ImportError when package is symlinked on Windows In-Reply-To: <1250608383.93.0.471187637916.issue6727@psf.upfronthosting.co.za> Message-ID: <1331218289.19.0.627046753215.issue6727@psf.upfronthosting.co.za> Florent Xicluna added the comment: It breaks the compilation on few buildbots. Python/import.c:130:14: error: #if with no expression ---------- nosy: +flox _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 15:52:26 2012 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 08 Mar 2012 14:52:26 +0000 Subject: [issue6727] ImportError when package is symlinked on Windows In-Reply-To: <1250608383.93.0.471187637916.issue6727@psf.upfronthosting.co.za> Message-ID: <1331218346.37.0.679489535939.issue6727@psf.upfronthosting.co.za> Jason R. Coombs added the comment: I see that. Thanks. I'm on it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 15:54:39 2012 From: report at bugs.python.org (=?utf-8?q?Pekka_Kl=C3=A4rck?=) Date: Thu, 08 Mar 2012 14:54:39 +0000 Subject: [issue6333] logging: ValueError: I/O operation on closed file In-Reply-To: <1245807768.39.0.536701423847.issue6333@psf.upfronthosting.co.za> Message-ID: <1331218479.48.0.416157756668.issue6333@psf.upfronthosting.co.za> Pekka Kl?rck added the comment: The same problem that caused problems to py.test caused problems also to Robot Framework: http://code.google.com/p/robotframework/issues/detail?id=1079 I was surprised to notice this issue was closed as invalid although the problem didn't occur with Python 2.7 anymore. After a little more digging I noticed that the proposed fix has actually been done in r84282 as part of fixing issue 9051. The fix doesn't check for `closed` attribute but instead silences possible ValueError. We also noticed a variation of the problem: If the registered handler ever tries to write anything to its stream you also get an exception. We decided to silence all these errors with this code: import logging logging.raiseExceptions = False Finally, I consider it a separate bug that logging.StreamHandler uses sys.stderr by default. It should use sys.__stderr__ instead. ---------- nosy: +pekka.klarck _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 16:49:52 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 08 Mar 2012 15:49:52 +0000 Subject: [issue9408] curses: Link against libncursesw instead of libncurses In-Reply-To: <1280360992.02.0.384889308435.issue9408@psf.upfronthosting.co.za> Message-ID: <1331221792.75.0.155298984962.issue9408@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 16:53:09 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 08 Mar 2012 15:53:09 +0000 Subject: [issue14228] SIGINT (Ctrl-C) not caught at startup In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1331221989.4.0.447680883632.issue14228@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Try to enclose the whole code (including the imports) in the try...except block. I'm not sure why this matters, though. If you want Python to have a different return code when terminated by a KeyboardInterrupt, then I agree it is a valid feature request. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 16:58:56 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 08 Mar 2012 15:58:56 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: <1331111194.08.0.943407781198.issue14218@psf.upfronthosting.co.za> Message-ID: <1331222336.94.0.206607468731.issue14218@psf.upfronthosting.co.za> ?ric Araujo added the comment: I don?t understand why you don?t want to build the doc if you want to see what the output looks like. You should build the doc anyway before making a patch to make sure there are no errors, and it does not take that long. As I don?t understand your problem, I disagree to making the doc longer for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 17:49:27 2012 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 08 Mar 2012 16:49:27 +0000 Subject: [issue6333] logging: ValueError: I/O operation on closed file In-Reply-To: <1245807768.39.0.536701423847.issue6333@psf.upfronthosting.co.za> Message-ID: <1331225367.38.0.38508874185.issue6333@psf.upfronthosting.co.za> Vinay Sajip added the comment: Re. the fix to #9501, the swallowing of exceptions was done for specific reasons noted in the comments in the exception clause which does the swallowing. This only happens during application shutdown - not all ValueErrors on flush() or close() are swallowed. In general, swallowing these will mask logic errors which close a stream prematurely. If you pass a stream to a logging.StreamHandler, make sure you remove the handler from any loggers you attached it to, then close it. Otherwise (if you just close the underlying stream) the StreamHandler might still try to use it, leading to the error. Unattaching the handler and closing it tells logging you're done with writing to that stream, so subsequent logging calls won't try to write to that stream. I'm not aware that every file-like object (including duck-typed ones) will have a 'closed' attribute, so checking for that may not help. If you want to set sys.stderr to a StringIO() and then create a StreamHandler from it, that's fine. The sequence should be: set sys.stderr to StringIO instance create a StreamHandler with sys.stderr add that handler to a logger when finished, remove that handler from a logger close the handler (StreamHandler does not close the underlying stream) restore sys.stderr close the StringIO instance access the contents of the StringIO instance using getvalue() If things are not done in that order, it's possible for arbitrary code (e.g. in a 3rd-party library) to log an event, because of which logging then tries to write to the stream. If that stream is closed, you get the ValueError - that's a warning that something isn't being done correctly, and the answer is not to just swallow that exception. Re. your proposed fix - it may be fine in your specific scenario, but I wouldn't recommend it in general because it may mask logic errors in a program. Regarding your preference for sys.__stderr__ rather than sys.stderr, that's all it is - a preference. You can easily pass the exact stream that you want to StreamHandler, including sys.__stderr__, so the fact that it picks sys.stderr by default shouldn't bother you - just be explicit. Of course, that default - whatever the rights and wrongs of it - cannot be changed without breaking existing code, so it has to stay that way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 18:07:12 2012 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 08 Mar 2012 17:07:12 +0000 Subject: [issue6727] ImportError when package is symlinked on Windows In-Reply-To: <1250608383.93.0.471187637916.issue6727@psf.upfronthosting.co.za> Message-ID: <1331226432.39.0.267533286041.issue6727@psf.upfronthosting.co.za> Jason R. Coombs added the comment: The Unix tests are now passing again. Some Windows buildbots are failing because they do not have the symlink privilege. I'll add a guard in the test to not run it if it doesn't have privilege to symlink. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 18:44:30 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 08 Mar 2012 17:44:30 +0000 Subject: [issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect In-Reply-To: <1330382649.62.0.524230876085.issue14144@psf.upfronthosting.co.za> Message-ID: <1331228670.27.0.697178297933.issue14144@psf.upfronthosting.co.za> Senthil Kumaran added the comment: I am closing this issue as I feel that the requirement may not be addressed by a change. If there is patch for HowTo, we can tackle that in another issue. Thank you for contribution. ---------- resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 18:49:34 2012 From: report at bugs.python.org (Brian Curtin) Date: Thu, 08 Mar 2012 17:49:34 +0000 Subject: [issue6727] ImportError when package is symlinked on Windows In-Reply-To: <1250608383.93.0.471187637916.issue6727@psf.upfronthosting.co.za> Message-ID: <1331228974.46.0.632023644173.issue6727@psf.upfronthosting.co.za> Brian Curtin added the comment: The @support.skip_unless_symlink decorator could be helpful there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 19:04:00 2012 From: report at bugs.python.org (telmich) Date: Thu, 08 Mar 2012 18:04:00 +0000 Subject: [issue14228] SIGINT (Ctrl-C) not caught at startup In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1331229840.3.0.826575679246.issue14228@psf.upfronthosting.co.za> telmich added the comment: This does not change a thing: Indirect child being called ^CTraceback (most recent call last): File "/usr/lib/python3.2/functools.py", line 176, in wrapper caught signint in parent result = cache[key] KeyError: (, '[ \\f\\t]*((\\\\\\r?\\n|#[^\\r\\n]*|([bB]?[rR]?\'\'\'|[bB]?[rR]?"""))|(([0-9]+[jJ]|(([0-9]+\\.[0-9]*|\\.[0-9]+)([eE][-+]?[0-9]+)?|[0-9]+[eE][-+]?[0-9]+)[jJ])|(([0-9]+\\.[0-9]*|\\.[0-9]+)([eE][-+]?[0-9]+)?|[0-9]+[eE][-+]?[0-9]+)|(0[xX][0-9a-fA-F]+|0[bB][01]+|0[oO][0-7]+|(?:0+|[1-9][0-9]*)))|((\\*\\*=?|>>=?|<<=?|!=|//=?|->|[+\\-*/%&|^=<>]=?|~)|[][(){}]|(\\r?\\n|\\.\\.\\.|[:;.,@]))|([bB]?[rR]?\'[^\\n\'\\\\]*(?:\\\\.[^\\n\'\\\\]*)*(\'|\\\\\\r?\\n)|[bB]?[rR]?"[^\\n"\\\\]*(?:\\\\.[^\\n"\\\\]*)*("|\\\\\\r?\\n))|\\w+)', 32) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.2/site.py", line 58, in import traceback File "/usr/lib/python3.2/traceback.py", line 3, in import linecache File "/usr/lib/python3.2/linecache.py", line 10, in import tokenize File "/usr/lib/python3.2/tokenize.py", line 118, in [19:02] brief:python-traceback-test% _compile, (Token, PseudoToken, Single3, Double3)) File "/usr/lib/python3.2/tokenize.py", line 115, in _compile return re.compile(expr, re.UNICODE) File "/usr/lib/python3.2/re.py", line 206, in compile return _compile(pattern, flags) File "/usr/lib/python3.2/re.py", line 255, in _compile return _compile_typed(type(pattern), pattern, flags) File "/usr/lib/python3.2/functools.py", line 180, in wrapper result = user_function(*args, **kwds) File "/usr/lib/python3.2/re.py", line 267, in _compile_typed return sre_compile.compile(pattern, flags) File "/usr/lib/python3.2/sre_compile.py", line 495, in compile code = _code(p, flags) File "/usr/lib/python3.2/sre_compile.py", line 480, in _code _compile(code, p.data, flags) File "/usr/lib/python3.2/sre_compile.py", line 101, in _compile _compile(code, av[1], flags) File "/usr/lib/python3.2/sre_compile.py", line 142, in _compile _compile(code, av, flags) File "/usr/lib/python3.2/sre_compile.py", line 101, in _compile _compile(code, av[1], flags) File "/usr/lib/python3.2/sre_compile.py", line 142, in _compile _compile(code, av, flags) File "/usr/lib/python3.2/sre_compile.py", line 101, in _compile _compile(code, av[1], flags) File "/usr/lib/python3.2/sre_compile.py", line 142, in _compile _compile(code, av, flags) File "/usr/lib/python3.2/sre_compile.py", line 57, in _compile _compile_charset(av, flags, code, fixup) File "/usr/lib/python3.2/sre_compile.py", line 183, in _compile_charset for op, av in _optimize_charset(charset, fixup): File "/usr/lib/python3.2/sre_compile.py", line 253, in _optimize_charset data = _mk_bitmap(charmap) File "/usr/lib/python3.2/sre_compile.py", line 270, in _mk_bitmap if m > MAXCODE: KeyboardInterrupt [19:03] brief:python-trace ---------- Added file: http://bugs.python.org/file24758/caller.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 19:10:49 2012 From: report at bugs.python.org (telmich) Date: Thu, 08 Mar 2012 18:10:49 +0000 Subject: [issue14228] SIGINT (Ctrl-C) not caught at startup In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1331230249.37.0.418896595509.issue14228@psf.upfronthosting.co.za> telmich added the comment: Regarding "feature request": I think this is a *bug*, not a feature request: For me, it is impossible to handle SIGINT correctly with my code, because it is half-handled (exception raised, but impossible to catch) by python itself. Imho this behaviour should not be possible. Instead python could do the standard sigint behaviour, before reading python code (= exit). When starting to read "python shipped code" (i.e. stuff that comes with python and is always loaded), it should either implement a handler for sigint OR have sigint signal handler set to ignore. As soon as control flow is passed over to user code, raising KeyboardInterrupt is fine and I can catch that by enclosing all parts (including import statements) into a try: ... block that does what I want. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 19:48:54 2012 From: report at bugs.python.org (Glenn Linderman) Date: Thu, 08 Mar 2012 18:48:54 +0000 Subject: [issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters In-Reply-To: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> Message-ID: <1331232534.96.0.764860836519.issue14191@psf.upfronthosting.co.za> Glenn Linderman added the comment: Ah yes, argparse had a life outside the stdlib, so now I understand your compatibility concerns. Mind you, I think the overall technology of argparse is superior to optparse, which is why, together with the optparse deprecation, I am trying to port to use it... so consider me a fan, not an enemy. But... However, it seems that while the esoteric extensions required in optparse were a known incompatibility at the time the PEP was written, the incompatibility with intermixed positional and optional parameters slipped under the radar... but is actually a more serious compatibility problem for general use. I see three possible ways forward, maybe there are others. 1) un-deprecate optparse, explaining and documenting this functional difference between optparse and argparse. The deprecation of optparse is what makes this missing capability a bug, rather than a feature enhancement. 2) add features to argparse to make it capable of parsing all the same command lines as unextended optparse. (I'm of the opinion that folks that extended optparse can learn to extend argparse in similar or more capable manners; not having such extensions, I'm not qualified to state whether there are optparse extensions that cannot be ported to use standard or extended argparse capabilities.) The documentation for such features should clearly state that former users of argparse may be interested in using this feature, and should state why; further, the deprecation notice in optparse should be updated to point out that porting to argparse may need to use this particular argparse capability to achieve command line compatibility with optparse, and that the capability is not available until (specified release). 3) If there is an already existing way (my t14.py is a half-hearted attempt to find it) to parse scattered positional parameters, it could be explicitly documented rather than writing new capabilities per #2. However, since you as author jumped to the new capabilities option straightway, I suspect this is not really a possibility. The rest of this is concerned option #2, which seems the best way forward to me, with my current knowledge. You mention ArgumentParserAllowingOptionalsInsidePositionals and that is extremely lengthy, might I suggest something like ArgumentParserIntermixed ? What would be the scope of the effort, and what release(s) might be a possible target? (since it is a bug, it can be backported, but since the cure will be implemented as a new capability, that might be problematical for point releases, somehow? I'm not the expert in that area.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 20:06:15 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 08 Mar 2012 19:06:15 +0000 Subject: [issue14228] SIGINT (Ctrl-C) not caught at startup In-Reply-To: <1331230249.37.0.418896595509.issue14228@psf.upfronthosting.co.za> Message-ID: <1331233326.3386.1.camel@localhost.localdomain> Antoine Pitrou added the comment: > Regarding "feature request": I think this is a *bug*, not a feature > request: For me, it is impossible to handle SIGINT correctly with my > code, because it is half-handled (exception raised, but impossible to > catch) by python itself. In the trace you just posted, I see "caught signint in parent" (at the beginning), so the exception was indeed caught. > When starting to read "python shipped code" (i.e. stuff that comes > with python and is always loaded), it should either implement a > handler for sigint OR have sigint signal handler set to ignore. Well, it does implement a SIGINT handler, and that handler raises KeyboardInterrupt. QED. You can override that behaviour and register your own handler using the standard "signal" module. http://docs.python.org/dev/library/signal.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 21:21:25 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 08 Mar 2012 20:21:25 +0000 Subject: [issue14229] On KeyboardInterrupt, the exit code should mirror the signal number Message-ID: <1331238085.62.0.936420173713.issue14229@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Compare: $ ./python -c "import subprocess, signal, time; p = subprocess.Popen(['cat']); time.sleep(1); p.send_signal(signal.SIGINT); print(p.wait())" -2 with: $ ./python -c "import subprocess, signal, time; p = subprocess.Popen(['python', '-c', 'input()']); time.sleep(1); p.send_signal(signal.SIGINT); print(p.wait())" Traceback (most recent call last): File "", line 1, in KeyboardInterrupt 1 Python's behaviour apparently breaks a common assumption towards Unix processes (see bug reported at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652926). A solution would be to add a signal number attribute to KeyboardInterrupt, and use that value when computing the process exit code. ---------- components: Interpreter Core messages: 155174 nosy: loewis, neologix, pitrou priority: normal severity: normal status: open title: On KeyboardInterrupt, the exit code should mirror the signal number type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 21:22:11 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 08 Mar 2012 20:22:11 +0000 Subject: [issue14228] SIGINT (Ctrl-C) not caught at startup In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1331238131.23.0.0958683226063.issue14228@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Opened issue14229 for the "signal number as exit code" enhancement as mentioned on the Debian issue tracker. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 21:26:14 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Thu, 08 Mar 2012 20:26:14 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: <1331111194.08.0.943407781198.issue14218@psf.upfronthosting.co.za> Message-ID: <1331238374.66.0.47322486102.issue14218@psf.upfronthosting.co.za> Tshepang Lekhonkhobe added the comment: Okay, let me try again: I want the documentation tutorial to tell me, for example, (1) here is the markup for a code block, and (2) here is what it looks like. At the moment, I only get (1)... point is I do not want to have to rebuild a reST file each time I want to see what some specific markup (e.g. a code block) would look like. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 21:28:07 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Thu, 08 Mar 2012 20:28:07 +0000 Subject: [issue14229] On KeyboardInterrupt, the exit code should mirror the signal number In-Reply-To: <1331238085.62.0.936420173713.issue14229@psf.upfronthosting.co.za> Message-ID: <1331238487.32.0.880203899326.issue14229@psf.upfronthosting.co.za> Changes by Nadeem Vawda : ---------- nosy: +nadeem.vawda _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 21:30:29 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 08 Mar 2012 20:30:29 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: <1331111194.08.0.943407781198.issue14218@psf.upfronthosting.co.za> Message-ID: <1331238629.57.0.247406813851.issue14218@psf.upfronthosting.co.za> ?ric Araujo added the comment: I don?t get why you want to know what it looks like, and then, I don?t get why you can?t build the doc or look at docs.python.org. Also, not getting what you talk about re-building: building the devguide or docs once should be enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 21:32:45 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 08 Mar 2012 20:32:45 +0000 Subject: [issue14220] "yield from" kills generator on re-entry In-Reply-To: <1331118543.05.0.972821091665.issue14220@psf.upfronthosting.co.za> Message-ID: <1331238765.74.0.752886273501.issue14220@psf.upfronthosting.co.za> Changes by Benjamin Peterson : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 21:34:43 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 08 Mar 2012 20:34:43 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: <1331111194.08.0.943407781198.issue14218@psf.upfronthosting.co.za> Message-ID: <1331238883.61.0.78823389297.issue14218@psf.upfronthosting.co.za> ?ric Araujo added the comment: It looks like I have a hard time putting myself in your shoes and seeing what you want, so I?m going to shut up for a while and let Ezio and Sandro state their opinion on your original request. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 21:45:21 2012 From: report at bugs.python.org (Sandro Tosi) Date: Thu, 08 Mar 2012 20:45:21 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: <1331238883.61.0.78823389297.issue14218@psf.upfronthosting.co.za> Message-ID: Sandro Tosi added the comment: eheh yeah it seems so :) What I think Tshepang wants is this: - the devguide contains the description of how to document python - that documentation is about a set of ReST coding commands that generate the desired output - currently the devguide reports only the ReST code block without, right below to that block, the resulting highlitening. -> add the resulting "visual" output right below the description of the code to use. so something like blablabla you have to use ``word`` to have the word in bold (or whatever it generates, I'm too lazy to check :) ) for example: Tshepang: did I get it correctly? ?ric: is it (at least a bit) clearer? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 21:52:59 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Thu, 08 Mar 2012 20:52:59 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: Message-ID: Tshepang Lekhonkhobe added the comment: > Sandro Tosi added the comment: > Tshepang: did I get it correctly? ?ric: is it (at least a bit) clearer? that's exactly what I tried to convey ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 22:08:00 2012 From: report at bugs.python.org (=?utf-8?q?Pekka_Kl=C3=A4rck?=) Date: Thu, 08 Mar 2012 21:08:00 +0000 Subject: [issue6333] logging: ValueError: I/O operation on closed file In-Reply-To: <1245807768.39.0.536701423847.issue6333@psf.upfronthosting.co.za> Message-ID: <1331240880.51.0.615835340865.issue6333@psf.upfronthosting.co.za> Pekka Kl?rck added the comment: @vinay.sajip the problem is that many tools that don't do anything with logging module intercept sys.stdout and sys.stderr. Such tools typically aren't even aware of libraries they use (or test) using logging and much less about them registering StreamHandler using sys.stderr. It's great that nowadays you don't always get ValueError at exit anymore. Now you only get them if the StreamHandler itself tries to use the stream after sys.stderr is restored and the intercepting stream closed. Typically this only happens in error situations so the problem isn't so severe. IMHO nobody should ever register StreamHandler with sys.stderr because you cannot be sure has someone intercepted it or not. There's a strong convention that sys.__stderr__ should not be intercepted so using it is safe. I strongly believe StreamHandler should be changed to use sys.__stderr__ by default. That shouldn't cause problems because a) if sys.stderr isn't intercepted sys.stderr is sys.__stderr__, and b) if sys.stderr is intercepted you most likely already have problems. I know stuff like this cannot be changed other than in major releases and there should perhaps even be a deprecation period. I also acknowledge that it might be too much work to be worth the effort. Mentioning this issue in the docs might be a good idea nevertheless. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 22:11:51 2012 From: report at bugs.python.org (Mark Shannon) Date: Thu, 08 Mar 2012 21:11:51 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb Message-ID: <1331241110.78.0.993419519739.issue14230@psf.upfronthosting.co.za> New submission from Mark Shannon : Delegating generators do not show always up in stack traces, such as inspect.stack(). The show up during the first delegation, but not thereafter. I have attached a patch. It alters the way the YIELD_FROM bytecode works; it loops back on itself. This ensures the delegator's frame is always in the trace. Unfortunately I started working on it before Benjamin fixed issue 14220 (rev 3357eac1ba62). By the nature of it, this patch necessarily fixes most of issue 14220, so I have just included the tests for issue 14220 in this patch as well. So in order to apply this, 3357eac1ba62 will have to be backed out. Sorry for the overlap. ---------- components: Interpreter Core files: yieldfrom.patch keywords: patch messages: 155182 nosy: Mark.Shannon priority: normal severity: normal status: open title: Delegating generator is not always visible to debugging tools such as inspect & pdb type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file24759/yieldfrom.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 22:13:37 2012 From: report at bugs.python.org (Mark Shannon) Date: Thu, 08 Mar 2012 21:13:37 +0000 Subject: [issue14220] "yield from" kills generator on re-entry In-Reply-To: <1331118543.05.0.972821091665.issue14220@psf.upfronthosting.co.za> Message-ID: <1331241217.83.0.584625405674.issue14220@psf.upfronthosting.co.za> Mark Shannon added the comment: I've just added issue 14230 which overlaps with this issue somewhat. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 23:01:14 2012 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 08 Mar 2012 22:01:14 +0000 Subject: [issue13842] Cannot pickle Ellipsis or NotImplemented In-Reply-To: <1327346659.12.0.712807876778.issue13842@psf.upfronthosting.co.za> Message-ID: <1331244074.41.0.993690672087.issue13842@psf.upfronthosting.co.za> Changes by ?ukasz Langa : ---------- assignee: -> lukasz.langa nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 23:01:28 2012 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 08 Mar 2012 22:01:28 +0000 Subject: [issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__ Message-ID: <1331244088.28.0.510358877628.issue1692335@psf.upfronthosting.co.za> Changes by ?ukasz Langa : ---------- assignee: -> lukasz.langa nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 23:14:41 2012 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 08 Mar 2012 22:14:41 +0000 Subject: [issue8754] quote bad module name in ImportError-like messages In-Reply-To: <1274202200.16.0.392487565261.issue8754@psf.upfronthosting.co.za> Message-ID: <1331244881.64.0.512430971799.issue8754@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 8 23:20:43 2012 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 08 Mar 2012 22:20:43 +0000 Subject: [issue6333] logging: ValueError: I/O operation on closed file In-Reply-To: <1331240880.51.0.615835340865.issue6333@psf.upfronthosting.co.za> Message-ID: <1331245241.82404.YahooMailNeo@web171318.mail.ir2.yahoo.com> Vinay Sajip added the comment: > IMHO nobody should ever register StreamHandler with sys.stderr because you > cannot be sure has someone intercepted it or not. There's a strong > convention that sys.__stderr__ should not be intercepted so using it is safe. Actually, I believe it is reasonable to intercept sys.stderr, even with logging in use, because you might be testing that logging actually works in a common scenario (use of StreamHandler in the default configuration). To do that, you would need to capture sys.stderr and check that its contents contain logged messages. For example, the Python test suite contains specific tests which intercept (and restore) sys.stderr, for this very purpose. If one is careful to follow the sequence of events I mentioned in my last response, it should be safe to intercept sys.stderr. You only have to remember that if you have passed it to logging to use for I/O, logging may try to use it at times you don't expect (e.g. because of logging by third-party code). Just remove it from logging before you close it, and all will be well. This, of course, applies to any stream you pass to logging - not just sys.stderr or a replacement for it like a StringIO. Using sys.__stderr__ is of course doable right now by your code; as you are the first one to mention this as desirable, I think it quite likely that people are working with the existing default without any problems. So it's unlikely that this default will change (as it doesn't need to - you can be explicit about the stream you want to use). If there is a lot of adverse feedback about the default (unlikely, since it's been there ever since logging was added to Python - about 10 years ago) then I will of course reconsider. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 00:29:12 2012 From: report at bugs.python.org (Steven Bethard) Date: Thu, 08 Mar 2012 23:29:12 +0000 Subject: [issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters In-Reply-To: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> Message-ID: <1331249352.39.0.482048132089.issue14191@psf.upfronthosting.co.za> Steven Bethard added the comment: Thinking about it a bit more, it strikes me that maybe you could get the behavior you want by declaring two parsers, one with just optionals, and one with just positionals. Then: optional_args, remaining_args = optionals.parse_known_args() args = positionals.parse_args(remaining_args) vars(args).update(vars(optional_args)) Basically, you first parse out all the optional arguments, then you parse out the positional arguments from what's left after the optional arguments are stripped out. This approach seems to work for your t14.py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 00:39:09 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 08 Mar 2012 23:39:09 +0000 Subject: [issue14199] Keep a refence to mro in _PyType_Lookup() and super_getattro() In-Reply-To: <1330950808.29.0.801414525121.issue14199@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 21e245ed3747 by Victor Stinner in branch 'default': Close #14199: _PyType_Lookup() and super_getattro() keep a strong reference to http://hg.python.org/cpython/rev/21e245ed3747 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 00:47:22 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 08 Mar 2012 23:47:22 +0000 Subject: [issue14211] Don't rely on borrowed _PyType_Lookup() reference in PyObject_GenericSetAttr() In-Reply-To: <1331054345.96.0.65871889242.issue14211@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 579f845ac396 by Victor Stinner in branch 'default': Issue #14211: _PyObject_GenericSetAttrWithDict() keeps a strong reference to http://hg.python.org/cpython/rev/579f845ac396 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 00:48:54 2012 From: report at bugs.python.org (Steven Bethard) Date: Thu, 08 Mar 2012 23:48:54 +0000 Subject: [issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters In-Reply-To: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> Message-ID: <1331250534.54.0.561407439076.issue14191@psf.upfronthosting.co.za> Steven Bethard added the comment: Actually, that could be even simpler: args, remaining_args = optionals.parse_known_args() args = positionals.parse_args(remaining_args, args) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 00:52:37 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 08 Mar 2012 23:52:37 +0000 Subject: [issue14211] Don't rely on borrowed _PyType_Lookup() reference in PyObject_GenericSetAttr() In-Reply-To: <1331054345.96.0.65871889242.issue14211@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 2cc44cd8098e by Victor Stinner in branch 'default': Issue #14211: Oops, I removed the wrong file :-) http://hg.python.org/cpython/rev/2cc44cd8098e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 01:05:37 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Mar 2012 00:05:37 +0000 Subject: [issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py Message-ID: <1331251537.37.0.172100522309.issue14231@psf.upfronthosting.co.za> New submission from STINNER Victor : Lib/test/crashers/borrowed_ref_1.py contains the docstring: "_PyType_Lookup() returns a borrowed reference. This attacks the call in dictobject.c." The file was added by Armin in 2006 by the changeset 4dd1a9383e47. I just fixed #14211 which was a similar bug (Lib/test/crashers/borrowed_ref_2.py), but I'm unable to reproduce this one. Extract of dict_subscript(): missing = _PyObject_LookupSpecial((PyObject *)mp, &PyId___missing__); if (missing != NULL) { res = PyObject_CallFunctionObjArgs(missing, key, NULL); Py_DECREF(missing); return res; } I fail to see how missing can be destroyed before being used. Is it a problem that missing is destroyed while we are calling it? How can I trigger the crash in gdb? ---------- components: Interpreter Core messages: 155190 nosy: arigo, haypo priority: normal severity: normal status: open title: Fix or drop Lib/test/crashers/borrowed_ref_1.py type: crash versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 01:06:11 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Mar 2012 00:06:11 +0000 Subject: [issue14211] Don't rely on borrowed _PyType_Lookup() reference in PyObject_GenericSetAttr() In-Reply-To: <1331054345.96.0.65871889242.issue14211@psf.upfronthosting.co.za> Message-ID: <1331251571.85.0.377749327494.issue14211@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 01:14:02 2012 From: report at bugs.python.org (Armin Rigo) Date: Fri, 09 Mar 2012 00:14:02 +0000 Subject: [issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py In-Reply-To: <1331251537.37.0.172100522309.issue14231@psf.upfronthosting.co.za> Message-ID: <1331252042.54.0.232465265837.issue14231@psf.upfronthosting.co.za> Armin Rigo added the comment: Crashes for me on Python 2.5 and 2.6, but no longer on Python 2.7. The problem may have been fixed in the meantime. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 01:18:00 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Mar 2012 00:18:00 +0000 Subject: [issue14232] obmalloc: mmap() returns MAP_FAILED on error, not 0 Message-ID: <1331252280.16.0.132612334338.issue14232@psf.upfronthosting.co.za> New submission from STINNER Victor : Python fails to catch memory allocation error in its memory allocator when mmap() is used. Attached patch fixes the issue. ---------- components: Interpreter Core files: obmalloc_map_failed.patch keywords: patch messages: 155192 nosy: haypo, neologix, pitrou priority: normal severity: normal status: open title: obmalloc: mmap() returns MAP_FAILED on error, not 0 versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24760/obmalloc_map_failed.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 01:20:49 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Mar 2012 00:20:49 +0000 Subject: [issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py In-Reply-To: <1331251537.37.0.172100522309.issue14231@psf.upfronthosting.co.za> Message-ID: <1331252449.21.0.280773891624.issue14231@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, it looks like the following commit fixed the issue without touching to the crasher test: ba6376dff6c4. Armin, Benjamin: can you confirm? ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 01:43:10 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Mar 2012 00:43:10 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: <1331253790.94.0.19113297437.issue14205@psf.upfronthosting.co.za> STINNER Victor added the comment: Guido: So, what do you think? Do you like the new behaviour, or would you prefer a softer solution like retrying N times? Python < 3.3 retries the lookup an unlimited number of times which lead to a crash, that's the issue fixed by my change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 01:48:34 2012 From: report at bugs.python.org (guilherme-pg) Date: Fri, 09 Mar 2012 00:48:34 +0000 Subject: [issue14233] argparse: "append" action fails to override default values Message-ID: <1331254114.08.0.807459942746.issue14233@psf.upfronthosting.co.za> New submission from guilherme-pg : Trying to set a default value to arguments whose action is "append" causes argparse to raise AttributeError when such arguments are provided in the command line (see attached test case t1.py). This happens because _AppendAction doesn't expect the presence of a default value for the argument: when the command line is parsed and the argument is found, _AppendAction attempts to append the new value to the list of old values, if any, or the old list. In case there is already a non-list default value, it attempts to append the new value to it, which raises the exception. Is this intended behavior? If so, shouldn't ArgumentError be raised instead? It should also be easy to fix this issue otherwise, making _StoreAction ensure the old values are stored in a list before appending. ---------- components: Library (Lib) files: t1.py messages: 155195 nosy: bethard, guilherme-pg priority: normal severity: normal status: open title: argparse: "append" action fails to override default values type: crash versions: Python 3.3 Added file: http://bugs.python.org/file24761/t1.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 01:50:02 2012 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 09 Mar 2012 00:50:02 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: <1331254202.62.0.420547869889.issue14205@psf.upfronthosting.co.za> Guido van Rossum added the comment: I'm still torn. Can you implement the counter without adding an extra field to the dict object? I worry that we'll get the same objection we had when MAL proposed collision counting as a solution to the hash DoS attack. The numbers 0, 1 and infinity are special; all others are to be treated with skepticism. I'm prepared to make the current semantic change a 3.3 feature, but I'm not sure it's safe to backport. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 01:56:17 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Mar 2012 00:56:17 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1331254202.62.0.420547869889.issue14205@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > Can you implement the counter without adding an extra field to the dict object? Add a counter requires to change the prototype of the C lookup function: PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, Py_hash_t hash); I don't know if it is a problem for ABI compatibility or extension modules. I suppose that it is safer and simpler to not change it :-) >?I worry that we'll get the same objection we had when MAL proposed collision counting as a solution to the hash DoS attack. > > The numbers 0, 1 and infinity are special; all others are to be treated with skepticism. Is it really useful to only retry once? Retrying once means that it would work in most cases, but not in some corner cases. For example, retrying once may hide the problem if you have only 1 client (1 thread), but you get the exception when you have more clients (more threads). Or do I misunderstand the problem? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 01:56:33 2012 From: report at bugs.python.org (Dave Malcolm) Date: Fri, 09 Mar 2012 00:56:33 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat Message-ID: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> New submission from Dave Malcolm : Expat 2.1.0 Beta was recently announced: http://mail.libexpat.org/pipermail/expat-discuss/2012-March/002768.html which contains (among other things) a fix for a hash-collision denial-of-service attack (CVE-2012-0876) I'm attaching a patch which minimally backports the hash-collision fix part of expat 2.1.0 to the embedded copy of expat in the CPython source tree, and which adds a call to XML_SetHashSalt() to pyexpat when creating parsers. It reuses part of the hash secret from Py_HashSecret. ---------- components: XML files: expat-hash-randomization.patch keywords: patch messages: 155198 nosy: dmalcolm priority: normal severity: normal status: open title: CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file24762/expat-hash-randomization.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 02:01:47 2012 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 09 Mar 2012 01:01:47 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: Message-ID: Guido van Rossum added the comment: On Thu, Mar 8, 2012 at 4:56 PM, STINNER Victor wrote: > > STINNER Victor added the comment: > >> Can you implement the counter without adding an extra field to the dict object? > > Add a counter requires to change the prototype of the C lookup function: > PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, Py_hash_t hash); > > I don't know if it is a problem for ABI compatibility or extension > modules. I suppose that it is safer and simpler to not change it :-) Agreed. >>?I worry that we'll get the same objection we had when MAL proposed collision counting as a solution to the hash DoS attack. >> >> The numbers 0, 1 and infinity are special; all others are to be treated with skepticism. > > Is it really useful to only retry once? Retrying once means that it > would work in most cases, but not in some corner cases. For example, > retrying once may hide the problem if you have only 1 client (1 > thread), but you get the exception when you have more clients (more > threads). > > Or do I misunderstand the problem? Sorry, I was joking; anyway, 1 in this context would mean do the lookup exactly once (so 0 would mean not to do it at all). One retry would effectively mean try it twice, which would have to be treated skeptically. :-) Given all this I think we should keep it as you have committed and add it to the docs and whatsnew. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 02:03:27 2012 From: report at bugs.python.org (Dave Malcolm) Date: Fri, 09 Mar 2012 01:03:27 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331255007.9.0.368380519843.issue14234@psf.upfronthosting.co.za> Changes by Dave Malcolm : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 02:12:50 2012 From: report at bugs.python.org (Josh Watson) Date: Fri, 09 Mar 2012 01:12:50 +0000 Subject: [issue14235] test_cmd.py does not correctly call reload() Message-ID: <1331255570.35.0.441826601517.issue14235@psf.upfronthosting.co.za> New submission from Josh Watson : The test_coverage function in test_cmd.py calls reload(cmd) ---------- components: Tests messages: 155200 nosy: Josh.Watson priority: normal severity: normal status: open title: test_cmd.py does not correctly call reload() type: crash versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 02:15:38 2012 From: report at bugs.python.org (Josh Watson) Date: Fri, 09 Mar 2012 01:15:38 +0000 Subject: [issue14235] test_cmd.py does not correctly call reload() In-Reply-To: <1331255570.35.0.441826601517.issue14235@psf.upfronthosting.co.za> Message-ID: <1331255738.07.0.607517539399.issue14235@psf.upfronthosting.co.za> Josh Watson added the comment: Accidentally submitted before finishing typing. Anyways, it calls "reload(cmd)" in the test_coverage function in test_cmd.py, which does not work anymore given that reload has been moved to imp. I've uploaded a patch that fixes this. ---------- keywords: +patch Added file: http://bugs.python.org/file24763/test_cmd-reload.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 02:18:21 2012 From: report at bugs.python.org (Josh Watson) Date: Fri, 09 Mar 2012 01:18:21 +0000 Subject: [issue14235] test_cmd.py does not correctly call reload() In-Reply-To: <1331255570.35.0.441826601517.issue14235@psf.upfronthosting.co.za> Message-ID: <1331255901.58.0.245742862578.issue14235@psf.upfronthosting.co.za> Changes by Josh Watson : ---------- type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 02:35:49 2012 From: report at bugs.python.org (Glenn Linderman) Date: Fri, 09 Mar 2012 01:35:49 +0000 Subject: [issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters In-Reply-To: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> Message-ID: <1331256949.97.0.294931268494.issue14191@psf.upfronthosting.co.za> Glenn Linderman added the comment: *Very* interesting, Steven. Looking again at section 15.4.6, and recognizing that positional arguments were never parsed by optparse, then we discover that with two minor tweaks, removing "and add additional ArgumentParser.add_argument() calls for the positional arguments." from step two, and calling parse_known_args instead of parse_args, we actually achieve greater compatibility with optparse, for those that need it. However, the above would allow undefined arguments to slip through into the positional arguments. So to prevent that, the second parser you suggest, defining only the positional arguments, will tighten up the error checks. So this issue could be resolved simply by updating section 15.4.6 of the documentation to explain all this. On the other hand, the explanation gets long and perhaps confusing. Looking at the 15.4.4, I see: ArgumentParser.parse_args(args=None, namespace=None) Convert argument strings to objects and assign them as attributes of the namespace. Return the populated namespace. Previous calls to add_argument() determine exactly what objects are created and how they are assigned. See the documentation for add_argument() for details. By default, the argument strings are taken from sys.argv, and a new empty Namespace object is created for the attributes. However, nowhere is the args= parameter explained. One example is given at the end of 15.4.4.6 showing the use of args= which apparently accepts a list of parameters, similar to the positional list of parameters that are used in all the other examples. It might be nice to clarify that. This leads into a suggestion: a new keyword parameter for parse_args: intermixed=False. When False, the default, new_parse_args would act exactly as it does today, possibly by calling old_parse_args. When True, parse_args would implement your suggestion probably in the following way: filter out the positional parameters, call parse_known_args, then filter out the optional parameters, call old_parse_args, and return the combination. t16.py implements this, external to the class, and using two parsers as you suggested. One thing I notice in playing with my optparse function, is that error messages contain an improper usage message. This would seem to be most easily fixed if the logic were built in to argparse, rather than attempting to do it externally. Adding this parameter would also make it is much easier to write section 15.4.7 accurately, and would reduce the porting burden on each implementer, as well. The technique has merit in achieving compatibility with optparse, to allow it to remain deprecated, and looks straightforward to implement. ---------- Added file: http://bugs.python.org/file24764/t16.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 02:52:56 2012 From: report at bugs.python.org (guilherme-pg) Date: Fri, 09 Mar 2012 01:52:56 +0000 Subject: [issue14233] argparse: "append" action fails to override default values In-Reply-To: <1331254114.08.0.807459942746.issue14233@psf.upfronthosting.co.za> Message-ID: <1331257976.19.0.134096194736.issue14233@psf.upfronthosting.co.za> Changes by guilherme-pg : ---------- type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 03:20:16 2012 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 09 Mar 2012 02:20:16 +0000 Subject: [issue14233] argparse: "append" action fails to override default values In-Reply-To: <1331254114.08.0.807459942746.issue14233@psf.upfronthosting.co.za> Message-ID: <1331259616.29.0.717663250848.issue14233@psf.upfronthosting.co.za> Eric V. Smith added the comment: I don't think it's worth checking that you've passed in the correct type for the default parameter. That's not something that Python code typically does. The error you get: AttributeError: 'tuple' object has no attribute 'append' seem pretty clear. Pass in a list instead of a tuple, and it works as expected. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 04:07:01 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 09 Mar 2012 03:07:01 +0000 Subject: [issue14036] urlparse insufficient port property validation In-Reply-To: <1329435639.39.0.341536822512.issue14036@psf.upfronthosting.co.za> Message-ID: <1331262421.68.0.340682399848.issue14036@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Couple of points: 1. On your last example, which webserver treats 'L' as part of port number? I can't of anything. 2. Can you write a "real application" which is listening to beyond 65535? Which platform would it be? Current way of handling invalid port like, int('foo') by raising ValueError seems to be a better than returning a None. A better error message could be desirable, but that does not make it a security issue. Additionally, for the example of int changing long integer to 'L' appended one would a 2.x case as it is no longer the behavior in 3.x Also, I would advice to look at getPort function in a C library or a Java library and see what it does. The only difference I see is, they return -1 where Python returns None. I am changing the request type to an enhancement, because there is not a valid argument to support that it is a security issue. ---------- status: open -> pending type: security -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 05:28:09 2012 From: report at bugs.python.org (Jim Jewett) Date: Fri, 09 Mar 2012 04:28:09 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1331253790.94.0.19113297437.issue14205@psf.upfronthosting.co.za> Message-ID: Jim Jewett added the comment: On Thu, Mar 8, 2012 at 7:43 PM, STINNER Victor wrote: > Python < 3.3 retries the lookup an unlimited number of times which > lead to a crash, that's the issue fixed by my change. How does it lead to a crash? I think it just leads to an infinite loop (which is worse) if the data is actually malicious, but eventually fixes itself if the data is merely unlucky or even ill-behaved. Guido van Rossume: >> Can you implement the counter without adding an extra field to the dict object? Yes. The logic does add complexity, but there is no per-dict charge, and the extra logic can be isolated to a function that will normally not be paged in. > Add a counter requires to change the prototype of the C lookup > function: > PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, Py_hash_t hash); > I don't know if it is a problem for ABI compatibility or extension > modules. I suppose that it is safer and simpler to not change it :-) That should still be the signature for the primary lookup; it can do its own delegation to a private function with an extra parameter if/when needed. > The numbers 0, 1 and infinity are special; all others are to be > treated with skepticism. Yes; it isn't clear whether to cut off after 1 retry or 3 or 10... > Is it really useful to only retry once? Retrying once means that it > would work in most cases, but not in some corner cases. For example, > retrying once may hide the problem if you have only 1 client (1 > thread), but you get the exception when you have more clients (more > threads). Without threads, there shouldn't be any problems for innocent code. Even with threads, the number of resets is not (for innocent code) tied to the number of alternative threads; only to the fact that they can run mid-lookup. -jJ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 06:00:11 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 09 Mar 2012 05:00:11 +0000 Subject: [issue14217] text output pretends to be code In-Reply-To: <1331108351.7.0.269278733631.issue14217@psf.upfronthosting.co.za> Message-ID: <1331269211.19.0.942330631124.issue14217@psf.upfronthosting.co.za> Senthil Kumaran added the comment: I reviewed the patch, built the docs and found it good. Fixed it in 3d877dee1bde and aaf45928899c Thanks! ---------- nosy: +orsenthil resolution: -> fixed status: open -> closed versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 07:06:57 2012 From: report at bugs.python.org (py.user) Date: Fri, 09 Mar 2012 06:06:57 +0000 Subject: [issue14236] In help(re) are insufficient details Message-ID: <1331273217.26.0.527770128505.issue14236@psf.upfronthosting.co.za> New submission from py.user : 1) help(re) " \s Matches any whitespace character; equivalent to [ \t\n\r\f\v]. \S Matches any non-whitespace character; equiv. to [^ \t\n\r\f\v]." no info about unicode spaces 2) help(re.split) "split(pattern, string, maxsplit=0, flags=0) Split the source string by the occurrences of the pattern, returning a list containing the resulting substrings." no info about behaviour with groups in pattern ---------- assignee: docs at python components: Documentation, Regular Expressions messages: 155207 nosy: docs at python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: In help(re) are insufficient details versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 07:11:14 2012 From: report at bugs.python.org (py.user) Date: Fri, 09 Mar 2012 06:11:14 +0000 Subject: [issue14237] Special sequences \A and \Z don't work in character set [] Message-ID: <1331273474.34.0.161446399383.issue14237@psf.upfronthosting.co.za> New submission from py.user : >>> import re >>> re.search(r'\Ac\Z', 'c') <_sre.SRE_Match object at 0xb74cff38> >>> re.search(r'[\A]c[\Z]', 'c') >>> re.purge() >>> re.search(r'[\A]c[\Z]', 'c', re.DEBUG) in at at_beginning_string literal 99 in at at_end_string >>> ---------- components: Regular Expressions messages: 155208 nosy: ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: Special sequences \A and \Z don't work in character set [] type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 08:14:35 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Fri, 09 Mar 2012 07:14:35 +0000 Subject: [issue14229] On KeyboardInterrupt, the exit code should mirror the signal number In-Reply-To: <1331238085.62.0.936420173713.issue14229@psf.upfronthosting.co.za> Message-ID: <1331277275.14.0.703518261811.issue14229@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I'm not so sure that Python is in violation of the convention here. The exit code should report *unhandled* signals, indicating that the process didn't provide an exit code at all (as it didn't call exit(2)). You are supposed to use WIFEXITED/WIFSIGNALED/WIFSTOPPED on the status code, and interpret it as an exit code only if WIFEXITED. Since Python *does* handle the signal, and exits "regularly", we shouldn't (and probably even can't) claim that we didn't exit (unless we raise the signal again instead of exiting). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 08:37:52 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Fri, 09 Mar 2012 07:37:52 +0000 Subject: [issue14237] Special sequences \A and \Z don't work in character set [] In-Reply-To: <1331273474.34.0.161446399383.issue14237@psf.upfronthosting.co.za> Message-ID: <1331278672.19.0.197103697201.issue14237@psf.upfronthosting.co.za> Martin v. L?wis added the comment: What behavior would you expect? ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 09:12:44 2012 From: report at bugs.python.org (R. David Murray) Date: Fri, 09 Mar 2012 08:12:44 +0000 Subject: [issue14233] argparse: "append" action fails to override default values In-Reply-To: <1331254114.08.0.807459942746.issue14233@psf.upfronthosting.co.za> Message-ID: <1331280764.64.0.0520195307734.issue14233@psf.upfronthosting.co.za> R. David Murray added the comment: I agree with Eric. I've run in to this error, and immediatly figured out what I'd done wrong based on the existing error message. ---------- nosy: +r.david.murray resolution: -> invalid stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 09:33:32 2012 From: report at bugs.python.org (R. David Murray) Date: Fri, 09 Mar 2012 08:33:32 +0000 Subject: [issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters In-Reply-To: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> Message-ID: <1331282012.37.0.917233936863.issue14191@psf.upfronthosting.co.za> R. David Murray added the comment: To answer Glenn's procedural question: no this is not a bug whose fix can be backported. API changes are not allowed in maintenance releases. Doc improvements can be backported, though, so I'm leaving versios alone (alternatively someone could split this into two bugs, one for the doc fixes for older releases, and one for adding the new capability). ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 09:52:15 2012 From: report at bugs.python.org (Eric Snow) Date: Fri, 09 Mar 2012 08:52:15 +0000 Subject: [issue14226] Expose dict_proxy type from descrobject.c In-Reply-To: <1331163340.11.0.494916770875.issue14226@psf.upfronthosting.co.za> Message-ID: <1331283135.06.0.269304069048.issue14226@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 09:54:04 2012 From: report at bugs.python.org (Juan Javier) Date: Fri, 09 Mar 2012 08:54:04 +0000 Subject: [issue13785] Make concurrent.futures.Future state public In-Reply-To: <1326560835.55.0.282912980665.issue13785@psf.upfronthosting.co.za> Message-ID: <1331283244.43.0.479808329786.issue13785@psf.upfronthosting.co.za> Juan Javier added the comment: I'm writting an application where users can submit long running jobs and I want to disply a list of those jobs and the state of each one. My idea is to use an executor and use the futures to display information about the jobs: not started, cancelled, running, etc. Think of a table with these headers: ID, Start date, Last state change date, State, Info ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 09:54:28 2012 From: report at bugs.python.org (Eric Snow) Date: Fri, 09 Mar 2012 08:54:28 +0000 Subject: [issue14209] pkgutil.iter_zipimport_modules ignores the prefix parameter for packages In-Reply-To: <1331046144.89.0.833633660995.issue14209@psf.upfronthosting.co.za> Message-ID: <1331283268.49.0.251237776955.issue14209@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 09:55:08 2012 From: report at bugs.python.org (Eric Snow) Date: Fri, 09 Mar 2012 08:55:08 +0000 Subject: [issue1469629] __dict__ = self in subclass of dict causes a memory leak Message-ID: <1331283308.52.0.251474576797.issue1469629@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 10:00:09 2012 From: report at bugs.python.org (Mark Shannon) Date: Fri, 09 Mar 2012 09:00:09 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: <1331283609.38.0.932864115563.issue14205@psf.upfronthosting.co.za> Mark Shannon added the comment: Unmodified CPython (without the patch) already passes the new test in the patch. The unmodified code already raises a Runtime error; a recursion limit exceeded error! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 10:22:00 2012 From: report at bugs.python.org (Arkadiusz Miskiewicz Arkadiusz Miskiewicz) Date: Fri, 09 Mar 2012 09:22:00 +0000 Subject: [issue14238] python shouldn't need username in passwd database Message-ID: <1331284920.1.0.720164223022.issue14238@psf.upfronthosting.co.za> New submission from Arkadiusz Miskiewicz Arkadiusz Miskiewicz : I'm trying to run python from UID which doesn't have entry in passwd database. This fails with: Traceback (most recent call last): File "/usr/share/python2.7/site.py", line 567, in File "/usr/share/python2.7/site.py", line 549, in main File "/usr/share/python2.7/site.py", line 278, in addusersitepackages File "/usr/share/python2.7/site.py", line 253, in getusersitepackages File "/usr/share/python2.7/site.py", line 243, in getuserbase File "/usr/share/python2.7/sysconfig.py", line 522, in get_config_var File "/usr/share/python2.7/sysconfig.py", line 426, in get_config_vars File "/usr/share/python2.7/sysconfig.py", line 184, in _getuserbase File "/usr/share/python2.7/sysconfig.py", line 171, in joinuser File "/usr/share/python2.7/posixpath.py", line 260, in expanduser KeyError: 'getpwuid(): uid not found: 51' ---------- components: Interpreter Core messages: 155215 nosy: arekm priority: normal severity: normal status: open title: python shouldn't need username in passwd database versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 10:31:57 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Fri, 09 Mar 2012 09:31:57 +0000 Subject: [issue14238] python shouldn't need username in passwd database In-Reply-To: <1331284920.1.0.720164223022.issue14238@psf.upfronthosting.co.za> Message-ID: <1331285517.14.0.517344805294.issue14238@psf.upfronthosting.co.za> Nadeem Vawda added the comment: This looks similar to a sporadic failure on the debian bigmem buildbot: http://www.python.org/dev/buildbot/all/builders/AMD64%20debian%20bigmem%203.x/builds/168/steps/test/logs/stdio ERROR: test_expanduser (test.test_posixpath.PosixPathTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/test_posixpath.py", line 305, in test_expanduser home = pwd.getpwuid(os.getuid()).pw_dir KeyError: 'getpwuid(): uid not found: 5025' ---------- components: +Library (Lib) -Interpreter Core keywords: +buildbot nosy: +loewis, nadeem.vawda stage: -> needs patch type: -> behavior versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 10:35:22 2012 From: report at bugs.python.org (Georg Brandl) Date: Fri, 09 Mar 2012 09:35:22 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331285722.96.0.553062797796.issue14234@psf.upfronthosting.co.za> Changes by Georg Brandl : ---------- nosy: +benjamin.peterson, georg.brandl priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 10:36:08 2012 From: report at bugs.python.org (Georg Brandl) Date: Fri, 09 Mar 2012 09:36:08 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331285768.28.0.939177277522.issue14234@psf.upfronthosting.co.za> Georg Brandl added the comment: I hope this can be integrated during the PyCon sprints? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 10:37:02 2012 From: report at bugs.python.org (Georg Brandl) Date: Fri, 09 Mar 2012 09:37:02 +0000 Subject: [issue14238] python shouldn't need username in passwd database In-Reply-To: <1331284920.1.0.720164223022.issue14238@psf.upfronthosting.co.za> Message-ID: <1331285822.26.0.0656973134778.issue14238@psf.upfronthosting.co.za> Georg Brandl added the comment: I agree -- there should be a guard here that just doesn't add user site directories if the lookup fails. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 10:38:30 2012 From: report at bugs.python.org (Georg Brandl) Date: Fri, 09 Mar 2012 09:38:30 +0000 Subject: [issue14116] Lock.__enter__() method returns True instead of self In-Reply-To: <1330117381.1.0.499178307418.issue14116@psf.upfronthosting.co.za> Message-ID: <1331285910.89.0.951358762151.issue14116@psf.upfronthosting.co.za> Changes by Georg Brandl : ---------- type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 10:44:09 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Mar 2012 09:44:09 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1331283609.38.0.932864115563.issue14205@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > Unmodified CPython (without the patch) already passes the new test in the patch. You should try Lib/test/crashers/nasty_eq_vs_dict.py, not my test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 10:50:41 2012 From: report at bugs.python.org (Georg Brandl) Date: Fri, 09 Mar 2012 09:50:41 +0000 Subject: [issue14210] add filename completion to pdb In-Reply-To: <1331048207.84.0.206422925925.issue14210@psf.upfronthosting.co.za> Message-ID: <1331286641.58.0.779678998531.issue14210@psf.upfronthosting.co.za> Georg Brandl added the comment: I agree. It should not be too hard to add complete_break() and other similar methods that do this to Pdb. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 11:04:22 2012 From: report at bugs.python.org (Mark Shannon) Date: Fri, 09 Mar 2012 10:04:22 +0000 Subject: [issue14239] Uninitialised variable in _PyObject_GenericSetAttrWithDict Message-ID: <1331287462.62.0.137638108542.issue14239@psf.upfronthosting.co.za> New submission from Mark Shannon : I get the following compiler warning (rev 2a142141e5fd) Its not strictly an error, but an unitialised variable in such an important function is dangerous. Objects/object.c: In function ?_PyObject_GenericSetAttrWithDict?: Objects/object.c:1144: warning: ?descr? may be used uninitialised in this function Patch attached ---------- components: Installation files: uninitialised_descr.patch keywords: patch messages: 155221 nosy: Mark.Shannon priority: normal severity: normal status: open title: Uninitialised variable in _PyObject_GenericSetAttrWithDict type: compile error Added file: http://bugs.python.org/file24765/uninitialised_descr.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 11:12:34 2012 From: report at bugs.python.org (Mark Shannon) Date: Fri, 09 Mar 2012 10:12:34 +0000 Subject: [issue13903] New shared-keys dictionary implementation In-Reply-To: <1327847206.97.0.499643364955.issue13903@psf.upfronthosting.co.za> Message-ID: <1331287954.29.0.585500517676.issue13903@psf.upfronthosting.co.za> Changes by Mark Shannon : Added file: http://bugs.python.org/file24766/257e16e71654.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 11:54:05 2012 From: report at bugs.python.org (Georg Brandl) Date: Fri, 09 Mar 2012 10:54:05 +0000 Subject: [issue14210] add filename completion to pdb In-Reply-To: <1331048207.84.0.206422925925.issue14210@psf.upfronthosting.co.za> Message-ID: <1331290445.5.0.47458853779.issue14210@psf.upfronthosting.co.za> Georg Brandl added the comment: Here's a patch for 3.3, adding completion to most commands (either completes locations, breakpoint numbers or expressions). Please test! ---------- assignee: -> georg.brandl keywords: +patch Added file: http://bugs.python.org/file24767/pdb-completion.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 12:14:19 2012 From: report at bugs.python.org (Nicholas Cole) Date: Fri, 09 Mar 2012 11:14:19 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1331291659.29.0.288605481872.issue12568@psf.upfronthosting.co.za> Nicholas Cole added the comment: Could we have an update on the status of this? I ask because if 3.3 is going to (finally) fix unicode for curses, it would be really nice if it were possible to calculate the width of what's being displayed! It looks as if there was never quite agreement on the proper API.... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 12:39:18 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 09 Mar 2012 11:39:18 +0000 Subject: [issue14178] _elementtree problem deleting slices with steps != +1 In-Reply-To: <1330706183.38.0.536130831322.issue14178@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 1a721b9a4039 by Eli Bendersky in branch 'default': Issue #14178: Problem deleting slices with steps != +1 in the _elementtree module. http://hg.python.org/cpython/rev/1a721b9a4039 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 12:41:00 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 09 Mar 2012 11:41:00 +0000 Subject: [issue14178] _elementtree problem deleting slices with steps != +1 In-Reply-To: <1330706183.38.0.536130831322.issue14178@psf.upfronthosting.co.za> Message-ID: <1331293260.78.0.689058751103.issue14178@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 12:51:35 2012 From: report at bugs.python.org (Thomas Turner) Date: Fri, 09 Mar 2012 11:51:35 +0000 Subject: [issue14240] lstrip problem Message-ID: <1331293895.45.0.678808480935.issue14240@psf.upfronthosting.co.za> New submission from Thomas Turner : Problem with lstrip >>> s = 'msgid "supplier code"' >>> >>> s.lstrip('msgid "') 'upplier code"' >>> It should come back with supplier code" To get round the bug I did >>> s.lstrip('msgid ').lstrip('"') 'supplier code"' >>> ---------- components: None messages: 155225 nosy: Thomas.Turner priority: normal severity: normal status: open title: lstrip problem type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 13:06:03 2012 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 09 Mar 2012 12:06:03 +0000 Subject: [issue14240] lstrip problem In-Reply-To: <1331293895.45.0.678808480935.issue14240@psf.upfronthosting.co.za> Message-ID: <1331294763.73.0.27841535905.issue14240@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: This is expected behavior: http://docs.python.org/library/stdtypes.html#str.lstrip """The chars argument is not a prefix; rather, all combinations of its values are stripped""" ---------- nosy: +amaury.forgeotdarc resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 13:39:16 2012 From: report at bugs.python.org (Mark Shannon) Date: Fri, 09 Mar 2012 12:39:16 +0000 Subject: [issue14241] io.UnsupportedOperation.__new__(io.UnsupportedOperation) fails Message-ID: <1331296756.01.0.329340447456.issue14241@psf.upfronthosting.co.za> New submission from Mark Shannon : >>> io.UnsupportedOperation.__new__(io.UnsupportedOperation) Traceback (most recent call last): File "", line 1, in TypeError: ValueError.__new__(UnsupportedOperation) is not safe, use OSError.__new__() Looking at the mro of io.UnsupportedOperation (io.UnsupportedOperation, ValueError, OSError, Exception, BaseException, object'>) Shows that ValueError.__new__ is getting called, but will not construct an instance of a subtype of OSError Switching the order of ValueError and OSError fixes this error (patch attached), but doesn't fix the underlying problem. Why doesn't io.UnsupportedOperation() fail, when UnsupportedOperation.__new__ does? io.UnsupportedOperation() actually calls OSError.__new__ via the internal tp_new slot. In other words UnsupportedOperation->tp_new != UnsupportedOperation.__new__ This should not happen, it looks like the logic in inherit_special() in typeobject.c may be faulty. ---------- components: Interpreter Core files: io_new.patch keywords: patch messages: 155227 nosy: Mark.Shannon priority: normal severity: normal status: open title: io.UnsupportedOperation.__new__(io.UnsupportedOperation) fails type: behavior Added file: http://bugs.python.org/file24768/io_new.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 13:59:55 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Mar 2012 12:59:55 +0000 Subject: [issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py In-Reply-To: <1331251537.37.0.172100522309.issue14231@psf.upfronthosting.co.za> Message-ID: <1331297995.56.0.747124618045.issue14231@psf.upfronthosting.co.za> STINNER Victor added the comment: ba6376dff6c4 changed dict_subscript(): _PyType_Lookup() is replaced by _PyObject_LookupSpecial(). 7b4b921f3335 fixed a reference introduced in this change. _PyObject_Lookup() returns a borrowed reference, whereas _PyObject_LookupSpecial() increments the reference to the attribute. The issue was on borrowed reference, so the bug is already fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 14:00:14 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 09 Mar 2012 13:00:14 +0000 Subject: [issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py In-Reply-To: <1331251537.37.0.172100522309.issue14231@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 850d7f6af1b0 by Victor Stinner in branch 'default': Issue #14231: Lib/test/crashers/borrowed_ref_1.py was fixed by ba6376dff6c4. http://hg.python.org/cpython/rev/850d7f6af1b0 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 14:00:45 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Mar 2012 13:00:45 +0000 Subject: [issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py In-Reply-To: <1331251537.37.0.172100522309.issue14231@psf.upfronthosting.co.za> Message-ID: <1331298045.16.0.0995830982246.issue14231@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 14:04:09 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 09 Mar 2012 13:04:09 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset a428f85de29c by Victor Stinner in branch 'default': Issue #14205: Document the dict lookup change in What's New in Python 3.3 http://hg.python.org/cpython/rev/a428f85de29c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 14:05:01 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Mar 2012 13:05:01 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: <1331298301.13.0.409974287937.issue14205@psf.upfronthosting.co.za> STINNER Victor added the comment: Guido> Given all this I think we should keep it as you have committed Guido> and add it to the docs and whatsnew. I updated What's New in Python 3.3 document. I also wrote an email to python-dev to notify all developers of this change. Let's close the issue. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 14:52:48 2012 From: report at bugs.python.org (Mark Shannon) Date: Fri, 09 Mar 2012 13:52:48 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1331298301.13.0.409974287937.issue14205@psf.upfronthosting.co.za> Message-ID: <4F5A0B31.4060605@hotpy.org> Mark Shannon added the comment: STINNER Victor wrote: > STINNER Victor added the comment: > > Guido> Given all this I think we should keep it as you have committed > Guido> and add it to the docs and whatsnew. > > I updated What's New in Python 3.3 document. I also wrote an email to python-dev to notify all developers of this change. Let's close the issue. > The tests still need to fixed test_mutating_lookuptest doesn't fail on the unmodified version of cpython. Lib/test/crashers/nasty_eq_vs_dict.py has been removed, but no equivalent test has been added to Lib/test/test_dict.py There should be at least one failing test for this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 15:28:51 2012 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 09 Mar 2012 14:28:51 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: <1331111194.08.0.943407781198.issue14218@psf.upfronthosting.co.za> Message-ID: <1331303331.89.0.239979152935.issue14218@psf.upfronthosting.co.za> Ezio Melotti added the comment: My opinion is that in general you should worry about the semantic of the role/directive you are using, rather than its aspect while rendered. Some entries (especially some directives) might benefit from a rendered example, but I don't think it's necessary to add the output to each role/directive. Another idea that we were discussing on IRC (and IIRC on another issue that I can't find anymore), was to add at the top a table like: ---------------------------------------- arguments *arg* strong text **strong** code snippets ``print('hello world')`` True/False/None ``True`` functions :func:`sorted` methods :meth:`list.sort` ... ---------------------------------------- This will allow people that are searching for the right markup to find quickly what role they should use. I also agree with ?ric that you should always build the doc anyway to check for errors. Sometimes it happens that I have to experiment a bit if I'm using some uncommon role/directive, but that doesn't happen often, and building the doc a few times is not a problem for me in these cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 15:28:53 2012 From: report at bugs.python.org (telmich) Date: Fri, 09 Mar 2012 14:28:53 +0000 Subject: [issue14228] SIGINT (Ctrl-C) not caught at startup In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1331303333.38.0.45936041951.issue14228@psf.upfronthosting.co.za> telmich added the comment: The problem is *NOT* in the parent: The problem is in the *CHILD* that is being called from the shell that is throwing a traceback, which I cannot prevent in the python code. Please run the script yourself and try to get around the problem, you'll notice it's not possible currently in python 3.2.2. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 15:33:38 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 09 Mar 2012 14:33:38 +0000 Subject: [issue14228] SIGINT (Ctrl-C) not caught at startup In-Reply-To: <1331303333.38.0.45936041951.issue14228@psf.upfronthosting.co.za> Message-ID: <1331303367.3392.3.camel@localhost.localdomain> Antoine Pitrou added the comment: > The problem is *NOT* in the parent: The problem is in the *CHILD* that > is being called from the shell that is throwing a traceback, which I > cannot prevent in the python code. Python does not (at least, should not) run differently as a child or as a parent. As a matter of fact, any uncaught exception will indeed print a traceback (which is very useful for e.g. debug purposes). If you don't want such tracebacks, you can capture stderr in the calling process. Also, it would be better if you explained your actual case, rather than complain about specific behaviour. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 15:35:00 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 09 Mar 2012 14:35:00 +0000 Subject: [issue14241] io.UnsupportedOperation.__new__(io.UnsupportedOperation) fails In-Reply-To: <1331296756.01.0.329340447456.issue14241@psf.upfronthosting.co.za> Message-ID: <1331303700.98.0.0109303263076.issue14241@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 16:05:42 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Fri, 09 Mar 2012 15:05:42 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1331305542.07.0.334619195022.issue12568@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Nicholas: I consider this issue fixed. There already *is* any API to compute the width of a character. Closing this as "works for me". ---------- resolution: -> works for me status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 16:06:00 2012 From: report at bugs.python.org (telmich) Date: Fri, 09 Mar 2012 15:06:00 +0000 Subject: [issue14228] SIGINT (Ctrl-C) not caught at startup In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1331305560.67.0.813871956785.issue14228@psf.upfronthosting.co.za> telmich added the comment: You are right, there is no different behaviour as parent or child in general. I used this example python => shell => python, because it is actually being used like this in cdist (first link in the first post). The problem arises there, because python is called many (some thousand) times, depending on the configuration, thus you see the problem very often. This is indeed a general problem, but you cannot easily trigger it in one python process, because the race condition is hard to trigger manually. Thus the provided use case (running python 1000 times from shell scripts) is very realistic in a typical cdist run. For demonstration, you can run ./shellpart.sh directly, press ctrl-c and see that you'll get a traceback, although all possible code is protected from the exception. But (in that's the point) it is possible in user code to catch this exception. I should probably rephrase the title to "It is impossible to catch sigint on startup in python code" Hope this makes things more clear. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 17:07:38 2012 From: report at bugs.python.org (Armin Rigo) Date: Fri, 09 Mar 2012 16:07:38 +0000 Subject: [issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py In-Reply-To: <1331251537.37.0.172100522309.issue14231@psf.upfronthosting.co.za> Message-ID: <1331309258.34.0.664031412134.issue14231@psf.upfronthosting.co.za> Armin Rigo added the comment: I will attempt a last time to mention that the docstrings in borrowed_ref_*.py used to say they were *examples*. That means: (1) find any internal or external C function that returns a borrowed reference; (2) find all callers and write down all the places that don't immediately either Py_INCREF() the returned value or immediately forget about it; (3) for each such place, either come up painfully with a complicated explanation of why it's safe in all possible cases, or in doubt, just fix it by adding Py_INCREF()/Py_DECREF(). What I did in writing these two borrowed_ref_*.py was to do instead (3') spend a few hours figuring out how to exploit the issue until we get a segfault. I did it for two examples, but what I'm definitely not going to do is spend N times a few hours for a large number N. If python-dev people just fix the two examples, remove the crashers, and just forget about the issue, then well, the point is missed, but I'm not going to fight it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 17:20:04 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 09 Mar 2012 16:20:04 +0000 Subject: [issue14232] obmalloc: mmap() returns MAP_FAILED on error, not 0 In-Reply-To: <1331252280.16.0.132612334338.issue14232@psf.upfronthosting.co.za> Message-ID: <1331310004.97.0.600477293321.issue14232@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Ha, good catch. Indeed, under Linux MMAP_FAILED seems to be ((void *) -1). ---------- stage: -> commit review type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 17:20:23 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Fri, 09 Mar 2012 16:20:23 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: <1331303331.89.0.239979152935.issue14218@psf.upfronthosting.co.za> Message-ID: Tshepang Lekhonkhobe added the comment: > Ezio Melotti added the comment: > Another idea that we were discussing on IRC (and IIRC on another issue that I can't find anymore), was to add at the top a table like: > ---------------------------------------- > arguments ? ? ? *arg* > strong text ? ? **strong** > code snippets ? ``print('hello world')`` > True/False/None ``True`` > functions ? ? ? :func:`sorted` > methods ? ? ? ? :meth:`list.sort` > ... > ---------------------------------------- > > This will allow people that are searching for the right markup to find quickly what role they should use. That would be a good idea. A quick ref check without all the prose. > I also agree with ?ric that you should always build the doc anyway to check for errors. ?Sometimes it happens that I have to experiment a bit if I'm using some uncommon role/directive, but that doesn't happen often, and building the doc a few times is not a problem for me in these cases. I also agree. I'm just thinking someone who reads that doc should be able to see the output without building anything. That is, reading the doc doesn't necessarily mean you want to apply what you just learned "right now". There's also "just in case" or "curiosity" learning. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 17:26:26 2012 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 09 Mar 2012 16:26:26 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: <1331111194.08.0.943407781198.issue14218@psf.upfronthosting.co.za> Message-ID: <1331310386.06.0.896797084258.issue14218@psf.upfronthosting.co.za> Ezio Melotti added the comment: > I also agree. I'm just thinking someone who reads that doc should be > able to see the output without building anything. Indeed I wasn't thinking about this use case, but IME people learn most of they know about rst "on the field" (i.e. by imitating what they see in the doc page they are working on), and then go check the devguide to expand their knowledge and make sure they are using the markup correctly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 17:26:31 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Fri, 09 Mar 2012 16:26:31 +0000 Subject: [issue14210] add filename completion to pdb In-Reply-To: <1331048207.84.0.206422925925.issue14210@psf.upfronthosting.co.za> Message-ID: <1331310391.12.0.641313329779.issue14210@psf.upfronthosting.co.za> Tshepang Lekhonkhobe added the comment: Thanks for the work. I see that completion now works for user-defined variables, but: * completing with 'b' doesn't work at all * completing with 'break' only completes the first directory that gets the TAB key * also, 'break' doesn't complete when I do another try to do auto-completion (works only on first try) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 17:33:51 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 09 Mar 2012 16:33:51 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1331310831.89.0.978453374723.issue14228@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Ok, I see. Would an option to disable the default SIGINT handlers (and let the OS kill the process) be an acceptable solution to your use case? Keep in mind that letting the OS kill the process will bypass any destructors at the Python level, so for example some buffered file data may not be flushed properly, etc. By the way, if I'm not mistaken, the problem is only with SIGINT, right? ---------- components: +Interpreter Core title: SIGINT (Ctrl-C) not caught at startup -> It is impossible to catch sigint on startup in python code type: crash -> enhancement versions: +Python 3.3 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 17:38:58 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 09 Mar 2012 16:38:58 +0000 Subject: [issue14229] On KeyboardInterrupt, the exit code should mirror the signal number In-Reply-To: <1331238085.62.0.936420173713.issue14229@psf.upfronthosting.co.za> Message-ID: <1331311138.02.0.657307338136.issue14229@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Another problem with my suggestion is that C exit() ANDs the status with 255 before transmitting it to the parent. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 17:40:37 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 09 Mar 2012 16:40:37 +0000 Subject: [issue14229] On KeyboardInterrupt, the exit code should mirror the signal number In-Reply-To: <1331238085.62.0.936420173713.issue14229@psf.upfronthosting.co.za> Message-ID: <1331311237.8.0.717540809839.issue14229@psf.upfronthosting.co.za> Antoine Pitrou added the comment: (faulthandler works around that problem by restoring the previous signal handler and calling raise(), apparently) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 17:41:56 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 09 Mar 2012 16:41:56 +0000 Subject: [issue14238] python shouldn't need username in passwd database In-Reply-To: <1331284920.1.0.720164223022.issue14238@psf.upfronthosting.co.za> Message-ID: <1331311316.91.0.73747747007.issue14238@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- keywords: +easy nosy: +eric.araujo versions: +Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 18:13:20 2012 From: report at bugs.python.org (Jim Jewett) Date: Fri, 09 Mar 2012 17:13:20 +0000 Subject: [issue13903] New shared-keys dictionary implementation In-Reply-To: <1327847206.97.0.499643364955.issue13903@psf.upfronthosting.co.za> Message-ID: <1331313200.46.0.179234515795.issue13903@psf.upfronthosting.co.za> Jim Jewett added the comment: >> As of Feb 28, 2012, the PEP mentions an additional >> optimization of storing the values in an array indexed >> by (effectively) key insertion order, rather than key >> position. ("Alternative Implementation") >> It states that this would reduce memory usage for the >> values array by 1/3. 1/3 is a worst-case measurement; >> average is 1/2. (At savings of less than 1/3, the keys >> would resize, to initial savings of 2/3. And yes, that >> means in practice, the average savings would be greater >> than half, because the frequency of dicts of size N >> decreases with N.) > I presume you mean to allocate a values array of > size == actual keys rather than size == usable keys. Actually, I meant size==maximum(keys in use for this dict), so that for objects with a potentially complex lifecycle, those instances that had not yet needed the new attributes would not need to allocate space for them. But I see now that just allocating space for each of the potential keys is indeed simpler. And I suppose that a class which won't eventually need all the attributes for every instance is an unusual case. So to get beneath 2/3 without lots of reallocation probably requires knowing when the key set is likely to be complete, and that is indeed more complex than the current changes. (That said, you have left code in for immutable keys, so there may be cases where this isn't so hard after all.) > Making the values array smaller than the the number > of usable keys causes a number of issues: > 1. The values_size will need to be kept in the dict, > not in the keys, That was indeed true for my proposal. If you just allocate 2/3, then you don't need to store the value, unless you want to be lazy about reallocating when the keys grow. Even then, there are few enough potential sizes to fit the information in a byte, or we could get the info for free *if* the dict were already timestamped or versioned. >> It states that the keys table would need an additional >> "values_size" field, but in the absence of dummies, this >> is just ma_used. I was mixing two structures in my mind. The current key count (which is sufficient for a new values array) is actually USABLE_FRACTION(dk_size) - dk_free. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 18:17:09 2012 From: report at bugs.python.org (Georg Brandl) Date: Fri, 09 Mar 2012 17:17:09 +0000 Subject: [issue14210] add filename completion to pdb In-Reply-To: <1331048207.84.0.206422925925.issue14210@psf.upfronthosting.co.za> Message-ID: <1331313429.92.0.600816523727.issue14210@psf.upfronthosting.co.za> Georg Brandl added the comment: > I see that completion now works for user-defined variables, but: > * completing with 'b' doesn't work at all Right, that needs to be added for every shortcut. > * completing with 'break' only completes the first directory that gets the TAB key > * also, 'break' doesn't complete when I do another try to do auto-completion (works only on first try) Indeed. That should be fixed with this new version of the patch. ---------- Added file: http://bugs.python.org/file24769/pdb-completion-v2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 18:18:56 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 09 Mar 2012 17:18:56 +0000 Subject: [issue14239] Uninitialised variable in _PyObject_GenericSetAttrWithDict In-Reply-To: <1331287462.62.0.137638108542.issue14239@psf.upfronthosting.co.za> Message-ID: <1331313536.31.0.243522256126.issue14239@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 18:30:28 2012 From: report at bugs.python.org (Jim Jewett) Date: Fri, 09 Mar 2012 17:30:28 +0000 Subject: [issue13903] New shared-keys dictionary implementation In-Reply-To: <1331313200.46.0.179234515795.issue13903@psf.upfronthosting.co.za> Message-ID: Jim Jewett added the comment: On Fri, Mar 9, 2012 at 12:13 PM, Jim Jewett > So to get beneath 2/3 without lots of reallocation > probably requires knowing when the key set is likely > to be complete, and that is indeed more complex than > the current changes. ?(That said, you have left code > in for immutable keys, so there may be cases where > this isn't so hard after all.) On second thought, avoiding reallocation doesn't have to be perfect -- just good enough to work on average. For a *normal* class, the keyset won't change after the first instance has completed its __init__. Which of course again leads to autoslots and a normally NULL extra_dict. And having done that, it makes sense to combine the (normal) instance dict with the type dict to simplify the lookup chain, but ... that is probably too aggressive for the 3.3 schedule. One silver lining to your patch plus hash randomization is that that 3.4 should have a pretty free hand with regards to internal details. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 18:36:26 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Fri, 09 Mar 2012 17:36:26 +0000 Subject: [issue14210] add filename completion to pdb In-Reply-To: <1331048207.84.0.206422925925.issue14210@psf.upfronthosting.co.za> Message-ID: <1331314586.98.0.988747191443.issue14210@psf.upfronthosting.co.za> Tshepang Lekhonkhobe added the comment: Works much better, but there are still some issues: * using relative path completes, but I get something like "'../prog.py' not found from sys.path" * using "~/" to try to complete the HOME directory doesn't work... it completes the root directory ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 18:41:50 2012 From: report at bugs.python.org (Georg Brandl) Date: Fri, 09 Mar 2012 17:41:50 +0000 Subject: [issue14210] add filename completion to pdb In-Reply-To: <1331048207.84.0.206422925925.issue14210@psf.upfronthosting.co.za> Message-ID: <1331314910.89.0.441614812625.issue14210@psf.upfronthosting.co.za> Georg Brandl added the comment: > * using relative path completes, but I get something like "'../prog.py' not found from sys.path" That has nothing to do with the completion. > * using "~/" to try to complete the HOME directory doesn't work... it completes the root directory Since break doesn't accept "~", I don't see why it should complete it. Keep in mind it's not a shell :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 18:42:31 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Fri, 09 Mar 2012 17:42:31 +0000 Subject: [issue14236] In help(re) are insufficient details In-Reply-To: <1331273217.26.0.527770128505.issue14236@psf.upfronthosting.co.za> Message-ID: <1331314951.3.0.0987284309938.issue14236@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 18:46:49 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Fri, 09 Mar 2012 17:46:49 +0000 Subject: [issue14210] add filename completion to pdb In-Reply-To: <1331314910.89.0.441614812625.issue14210@psf.upfronthosting.co.za> Message-ID: Tshepang Lekhonkhobe added the comment: > Georg Brandl added the comment: >> * using relative path completes, but I get something like "'../prog.py' not found from sys.path" > That has nothing to do with the completion. If I give it an absolute path it works, hence the complaint. >> * using "~/" to try to complete the HOME directory doesn't work... it completes the root directory > Since break doesn't accept "~", I don't see why it should complete it. ?Keep in mind it's not a shell :) Fair enough. Perhaps the completion should not be when encountering that character? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 18:50:02 2012 From: report at bugs.python.org (Georg Brandl) Date: Fri, 09 Mar 2012 17:50:02 +0000 Subject: [issue14210] add filename completion to pdb In-Reply-To: <1331048207.84.0.206422925925.issue14210@psf.upfronthosting.co.za> Message-ID: <1331315402.68.0.847198252596.issue14210@psf.upfronthosting.co.za> Georg Brandl added the comment: >>> * using relative path completes, but I get something like "'../prog.py' not found from sys.path" >> That has nothing to do with the completion. > If I give it an absolute path it works, hence the complaint. But that has to do with how relative paths are handled, not with how they are entered: they are taken relative to sys.path[0]. I don't know why, and if that is the useful thing to do, but it's for another issue. >>> * using "~/" to try to complete the HOME directory doesn't work... it completes the root directory >> Since break doesn't accept "~", I don't see why it should complete it. Keep in mind it's not a shell :) > Fair enough. Perhaps the completion should not be when encountering that character? That should be easy to do, yes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 19:10:43 2012 From: report at bugs.python.org (Matthew Barnett) Date: Fri, 09 Mar 2012 18:10:43 +0000 Subject: [issue14237] Special sequences \A and \Z don't work in character set [] In-Reply-To: <1331273474.34.0.161446399383.issue14237@psf.upfronthosting.co.za> Message-ID: <1331316643.76.0.0557075416907.issue14237@psf.upfronthosting.co.za> Matthew Barnett added the comment: Within a character set \A and \Z should behave like, say, \C; in other words, they should be the literals "A" and "Z". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 19:14:57 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Fri, 09 Mar 2012 18:14:57 +0000 Subject: [issue14210] add filename completion to pdb In-Reply-To: <1331315402.68.0.847198252596.issue14210@psf.upfronthosting.co.za> Message-ID: Tshepang Lekhonkhobe added the comment: > But that has to do with how relative paths are handled, not with how they are entered: they are taken relative to sys.path[0]. I don't know why, and if that is the useful thing to do, but it's for another issue. Perhaps refuse to complete all relative paths as well? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 19:16:19 2012 From: report at bugs.python.org (Georg Brandl) Date: Fri, 09 Mar 2012 18:16:19 +0000 Subject: [issue14210] add filename completion to pdb In-Reply-To: <1331048207.84.0.206422925925.issue14210@psf.upfronthosting.co.za> Message-ID: <1331316979.66.0.115649297293.issue14210@psf.upfronthosting.co.za> Georg Brandl added the comment: Nope, don't think so. They are accepted and handled (albeit strangely) after all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 20:02:59 2012 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Fri, 09 Mar 2012 19:02:59 +0000 Subject: [issue211481] os.stat() doesn't return st_rdev Message-ID: <1331319779.63.0.245274271487.issue211481@psf.upfronthosting.co.za> ???? ????????? added the comment: Okay, it returns that field, but still not print one in repr(). Please fix. ---------- nosy: +mmarkk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 20:15:50 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 09 Mar 2012 19:15:50 +0000 Subject: [issue14239] Uninitialised variable in _PyObject_GenericSetAttrWithDict In-Reply-To: <1331287462.62.0.137638108542.issue14239@psf.upfronthosting.co.za> Message-ID: <1331320550.63.0.71314733294.issue14239@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Fixed in differently in 46e600fa8d05 Thanks anyway. ---------- resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 20:16:47 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 09 Mar 2012 19:16:47 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331320607.54.0.601299334088.issue14234@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Since this has been approved upstream and the Python change is minimal, I think this can just be applied. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 20:23:14 2012 From: report at bugs.python.org (Jim Jewett) Date: Fri, 09 Mar 2012 19:23:14 +0000 Subject: [issue14239] Uninitialised variable in _PyObject_GenericSetAttrWithDict In-Reply-To: <1331287462.62.0.137638108542.issue14239@psf.upfronthosting.co.za> Message-ID: <1331320994.12.0.629991211548.issue14239@psf.upfronthosting.co.za> Jim Jewett added the comment: So the risk is that descr may be given garbage memory that just happens to look like an object with 1 reference, so that it really does a decref and tries to re-deallocate whatever was there before. I would rather see the change at the top of the function; just initialize descr to NULL when it is declared, and let the compiler figure out that it can skip the zeroing on some (most) paths. ---------- nosy: +Jim.Jewett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 20:44:50 2012 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 09 Mar 2012 19:44:50 +0000 Subject: [issue211481] os.stat() doesn't return st_rdev Message-ID: <1331322290.63.0.520601429649.issue211481@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: ????, issue11698 already track this. ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 20:49:30 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 09 Mar 2012 19:49:30 +0000 Subject: [issue11698] Improve repr for structseq objects to show named, but unindexed fields In-Reply-To: <1301264097.04.0.982421975108.issue11698@psf.upfronthosting.co.za> Message-ID: <1331322570.58.0.49703024443.issue11698@psf.upfronthosting.co.za> Antoine Pitrou added the comment: +1. Also, the repr() should show the float values of st_mtime and friends, rather than truncated integers. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 20:52:42 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 09 Mar 2012 19:52:42 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331322762.16.0.269903094734.issue14234@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Note sure I understand: XML_SetHashSalt() takes a parser argument, but the hash secret is global? ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 21:11:35 2012 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 09 Mar 2012 20:11:35 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331323895.36.0.557375269583.issue14234@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: No, the salt is stored on the parser. See the line: +#define hash_secret_salt (parser->m_hash_secret_salt) Yes, expat code is confusing. ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 21:13:37 2012 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 09 Mar 2012 20:13:37 +0000 Subject: [issue12151] test_logging fails sometimes In-Reply-To: <1306106163.56.0.790245092521.issue12151@psf.upfronthosting.co.za> Message-ID: <1331324017.29.0.794764320209.issue12151@psf.upfronthosting.co.za> Vinay Sajip added the comment: After an increase to a delay in the test(1.01 -> 1.1 seconds) the problem seems to have disappeared. So closing for now, since this error appears not to have occurred over a period of a few days. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 22:23:57 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 09 Mar 2012 21:23:57 +0000 Subject: [issue12328] multiprocessing's overlapped PipeConnection on Windows In-Reply-To: <1307991196.59.0.849860111943.issue12328@psf.upfronthosting.co.za> Message-ID: <1331328237.46.0.987925891426.issue12328@psf.upfronthosting.co.za> Antoine Pitrou added the comment: One of our buildbots seems to have recurring issues with the timeout issues. I don't know if the machine is very loaded: ====================================================================== FAIL: test_wait_integer (test.test_multiprocessing.TestWait) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_multiprocessing.py", line 2617, in test_wait_integer self.assertLess(delta, expected + 2) AssertionError: 8.592355012893677 not less than 7 ====================================================================== FAIL: test_wait_timeout (test.test_multiprocessing.TestWait) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_multiprocessing.py", line 2590, in test_wait_timeout self.assertLess(delta, expected + 0.5) AssertionError: 1.532202959060669 not less than 1.5 http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.x ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 22:59:10 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 09 Mar 2012 21:59:10 +0000 Subject: [issue14205] Raise an error if a dict is modified during a lookup In-Reply-To: <1330982395.54.0.88630927528.issue14205@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 70fbb02d588c by Victor Stinner in branch 'default': Issue #14205: Fix test_dict.test_mutating_lookup() http://hg.python.org/cpython/rev/70fbb02d588c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 9 23:27:45 2012 From: report at bugs.python.org (Miki Tebeka) Date: Fri, 09 Mar 2012 22:27:45 +0000 Subject: [issue14214] test_concurrent_futures hangs In-Reply-To: <1331083850.64.0.939496340029.issue14214@psf.upfronthosting.co.za> Message-ID: <1331332065.58.0.487118502107.issue14214@psf.upfronthosting.co.za> Miki Tebeka added the comment: Of course now the tests pass and I can't reproduce it. Sorry. You can close the issue or wait to see if someone else has the same problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 00:07:43 2012 From: report at bugs.python.org (Brett Cannon) Date: Fri, 09 Mar 2012 23:07:43 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1331334463.77.0.715911366447.issue2377@psf.upfronthosting.co.za> Brett Cannon added the comment: Two things I realized yesterday that need to be implemented (and some double-checking and/or opinion would be nice) while I wait for a full patch review. One is ``python -v`` support. sys.flags has a verbose attribute that can be used to properly guard printing imported modules. It might be tricky, though, if sys.stderr is not set up properly during very early imports. I guess at worst I expose some sprintf() in imp just for this case (ugh). Two is getting __import__() for situations where another import is triggered (e.g. fromlist stuff). I think the proper semantics is ``globals['__builtins__']['__import__'] if '__builtins__' in globals else builtins.__import__``. Now where this gets tricky is that doing this means importlib.__import__(), when used directly from the importlib module, would sometimes use its implementation, and in other cases use builtins.__import__(). So either importlib.__import__() gets forked from builtins.__import__() so that it always uses importlib internally or simply don't worry about it and just have importlib.__import__() use builtins.__import__() when the need to trigger another import comes up. What do people think should happen? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 00:11:26 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 09 Mar 2012 23:11:26 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1331334463.77.0.715911366447.issue2377@psf.upfronthosting.co.za> Message-ID: <1331334434.3392.68.camel@localhost.localdomain> Antoine Pitrou added the comment: > One is ``python -v`` support. sys.flags has a verbose attribute that > can be used to properly guard printing imported modules. It might be > tricky, though, if sys.stderr is not set up properly during very early > imports. Might or might not. You should try, there's a fallback stderr at interpreter startup. > Two is getting __import__() for situations where another import is > triggered (e.g. fromlist stuff). I think the proper semantics is > ``globals['__builtins__']['__import__'] if '__builtins__' in globals > else builtins.__import__``. Now where this gets tricky is that doing > this means importlib.__import__(), when used directly from the > importlib module, would sometimes use its implementation, and in other > cases use builtins.__import__(). So either importlib.__import__() gets > forked from builtins.__import__() so that it always uses importlib > internally or simply don't worry about it and just have > importlib.__import__() use builtins.__import__() when the need to > trigger another import comes up. What do people think should happen? I don't think I have understood anything :) It probably doesn't help, but I think the __import__ signature is generally crazy, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 00:12:07 2012 From: report at bugs.python.org (Dave Burton) Date: Fri, 09 Mar 2012 23:12:07 +0000 Subject: [issue9949] os.path.realpath on Windows does not follow symbolic links In-Reply-To: <1285426994.28.0.192028764756.issue9949@psf.upfronthosting.co.za> Message-ID: <1331334727.46.0.518006502983.issue9949@psf.upfronthosting.co.za> Dave Burton added the comment: This is a patch for the os.path.realpath() bug under Windows, http://bugs.python.org/issue9949 "os.path.realpath on Windows does not follow symbolic links" ntpath.diff fixes the realpath() function to resolve symbolic links to their targets (tested under Windows 7). Note: I tried to make the equivalent patch for Python 2.7, but it didn't work because the "from nt import _getfinalpathname" fails. ---------- nosy: +ncdave4life Added file: http://bugs.python.org/file24770/ntpath_fix_issue9949.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 00:21:42 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 09 Mar 2012 23:21:42 +0000 Subject: [issue14232] obmalloc: mmap() returns MAP_FAILED on error, not 0 In-Reply-To: <1331252280.16.0.132612334338.issue14232@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset ba8f85e16dd9 by Victor Stinner in branch 'default': Close #14232: catch mmap() failure in new_arena() of obmalloc http://hg.python.org/cpython/rev/ba8f85e16dd9 ---------- nosy: +python-dev resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 01:04:12 2012 From: report at bugs.python.org (Glenn Linderman) Date: Sat, 10 Mar 2012 00:04:12 +0000 Subject: [issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters In-Reply-To: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> Message-ID: <1331337852.08.0.696657544384.issue14191@psf.upfronthosting.co.za> Glenn Linderman added the comment: Sad. That means all the documentation of workarounds needs to be written, even figured out in the first place. Steven's code, while being a nice implementation when proper arguments are provided, produces inappropriate errors, because only the positional, or only the optional, parameters are printed when errors occur. So it would probably take a third parser, with all the parameters defined, to exist, to allow easiest generation of the usage message, but I'm not quite sure how to catch the error printing, and redirect it to the third parser. So, I tried the classes in t17.py; they are not complete; CompatibleArgumentParser should pass through all the other APIs, and I'm not sure if all the extension semantics can be appropriately passed through when there are three classes and two objects involved. But this is sort of a proof-of-concept wrapper for achieving intermixed optional and positional arguments, and still get proper error messages. ---------- Added file: http://bugs.python.org/file24771/t18.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 01:19:07 2012 From: report at bugs.python.org (py.user) Date: Sat, 10 Mar 2012 00:19:07 +0000 Subject: [issue14237] Special sequences \A and \Z don't work in character set [] In-Reply-To: <1331273474.34.0.161446399383.issue14237@psf.upfronthosting.co.za> Message-ID: <1331338747.57.0.0600173685423.issue14237@psf.upfronthosting.co.za> py.user added the comment: Martin v. L?wis wrote: > What behavior would you expect? I expected similar work >>> re.search(r'[\s]a', ' a').group() ' a' >>> re.search(r'[\s]a', 'ba').group() Traceback (most recent call last): File "", line 1, in AttributeError: 'NoneType' object has no attribute 'group' >>> >>> >>> re.search(r'[^\s]a', ' a').group() Traceback (most recent call last): File "", line 1, in AttributeError: 'NoneType' object has no attribute 'group' >>> re.search(r'[^\s]a', 'ba').group() 'ba' >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 01:23:04 2012 From: report at bugs.python.org (Dan Colish) Date: Sat, 10 Mar 2012 00:23:04 +0000 Subject: [issue14242] Make subprocess.Popen aware of $SHELL Message-ID: <1331338984.42.0.434201711387.issue14242@psf.upfronthosting.co.za> New submission from Dan Colish : The hardcoding of /bin/sh in the Popen _execute_child method can be a point of frustration when so many users are used to their chosen environment shell. The module can easily support the re-use of the defined $SHELL variable. I've attached a patch which gives one way of doing this. Before I get into writing tests for this, I wanted to float the idea of adding this feature. ---------- components: Library (Lib) files: popen_shell.diff keywords: patch messages: 155274 nosy: dcolish priority: normal severity: normal status: open title: Make subprocess.Popen aware of $SHELL type: enhancement versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file24772/popen_shell.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 01:26:34 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 10 Mar 2012 00:26:34 +0000 Subject: [issue14241] io.UnsupportedOperation.__new__(io.UnsupportedOperation) fails In-Reply-To: <1331296756.01.0.329340447456.issue14241@psf.upfronthosting.co.za> Message-ID: <1331339194.37.0.291679778369.issue14241@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- stage: -> patch review versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 01:39:48 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 10 Mar 2012 00:39:48 +0000 Subject: [issue14218] include rendered output in addition to markup In-Reply-To: <1331111194.08.0.943407781198.issue14218@psf.upfronthosting.co.za> Message-ID: <1331339988.4.0.86443203283.issue14218@psf.upfronthosting.co.za> Terry J. Reedy added the comment: It is not unusual and perhaps common for markup documentation to give rendered output for example input. This is similar to what we do in the tutorial and elsewhere with interactive examples: >>> 2 + 2 # input code 4 # output of running the code This may be fairly easy. Since the page is a rendered page, I presume some quoting mechanism is used to keep example text as is without being rendered. If so, all that should be needed is the same marked up text in a second box directive but without the quoting, so that it is rendered. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 02:09:37 2012 From: report at bugs.python.org (Matthew Barnett) Date: Sat, 10 Mar 2012 01:09:37 +0000 Subject: [issue14237] Special sequences \A and \Z don't work in character set [] In-Reply-To: <1331273474.34.0.161446399383.issue14237@psf.upfronthosting.co.za> Message-ID: <1331341777.24.0.703544869453.issue14237@psf.upfronthosting.co.za> Matthew Barnett added the comment: \s matches a character, whereas \A and \Z don't. Within a character set \s makes sense, but \A and \Z don't, so they should be treated as literals. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 02:16:32 2012 From: report at bugs.python.org (Glenn Linderman) Date: Sat, 10 Mar 2012 01:16:32 +0000 Subject: [issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters In-Reply-To: <1330843053.88.0.983162018395.issue14191@psf.upfronthosting.co.za> Message-ID: <1331342192.07.0.999930983987.issue14191@psf.upfronthosting.co.za> Glenn Linderman added the comment: Of course, if a "real" solution can only be shipped in 3.3, it may want to use a different API than parse_args to avoid the parameter, parse_intermixed_args, perhaps. But my t18.py uses the name parse_args, but just always does the intermixed parsing, so that is something to be aware of if building on that code at all, for the real solution or for sample code for older versions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 03:14:08 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 10 Mar 2012 02:14:08 +0000 Subject: [issue14238] python shouldn't need username in passwd database In-Reply-To: <1331284920.1.0.720164223022.issue14238@psf.upfronthosting.co.za> Message-ID: <1331345648.6.0.16768514576.issue14238@psf.upfronthosting.co.za> ?ric Araujo added the comment: > there should be a guard here that just doesn't add user site directories if the lookup fails. Agreed too. site is easy to fix (I can do it or review a patch), but we also need to fix sysconfig; I think the right thing to do would be not to have a config var named 'userbase' when run from a UID without passwd entry. This implies that the functions listed under http://docs.python.org/library/sysconfig#installation-paths would also need to omit *user schemes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 03:14:08 2012 From: report at bugs.python.org (Dave Abrahams) Date: Sat, 10 Mar 2012 02:14:08 +0000 Subject: [issue14243] NamedTemporaryFile usability request Message-ID: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> New submission from Dave Abrahams : NamedTemporaryFile is too hard to use portably when you need to open the file by name after writing it. To do that, you need to close the file first (on Windows), which means you have to pass delete=False, which in turn means that you get no help in cleaning up the actual file resource, which as you can see from the code in tempfile.py is devilishly hard to do correctly. The fact that it's different on posix (you can open the file for reading by name without closing it first) makes this problem worse. What we really need for this use-case is a way to say, "delete on __del__ but not on close()." ---------- components: Library (Lib) messages: 155278 nosy: dabrahams priority: normal severity: normal status: open title: NamedTemporaryFile usability request versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 03:20:18 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 10 Mar 2012 02:20:18 +0000 Subject: [issue14187] add "annotation" entry to Glossary In-Reply-To: <1330805957.18.0.748865462478.issue14187@psf.upfronthosting.co.za> Message-ID: <1331346018.37.0.645439386038.issue14187@psf.upfronthosting.co.za> ?ric Araujo added the comment: I think too that function annotations don?t need to be in the glossary; documenting them in the language reference section that talks about defining functions should be enough. What do you think, Chris? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 03:22:40 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 10 Mar 2012 02:22:40 +0000 Subject: [issue14186] Link to PEP 3107 in "def" part of Language Reference In-Reply-To: <1330805711.99.0.463703521532.issue14186@psf.upfronthosting.co.za> Message-ID: <1331346160.53.0.00750614438134.issue14186@psf.upfronthosting.co.za> ?ric Araujo added the comment: Sure. Don?t know if we should use a seealso section or just a regular link. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 03:24:08 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 10 Mar 2012 02:24:08 +0000 Subject: [issue14219] start the Class tutorial in a more gentle manner In-Reply-To: <1331111619.2.0.272575522063.issue14219@psf.upfronthosting.co.za> Message-ID: <1331346248.37.0.0631338628096.issue14219@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 03:25:39 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 10 Mar 2012 02:25:39 +0000 Subject: [issue14235] test_cmd.py does not correctly call reload() In-Reply-To: <1331255570.35.0.441826601517.issue14235@psf.upfronthosting.co.za> Message-ID: <1331346339.66.0.448076177521.issue14235@psf.upfronthosting.co.za> ?ric Araujo added the comment: Thanks for the report and patch. This begs the question: why does the current buggy code not cause a test failure? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 03:27:09 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 10 Mar 2012 02:27:09 +0000 Subject: =?utf-8?q?=5Bissue14236=5D_re=3A_Docstring_for_=5Cs_and_=5CS_don=E2=80=99?= =?utf-8?q?t_mention_Unicode?= In-Reply-To: <1331273217.26.0.527770128505.issue14236@psf.upfronthosting.co.za> Message-ID: <1331346429.75.0.108740747221.issue14236@psf.upfronthosting.co.za> ?ric Araujo added the comment: Please open another report for your second bug. Thanks. ---------- nosy: +eric.araujo title: In help(re) are insufficient details -> re: Docstring for \s and \S don?t mention Unicode versions: +Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 03:28:24 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 10 Mar 2012 02:28:24 +0000 Subject: [issue14241] io.UnsupportedOperation.__new__(io.UnsupportedOperation) fails In-Reply-To: <1331296756.01.0.329340447456.issue14241@psf.upfronthosting.co.za> Message-ID: <1331346504.65.0.870012595919.issue14241@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 03:35:41 2012 From: report at bugs.python.org (Chris Rebert) Date: Sat, 10 Mar 2012 02:35:41 +0000 Subject: [issue14186] Link to PEP 3107 in "def" part of Language Reference In-Reply-To: <1330805711.99.0.463703521532.issue14186@psf.upfronthosting.co.za> Message-ID: <1331346941.09.0.01624055108.issue14186@psf.upfronthosting.co.za> Chris Rebert added the comment: My suggestion was a seealso to parallel those in the "The with Statement" and "Class definitions" sections of the same page. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 04:01:17 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Sat, 10 Mar 2012 03:01:17 +0000 Subject: [issue13532] In IDLE, sys.stdout.write and sys.stderr can write any pickleable object In-Reply-To: <1323094063.21.0.960772272227.issue13532@psf.upfronthosting.co.za> Message-ID: <1331348477.38.0.147449183979.issue13532@psf.upfronthosting.co.za> Ramchandra Apte added the comment: What is the status of this bug? It has been about two months since the last message. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 04:08:22 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Sat, 10 Mar 2012 03:08:22 +0000 Subject: [issue14244] No information about behaviour with groups in pattern in the docstring for re.split Message-ID: <1331348902.51.0.968875082813.issue14244@psf.upfronthosting.co.za> New submission from Ramchandra Apte : help(re.split) "split(pattern, string, maxsplit=0, flags=0) Split the source string by the occurrences of the pattern, returning a list containing the resulting substrings." No info is given about behaviour with groups in pattern. Created because of http://bugs.python.org/issue14236#msg155283. ---------- assignee: docs at python components: Documentation messages: 155286 nosy: docs at python, ramchandra.apte priority: normal severity: normal status: open title: No information about behaviour with groups in pattern in the docstring for re.split _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 04:08:59 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Sat, 10 Mar 2012 03:08:59 +0000 Subject: =?utf-8?q?=5Bissue14236=5D_re=3A_Docstring_for_=5Cs_and_=5CS_don=E2=80=99?= =?utf-8?q?t_mention_Unicode?= In-Reply-To: <1331273217.26.0.527770128505.issue14236@psf.upfronthosting.co.za> Message-ID: <1331348939.27.0.823424161719.issue14236@psf.upfronthosting.co.za> Ramchandra Apte added the comment: Done so see issue14244 . ---------- nosy: +ramchandra.apte _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 04:10:50 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Sat, 10 Mar 2012 03:10:50 +0000 Subject: [issue14244] No information about behaviour with groups in pattern in the docstring for re.split In-Reply-To: <1331348902.51.0.968875082813.issue14244@psf.upfronthosting.co.za> Message-ID: <1331349050.01.0.905430307483.issue14244@psf.upfronthosting.co.za> Ramchandra Apte added the comment: Oops. The link in the last sentence doesn't work. It should be see msg155283 . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 04:39:12 2012 From: report at bugs.python.org (Tim Lesher) Date: Sat, 10 Mar 2012 03:39:12 +0000 Subject: [issue8070] Infinite loop in PyRun_InteractiveLoopFlags() if PyRun_InteractiveOneFlags() raises an error In-Reply-To: <1267793425.09.0.566406511799.issue8070@psf.upfronthosting.co.za> Message-ID: <1331350752.95.0.358419386594.issue8070@psf.upfronthosting.co.za> Tim Lesher added the comment: Victor: would you object to ysj.ray's solution? I don't think it was an option when we last looked at this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 05:52:48 2012 From: report at bugs.python.org (py.user) Date: Sat, 10 Mar 2012 04:52:48 +0000 Subject: [issue14244] No information about behaviour with groups in pattern in the docstring for re.split In-Reply-To: <1331348902.51.0.968875082813.issue14244@psf.upfronthosting.co.za> Message-ID: <1331355168.08.0.204495201509.issue14244@psf.upfronthosting.co.za> Changes by py.user : ---------- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett, py.user versions: +Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 05:53:46 2012 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 10 Mar 2012 04:53:46 +0000 Subject: [issue14243] NamedTemporaryFile usability request In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1331355226.58.0.441753028022.issue14243@psf.upfronthosting.co.za> Changes by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 05:53:51 2012 From: report at bugs.python.org (Jim Jewett) Date: Sat, 10 Mar 2012 04:53:51 +0000 Subject: [issue14169] compiler.compile fails on "if" statement in attached file In-Reply-To: <1330624985.96.0.952704814324.issue14169@psf.upfronthosting.co.za> Message-ID: <1331355231.64.0.452257845639.issue14169@psf.upfronthosting.co.za> Jim Jewett added the comment: If I understood correctly, that *is* the minimal case, which suggests some sort of size problem. That said, I could not duplicate on 2.6.2, nor with py_compile.compiler in 3.2.2; I am not currently sufficiently motivated to install another version just for this. ---------- nosy: +Jim.Jewett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 05:54:17 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 10 Mar 2012 04:54:17 +0000 Subject: [issue13532] In IDLE, sys.stdout.write and sys.stderr can write any pickleable object In-Reply-To: <1323094063.21.0.960772272227.issue13532@psf.upfronthosting.co.za> Message-ID: <1331355257.97.0.650390956689.issue13532@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Many issues take a while, depending on volunteers time and choice of priority. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 06:04:29 2012 From: report at bugs.python.org (Ross Lagerwall) Date: Sat, 10 Mar 2012 05:04:29 +0000 Subject: [issue14229] On KeyboardInterrupt, the exit code should mirror the signal number In-Reply-To: <1331238085.62.0.936420173713.issue14229@psf.upfronthosting.co.za> Message-ID: <1331355869.2.0.954490654802.issue14229@psf.upfronthosting.co.za> Changes by Ross Lagerwall : ---------- nosy: +rosslagerwall _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 06:57:57 2012 From: report at bugs.python.org (Josh Watson) Date: Sat, 10 Mar 2012 05:57:57 +0000 Subject: [issue14235] test_cmd.py does not correctly call reload() In-Reply-To: <1331255570.35.0.441826601517.issue14235@psf.upfronthosting.co.za> Message-ID: <1331359077.03.0.452038612986.issue14235@psf.upfronthosting.co.za> Josh Watson added the comment: That particular function only gets called by running `./python Lib/test/test_cmd.py -c`, and not through regrtest.py, so I suspect that's why it wasn't noticed before. I just happened to be exploring test files and ran into an unhandled exception when I tried running it with the -c flag, haha. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 06:59:11 2012 From: report at bugs.python.org (Kurt Seifried) Date: Sat, 10 Mar 2012 05:59:11 +0000 Subject: [issue13703] Hash collision security issue In-Reply-To: <1325619410.45.0.862265945379.issue13703@psf.upfronthosting.co.za> Message-ID: <1331359151.54.0.739298714787.issue13703@psf.upfronthosting.co.za> Kurt Seifried added the comment: I have assigned CVE-2012-1150 for this issue as per http://www.openwall.com/lists/oss-security/2012/03/10/3 ---------- nosy: +kseifried at redhat.com _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 06:59:40 2012 From: report at bugs.python.org (Kurt Seifried) Date: Sat, 10 Mar 2012 05:59:40 +0000 Subject: [issue13703] Hash collision security issue In-Reply-To: <1325619410.45.0.862265945379.issue13703@psf.upfronthosting.co.za> Message-ID: <1331359180.35.0.206823856507.issue13703@psf.upfronthosting.co.za> Changes by Kurt Seifried : ---------- nosy: -kseifried at redhat.com _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 07:55:20 2012 From: report at bugs.python.org (Georg Brandl) Date: Sat, 10 Mar 2012 06:55:20 +0000 Subject: [issue14237] Special sequences \A and \Z don't work in character set [] In-Reply-To: <1331273474.34.0.161446399383.issue14237@psf.upfronthosting.co.za> Message-ID: <1331362520.78.0.469804878398.issue14237@psf.upfronthosting.co.za> Georg Brandl added the comment: Duplicate of #13899. ---------- nosy: +georg.brandl superseder: -> re pattern r"[\A]" should work like "A" but matches nothing. Ditto B and Z. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 08:01:09 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 10 Mar 2012 07:01:09 +0000 Subject: [issue13532] In IDLE, sys.stdout.write and sys.stderr can write any pickleable object In-Reply-To: <1323094063.21.0.960772272227.issue13532@psf.upfronthosting.co.za> Message-ID: <1331362869.13.0.117244071447.issue13532@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Ramchandra: Most likely, the status is that nobody is working on this, and nobody is planning to work on this. So if you want to see it fixed, it may be that you have to submit a patch yourself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 08:17:32 2012 From: report at bugs.python.org (Georg Brandl) Date: Sat, 10 Mar 2012 07:17:32 +0000 Subject: [issue14237] Special sequences \A and \Z don't work in character set [] In-Reply-To: <1331273474.34.0.161446399383.issue14237@psf.upfronthosting.co.za> Message-ID: <1331363852.33.0.387268807285.issue14237@psf.upfronthosting.co.za> Changes by Georg Brandl : ---------- resolution: -> duplicate status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 09:23:28 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 10 Mar 2012 08:23:28 +0000 Subject: [issue14244] No information about behaviour with groups in pattern in the docstring for re.split In-Reply-To: <1331348902.51.0.968875082813.issue14244@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset b96251d9f36a by Georg Brandl in branch '3.2': Closes #14244: add info about capturing groups and maxsplit to the docstring of re.split(). http://hg.python.org/cpython/rev/b96251d9f36a ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 09:23:28 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 10 Mar 2012 08:23:28 +0000 Subject: [issue14186] Link to PEP 3107 in "def" part of Language Reference In-Reply-To: <1330805711.99.0.463703521532.issue14186@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset c18d538d2ece by Georg Brandl in branch '3.2': Closes #14186: add link to PEP 3107 (function annotations) to the function definition section. http://hg.python.org/cpython/rev/c18d538d2ece ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 09:24:22 2012 From: report at bugs.python.org (Georg Brandl) Date: Sat, 10 Mar 2012 08:24:22 +0000 Subject: [issue14244] No information about behaviour with groups in pattern in the docstring for re.split In-Reply-To: <1331348902.51.0.968875082813.issue14244@psf.upfronthosting.co.za> Message-ID: <1331367862.61.0.0635531887082.issue14244@psf.upfronthosting.co.za> Georg Brandl added the comment: Thank you, should be fixed now. ---------- nosy: +georg.brandl stage: committed/rejected -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 09:42:14 2012 From: report at bugs.python.org (py.user) Date: Sat, 10 Mar 2012 08:42:14 +0000 Subject: [issue14244] No information about behaviour with groups in pattern in the docstring for re.split In-Reply-To: <1331348902.51.0.968875082813.issue14244@psf.upfronthosting.co.za> Message-ID: <1331368934.8.0.996037634245.issue14244@psf.upfronthosting.co.za> py.user added the comment: "+ returning a list containing the resulting substrings. If + capturing parentheses are used in pattern, then the text of all + groups in the pattern are also returned as part of the resulting + list." not only text >>> import re >>> re.split(r'(a)(x)?', 'abcabc') ['', 'a', None, 'bc', 'a', None, 'bc'] >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 10:35:12 2012 From: report at bugs.python.org (Zbyszek Szmek) Date: Sat, 10 Mar 2012 09:35:12 +0000 Subject: [issue14245] float rounding examples in FAQ are outdated Message-ID: <1331372112.92.0.532785259032.issue14245@psf.upfronthosting.co.za> New submission from Zbyszek Szmek : http://docs.python.org/dev/faq/design.html#why-are-floating-point-calculations-so-inaccurate This whole paragraph is wrong since #9337 (Make float.__str__ behave identically to float.__repr__). """ The str() function prints fewer digits and this often results in the more sensible number that was probably intended: >>> 1.1 - 0.9 0.20000000000000007 >>> print(1.1 - 0.9) 0.2 """ Applies from 3.2 onwards. ---------- assignee: docs at python components: Documentation messages: 155300 nosy: docs at python, zbysz priority: normal severity: normal status: open title: float rounding examples in FAQ are outdated versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 12:04:02 2012 From: report at bugs.python.org (Phil Thompson) Date: Sat, 10 Mar 2012 11:04:02 +0000 Subject: [issue14246] Accelerated ETree XMLParser cannot handle io.StringIO Message-ID: <1331377442.17.0.542633134085.issue14246@psf.upfronthosting.co.za> New submission from Phil Thompson : The old unaccelerated ETree XMLParser accepts input from a io.StringIO, but the accelerated version does not. Any code that relies on this is broken by Python v3.3. ---------- components: XML messages: 155301 nosy: philthompson10 priority: normal severity: normal status: open title: Accelerated ETree XMLParser cannot handle io.StringIO type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 12:10:49 2012 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 10 Mar 2012 11:10:49 +0000 Subject: [issue14245] float rounding examples in FAQ are outdated In-Reply-To: <1331372112.92.0.532785259032.issue14245@psf.upfronthosting.co.za> Message-ID: <1331377849.88.0.806953229713.issue14245@psf.upfronthosting.co.za> Mark Dickinson added the comment: Agreed. Do you have a suggested rewrite? That faq entry could be improved significantly in many ways; the tutorial material is much better. I'm wondering whether it would be better to cut down the FAQ to much something much briefer, and leave the link to the tutorial for people who want more. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 12:26:28 2012 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 10 Mar 2012 11:26:28 +0000 Subject: [issue14245] float rounding examples in FAQ are outdated In-Reply-To: <1331372112.92.0.532785259032.issue14245@psf.upfronthosting.co.za> Message-ID: <1331378788.28.0.772857729367.issue14245@psf.upfronthosting.co.za> Mark Dickinson added the comment: Proposed rewrite: Why are floating point calculations inaccurate? ----------------------------------------------- Users are often surprised by results like this:: >>> 1.2 - 1.0 0.199999999999999996 and think it is a bug in Python. It's not. This has little to do with Python, and much more to do with how the underlying platform handles floating-point numbers. Python floats are stored internally in binary floating-point, using a fixed precision (typically 53 bits). Many numbers that can be written easily in decimal notation (``1.2``, for example), cannot be expressed exactly in this internal binary format. After:: >>> x = 1.2 the value stored for x is a (very good) approximation to the value ``1.2``, but is not exactly equal to it. (On a typical machine, the actual stored value is:: 1.1999999999999999555910790149937383830547332763671875 which is accurate to around 16 decimal digits.) Similarly, the result of any floating-point operation must often be rounded to fit into the internal format, resulting in another tiny error. For a more detailed explanation of what's involved, please see the chapter on :ref:`floating point arithmetic ` in the Python tutorial. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 12:52:13 2012 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 10 Mar 2012 11:52:13 +0000 Subject: [issue14169] compiler.compile fails on "if" statement in attached file In-Reply-To: <1330624985.96.0.952704814324.issue14169@psf.upfronthosting.co.za> Message-ID: <1331380333.43.0.688321656077.issue14169@psf.upfronthosting.co.za> Mark Dickinson added the comment: Here's the trackback I get with Python 2.7. Look's like something's assuming that POP_JUMP_IF_FALSE target of 65541 fits in 16 bits. Python 2.7.2 (default, Jan 13 2012, 17:11:09) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> with open('small_with_error.py') as f: ... contents = f.read() ... >>> import compiler >>> compiler.compile(contents, '', 'exec') POP_JUMP_IF_FALSE 65541 114 5 256 Traceback (most recent call last): File "", line 1, in File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/compiler/pycodegen.py", line 65, in compile gen.compile() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/compiler/pycodegen.py", line 117, in compile self.code = gen.getCode() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/compiler/pycodegen.py", line 248, in getCode return self.graph.getCode() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/compiler/pyassem.py", line 313, in getCode self.makeByteCode() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/compiler/pyassem.py", line 518, in makeByteCode lnotab.addCode(self.opnum[opname], lo, hi) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/compiler/pyassem.py", line 612, in addCode self.code.append(chr(arg)) ValueError: chr() arg not in range(256) ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 13:27:00 2012 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 10 Mar 2012 12:27:00 +0000 Subject: [issue14169] compiler.compile fails on "if" statement in attached file In-Reply-To: <1330624985.96.0.952704814324.issue14169@psf.upfronthosting.co.za> Message-ID: <1331382420.32.0.703363205329.issue14169@psf.upfronthosting.co.za> Mark Dickinson added the comment: Interestingly, dis.dis also fails to decompile the .pyc bytecode generated by importing the file. (This was after adding dummy AddUnit, MakeCustomaryToBase and MakeBaseToCustomary definitions to the top of the file to prevent the import raising an exception.) >>> with open('small_with_error.pyc', 'r') as f: ... bytecode = f.read() ... >>> bytecode = bytecode[8:] >>> dis.dis(bytecode) <... lots of output snipped ...> 65686 LOAD_GLOBAL 4 (4) 65689 STOP_CODE 65690 STOP_CODE 65691 POP_JUMP_IF_TRUE 27749 65694 BUILD_TUPLE 1140 65697 STOP_CODE 65698 STOP_CODE 65699 STOP_CODE 65700 STORE_GLOBAL 26482 (26482) 65703 POP_JUMP_IF_TRUE 1652 65706 STOP_CODE 65707 STOP_CODE 65708 STOP_CODE 65709 COMPARE_OP 24951 Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/dis.py", line 45, in dis disassemble_string(x) File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/dis.py", line 147, in disassemble_string print '(' + cmp_op[oparg] + ')', IndexError: tuple index out of range ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 13:41:20 2012 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 10 Mar 2012 12:41:20 +0000 Subject: [issue14169] compiler.compile fails on "if" statement in attached file In-Reply-To: <1330624985.96.0.952704814324.issue14169@psf.upfronthosting.co.za> Message-ID: <1331383280.08.0.141270140088.issue14169@psf.upfronthosting.co.za> Mark Dickinson added the comment: D'oh. Ignore that last message; all it shows is that I'm stupid. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 13:56:18 2012 From: report at bugs.python.org (Nicholas Cole) Date: Sat, 10 Mar 2012 12:56:18 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1331384178.57.0.98024663167.issue12568@psf.upfronthosting.co.za> Nicholas Cole added the comment: Martin: sorry to be completely dense, but I can't get this to work properly with the python3.3a1 build. Could you post some example code? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 13:59:14 2012 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 10 Mar 2012 12:59:14 +0000 Subject: [issue14169] compiler.compile fails on "if" statement in attached file In-Reply-To: <1330624985.96.0.952704814324.issue14169@psf.upfronthosting.co.za> Message-ID: <1331384354.72.0.36912507348.issue14169@psf.upfronthosting.co.za> Mark Dickinson added the comment: Okay, so the issue is simply that the compiler module doesn't have logic for emitting the EXTENDED_ARGS[1] bytecode instruction to properly deal with a jump target that won't fit in two bytes. Given that the compiler module is deprecated, I propose closing this as 'won't fix'. [1] http://docs.python.org/library/dis.html#opcode-EXTENDED_ARG ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 14:44:26 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 10 Mar 2012 13:44:26 +0000 Subject: [issue14243] NamedTemporaryFile unusable under Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1331387066.23.0.843630618319.issue14243@psf.upfronthosting.co.za> Antoine Pitrou added the comment: This is quite silly indeed, and is due to the use of O_TEMPORARY in the file creation flags. ---------- nosy: +ncoghlan, pitrou title: NamedTemporaryFile usability request -> NamedTemporaryFile unusable under Windows type: -> behavior versions: +Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 14:56:04 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 10 Mar 2012 13:56:04 +0000 Subject: [issue14245] float rounding examples in FAQ are outdated In-Reply-To: <1331372112.92.0.532785259032.issue14245@psf.upfronthosting.co.za> Message-ID: <1331387764.37.0.304066628992.issue14245@psf.upfronthosting.co.za> Martin v. L?wis added the comment: +1 ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 14:58:46 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 10 Mar 2012 13:58:46 +0000 Subject: [issue14246] Accelerated ETree XMLParser cannot handle io.StringIO In-Reply-To: <1331377442.17.0.542633134085.issue14246@psf.upfronthosting.co.za> Message-ID: <1331387926.16.0.889285752722.issue14246@psf.upfronthosting.co.za> Changes by Martin v. L?wis : ---------- nosy: +eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 15:09:48 2012 From: report at bugs.python.org (Zbyszek Szmek) Date: Sat, 10 Mar 2012 14:09:48 +0000 Subject: [issue14245] float rounding examples in FAQ are outdated In-Reply-To: <1331378788.28.0.772857729367.issue14245@psf.upfronthosting.co.za> Message-ID: <4F5B609F.9050407@in.waw.pl> Zbyszek Szmek added the comment: On 03/10/2012 12:26 PM, Mark Dickinson wrote: > > Mark Dickinson added the comment: > > Proposed rewrite: Hi, thanks for the quick reply. If we were to rewrite the whole entry, some more changes could be done: I think it would be useful to mention explicitly that Python simply uses the native floating-point implementation in hardware and thus behaves very similarly to other languages which do this, for instance C or Java. This should clear up a lot of the behaviour for people who know other programming languages. "how the underlying platform handles floating-point" says something very similar, but the reader needs to understand what the "underlying platform" exactly is. It is easy to count, that exactly 17 digits are accurate. I have to admit, that I'm completely lost here --- why would a vastly inaccurate number (with more than half of digits wrong) be ever stored? If "1.2" is converted to a float (a C double in current implementation), it has 15.96 decimal digits of precision. "Similarly, the result of a floating-point operation must be rounded to fit into the fixed precision, often resulting in another tiny error." ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 15:17:02 2012 From: report at bugs.python.org (Zbyszek Szmek) Date: Sat, 10 Mar 2012 14:17:02 +0000 Subject: [issue14245] float rounding examples in FAQ are outdated In-Reply-To: <4F5B609F.9050407@in.waw.pl> Message-ID: <4F5B6257.9050003@in.waw.pl> Zbyszek Szmek added the comment: [part mangled by the tracker] "> 1.1999999999999999555910790149937383830547332763671875 "> "> which is accurate to around 16 decimal digits.) It is easy to count, that exactly 17 digits are accurate. I have to admit, that I'm completely lost here --- why would a vastly inaccurate number (with more than half of digits wrong) be ever stored? If "1.2" is converted to a float (a C double in current implementation), it has 15.96 decimal digits of precision. " > Similarly, the result of any " > floating-point operation must often be rounded to fit into the " > internal format, resulting in another tiny error. "Similarly, the result of a floating-point operation must be rounded to fit into the fixed precision, often resulting in another tiny error." ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 15:33:01 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 10 Mar 2012 14:33:01 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1331389981.4.0.969345176914.issue12568@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Please see the attached width.py for an example ---------- Added file: http://bugs.python.org/file24773/width.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 15:37:35 2012 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 10 Mar 2012 14:37:35 +0000 Subject: [issue14245] float rounding examples in FAQ are outdated In-Reply-To: <1331372112.92.0.532785259032.issue14245@psf.upfronthosting.co.za> Message-ID: <1331390255.21.0.339765760796.issue14245@psf.upfronthosting.co.za> Mark Dickinson added the comment: > I think it would be useful to mention explicitly that Python simply uses > the native floating-point implementation in hardware and thus behaves > very similarly to other languages which do this, for instance C or Java. Agreed that it's useful to say something here to make it obvious that Python's behaving just like most other mainstream programming languages. Perhaps most straightforward would be to state that CPython just uses C doubles. (That sidesteps nitpicking about software floating-point :-). > It is easy to count, that exactly 17 digits are accurate. Hmm; that depends a bit on your definitions. The relative error here is around 3.7e-17, so in this particular case you're getting something between 16 and 17 decimal digits of accuracy. Other cases would produce different relative errors, with a max relative error for normal cases of 2**-53, or approximately 1.1e-16. > I have to admit, that I'm completely lost here --- why would a vastly > inaccurate number (with more than half of digits wrong) be ever stored? Because that number is the unique closest representable IEEE 754 double to the target number (1.2). You can go through all the steps here: - convert 1.2 to binary, to get: 1.001100110011001100110011..... repeated ad infinitum - round to the nearest 53-bit number: 1.0011001100110011001100110011001100110011001100110011 - convert back to decimal to get the number that I gave. But this sort of detail is already there in the tutorial, and doesn't seem appropriate for the FAQ entry. For the FAQ, maybe it would be less confusing to give only about a 20-digit approximation. > "Similarly, the result of any > floating-point operation must often be rounded to fit into the > internal format, > resulting in another tiny error." ? The aim here was to make the point that it's not just conversion from decimal to binary that introduces errors; it's also true that any arithmetic operation has the potential to introduce errors. For example, 10**16 and 1 are both exactly representable as floats, but the sum of 10**16 + 1 is not; the result has to be rounded to fit into a float. Suggestions for rewording to make this clearer are welcome! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 15:51:00 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 10 Mar 2012 14:51:00 +0000 Subject: [issue14245] float rounding examples in FAQ are outdated In-Reply-To: <4F5B609F.9050407@in.waw.pl> Message-ID: <4F5B6A50.3080506@v.loewis.de> Martin v. L?wis added the comment: > I think it would be useful to mention explicitly that Python simply uses > the native floating-point implementation in hardware and thus behaves > very similarly to other languages which do this, for instance C or Java. > This should clear up a lot of the behaviour for people who know other > programming languages. "how the underlying platform handles > floating-point" says something very similar, but the reader needs to > understand what the "underlying platform" exactly is. Well, people may just be as confused about the term "native implementation" as they are seemingly confused about "underlying platform". > > I have to admit, that I'm completely lost here --- why would a vastly > inaccurate number (with more than half of digits wrong) be ever stored? > If "1.2" is converted to a float (a C double in current implementation), > it has 15.96 decimal digits of precision. Since it has this number of decimal digits of precision, the text says "about 16", rather than "exactly 17", which would mislead people into thinking that they get 17 digits of precision. I don't understand your confusion. The numbers are stored in binary, and it's *not* the case that half of the digits are wrong. In binary, all 53 bits of mantissa are correct. When displaying this number in decimal (which is not the way in which it is stored), then you many more decimal digits to make the decimal representation correct. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 16:03:00 2012 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 10 Mar 2012 15:03:00 +0000 Subject: [issue14243] NamedTemporaryFile unusable under Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1331391780.98.0.229496247469.issue14243@psf.upfronthosting.co.za> Nick Coghlan added the comment: What's the proposal here? If delete is True, close() must delete the file. It is not acceptable for close() and __del__() to behave differently. OTOH, if the proposal is merely to change the way the file is opened on Windows so that it can be opened again without closing it first, that sounds fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 16:17:31 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 10 Mar 2012 15:17:31 +0000 Subject: [issue14243] NamedTemporaryFile unusable under Windows In-Reply-To: <1331391780.98.0.229496247469.issue14243@psf.upfronthosting.co.za> Message-ID: <1331392397.3448.4.camel@localhost.localdomain> Antoine Pitrou added the comment: > OTOH, if the proposal is merely to change the way the file is opened > on Windows so that it can be opened again without closing it first, > that sounds fine. That would be my proposal. It probably needs getting rid of O_TEMPORARY, exposing CreateFile and _open_osfhandle, and using the FILE_SHARE_DELETE open mode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 16:20:07 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 10 Mar 2012 15:20:07 +0000 Subject: [issue14243] NamedTemporaryFile unusable under Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1331392807.46.0.239532900339.issue14243@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +brian.curtin, tim.golden _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 16:29:30 2012 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 10 Mar 2012 15:29:30 +0000 Subject: [issue13496] bisect module: Overflow at index computation In-Reply-To: <1322519672.22.0.173147243777.issue13496@psf.upfronthosting.co.za> Message-ID: <1331393370.38.0.776262638161.issue13496@psf.upfronthosting.co.za> Mark Dickinson added the comment: Updated patch, with comment. ---------- Added file: http://bugs.python.org/file24774/issue13496_v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 17:08:25 2012 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 10 Mar 2012 16:08:25 +0000 Subject: [issue9574] allow whitespace around central '+' in complex constructor In-Reply-To: <1281597162.74.0.823446392009.issue9574@psf.upfronthosting.co.za> Message-ID: <1331395705.55.0.0610690228829.issue9574@psf.upfronthosting.co.za> Mark Dickinson added the comment: Reclassifying as a doc issue; I don't think my proposed change is worth it. I'll submit some form of Jervis's docfix shortly. ---------- components: +Documentation -Interpreter Core priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 17:15:40 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 10 Mar 2012 16:15:40 +0000 Subject: [issue9574] allow whitespace around central '+' in complex constructor In-Reply-To: <1281597162.74.0.823446392009.issue9574@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 5a3c89337b50 by Mark Dickinson in branch '2.7': Closes #9574: Note that complex constructor doesn't allow whitespace around central operator. http://hg.python.org/cpython/rev/5a3c89337b50 New changeset a5b073b1cfea by Mark Dickinson in branch '3.2': Closes #9574: Note that complex constructor doesn't allow whitespace around central operator. http://hg.python.org/cpython/rev/a5b073b1cfea New changeset 2f48415e917c by Mark Dickinson in branch 'default': merge 3.2 (#9574) http://hg.python.org/cpython/rev/2f48415e917c ---------- nosy: +python-dev resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 17:30:10 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 10 Mar 2012 16:30:10 +0000 Subject: [issue14169] compiler.compile fails on "if" statement in attached file In-Reply-To: <1330624985.96.0.952704814324.issue14169@psf.upfronthosting.co.za> Message-ID: <1331397010.11.0.456515269697.issue14169@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I agree. 'deprecated' pretty much means "We do not think this is worth the effort of maintaining it. Don't use it unless it is already in old code." ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 17:41:27 2012 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 10 Mar 2012 16:41:27 +0000 Subject: [issue13889] str(float) and round(float) issues with FPU precision In-Reply-To: <1327676303.66.0.487112802864.issue13889@psf.upfronthosting.co.za> Message-ID: <1331397687.79.0.424983174623.issue13889@psf.upfronthosting.co.za> Mark Dickinson added the comment: Patch looks fine to me. A couple of minor points (which I'm happy to fix at commit time if you agree, and don't want to create a new patch): - it looks to me as though the #ifdef _WIN32 isn't necessary any more; it's enough that we're on MSVC and that this isn't a 64-bit build. - I'd suggest replacing _PC_53 with _PC_53 | _RC_NEAR. I know it's technically redundant, since _RC_NEAR happens to be 0, but it makes the intent of the code clearer. I'd still want to see all the tests pass on both x64 and x86 Windows before applying this; I may have an opportunity to test this on x64 in the near future. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 17:52:54 2012 From: report at bugs.python.org (poq) Date: Sat, 10 Mar 2012 16:52:54 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1331398374.59.0.359908742277.issue12568@psf.upfronthosting.co.za> poq added the comment: Martin, I think you meant to write "if w == 'A':". Some very common characters have ambiguous widths though (e.g. the Greek alphabet), so you can't just raise an error for them. http://unicode.org/reports/tr11/ says: "Ambiguous characters occur in East Asian legacy character sets as wide characters, but as narrow (i.e., normal-width) characters in non-East Asian usage." So in practice applications can treat ambiguous characters as narrow by default, with a user setting to use legacy (wide) width. As Tom pointed out there are also a bunch of zero width characters, and characters with special formatting like tab, soft hyphen, ... ---------- nosy: +poq _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 17:58:29 2012 From: report at bugs.python.org (Tom Christiansen) Date: Sat, 10 Mar 2012 16:58:29 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1331398374.59.0.359908742277.issue12568@psf.upfronthosting.co.za> Message-ID: <1127.1331398702@chthon> Tom Christiansen added the comment: I would encourage you to look at the Perl CPAN module Unicode::LineBreak, which fully implements tr11. It includes Unicode::GCString, a class that has a columns() method to determine the print columns. This is very fancy in the case of Asian widths, but of course there are many other cases too. If you'd like, I can show you a program that uses these, a rewrite the standard Unix fmt(1) filter that works properly on Unicode column widths. --tom ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 18:11:55 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Mar 2012 17:11:55 +0000 Subject: [issue4761] create Python wrappers for openat() and others In-Reply-To: <1230476318.95.0.898909480668.issue4761@psf.upfronthosting.co.za> Message-ID: <1331399515.55.0.507226520307.issue4761@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Why use a special value AT_FDCWD instead of None? It is not Pythonish. Clearly, when it is used in C, but in dynamically typed Python we are not limited to only one C-type. Such a large number of new functions littering the namespace. Why not just add additional arguments to existing functions? Instead 'fstatat(dirfd, path, flags=0)' let it be 'stat(path, *, dirfd=None, flags=0)' or even better 'stat(path, *, dirfd=None, followlinks=True)' (as in os.fwalk). ---------- nosy: +storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 18:34:37 2012 From: report at bugs.python.org (Colin Marc) Date: Sat, 10 Mar 2012 17:34:37 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: <1331400877.49.0.0672137666875.issue14204@psf.upfronthosting.co.za> Colin Marc added the comment: Here's an updated patch against 3.3. ---------- Added file: http://bugs.python.org/file24775/npn_patch_py3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 18:49:37 2012 From: report at bugs.python.org (Georg Brandl) Date: Sat, 10 Mar 2012 17:49:37 +0000 Subject: [issue4761] create Python wrappers for openat() and others In-Reply-To: <1230476318.95.0.898909480668.issue4761@psf.upfronthosting.co.za> Message-ID: <1331401777.68.0.358325716967.issue4761@psf.upfronthosting.co.za> Georg Brandl added the comment: I agree about the constant AT_FDCWD. (At least, None should be allowed in addition.) Your other proposition would break the principle of very thin platform wrappers that we try to follow in posixmodule.c. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 18:53:53 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Mar 2012 17:53:53 +0000 Subject: [issue13496] bisect module: Overflow at index computation In-Reply-To: <1322519672.22.0.173147243777.issue13496@psf.upfronthosting.co.za> Message-ID: <1331402033.11.0.643964060955.issue13496@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Thanks for the updated patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 18:59:29 2012 From: report at bugs.python.org (Stefan Krah) Date: Sat, 10 Mar 2012 17:59:29 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1331402369.77.0.543204042386.issue7652@psf.upfronthosting.co.za> Changes by Stefan Krah : Added file: http://bugs.python.org/file24776/9b3b1f5c4072.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:01:02 2012 From: report at bugs.python.org (=?utf-8?q?Damjan_Ko=C5=A1ir?=) Date: Sat, 10 Mar 2012 18:01:02 +0000 Subject: [issue14247] "in" operator doesn't return boolean Message-ID: <1331402462.68.0.808379005089.issue14247@psf.upfronthosting.co.za> New submission from Damjan Ko?ir : In operator acts like it doesn't return a boolean value >>> 3 in [1,2,3] == True False and even >>> 3 in [1,2,3] == 3 in [1,2,3] False but somehow if you add ( ) it starts working >>> (3 in [1,2,3]) == True True Tested on OSX 10.7 Python 2.7.1 ---------- components: None messages: 155329 nosy: Damjan.Ko?ir priority: normal severity: normal status: open title: "in" operator doesn't return boolean versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:01:03 2012 From: report at bugs.python.org (Stefan Krah) Date: Sat, 10 Mar 2012 18:01:03 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1331402463.09.0.755635497116.issue7652@psf.upfronthosting.co.za> Stefan Krah added the comment: Here's a new patch that addresses several remarks: o _decimal now has __floor__ and __ceil__methods. o libmpdec is now in a separate directory. o I removed the big libmpdec test suite. This is why: - It reduces the number of files that has been criticized multiple times. - Probably I'll be the only one who will be running the test suite. - The test suite is still on PyPI. - The test suite is so large that it's a magnet for toolchain bugs. For example, it found a bug in suncc (acknowledged and fixed by Sun) and a bug in CompCert (acknowledged and fixed by Xavier Leroy). I'm really worried that *if* someone runs the tests and finds an obscure bug, I'll have to spend hours debugging something that might ultimately be an external bug. o Renamed "python" directory into "tests". o Test functions in mpdecimal.c are removed. o All files in libmpdec that aren't required for _decimal are removed. o Extra functionality in _decimal.c is commented out. This does not yet cover the FloatOperation signal, which I would like to add to decimal.py as well (I'll ask later on python-dev). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:01:12 2012 From: report at bugs.python.org (Stefan Krah) Date: Sat, 10 Mar 2012 18:01:12 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1331402472.25.0.281550318829.issue7652@psf.upfronthosting.co.za> Stefan Krah added the comment: Here's a new patch that addresses several remarks: o _decimal now has __floor__ and __ceil__methods. o libmpdec is now in a separate directory. o I removed the big libmpdec test suite. This is why: - It reduces the number of files that has been criticized multiple times. - Probably I'll be the only one who will be running the test suite. - The test suite is still on PyPI. - The test suite is so large that it's a magnet for toolchain bugs. For example, it found a bug in suncc (acknowledged and fixed by Sun) and a bug in CompCert (acknowledged and fixed by Xavier Leroy). I'm really worried that *if* someone runs the tests and finds an obscure bug, I'll have to spend hours debugging something that might ultimately be an external bug. o Renamed "python" directory into "tests". o Test functions in mpdecimal.c are removed. o All files in libmpdec that aren't required for _decimal are removed. o Extra functionality in _decimal.c is commented out. This does not yet cover the FloatOperation signal, which I would like to add to decimal.py as well (I'll ask later on python-dev). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:11:07 2012 From: report at bugs.python.org (Georg Brandl) Date: Sat, 10 Mar 2012 18:11:07 +0000 Subject: [issue14247] "in" operator doesn't return boolean In-Reply-To: <1331402462.68.0.808379005089.issue14247@psf.upfronthosting.co.za> Message-ID: <1331403067.24.0.38318710951.issue14247@psf.upfronthosting.co.za> Georg Brandl added the comment: Chaining comparison operators inserts implicit "and" conditions: a OP b OP c OP d is equivalent to (a OP b) and (b OP c) and (c OP d) This is most useful with ==, <, <= and so forth, but "in" and "is" also count as comparison ops and have the same precedence. ---------- nosy: +georg.brandl resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:20:18 2012 From: report at bugs.python.org (Dave Abrahams) Date: Sat, 10 Mar 2012 18:20:18 +0000 Subject: [issue14243] NamedTemporaryFile unusable under Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1331403618.29.0.953936973726.issue14243@psf.upfronthosting.co.za> Dave Abrahams added the comment: I disagree that it's unacceptable for close() and __del__() to behave differently. The acceptable difference would be that __del__() closes (if necessary) /and/ deletes the file on disk, while close() merely closes the file. If you can in fact "change the way the file is opened on Windows so that it can be opened again without closing it first," that would be fine with me. It isn't clear to me that Windows supports that option, but I'm not an expert. Another possibility, of course, is something like what's implemented in: https://github.com/dabrahams/zeroinstall/commit/d76de038ef51bd1dae36280f8743e06c7154b44a#L3R44 (an optional argument to close() that prevents deletion). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:21:26 2012 From: report at bugs.python.org (Zbyszek Szmek) Date: Sat, 10 Mar 2012 18:21:26 +0000 Subject: [issue14245] float rounding examples in FAQ are outdated In-Reply-To: <1331372112.92.0.532785259032.issue14245@psf.upfronthosting.co.za> Message-ID: <1331403686.47.0.300772606512.issue14245@psf.upfronthosting.co.za> Zbyszek Szmek added the comment: Proposed rewrite (building on Mark's version): - mention C doubles - explain ``1.2`` example a bit more """ Why are floating-point calculations inaccurate? ----------------------------------------------- Users are often surprised by results like this:: >>> 1.2 - 1.0 0.199999999999999996 and think it is a bug in Python. It's not. This has little to do with Python, and much more to do with how the underlying platform handles floating-point numbers. The float type in CPython simply uses C ``double`` for storage. The number is stored in binary floating-point with a fixed precision (typically 53 bits) and Python uses C operations, which in turn rely on the hardware implementation in the processor, to perform floating-point operations. This means that as far as floating-point operations are concerned, Python behaves like many popular languages including C and Java. Many numbers that can be written easily in decimal notation (``1.2``, for example), cannot be expressed exactly in the binary format. After:: >>> x = 1.2 the value stored for ``x`` is a (very good) approximation of the value ``1.2``, but is not exactly equal to it. On a typical machine, the actual stored value is:: 1.0011001100110011001100110011001100110011001100110011 (binary) which is approximately:: 1.19999999999999995559 (decimal) 53 binary digits are equivalent to about 16 decimal digits and in this case the first 17 digits are correct after the conversion back to decimal. Similarly, the result of any floating-point operation must be rounded to fit into the fixed precision, often resulting in another tiny error. For a more detailed explanation of what's involved, please see the chapter on :ref:`floating point arithmetic ` in the Python tutorial. """ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:21:35 2012 From: report at bugs.python.org (Colin Marc) Date: Sat, 10 Mar 2012 18:21:35 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: <1331403695.03.0.504772637229.issue14204@psf.upfronthosting.co.za> Colin Marc added the comment: Oops, I had my vim configured wrong and left a few tab characters in there. Here's another updated patch =) ---------- Added file: http://bugs.python.org/file24777/npn_patch_py3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:22:37 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 10 Mar 2012 18:22:37 +0000 Subject: [issue14246] Accelerated ETree XMLParser cannot handle io.StringIO In-Reply-To: <1331377442.17.0.542633134085.issue14246@psf.upfronthosting.co.za> Message-ID: <1331403757.02.0.525278446054.issue14246@psf.upfronthosting.co.za> Eli Bendersky added the comment: Hi Phil, Could you please post the problematic code snippet that runs with 3.2 but not 3.3? Thanks in advance ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:24:04 2012 From: report at bugs.python.org (Nicholas Cole) Date: Sat, 10 Mar 2012 18:24:04 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1331403844.32.0.889987155478.issue12568@psf.upfronthosting.co.za> Nicholas Cole added the comment: Marting and Poq: I think the sample code shows up a real problem. "Ambiguous" characters according to unicode may be rendered by curses in different ways. Don't we need a function that actually reports how curses is going to print a given string, rather than just reporting what the unicode standard says? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:26:46 2012 From: report at bugs.python.org (Merlijn van Deen) Date: Sat, 10 Mar 2012 18:26:46 +0000 Subject: [issue6147] multithreading.Pool.map() crashes Windows computer In-Reply-To: <1243641888.16.0.0893563302083.issue6147@psf.upfronthosting.co.za> Message-ID: <1331404006.01.0.986632437081.issue6147@psf.upfronthosting.co.za> Merlijn van Deen added the comment: Two questions: (1) can this be at least be added as a big fat warning in the documentation? (2) would it be a reasonable option to let either (a) the creation of a Pool (b) executing something using the Pool cause an exception when it happens during the import of the function to run? I think it makes sense to prevent any accidental forkbombs, especially if they are /this/ easy to create. Untested (for obvious reasons...), but this should be enough: import multiprocessing def x(val): return val multiprocessing.Pool().map(x, range(10)) ---------- nosy: +valhallasw _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:28:01 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 10 Mar 2012 18:28:01 +0000 Subject: [issue14246] Accelerated ETree XMLParser cannot handle io.StringIO In-Reply-To: <1331377442.17.0.542633134085.issue14246@psf.upfronthosting.co.za> Message-ID: <1331404081.13.0.20544992948.issue14246@psf.upfronthosting.co.za> Eli Bendersky added the comment: Note that this code works fine: --------------------------------------- tree = ET.ElementTree() stream = io.BytesIO() stream.write(b''' ''') stream.seek(0) tree.parse(stream) print(tree.getroot()) --------------------------------------- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:28:08 2012 From: report at bugs.python.org (=?utf-8?q?Sidney_San_Mart=C3=ADn?=) Date: Sat, 10 Mar 2012 18:28:08 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: <1331404088.76.0.279456447083.issue14204@psf.upfronthosting.co.za> Changes by Sidney San Mart?n : ---------- nosy: +ssm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:31:45 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 10 Mar 2012 18:31:45 +0000 Subject: [issue4761] create Python wrappers for openat() and others In-Reply-To: <1230476318.95.0.898909480668.issue4761@psf.upfronthosting.co.za> Message-ID: <1331404305.85.0.814484027608.issue4761@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Addition/Substitution of None I think should be in a new issue. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:34:32 2012 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 10 Mar 2012 18:34:32 +0000 Subject: [issue9232] Allow trailing comma in any function argument list. In-Reply-To: <1278945017.29.0.842296068848.issue9232@psf.upfronthosting.co.za> Message-ID: <1331404472.82.0.847451245792.issue9232@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- assignee: mark.dickinson -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:35:37 2012 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 10 Mar 2012 18:35:37 +0000 Subject: [issue9154] Parser module doesn't understand function annotations. In-Reply-To: <1278270204.2.0.0990664909847.issue9154@psf.upfronthosting.co.za> Message-ID: <1331404537.3.0.604600489031.issue9154@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- versions: +Python 3.3 -Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:52:18 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 10 Mar 2012 18:52:18 +0000 Subject: [issue14245] float rounding examples in FAQ are outdated In-Reply-To: <1331403686.47.0.300772606512.issue14245@psf.upfronthosting.co.za> Message-ID: <4F5BA2E0.80900@v.loewis.de> Martin v. L?wis added the comment: > - explain ``1.2`` example a bit more +1 for giving the binary representation; -1 for rounding the decimal version of it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:53:57 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 10 Mar 2012 18:53:57 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1331398374.59.0.359908742277.issue12568@psf.upfronthosting.co.za> Message-ID: <4F5BA345.3080802@v.loewis.de> Martin v. L?wis added the comment: > Martin, I think you meant to write "if w == 'A':". > Some very common characters have ambiguous widths though (e.g. the Greek alphabet), so you can't just raise an error for them. That's precisely why I don't think this should be in the library, but in the application. Application developers who need that also need to concern themselves with the border cases, and decide on how they need to resolve them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:56:44 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 10 Mar 2012 18:56:44 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1127.1331398702@chthon> Message-ID: <4F5BA3EB.8020701@v.loewis.de> Martin v. L?wis added the comment: > I would encourage you to look at the Perl CPAN module Unicode::LineBreak, > which fully implements tr11. Thanks for the pointer! > If you'd like, I can show you a program that uses these, a rewrite the > standard Unix fmt(1) filter that works properly on Unicode column widths. I believe there can't be any truly "proper" implementation, as you can't be certain how the terminal will handle these itself. In any case, anybody who is interested in contributing a patch should also be capable of understanding the source of Unicode::LineBreak. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:57:38 2012 From: report at bugs.python.org (Tom Christiansen) Date: Sat, 10 Mar 2012 18:57:38 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <4F5BA345.3080802@v.loewis.de> Message-ID: <3652.1331405845@chthon> Tom Christiansen added the comment: >Martin v. L=C3=B6wis added the comment: >> Martin, I think you meant to write "if w =3D=3D 'A':". >> Some very common characters have ambiguous widths though (e.g. the Greek = >alphabet), so you can't just raise an error for them. >That's precisely why I don't think this should be in the library, but >in the application. Application developers who need that also need >to concern themselves with the border cases, and decide on how >they need to resolve them. The column-width of a string is not an application issue. It is well-defined by Unicode. Again, please see how we've done it in Perl, where tr11 is fully implemented. The columns() method from Unicode::GCString always gives the right answer per the Standard for any string, even what you are calling ambiguous ones. This is not an applications issue -- at all. --tom ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:59:14 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 10 Mar 2012 18:59:14 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1331403844.32.0.889987155478.issue12568@psf.upfronthosting.co.za> Message-ID: <4F5BA482.3010503@v.loewis.de> Martin v. L?wis added the comment: > Don't we need a function that actually reports how curses is going to > print a given string, rather than just reporting what the unicode > standard says? That may be useful, but a) this patch doesn't provide that, and b) it may not actually possible to implement such a change in a portable way as there may be no function exposed by the curses implementation that provides this information. To put my closing this issue differently: I rejected the patch that Victor initially submitted. If anybody wants to contribute a different patch that uses a different strategy, please submit a new issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 19:59:52 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 10 Mar 2012 18:59:52 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1331405992.73.0.403913109365.issue12568@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- resolution: works for me -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 20:03:33 2012 From: report at bugs.python.org (Tom Christiansen) Date: Sat, 10 Mar 2012 19:03:33 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <4F5BA3EB.8020701@v.loewis.de> Message-ID: <6679.1331406174@chthon> Tom Christiansen added the comment: >Martin v. L=C3=B6wis added the comment: >> I would encourage you to look at the Perl CPAN module Unicode::LineBreak, >> which fully implements tr11. >Thanks for the pointer! >> If you'd like, I can show you a program that uses these, a rewrite the >> standard Unix fmt(1) filter that works properly on Unicode column widths. >I believe there can't be any truly "proper" implementation, as you >can't be certain how the terminal will handle these itself. Hm. I think we may not be talking about the same thing after all. If we're talking about the Curses library, or something similar, this is not the same. I do not think Curses has support for combining characters, right to left text, wide characters, etc. However, Unicode does, and defines the column width for those. I have an illustration of what this looks like in the picture in the very last recipe, #44, in http://training.perl.com/scripts/perlunicook.html That is what I have been talking about by print widths. It's running in a Mac terminal emulator, and unlike the HTML which grabs from too many fonts, the terminal program does the right thing with the widths. Are we talking about different things? --tom ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 20:43:19 2012 From: report at bugs.python.org (Jakub Wilk) Date: Sat, 10 Mar 2012 19:43:19 +0000 Subject: =?utf-8?q?=5Bissue14248=5D_Typo_in_=22What=E2=80=99s_New_In_Python_3=2E3?= =?utf-8?q?=22=3A_=22comparaison=22?= Message-ID: <1331408599.07.0.132199218541.issue14248@psf.upfronthosting.co.za> New submission from Jakub Wilk : Typo in Doc/whatsnew/3.3.rst: "comparaison" -> "comparison". ---------- assignee: docs at python components: Documentation messages: 155347 nosy: docs at python, jwilk priority: normal severity: normal status: open title: Typo in "What?s New In Python 3.3": "comparaison" versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 20:52:23 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 10 Mar 2012 19:52:23 +0000 Subject: =?utf-8?q?=5Bissue14248=5D_Typo_in_=22What=E2=80=99s_New_In_Python_3=2E3?= =?utf-8?q?=22=3A_=22comparaison=22?= In-Reply-To: <1331408599.07.0.132199218541.issue14248@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 9afbb3af1693 by Georg Brandl in branch 'default': Close #14248: fix typo. http://hg.python.org/cpython/rev/9afbb3af1693 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 21:10:12 2012 From: report at bugs.python.org (Zbyszek Szmek) Date: Sat, 10 Mar 2012 20:10:12 +0000 Subject: [issue14245] float rounding examples in FAQ are outdated In-Reply-To: <4F5BA2E0.80900@v.loewis.de> Message-ID: <4F5BB51B.6050602@in.waw.pl> Zbyszek Szmek added the comment: On 03/10/2012 07:52 PM, Martin v. L?wis wrote: >> - explain ``1.2`` example a bit more > > +1 for giving the binary representation; -1 for rounding > the decimal version of it. Oh, 1.1999999999999999555910790149937383830547332763671875 is exactly equal to 1.0011001100110011001100110011001100110011001100110011. In this case yes, rounding it is not beneficial. So one more version (without this rounding): """ Why are floating-point calculations inaccurate? ----------------------------------------------- Users are often surprised by results like this:: >>> 1.2 - 1.0 0.199999999999999996 and think it is a bug in Python. It's not. This has little to do with Python, and much more to do with how the underlying platform handles floating-point numbers. The float type in CPython simply uses C ``double`` for storage. The number is stored in binary floating-point with a fixed precision (typically 53 bits) and Python uses C operations, which in turn rely on the hardware implementation in the processor, to perform floating-point operations. This means that as far as floating-point operations are concerned, Python behaves like many popular languages including C and Java. Many numbers that can be written easily in decimal notation (``1.2``, for example), cannot be expressed exactly in the binary format. After:: >>> x = 1.2 the value stored for ``x`` is a (very good) approximation of the value ``1.2``, but is not exactly equal to it. On a typical machine, the actual stored value is:: 1.0011001100110011001100110011001100110011001100110011 (binary) which is exactly:: 1.1999999999999999555910790149937383830547332763671875 (decimal) 53 binary digits are equivalent to about 16 decimal digits and in this case the first 17 digits are correct after the conversion back to decimal. Similarly, the result of any floating-point operation must be rounded to fit into the fixed precision, often resulting in another tiny error. For a more detailed explanation of what's involved, please see the chapter on :ref:`floating point arithmetic ` in the Python tutorial. """ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 21:22:06 2012 From: report at bugs.python.org (Colin Marc) Date: Sat, 10 Mar 2012 20:22:06 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: <1331410926.88.0.749012733294.issue14204@psf.upfronthosting.co.za> Colin Marc added the comment: Here's the OpenSSL code I referenced for my implementation. It's an excerpt of ssl/lib_ssl.c, starting at line 1514. ---------- Added file: http://bugs.python.org/file24778/npn_openssl_ref.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 21:59:48 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 10 Mar 2012 20:59:48 +0000 Subject: [issue14242] Make subprocess.Popen aware of $SHELL In-Reply-To: <1331338984.42.0.434201711387.issue14242@psf.upfronthosting.co.za> Message-ID: <1331413188.22.0.325303821407.issue14242@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +gregory.p.smith versions: -Python 2.7, Python 3.1, Python 3.2, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 22:35:47 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 10 Mar 2012 21:35:47 +0000 Subject: [issue14242] Make subprocess.Popen aware of $SHELL In-Reply-To: <1331338984.42.0.434201711387.issue14242@psf.upfronthosting.co.za> Message-ID: <1331415347.05.0.234494390082.issue14242@psf.upfronthosting.co.za> ?ric Araujo added the comment: Note that it?s already possible to use any shell with the ?executable? argument. Is there any official spec (i.e. POSIX) for the SHELL environment variable? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 22:36:54 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 10 Mar 2012 21:36:54 +0000 Subject: [issue14210] add filename completion to pdb In-Reply-To: <1331048207.84.0.206422925925.issue14210@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 01a25f638c83 by Georg Brandl in branch 'default': Close #14210: add command argument completion to pdb: complete file names, global/local variables, aliases http://hg.python.org/cpython/rev/01a25f638c83 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 22:39:30 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 10 Mar 2012 21:39:30 +0000 Subject: [issue14229] On KeyboardInterrupt, the exit code should mirror the signal number In-Reply-To: <1331238085.62.0.936420173713.issue14229@psf.upfronthosting.co.za> Message-ID: <1331415570.81.0.366629421273.issue14229@psf.upfronthosting.co.za> ?ric Araujo added the comment: The Debian bug has some more convincing examples: > any Python program which is expected to implement the interface of (say) "diff" is buggy, because > it may exit status 1 ("comparison successful; differences found") when it should have died with > SIGINT ("comparison not completed due to interrupt signal"); this could in principle cause data loss > in some applications. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 22:44:44 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 10 Mar 2012 21:44:44 +0000 Subject: [issue14229] On KeyboardInterrupt, the exit code should mirror the signal number In-Reply-To: <1331238085.62.0.936420173713.issue14229@psf.upfronthosting.co.za> Message-ID: <1331415884.91.0.623452252055.issue14229@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Since Python *does* handle the signal, and exits "regularly", we > shouldn't You are arguing from a legal point of view, but from a pratical point of view Python doesn't really "handle" the signal: it just defers the exit until after all internal structures are cleaned up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 22:53:28 2012 From: report at bugs.python.org (Phil Thompson) Date: Sat, 10 Mar 2012 21:53:28 +0000 Subject: [issue14246] Accelerated ETree XMLParser cannot handle io.StringIO In-Reply-To: <1331404081.13.0.20544992948.issue14246@psf.upfronthosting.co.za> Message-ID: <8c45e93ae6ce90f61d154ba4db8319ef@localhost> Phil Thompson added the comment: This variation of your test doesn't... --------------------------------------- import io from xml.etree.ElementTree import parse stream = io.StringIO() stream.write(''' ''') stream.seek(0) parsed = parse(stream) print(parsed) --------------------------------------- Phil ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 23:03:33 2012 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sat, 10 Mar 2012 22:03:33 +0000 Subject: [issue14246] Accelerated ETree XMLParser cannot handle io.StringIO In-Reply-To: <1331377442.17.0.542633134085.issue14246@psf.upfronthosting.co.za> Message-ID: <1331417013.76.0.849157869764.issue14246@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 23:07:20 2012 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sat, 10 Mar 2012 22:07:20 +0000 Subject: [issue14242] Make subprocess.Popen aware of $SHELL In-Reply-To: <1331338984.42.0.434201711387.issue14242@psf.upfronthosting.co.za> Message-ID: <1331417240.41.0.688109730033.issue14242@psf.upfronthosting.co.za> Arfrever Frehtes Taifersar Arahesis added the comment: POSIX documents SHELL variable: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 23:19:53 2012 From: report at bugs.python.org (Stefan Krah) Date: Sat, 10 Mar 2012 22:19:53 +0000 Subject: [issue14249] unicodeobject.c: aliasing warnings Message-ID: <1331417993.32.0.291164156337.issue14249@psf.upfronthosting.co.za> New submission from Stefan Krah : There are a couple of aliasing warnings in non-debug mode. For example: http://www.python.org/dev/buildbot/all/builders/x86%20Gentoo%20Non-Debug%203.x/builds/1741 Objects/object.c:293: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result Objects/object.c:302: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result Objects/unicodeobject.c:5533: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5533: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5533: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5523: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5523: warning: dereferencing pointer 'pblock' does break strict-aliasing rules cc1: warning: dereferencing pointer 'pblock' does break strict-aliasing rules cc1: warning: dereferencing pointer 'pblock' does break strict-aliasing rules cc1: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5523: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5523: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5533: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5533: warning: dereferencing pointer 'pblock' does break strict-aliasing rules Objects/unicodeobject.c:5533: warning: dereferencing pointer 'pblock' does break strict-aliasing rules cc1: warning: dereferencing pointer 'pblock' does break strict-aliasing rules cc1: warning: dereferencing pointer 'pblock' does break strict-aliasing rules cc1: warning: dereferencing pointer 'pblock' does break strict-aliasing rules ---------- components: Build keywords: buildbot messages: 155357 nosy: haypo, skrah priority: normal severity: normal status: open title: unicodeobject.c: aliasing warnings type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 23:24:20 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Mar 2012 22:24:20 +0000 Subject: [issue4761] create Python wrappers for openat() and others In-Reply-To: <1230476318.95.0.898909480668.issue4761@psf.upfronthosting.co.za> Message-ID: <1331418260.61.0.561849556793.issue4761@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Perhaps it is better not export these functions in the `os` module, leaving them in `posix`? In addition, `stat` and `lstat` is not very thin wrappers (especially on Windows) given that they are working with `bytes` and with `str`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 10 23:57:28 2012 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sat, 10 Mar 2012 22:57:28 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1331420248.53.0.414893031186.issue7652@psf.upfronthosting.co.za> Arfrever Frehtes Taifersar Arahesis added the comment: Please add --with-system-libmpdec (or --with-system-mpdecimal) option in `configure`, similarly to --with-system-expat and --with-system-ffi options. ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 00:03:56 2012 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sat, 10 Mar 2012 23:03:56 +0000 Subject: [issue14229] On KeyboardInterrupt, the exit code should mirror the signal number In-Reply-To: <1331238085.62.0.936420173713.issue14229@psf.upfronthosting.co.za> Message-ID: <1331420636.61.0.46079260738.issue14229@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 01:10:34 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 11 Mar 2012 00:10:34 +0000 Subject: [issue14242] Make subprocess.Popen aware of $SHELL In-Reply-To: <1331338984.42.0.434201711387.issue14242@psf.upfronthosting.co.za> Message-ID: <1331424634.45.0.604975992032.issue14242@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Users who want to use the SHELL environment variable can do so on their own by using it as their executable and constructing an appropriate command line. Allowing an environment variable to change the behavior of a program that assumes shell=True is going to be /bin/sh compatible by default (as it has been for ages) is a bad idea. ---------- assignee: -> gregory.p.smith resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 01:32:15 2012 From: report at bugs.python.org (poq) Date: Sun, 11 Mar 2012 00:32:15 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1331425935.51.0.471117522786.issue12568@psf.upfronthosting.co.za> poq added the comment: It seems this is a bit of a minefield... GNOME Terminal/libvte has an environment variable (VTE_CJK_WIDTH) to override the handling of ambiguous width characters. It bases its default on the locale (with the comment 'This is basically what GNU libc does'). urxvt just uses system wcwidth. Xterm uses some voodoo to decide between system wcwidth and mk_wcwidth(_cjk): http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c I think the simplest solution is to just expose libc's wc(s)width. It is widely used and is most likely to match the behaviour of the terminal. FWIW I wrote a little script to test the widths of all Unicode characters, and came up with the following logic to match libvte behaviour: def wcwidth(c, legacy_cjk=False): if c in u'\t\r\n\10\13\14': raise ValueError('character %r has no intrinsic width' % c) if c in u'\0\5\7\16\17': return 0 if u'\u1160' <= c <= u'\u11ff': return 0 # hangul jamo if unicodedata.category(c) in ('Mn', 'Me', 'Cf') and c != u'\u00ad': return 0 # 00ad = soft hyphen eaw = unicodedata.east_asian_width(c) if eaw in ('F', 'W'): return 2 if legacy_cjk and eaw == 'A': return 2 return 1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 01:46:32 2012 From: report at bugs.python.org (py.user) Date: Sun, 11 Mar 2012 00:46:32 +0000 Subject: [issue14250] regex.flags is never equal to 0 Message-ID: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> New submission from py.user : http://docs.python.org/py3k/library/re.html#re.regex.flags "or 0 if no flags were provided" >>> import re >>> p = re.compile(r'', 0) >>> p.flags 32 >>> ---------- assignee: docs at python components: Documentation, Regular Expressions messages: 155362 nosy: docs at python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: regex.flags is never equal to 0 versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 03:01:12 2012 From: report at bugs.python.org (R. David Murray) Date: Sun, 11 Mar 2012 02:01:12 +0000 Subject: [issue14250] regex.flags is never equal to 0 In-Reply-To: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> Message-ID: <1331431272.76.0.0531426956919.issue14250@psf.upfronthosting.co.za> R. David Murray added the comment: 32 is re.U, which is always ored with the passed in flags, unless re.A is set in the passed in flags. The flag docs should certinaly be updated to reflect this. ---------- nosy: +r.david.murray stage: -> needs patch versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 03:15:54 2012 From: report at bugs.python.org (Ejaj Hassan) Date: Sun, 11 Mar 2012 02:15:54 +0000 Subject: [issue14190] Minor C API documentation bugs In-Reply-To: <1330841228.13.0.736937779561.issue14190@psf.upfronthosting.co.za> Message-ID: <1331432154.07.0.550793955707.issue14190@psf.upfronthosting.co.za> Ejaj Hassan added the comment: The patch removes the function *PyCodec_KnownEncoding form document codec.rst found in cpython/doc/c-api ---------- keywords: +patch nosy: +ejjy Added file: http://bugs.python.org/file24779/issues14190.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 03:21:05 2012 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 11 Mar 2012 02:21:05 +0000 Subject: [issue14243] NamedTemporaryFile unusable under Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1331432465.25.0.403941847199.issue14243@psf.upfronthosting.co.za> Nick Coghlan added the comment: The whole point of close() methods is to offer deterministic resource management to applications that need it. Pointing out to applications when they're relying on CPython's refcounting for prompt resource cleanup is why many of the standard types now trigger ResourceWarning for any application that relies on the GC to clean up such external resources in __del__. So, no, we're not going to back away from the explicit guarantee in the NamedTemporaryFile docs: "If delete is true (the default), the file is deleted as soon as it is closed." (Especially since doing so would also breach backward compatibility guarantees) However, you're right that the exclusive read lock in the current implementation makes the default behaviour of NamedTemporaryFile significantly less useful on Windows than it is on POSIX systems, so the implementation should be changed to behave more like the POSIX variant. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 03:23:15 2012 From: report at bugs.python.org (rednaks) Date: Sun, 11 Mar 2012 02:23:15 +0000 Subject: [issue14251] [PATCH]HTMLParser decode issue Message-ID: <1331432595.42.0.705024671549.issue14251@psf.upfronthosting.co.za> New submission from rednaks : Hello ! while parsing a HTML code i got an decode Error : but this issue can be fixed by replacing the last string by s.decode() like in the diff file. I also tried to execute my script under python3.2 and it does not parsing any thing File "/usr/lib/python2.7/HTMLParser.py", line 111, in feed self.goahead(0) File "/usr/lib/python2.7/HTMLParser.py", line 155, in goahead k = self.parse_starttag(i) File "/usr/lib/python2.7/HTMLParser.py", line 260, in parse_starttag attrvalue = self.unescape(attrvalue) File "/usr/lib/python2.7/HTMLParser.py", line 410, in unescape return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));", replaceEntities, s) File "/usr/lib/python2.7/re.py", line 151, in sub return _compile(pattern, flags).sub(repl, string, count) UnicodeDecodeError: 'ascii' codec can't decode byte 0x97 in position 1: ordinal not in range(128) ---------- components: Library (Lib) files: patch.txt messages: 155366 nosy: rednaks priority: normal severity: normal status: open title: [PATCH]HTMLParser decode issue type: crash versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file24780/patch.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 03:32:21 2012 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 11 Mar 2012 02:32:21 +0000 Subject: [issue14251] [PATCH]HTMLParser decode issue In-Reply-To: <1331432595.42.0.705024671549.issue14251@psf.upfronthosting.co.za> Message-ID: <1331433141.08.0.968892785523.issue14251@psf.upfronthosting.co.za> Ezio Melotti added the comment: Can you provide a minimal example to reproduce this error? On Python 2 it's always better to decode the HTML first and then pass unicode to the parser. Even though on Python 2 the parser accepts bytes string too, there are a few corner cases where it fails. On Python 3 the parser only accepts unicode, and it should work fine with it (especially if you have an updated clone of cpython). Can you show what failure you get with Python 3? Also, can you reproduce the error if you use strict=False? ---------- assignee: -> ezio.melotti nosy: +ezio.melotti type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 03:35:16 2012 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 11 Mar 2012 02:35:16 +0000 Subject: [issue14251] [PATCH]HTMLParser decode issue In-Reply-To: <1331432595.42.0.705024671549.issue14251@psf.upfronthosting.co.za> Message-ID: <1331433316.61.0.0579469731917.issue14251@psf.upfronthosting.co.za> Ezio Melotti added the comment: See also #3932. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 04:08:00 2012 From: report at bugs.python.org (Ejaj Hassan) Date: Sun, 11 Mar 2012 03:08:00 +0000 Subject: [issue14190] Minor C API documentation bugs In-Reply-To: <1330841228.13.0.736937779561.issue14190@psf.upfronthosting.co.za> Message-ID: <1331435280.38.0.687916672496.issue14190@psf.upfronthosting.co.za> Ejaj Hassan added the comment: The diff file is the second submission containing the fixes to the following bugs: * PyCode_GetNumFree accepts a PyCodeObject* not PyObject* * PyOS_strnicmp returns int, not char* * PyUnicode_RichCompare returns PyObject*, not int * PyType_IS_GC needs a PyTypeObject*, not PyObject* * PyType_HasFeature needs a PyTypeObject*, not PyObject* Well, if the problems given are specified with each's version, then it would make it easier. Some of the reported bugs are not associated with version 2.7 ---------- Added file: http://bugs.python.org/file24781/issues14190-2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 04:14:53 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 11 Mar 2012 03:14:53 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1331435693.42.0.0207181032933.issue12568@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Tom: I don't think Unicode::GCString implements UAX#11 correctly (but this is really out of scope of this issue). In particular, it contains an ad-hoc decision to introduce the EA_Z east-asian width that UAX#11 doesn't talk about. In most cases, it's probably reasonable to introduce this EA_Z feature. However, there are some significant deviations from UAX#11 here: - combining characters are given EA_Z in sombok/data/custom.pl, even though UAX#11 assigns A or N. UAX#11 points out that the advance width depends on whether or not the terminal performs character combination or not. It's not clear whether Unicode::GCString aims for "strict" UAX#11, or "advance width". - control characters are also given EA_Z, even though UAX#11 gives them EA_N. In this case, it's neither UAX#11 width nor advance width since control characters will have various effects on the terminal (in particular for the tab character) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 04:15:13 2012 From: report at bugs.python.org (Dave Burton) Date: Sun, 11 Mar 2012 03:15:13 +0000 Subject: [issue9949] os.path.realpath on Windows does not follow symbolic links In-Reply-To: <1285426994.28.0.192028764756.issue9949@psf.upfronthosting.co.za> Message-ID: <1331435713.95.0.239584383181.issue9949@psf.upfronthosting.co.za> Dave Burton added the comment: It seems that the nt module is implemented in the posixmodule.c source file, and the Python 3 version contains the posix__getfinalpathname entry point, but the Python 2 version does not. I presume that PyWin32 could also be used to work around this. Too bad it isn't automatically included with Python: http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 04:23:01 2012 From: report at bugs.python.org (Brian Curtin) Date: Sun, 11 Mar 2012 03:23:01 +0000 Subject: [issue9949] os.path.realpath on Windows does not follow symbolic links In-Reply-To: <1331435713.95.0.239584383181.issue9949@psf.upfronthosting.co.za> Message-ID: Brian Curtin added the comment: file, and the Python 3 version contains the posix__getfinalpathname entry point, but the Python 2 version does not. > > I presume that PyWin32 could also be used to work around this. Too bad it isn't automatically included with Python: > http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/ We can't use external packages in the standard library. If you're looking for a Python which includes pywin32, ActiveState provides this. I think we can just implement the function we need. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 04:26:12 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 11 Mar 2012 03:26:12 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1331436372.32.0.0780302548094.issue12568@psf.upfronthosting.co.za> Martin v. L?wis added the comment: poq: I still remain opposed to exposing wcswidth, since it is just as incorrect as any of the other solutions that people have circulated. I could agree to it if it was called "wcswidth", making it clear that it does whatever the C library does, with whatever semantics the C library wants to give to it (and an availability that depends on whether the C library supports it or not). That would probably cover the nurses use cases, except that it is not only incorrect with respect to Unicode, but also incorrect with respect to what the terminal may be doing. I guess users would use it anyway. For Python's internal use, I could accept using the sombok algorithm. I wouldn't expose it, since it again would trick people into believing that it was correct in some sense. Perhaps calling it sombok_width might allow for exposing it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 04:30:16 2012 From: report at bugs.python.org (Dave Abrahams) Date: Sun, 11 Mar 2012 03:30:16 +0000 Subject: [issue14243] NamedTemporaryFile unusable under Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1331436616.41.0.357710725404.issue14243@psf.upfronthosting.co.za> Dave Abrahams added the comment: If file.close() "offers deterministic resource management," then you have to consider the file's open/closed state to be a resource separate from its existence. A NamedTemporaryFile whose close() deterministically managed the open/closed state but not the existence of the file would be consistent with file. That said, I understand the move toward deprecating (in the informal sense) cleanups that rely on GC. I'm not suggesting breaking backward compatibility, either. I'm suggesting that it might make sense to allow an explicit close-without-delete as an /extension/ of the current interface. Given the move away from GC-cleanups, you'd probably want an explicit unlink() method as well in that case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 04:45:34 2012 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 11 Mar 2012 03:45:34 +0000 Subject: [issue14243] NamedTemporaryFile unusable under Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1331437534.15.0.11806152347.issue14243@psf.upfronthosting.co.za> Nick Coghlan added the comment: Dave, decoupling the lifecycle of the created file from the object that created it is exactly what delete=False already covers. The complicated dance in NamedTemporaryFile is only to make *__del__* work a bit more reliably during process shutdown (due to some messy internal problems with what CPython is doing at that point). If you're doing deterministic cleanup (even via atexit), you don't need any of that - you can just use os.unlink(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 04:59:14 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 11 Mar 2012 03:59:14 +0000 Subject: [issue14246] Accelerated ETree XMLParser cannot handle io.StringIO In-Reply-To: <1331377442.17.0.542633134085.issue14246@psf.upfronthosting.co.za> Message-ID: <1331438354.76.0.145510822589.issue14246@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- assignee: -> eli.bendersky keywords: +3.2regression stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 05:03:25 2012 From: report at bugs.python.org (Dave Burton) Date: Sun, 11 Mar 2012 04:03:25 +0000 Subject: [issue9949] os.path.realpath on Windows does not follow symbolic links In-Reply-To: <1285426994.28.0.192028764756.issue9949@psf.upfronthosting.co.za> Message-ID: <1331438605.71.0.421051436709.issue9949@psf.upfronthosting.co.za> Dave Burton added the comment: Excellent! The ntpath.py change is nearly identical in Python 2.7 to the change for Python 3.2. The only difference is that instead of: + elif isinstance(path, bytes): + path = os.getcwdb() It is: + elif isinstance(path, unicode): + path = os.getcwdu() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 05:13:28 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 11 Mar 2012 04:13:28 +0000 Subject: [issue14246] Accelerated ETree XMLParser cannot handle io.StringIO In-Reply-To: <1331377442.17.0.542633134085.issue14246@psf.upfronthosting.co.za> Message-ID: <1331439208.63.0.609063470616.issue14246@psf.upfronthosting.co.za> Eli Bendersky added the comment: Both the Python ET and _elementtree use expat, but reach its parsing function in a different path when given a file-like object (StringIO, BytesIO). Python ET reads the stream itself and passes the data to pyexpat's Parse method, which uses PyArg_ParseTuple to decode it. The latter turns a string into bytes when required, so the parsing of str streams is handled transparently. For _elementtree, on the other hand, ET directly calls the internal XMLParser._parse, which uses its own (C) loop to read from the stream. When it sees that it hasn't read bytes (but a string) it stops and falls back on parsing an empty document. The fix will have to be in the latter loop, probably just converting the read string to bytes before moving on. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 10:44:57 2012 From: report at bugs.python.org (Juhana Jauhiainen) Date: Sun, 11 Mar 2012 09:44:57 +0000 Subject: [issue8739] Update to smtpd.py to RFC 5321 In-Reply-To: <1274103249.44.0.284620021799.issue8739@psf.upfronthosting.co.za> Message-ID: <1331459097.24.0.940315529741.issue8739@psf.upfronthosting.co.za> Juhana Jauhiainen added the comment: The patch I've attached adds minimal support for the SIZE parameter of MAIL command. If the given message size exceeds the servers maximum size the server responds with error 552. ---------- nosy: +Juhana.Jauhiainen Added file: http://bugs.python.org/file24782/size_parameter.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 11:13:45 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 11 Mar 2012 10:13:45 +0000 Subject: [issue14116] Condition.__enter__ should return self In-Reply-To: <1330117381.1.0.499178307418.issue14116@psf.upfronthosting.co.za> Message-ID: <1331460825.87.0.695442435191.issue14116@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- title: Lock.__enter__() method returns True instead of self -> Condition.__enter__ should return self _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 11:16:23 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 11 Mar 2012 10:16:23 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb In-Reply-To: <1331241110.78.0.993419519739.issue14230@psf.upfronthosting.co.za> Message-ID: <1331460983.18.0.136925633346.issue14230@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +benjamin.peterson, georg.brandl, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 11:17:28 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 11 Mar 2012 10:17:28 +0000 Subject: [issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__ Message-ID: <1331461048.62.0.19987729281.issue1692335@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 11:19:20 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 11 Mar 2012 10:19:20 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1331461160.23.0.887374885362.issue14228@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 11:21:09 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 11 Mar 2012 10:21:09 +0000 Subject: [issue14250] regex.flags is never equal to 0 In-Reply-To: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> Message-ID: <1331461269.39.0.197840408828.issue14250@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 11:21:55 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 11 Mar 2012 10:21:55 +0000 Subject: [issue14251] HTMLParser decode issue In-Reply-To: <1331432595.42.0.705024671549.issue14251@psf.upfronthosting.co.za> Message-ID: <1331461315.57.0.90557308602.issue14251@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo title: [PATCH]HTMLParser decode issue -> HTMLParser decode issue _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 11:52:21 2012 From: report at bugs.python.org (poq) Date: Sun, 11 Mar 2012 10:52:21 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1331463141.23.0.200342980125.issue12568@psf.upfronthosting.co.za> poq added the comment: Martin, I agree that wcswidth is incorrect with respect to Unicode. However I don't think that's relevant at all. Python should only try to match the behaviour of the terminal. Since terminals do slightly different things, trying to match them exactly - in all cases, on all systems - is virtually impossible. But AFAICT wcwidth should match the terminal behaviour on nearly all modern systems, so it makes sense to expose it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 12:00:12 2012 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 11 Mar 2012 11:00:12 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb In-Reply-To: <1331241110.78.0.993419519739.issue14230@psf.upfronthosting.co.za> Message-ID: <1331463612.98.0.711483140622.issue14230@psf.upfronthosting.co.za> Nick Coghlan added the comment: Mark's patch looks good on a quick read through (although I still need to double check where f_lasti gets incremented to be happy the new comment about YIELD_FROM is accurate). If someone gets to this soon, great, otherwise I'll deal with it after I finish moving house. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 12:05:20 2012 From: report at bugs.python.org (Stefan Krah) Date: Sun, 11 Mar 2012 11:05:20 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1331093383.53.0.464429203652.issue7652@psf.upfronthosting.co.za> Message-ID: <20120311110519.GA32380@sleipnir.bytereef.org> Stefan Krah added the comment: Benjamin Peterson wrote: > Speaking of inline, the "inline" keyword will have to go because it's not C89. Actually the trickier instances of "inline" in the .c files are already suppressed when LEGACY_COMPILER (i.e. C89) is defined. I've now listed the machine options here: http://hg.python.org/features/cdecimal/file/0f032cda94aa/Modules/_decimal/README.txt As I now remember, that was in fact necessary for CompCert. The "static inline" instances in header files might not be a problem even for embedded compilers, see e.g.: http://embeddedgurus.com/barr-code/2011/03/do-inline-function-bodies-belong-in-c-header-files/ IIRC also the Linux kernel uses "static inline" in header files. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 12:43:11 2012 From: report at bugs.python.org (Nicholas Cole) Date: Sun, 11 Mar 2012 11:43:11 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1331466191.22.0.664950479132.issue12568@psf.upfronthosting.co.za> Nicholas Cole added the comment: Poq: I agree. Guessing from the Unicode standard is going to lead to users having to write some complicated code that people are going have to reinvent over and over, and is not going to be accurate with respect to curses. I'd favour exposing wcwidth. Martin: I agree that there are going to be cases where it is not correct because the terminal does something strange, but what we need is something that gets as close as possible to what the terminal is likely to be doing (the Unicode standard itself is not really the issue for curses stuff). So whether it is called wcwidth or wcswidth I don't really mind, but I think it would be useful. The other alternative is to include one of the other ideas that have been mentioned in this thread as part of the library, I suppose, so that people don't have to keep reinventing the wheel for themselves. The one thing I really don't favour is shipping something that supports wide characters, but gives the users no way of guessing whether or not that is what they are printing, because that is surely going to break a lot of applications. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 14:48:08 2012 From: report at bugs.python.org (Johannes Kolb) Date: Sun, 11 Mar 2012 13:48:08 +0000 Subject: [issue13498] os.makedirs exist_ok documentation is incorrect, as is some of the behavior In-Reply-To: <1322574123.12.0.756700598965.issue13498@psf.upfronthosting.co.za> Message-ID: <1331473688.21.0.868440735968.issue13498@psf.upfronthosting.co.za> Johannes Kolb added the comment: I want to mention a situation in which the current behaviour of os.makedirs is confusing. At the first glance I would expect that if >>> os.makedirs(path) succeeds, then a following call to >>> os.makedirs(path, exist_ok=True) will succeed too. This is not always the case. Consider this (assuming Linux as OS and the umask set to 0o022): >>> os.makedirs('/tmp/mytest') >>> os.chmod('/tmp/mytest', 0o2755) >>> path='/tmp/mytest/dir1' >>> os.makedirs(path) >>> os.makedirs(path, exist_ok=True) OSError: [Errno 17] File exists: '/tmp/mytest/dir1' The directory '/tmp/mytest' here has the SETGID flag set, which is inherited automatically. Therefore the flags of '/tmp/mytest/dir1' are not 0o755 as expected by os.makedirs, but 0o2755. The same problem occurs if the user can changes the umask between the calls to os.makedirs. I wonder in what situation the current behaviour of os.makedirs is really helpful and not introducing subtle bugs. Consider using os.makedirs to ensure that the output directory of your script exists. Now the user decides to make this output directory world writeable. For most cases this is no problem, but os.makedirs will complain. ---------- nosy: +jokoala _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 14:50:52 2012 From: report at bugs.python.org (Georg Brandl) Date: Sun, 11 Mar 2012 13:50:52 +0000 Subject: [issue14116] threading classes' __enter__ should return self In-Reply-To: <1330117381.1.0.499178307418.issue14116@psf.upfronthosting.co.za> Message-ID: <1331473852.78.0.676353688083.issue14116@psf.upfronthosting.co.za> Changes by Georg Brandl : ---------- title: Condition.__enter__ should return self -> threading classes' __enter__ should return self _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 15:29:31 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Sun, 11 Mar 2012 14:29:31 +0000 Subject: [issue1531415] parsetok.c emits warnings by writing to stderr Message-ID: <1331476171.39.0.274380857286.issue1531415@psf.upfronthosting.co.za> Michele Orr? added the comment: May somebody check for this? Otherwise the bug could be considered invalid. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 15:51:30 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Sun, 11 Mar 2012 14:51:30 +0000 Subject: [issue8739] Update to smtpd.py to RFC 5321 In-Reply-To: <1274103249.44.0.284620021799.issue8739@psf.upfronthosting.co.za> Message-ID: <1331477490.18.0.687643187308.issue8739@psf.upfronthosting.co.za> Michele Orr? added the comment: I'm currently working on this issue. A little cleanup would be appreciated, or it would be better to split that on another issue? For what I saw, tests are in the form FooTest instead of TestFoo, smtpd imports modules used only in __main__, warnings can be handled the appropriate module, __import__ shall not be used. ---------- nosy: +maker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 16:30:17 2012 From: report at bugs.python.org (R. David Murray) Date: Sun, 11 Mar 2012 15:30:17 +0000 Subject: [issue8739] Update to smtpd.py to RFC 5321 In-Reply-To: <1274103249.44.0.284620021799.issue8739@psf.upfronthosting.co.za> Message-ID: <1331479817.89.0.335573538391.issue8739@psf.upfronthosting.co.za> R. David Murray added the comment: Yes, cleanups would be better as a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 16:30:22 2012 From: report at bugs.python.org (Ross Lagerwall) Date: Sun, 11 Mar 2012 15:30:22 +0000 Subject: [issue8963] test_urllibnet failure In-Reply-To: <1276196839.19.0.231590602267.issue8963@psf.upfronthosting.co.za> Message-ID: <1331479822.34.0.118421489182.issue8963@psf.upfronthosting.co.za> Ross Lagerwall added the comment: I tested the code from msg107484 on Fedora 16 with no change in locale. Probably OK to close? ---------- nosy: +rosslagerwall _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 16:38:07 2012 From: report at bugs.python.org (Jean-Paul Calderone) Date: Sun, 11 Mar 2012 15:38:07 +0000 Subject: [issue1531415] parsetok.c emits warnings by writing to stderr Message-ID: <1331480287.28.0.531737287774.issue1531415@psf.upfronthosting.co.za> Jean-Paul Calderone added the comment: > May somebody check for this? Otherwise the bug could be considered invalid. This is not the proper workflow for bug tracking. "No one is working on this right now" is not the same as "This bug is invalid". No one worked on this ticket almost *seven years* after I filed it. The "invalid" state in the issue tracker is for issues that have been filed that *do not describe a bug that exists at all* (or a feature is being rejected as a bad idea or something that will otherwise not be added to Python and will not be implemented). Please do not close tickets as invalid just because no one is working on resolving them *right now*. The purpose of closing issues is to keep track of useful development that is happening. In and of itself, closing issues is a useless activity; it is only useful inasmuch as it reflects useful development. ---------- nosy: +exarkun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 16:49:17 2012 From: report at bugs.python.org (a) Date: Sun, 11 Mar 2012 15:49:17 +0000 Subject: [issue9290] IDLE and Command line present different behavior for sys.stdin In-Reply-To: <1279417895.54.0.811089047738.issue9290@psf.upfronthosting.co.za> Message-ID: <1331480957.24.0.0727232447871.issue9290@psf.upfronthosting.co.za> a added the comment: Other quirks apparently caused by this bug: msvcrt.getch() does not block and wait for a keypress in IDLE. Returns immediately with b'\xff'. Some of the suggested usage in the manual for sys.stdin does not work under IDLE. E.g. sys.stdin.detach() doesn't work in IDLE. On this last point, the manual has a caveat in the last line of the sys.stdin description that could exonerate it. Regardless, the behavior is inconsistent and makes for awkward UI when using IDLE. ---------- nosy: +a versions: +Python 3.2 -Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 16:58:47 2012 From: report at bugs.python.org (R. David Murray) Date: Sun, 11 Mar 2012 15:58:47 +0000 Subject: [issue8739] Update to smtpd.py to RFC 5321 In-Reply-To: <1274103249.44.0.284620021799.issue8739@psf.upfronthosting.co.za> Message-ID: <1331481527.96.0.188985312191.issue8739@psf.upfronthosting.co.za> R. David Murray added the comment: Juhana: thanks for the patch. I see an issue with it, though. What if the email address is something like JOHN.SIZER at example.com? My thought is that there are two ways to handle this. Either we do a full RFC address parse in __getaddr and have it return the remainder of the line, or we parse from the right hand side looking for keword=value elements (which if I remember the RFC right have a pretty constrained syntax). Ideally I'd like to see a general parsing solution so we can handle other parameters in the future easily. So perhaps a function like _getkeywords(arg) -> (arg, kwdict) that parses the keywords off from the right and returns them in a dict, along with whatever non-keyword argument text is left. The other path, parsing the address fully, could theoretically use the parseaddr utility from the email package, but I'm not sure if it will return the endpoint of an address embedded in a longer string. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 17:02:48 2012 From: report at bugs.python.org (Dave Abrahams) Date: Sun, 11 Mar 2012 16:02:48 +0000 Subject: [issue14252] subprocess.Popen.terminate() inconsistent behavior on Windows Message-ID: <1331481768.76.0.379134642234.issue14252@psf.upfronthosting.co.za> New submission from Dave Abrahams : Try the following script on posix and Windows. On Posix: launched . . . exiting killed on Windows: launched . . . exiting Traceback (most recent call last): File "sp.py", line 16, in p.terminate() File "c:\Python26\lib\subprocess.py", line 949, in terminate _subprocess.TerminateProcess(self._handle, 1) WindowsError: [Error 5] Access is denied This inconsistency seems unnecessary and is an obstacle to writing portable code. from subprocess import * import sys, time p = Popen([sys.executable, '-c', ''' import time, sys for i in range(3): time.sleep(.3) print '.', sys.stdout.flush() print 'exiting' '''], stdout = sys.stdout, stderr = sys.stderr) print 'launched' time.sleep(2) p.terminate() print 'killed' ---------- components: Library (Lib) messages: 155391 nosy: dabrahams priority: normal severity: normal status: open title: subprocess.Popen.terminate() inconsistent behavior on Windows versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 17:08:05 2012 From: report at bugs.python.org (Dave Abrahams) Date: Sun, 11 Mar 2012 16:08:05 +0000 Subject: [issue14252] subprocess.Popen.terminate() inconsistent behavior on Windows In-Reply-To: <1331481768.76.0.379134642234.issue14252@psf.upfronthosting.co.za> Message-ID: <1331482085.54.0.430839136837.issue14252@psf.upfronthosting.co.za> Dave Abrahams added the comment: By the way, the suggested fix would be for terminate() to return a value indicating if the process were already terminated, and not throw an exception in that case. For a user to handle the issue correctly on Windows is rather a nasty project involving a race between process death and the call to terminate() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 17:39:44 2012 From: report at bugs.python.org (=?utf-8?q?Robert_Sj=C3=B6blom?=) Date: Sun, 11 Mar 2012 16:39:44 +0000 Subject: [issue14253] print() encodes characters to native system encoding Message-ID: <1331483984.27.0.0301545457628.issue14253@psf.upfronthosting.co.za> New submission from Robert Sj?blom : I'm on a cp932-encoded system. When I read in a cp1252-file, it's read into memory properly, but when printing it, Python tries to encode the output to cp932. Here's the relevant code: address = "C:/Path/to/file/file.ext" with open(address, encoding="cp1252") as alpha: print(line, end="") Traceback (most recent call last): File "C:\Python32\parser.py", line 8, in print(line) UnicodeEncodeError: 'cp932' codec can't encode character '\xe9' in position 13: illegal multibyte sequence Shouldn't the output be in unicode? ---------- components: Unicode messages: 155393 nosy: Robert.Sj?blom, ezio.melotti priority: normal severity: normal status: open title: print() encodes characters to native system encoding type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 17:42:08 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 11 Mar 2012 16:42:08 +0000 Subject: [issue14252] subprocess.Popen.terminate() inconsistent behavior on Windows In-Reply-To: <1331481768.76.0.379134642234.issue14252@psf.upfronthosting.co.za> Message-ID: <1331484128.47.0.606580387317.issue14252@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Here is a patch for 3.3. I'm not sure it should be backported, as it's a slight change in behaviour. ---------- keywords: +patch nosy: +brian.curtin, gregory.p.smith, pitrou, tim.golden stage: -> patch review versions: +Python 3.3 -Python 2.6 Added file: http://bugs.python.org/file24783/winspterminate.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 17:44:18 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 11 Mar 2012 16:44:18 +0000 Subject: [issue14253] print() encodes characters to native system encoding In-Reply-To: <1331483984.27.0.0301545457628.issue14253@psf.upfronthosting.co.za> Message-ID: <1331484258.19.0.80990578049.issue14253@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Probably a duplicate of issue1602. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 18:11:44 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 11 Mar 2012 17:11:44 +0000 Subject: [issue14252] subprocess.Popen.terminate() inconsistent behavior on Windows In-Reply-To: <1331481768.76.0.379134642234.issue14252@psf.upfronthosting.co.za> Message-ID: <1331485904.72.0.387660545387.issue14252@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Raising an exception on terminate is a bug. I'd backport this to 2.7 and 3.2. I don't actually have Windows to test on so i'll leave committing that to people who do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 18:24:11 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 11 Mar 2012 17:24:11 +0000 Subject: [issue7997] http://www.python.org/dev/faq/ doesn't seem to explain how to regenerate "configure" In-Reply-To: <1266882841.0.0.727782074241.issue7997@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 5432be4d4e1a by Ross Lagerwall in branch 'default': Issue 7997: Explain how to regenerate configure using Autoconf. http://hg.python.org/devguide/rev/5432be4d4e1a ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 18:51:13 2012 From: report at bugs.python.org (Roger Serwy) Date: Sun, 11 Mar 2012 17:51:13 +0000 Subject: [issue14254] IDLE - shell restart during readline does not reset readline Message-ID: <1331488273.19.0.978623849585.issue14254@psf.upfronthosting.co.za> New submission from Roger Serwy : In PyShell.py, the "readline" method enters a nested event loop for handling input. If the shell is restarted, the nested event loop remains until after the first press of "enter" causes the "enter_callback" to quit the nested event loop. The effect is that the first line of input to the prompt is ignored by the new shell. Attached is a patch against 3.3 to fix the problem. ---------- components: IDLE files: reading_reset.patch keywords: patch messages: 155398 nosy: serwy priority: normal severity: normal status: open title: IDLE - shell restart during readline does not reset readline type: behavior versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24784/reading_reset.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 18:51:51 2012 From: report at bugs.python.org (Roger Serwy) Date: Sun, 11 Mar 2012 17:51:51 +0000 Subject: [issue14254] IDLE - shell restart during readline does not reset readline In-Reply-To: <1331488273.19.0.978623849585.issue14254@psf.upfronthosting.co.za> Message-ID: <1331488311.11.0.789302530244.issue14254@psf.upfronthosting.co.za> Changes by Roger Serwy : ---------- nosy: +ned.deily, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 19:11:18 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 11 Mar 2012 18:11:18 +0000 Subject: [issue14252] subprocess.Popen.terminate() inconsistent behavior on Windows In-Reply-To: <1331481768.76.0.379134642234.issue14252@psf.upfronthosting.co.za> Message-ID: <1331489478.7.0.653006643353.issue14252@psf.upfronthosting.co.za> Martin v. L?wis added the comment: +1 for backporting to the bug fix releases. ---------- nosy: +loewis versions: +Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 19:12:26 2012 From: report at bugs.python.org (rednaks) Date: Sun, 11 Mar 2012 18:12:26 +0000 Subject: [issue14251] HTMLParser decode issue In-Reply-To: <1331432595.42.0.705024671549.issue14251@psf.upfronthosting.co.za> Message-ID: <1331489546.95.0.251895826706.issue14251@psf.upfronthosting.co.za> rednaks added the comment: So we cant make decode by default ? ! Concerning python 3, it seems that it's not reading tags and attributes, i didn't get any error, but i don't have any result the example i used is there : http://docs.python.org/library/htmlparser.html#module-HTMLParser Of course, I replaced HTMLParser by html.parser ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 19:18:17 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 11 Mar 2012 18:18:17 +0000 Subject: [issue14253] print() encodes characters to native system encoding In-Reply-To: <1331483984.27.0.0301545457628.issue14253@psf.upfronthosting.co.za> Message-ID: <1331489897.69.0.403838676663.issue14253@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Robert: this is not a bug. Python's IO stack has the fundamental assumption that streams are byte-oriented. So the "shouldn't be the output in Unicode" is not a possible solution, since Unicode cannot work on a byte stream. As a feature request, this is indeed a duplicate of 1602. ---------- nosy: +loewis resolution: -> duplicate status: open -> closed superseder: -> windows console doesn't print or input Unicode versions: +Python 3.3 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 19:31:56 2012 From: report at bugs.python.org (Tim Lesher) Date: Sun, 11 Mar 2012 18:31:56 +0000 Subject: [issue8070] Infinite loop in PyRun_InteractiveLoopFlags() if PyRun_InteractiveOneFlags() raises an error In-Reply-To: <1267793425.09.0.566406511799.issue8070@psf.upfronthosting.co.za> Message-ID: <1331490716.71.0.119471254662.issue8070@psf.upfronthosting.co.za> Tim Lesher added the comment: Updated patch: use Py_FileSystemDefaultEncoding (if possible) when sys.stdin is (or becomes) invalid; if none, then fails without entering infinite loop. Docs for PyRun_InteractiveLoopFlags have been updated. ---------- Added file: http://bugs.python.org/file24785/8070-use-default-encoding.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 19:32:53 2012 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 11 Mar 2012 18:32:53 +0000 Subject: [issue14251] HTMLParser decode issue In-Reply-To: <1331432595.42.0.705024671549.issue14251@psf.upfronthosting.co.za> Message-ID: <1331490773.75.0.753160196522.issue14251@psf.upfronthosting.co.za> Ezio Melotti added the comment: I don't think the patch can be applied as is -- in order to work s should be an ascii-only str. I will look at this again as soon as I have some time and see if something can be done. FTR the Python 3 doc for html.parser can be found here: http://docs.python.org/py3k/library/html.parser.html#example-html-parser-application ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 19:37:53 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 11 Mar 2012 18:37:53 +0000 Subject: [issue14252] subprocess.Popen.terminate() inconsistent behavior on Windows In-Reply-To: <1331481768.76.0.379134642234.issue14252@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 41b1fe5a75a6 by Antoine Pitrou in branch '3.2': Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under Windows when the child process has already exited. http://hg.python.org/cpython/rev/41b1fe5a75a6 New changeset f452d7d5470d by Antoine Pitrou in branch 'default': Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under Windows when the child process has already exited. http://hg.python.org/cpython/rev/f452d7d5470d ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 19:45:20 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 11 Mar 2012 18:45:20 +0000 Subject: [issue14252] subprocess.Popen.terminate() inconsistent behavior on Windows In-Reply-To: <1331481768.76.0.379134642234.issue14252@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset b6ec3b717f7e by Antoine Pitrou in branch '2.7': Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under Windows when the child process has already exited. http://hg.python.org/cpython/rev/b6ec3b717f7e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 19:45:48 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 11 Mar 2012 18:45:48 +0000 Subject: [issue14252] subprocess.Popen.terminate() inconsistent behavior on Windows In-Reply-To: <1331481768.76.0.379134642234.issue14252@psf.upfronthosting.co.za> Message-ID: <1331491548.43.0.120418640267.issue14252@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Ok, I've then fixed the bug in all 3 branches. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 20:13:51 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 11 Mar 2012 19:13:51 +0000 Subject: [issue11406] There is no os.listdir() equivalent returning generator instead of list In-Reply-To: <1299320278.86.0.403600489598.issue11406@psf.upfronthosting.co.za> Message-ID: <1331493231.74.0.237985226625.issue11406@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > On Unix, doing os.stat > on the directory, then looking on st_nlink, will tell you whether > the directory is empty (st_nlink is 2 on an empty directory). Directory with st_nlink==2 can contains any number of non-directory files. And one subdirectory if this directory is root. ---------- nosy: +storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 20:19:23 2012 From: report at bugs.python.org (Colin Marc) Date: Sun, 11 Mar 2012 19:19:23 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: <1331493563.91.0.50035608834.issue14204@psf.upfronthosting.co.za> Colin Marc added the comment: Updated patch. ---------- Added file: http://bugs.python.org/file24786/npn_patch_py3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 22:25:46 2012 From: report at bugs.python.org (Florian Mladitsch) Date: Sun, 11 Mar 2012 21:25:46 +0000 Subject: [issue9371] pulldom doesn't provide END_DOCUMENT or COMMENT nodes. In-Reply-To: <1279976512.14.0.00983593867016.issue9371@psf.upfronthosting.co.za> Message-ID: <1331501146.68.0.602305132038.issue9371@psf.upfronthosting.co.za> Florian Mladitsch added the comment: I found the bug for the end_document event and fixed it. But I couldn't figure out why the PullDOM class did not have comment-events. ---------- keywords: +patch nosy: +flomm Added file: http://bugs.python.org/file24787/pulldom_enddoc_event_fix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 22:44:06 2012 From: report at bugs.python.org (Roger Serwy) Date: Sun, 11 Mar 2012 21:44:06 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331502246.1.0.236468111751.issue14200@psf.upfronthosting.co.za> Roger Serwy added the comment: Attached is a patch to have the rpc marshal exceptions. When used with Martin's patch, IDLE returns >>> '\U00010330' Traceback (most recent call last): File "", line 1, in '\U00010330' ValueError: character U+10330 is above the range (U+0000-U+FFFF) allowed by Tcl Martin: I disagree with the approach of raising a UnicodeEncodeError if IDLE can't render the output of a user's program, especially when the program would otherwise run without error if ran from outside of IDLE. Would replacing these characters with "?" and documenting this limitation in IDLE's docs be an acceptable solution? ---------- Added file: http://bugs.python.org/file24788/rpc_marshal_exception.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 22:53:03 2012 From: report at bugs.python.org (Roger Serwy) Date: Sun, 11 Mar 2012 21:53:03 +0000 Subject: [issue13532] In IDLE, sys.stdout.write and sys.stderr can write any pickleable object In-Reply-To: <1323094063.21.0.960772272227.issue13532@psf.upfronthosting.co.za> Message-ID: <1331502783.1.0.945465598215.issue13532@psf.upfronthosting.co.za> Roger Serwy added the comment: Attached is a preliminary patch to solve this issue. It relies on "rpc_marshal_exception.patch" from issue14200. Does anyone know a good way to make the exception render as: "must be str, not int" instead of "must be str, not " ? ---------- keywords: +patch Added file: http://bugs.python.org/file24789/stdout_fix1.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 22:53:44 2012 From: report at bugs.python.org (rednaks) Date: Sun, 11 Mar 2012 21:53:44 +0000 Subject: [issue14251] HTMLParser decode issue In-Reply-To: <1331432595.42.0.705024671549.issue14251@psf.upfronthosting.co.za> Message-ID: <1331502824.08.0.266854540664.issue14251@psf.upfronthosting.co.za> rednaks added the comment: thank you for giving me a little of your time ! Yes that's what i've tested, i used the html.parser module and and I have no result! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 22:58:50 2012 From: report at bugs.python.org (Chris Rebert) Date: Sun, 11 Mar 2012 21:58:50 +0000 Subject: [issue14187] add "annotation" entry to Glossary In-Reply-To: <1330805957.18.0.748865462478.issue14187@psf.upfronthosting.co.za> Message-ID: <1331503130.7.0.427739940182.issue14187@psf.upfronthosting.co.za> Chris Rebert added the comment: Well, I thought the Glossary was a somewhat useful document in and of itself ("What's conceptual term 'X' mean? Hmm... I'll check the Glossary!") and so should include all terms which aren't module-specific. But I won't push hard if no one else sees value in adding this entry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 23:11:42 2012 From: report at bugs.python.org (Roger Serwy) Date: Sun, 11 Mar 2012 22:11:42 +0000 Subject: [issue12342] characters with ord above 65535 fail to display in IDLE In-Reply-To: <1308171600.34.0.388895530939.issue12342@psf.upfronthosting.co.za> Message-ID: <1331503902.44.0.262635258048.issue12342@psf.upfronthosting.co.za> Roger Serwy added the comment: I agree with Terry. The current behavior of raising ValueError will lead to problems in application code in the future if Tkinter gets fixed such that it can render Unicode properly beyond 0xFFFF. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 23:16:20 2012 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 11 Mar 2012 22:16:20 +0000 Subject: [issue14187] add "annotation" entry to Glossary In-Reply-To: <1330805957.18.0.748865462478.issue14187@psf.upfronthosting.co.za> Message-ID: <1331504180.75.0.254074001271.issue14187@psf.upfronthosting.co.za> Ezio Melotti added the comment: FWIW searching for "annotations" in the Sphinx quick search doesn't yield anything interesting, and the first result that actually contains a paragraph about annotations is the 11th (compound statements). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 11 23:30:40 2012 From: report at bugs.python.org (Chris Rebert) Date: Sun, 11 Mar 2012 22:30:40 +0000 Subject: [issue14187] add "annotation" entry to Glossary In-Reply-To: <1330805957.18.0.748865462478.issue14187@psf.upfronthosting.co.za> Message-ID: <1331505040.75.0.429059762954.issue14187@psf.upfronthosting.co.za> Chris Rebert added the comment: Also, it would be a nice place to point out for those coming from Java or similar that the Java-esque concept of annotations has little to do with Python's function annotations, and that in Python their uses are typically served using decorators instead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 00:13:19 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 11 Mar 2012 23:13:19 +0000 Subject: [issue14187] add "annotation" entry to Glossary In-Reply-To: <1330805957.18.0.748865462478.issue14187@psf.upfronthosting.co.za> Message-ID: <1331507599.48.0.684604630808.issue14187@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Propose some brief text for an entry so we have something to evaluate for its utility. ---------- assignee: docs at python -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 00:17:18 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 11 Mar 2012 23:17:18 +0000 Subject: [issue14161] python2 file __repr__ does not escape filename In-Reply-To: <1330533810.56.0.673512322833.issue14161@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 6c1964dee98b by Ezio Melotti in branch '2.7': #14161: fix the __repr__ of file objects to escape the file name. http://hg.python.org/cpython/rev/6c1964dee98b ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 00:18:52 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 11 Mar 2012 23:18:52 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1331507932.6.0.665983496402.issue7652@psf.upfronthosting.co.za> Raymond Hettinger added the comment: FWIW, I think we would be better off if this patch were merged in soon. Waiting until later in the release cycle risks introducing bugs that we won't have time to notice or fix. An early merge lets more people exercise the code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 00:29:04 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 11 Mar 2012 23:29:04 +0000 Subject: [issue14161] python2 file __repr__ does not escape filename In-Reply-To: <1330533810.56.0.673512322833.issue14161@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 86c749151660 by Ezio Melotti in branch '2.7': #14161: fix compile error under Windows. http://hg.python.org/cpython/rev/86c749151660 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 00:29:37 2012 From: report at bugs.python.org (Roger Serwy) Date: Sun, 11 Mar 2012 23:29:37 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331508577.68.0.850874515793.issue14200@psf.upfronthosting.co.za> Roger Serwy added the comment: I made a mistake in msg155410. The results in the message are WITHOUT "unicodeerror.diff" applied. When it is applied, the IDLE shell gives: >>> '\U00010330' Traceback (most recent call last): File "", line 1, in '\U00010330' UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 1-1: Non-BMP character not supported in Tk Traceback (most recent call last): ** IDLE Internal Exception: File "idlelib/run.py", line 98, in main ret = method(*args, **kwargs) File "idlelib/run.py", line 305, in runcode print_exception() File "idlelib/run.py", line 168, in print_exception print(line, end='', file=efile) File "idlelib/rpc.py", line 599, in __call__ value = self.sockio.remotecall(self.oid, self.name, args, kwargs) File "idlelib/rpc.py", line 214, in remotecall return self.asyncreturn(seq) File "idlelib/rpc.py", line 245, in asyncreturn return self.decoderesponse(response) File "idlelib/rpc.py", line 265, in decoderesponse raise what ValueError: max() arg is an empty sequence I will need to rework the rpc_marshal_exception patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 01:09:17 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Mar 2012 00:09:17 +0000 Subject: [issue14161] python2 file __repr__ does not escape filename In-Reply-To: <1330533810.56.0.673512322833.issue14161@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 6b1fad34d893 by Ezio Melotti in branch '2.7': #14161: fix test failures on Windows. http://hg.python.org/cpython/rev/6b1fad34d893 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 01:14:32 2012 From: report at bugs.python.org (Chris Rebert) Date: Mon, 12 Mar 2012 00:14:32 +0000 Subject: [issue14187] add "annotation" entry to Glossary In-Reply-To: <1330805957.18.0.748865462478.issue14187@psf.upfronthosting.co.za> Message-ID: <1331511272.21.0.909972779247.issue14187@psf.upfronthosting.co.za> Chris Rebert added the comment: Strawman entry wording: An annotation is an arbitrary metadata value associated with a function parameter or return value. The syntax for function annotations is explained in [Function definitions][http://docs.python.org/dev/reference/compound_stmts.html#function-definitions]. Annotations may be accessed via the [__annotations__][http://docs.python.org/dev/reference/datamodel.html#the-standard-type-hierarchy : Callable types -> User-defined functions -> Special attributes] special attribute of a function object. Python itself does not assign any particular meaning to function annotations; they are intended to be interpreted by third-party libraries or tools. Annotations were added to Python by [PEP 3107 "Function Annotations"][http://www.python.org/dev/peps/pep-3107/], which describes some of their possible uses. Some other languages (e.g. Java, C#) also have a concept of "annotations", but it is distinct from the Python concept; the purpose of these "annotations" is served in Python using [decorators]["decorator" entry in Glossary] instead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 01:16:20 2012 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 12 Mar 2012 00:16:20 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1331511380.84.0.951492968181.issue2377@psf.upfronthosting.co.za> Changes by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 01:32:26 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 12 Mar 2012 00:32:26 +0000 Subject: [issue14250] regex.flags is never equal to 0 In-Reply-To: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> Message-ID: <1331512346.86.0.0875947629773.issue14250@psf.upfronthosting.co.za> Changes by Benjamin Peterson : ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 02:12:42 2012 From: report at bugs.python.org (=?utf-8?b?5YuH5YiaIOe9lw==?=) Date: Mon, 12 Mar 2012 01:12:42 +0000 Subject: [issue14255] tempfile.gettempdir() didn't return the path with correct case. Message-ID: <1331514762.82.0.635964063955.issue14255@psf.upfronthosting.co.za> New submission from ?? ? : >>> print tempfile.gettempdir() c:\users\dreamkxd\appdata\local\temp >>> And the real path is C:\Users\dreamkxd\AppData\Local\Temp. ---------- messages: 155424 nosy: ??.? priority: normal severity: normal status: open title: tempfile.gettempdir() didn't return the path with correct case. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 02:13:30 2012 From: report at bugs.python.org (=?utf-8?b?5YuH5YiaIOe9lw==?=) Date: Mon, 12 Mar 2012 01:13:30 +0000 Subject: [issue14255] tempfile.gettempdir() didn't return the path with correct case. In-Reply-To: <1331514762.82.0.635964063955.issue14255@psf.upfronthosting.co.za> Message-ID: <1331514810.68.0.11212945254.issue14255@psf.upfronthosting.co.za> Changes by ?? ? : ---------- components: +IO, Library (Lib), Windows versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 02:24:17 2012 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 12 Mar 2012 01:24:17 +0000 Subject: [issue14256] test_logging fails if zlib is not present Message-ID: <1331515457.08.0.269897538589.issue14256@psf.upfronthosting.co.za> New submission from Eric V. Smith : Presumably this needs to use requires_zlib. $ time ./python -m test test_logging [1/1] test_logging test test_logging crashed -- Traceback (most recent call last): File "/home/eric/local/python/cpython/Lib/test/regrtest.py", line 1229, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/home/eric/local/python/cpython/Lib/test/test_logging.py", line 49, in import zlib ImportError: No module named 'zlib' 1 test failed: test_logging [111665 refs] ---------- components: Tests keywords: easy messages: 155425 nosy: eric.smith priority: normal severity: normal status: open title: test_logging fails if zlib is not present versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 02:25:42 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 12 Mar 2012 01:25:42 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1331502246.1.0.236468111751.issue14200@psf.upfronthosting.co.za> Message-ID: <4F5D5090.9020201@v.loewis.de> Martin v. L?wis added the comment: > Martin: I disagree with the approach of raising a UnicodeEncodeError > if IDLE can't render the output of a user's program, especially when > the program would otherwise run without error if ran from outside of > IDLE. This is really an independent issue, and I'd appreciate if people would treat it as such. *This* issue is about IDLE crashing, not about how Tkinter deals with non-BMP characters. So if the RPC exception marshalling works, and can resolve this issue, I'll be ready to commit this and close this issue. Opening another issue dealing with the more general Tk problem would be fine with me. I don't *quite* understand what you are proposing. If it is that Tkinter always replaces non-BMP characters in string objects with question marks, then I'm opposed. Tkinter can't know whether the replacement is an acceptable loss or not; errors should never pass silently. If you are suggesting that IDLE's write function should write a question mark instead of raising an exception: perhaps, but a) I'd rather use REPLACEMENT CHARACTER instead of QUESTION MARK b) I'd really try to find out first whether Tcl unknowingly supports UTF-16, at least for rendering. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 02:27:06 2012 From: report at bugs.python.org (Chris Rebert) Date: Mon, 12 Mar 2012 01:27:06 +0000 Subject: [issue14257] minor error in glossary wording regarding __hash__ Message-ID: <1331515626.11.0.049158499672.issue14257@psf.upfronthosting.co.za> New submission from Chris Rebert : The entry for "dictionary" reads in part: [...] The keys can be any object with __hash__() function and __eq__() methods. [...] __hash__() is a method, not a function (well, it's a "hash function" in the computer science sense, but it's still confusing even if that reading is what was intended; I think delegating the hashing part of the explanation to __hash__()'s docs is fine). Remove the word "function" from said sentence. ---------- assignee: docs at python components: Documentation messages: 155427 nosy: cvrebert, docs at python priority: normal severity: normal status: open title: minor error in glossary wording regarding __hash__ versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 02:39:23 2012 From: report at bugs.python.org (Roger Serwy) Date: Mon, 12 Mar 2012 01:39:23 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331516363.41.0.141831677277.issue14200@psf.upfronthosting.co.za> Roger Serwy added the comment: Having had some time to work on it, the bug is in the unicodeerror.diff patch. If the string is empty then max(s) will raise a ValueError. This is easy to trigger by generating an exception at the python prompt, like "1/0". Attached is a revised version of Martin's patch. ---------- Added file: http://bugs.python.org/file24790/unicodeerror_rev1.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 02:44:42 2012 From: report at bugs.python.org (Roger Serwy) Date: Mon, 12 Mar 2012 01:44:42 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331516682.29.0.264651570206.issue14200@psf.upfronthosting.co.za> Roger Serwy added the comment: Martin, I got your message after I submitted the last one. This issue does involve IDLE crashing, but it's not crashing due to non-BMP characters. That is a side-effect of a bigger issue with pythonw.exe. See Issue13582 for more information. IDLE's shell output has a gross deficiency due to Tkinter's inability to handle Unicode properly. Why penalize a program for running in IDLE just because IDLE can't write something to the text widget? This is precisely what your approach is doing - making IDLE an even more restricted environment than it needs to be. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 02:46:10 2012 From: report at bugs.python.org (Pedro Kroger) Date: Mon, 12 Mar 2012 01:46:10 +0000 Subject: [issue14256] test_logging fails if zlib is not present In-Reply-To: <1331515457.08.0.269897538589.issue14256@psf.upfronthosting.co.za> Message-ID: <1331516770.51.0.361176354079.issue14256@psf.upfronthosting.co.za> Pedro Kroger added the comment: Attached patch to fix this issue. ---------- keywords: +patch nosy: +kroger Added file: http://bugs.python.org/file24791/issue14256.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 03:12:00 2012 From: report at bugs.python.org (Roger Serwy) Date: Mon, 12 Mar 2012 02:12:00 +0000 Subject: [issue7163] IDLE suppresses sys.stdout.write() return value In-Reply-To: <1255819083.11.0.568760312973.issue7163@psf.upfronthosting.co.za> Message-ID: <1331518320.32.0.860877599959.issue7163@psf.upfronthosting.co.za> Roger Serwy added the comment: Attached is a patch against 3.3 to return the count. ---------- keywords: +patch Added file: http://bugs.python.org/file24792/issue7163.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 03:47:34 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 12 Mar 2012 02:47:34 +0000 Subject: [issue14249] unicodeobject.c: aliasing warnings In-Reply-To: <1331417993.32.0.291164156337.issue14249@psf.upfronthosting.co.za> Message-ID: <1331520454.11.0.297588427828.issue14249@psf.upfronthosting.co.za> Benjamin Peterson added the comment: gcc 4.5 doesn't warn for me. Is this a compiler bug in 4.4 or 4.5? That is, are these actual aliasing violations? ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 03:53:39 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 12 Mar 2012 02:53:39 +0000 Subject: [issue14133] improved PEP 409 implementation In-Reply-To: <1330269562.83.0.382343969435.issue14133@psf.upfronthosting.co.za> Message-ID: <1331520819.77.0.407995753287.issue14133@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Nick, care to look at the latest patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 04:22:06 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 12 Mar 2012 03:22:06 +0000 Subject: [issue14258] Better explain re.LOCALE and re.UNICODE for \S and \W Message-ID: <1331522526.82.0.873716298557.issue14258@psf.upfronthosting.co.za> New submission from Senthil Kumaran : Opening the this bug following this discussion - http://mail.python.org/pipermail/docs/2012-March/007829.html library/re.html \S When the LOCALE and UNICODE flags are not specified, matches any non-whitespace character; this is equivalent to the set [^ \t\n\r\f\v] With LOCALE, it will match any character not in this set, and not defined as space in the current locale. If UNICODE is set, this will match anything other than [ \t\n\r\f\v] and characters marked as space in the Unicode character properties database. This is wrong. With LOCALE set, it should be [^ \t\n\r\f\v] plus any non-space character in that locale. ---------- assignee: orsenthil components: Documentation messages: 155434 nosy: orsenthil priority: low severity: normal status: open title: Better explain re.LOCALE and re.UNICODE for \S and \W type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 04:23:41 2012 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 12 Mar 2012 03:23:41 +0000 Subject: [issue14258] Better explain re.LOCALE and re.UNICODE for \S and \W In-Reply-To: <1331522526.82.0.873716298557.issue14258@psf.upfronthosting.co.za> Message-ID: <1331522621.18.0.762862669529.issue14258@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 04:37:58 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Mar 2012 03:37:58 +0000 Subject: [issue14258] Better explain re.LOCALE and re.UNICODE for \S and \W In-Reply-To: <1331522526.82.0.873716298557.issue14258@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 2d2a972b7523 by Senthil Kumaran in branch '2.7': Fix closes issue14258 - added clarification to \W and \S flags http://hg.python.org/cpython/rev/2d2a972b7523 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 04:44:06 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 12 Mar 2012 03:44:06 +0000 Subject: [issue13496] bisect module: Overflow at index computation In-Reply-To: <1322519672.22.0.173147243777.issue13496@psf.upfronthosting.co.za> Message-ID: <1331523846.72.0.481772180087.issue13496@psf.upfronthosting.co.za> Benjamin Peterson added the comment: LGTM ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 04:44:21 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 12 Mar 2012 03:44:21 +0000 Subject: [issue14258] Better explain re.LOCALE and re.UNICODE for \S and \W In-Reply-To: Message-ID: <20120312034416.GG1986@mathmagic> Senthil Kumaran added the comment: This clarification is specific to Python 2.7. For Python3, the use of LOCALE flag is explicitly discouraged and confusing references to it's meaning is not present in the docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 05:05:40 2012 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 12 Mar 2012 04:05:40 +0000 Subject: [issue14133] improved PEP 409 implementation In-Reply-To: <1330269562.83.0.382343969435.issue14133@psf.upfronthosting.co.za> Message-ID: <1331525140.99.0.65303133171.issue14133@psf.upfronthosting.co.za> Nick Coghlan added the comment: Reviewed - actual impl looks good to me, couple of comments regarding the docs and tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 05:06:15 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Mar 2012 04:06:15 +0000 Subject: [issue14257] minor error in glossary wording regarding __hash__ In-Reply-To: <1331515626.11.0.049158499672.issue14257@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset f0a5f39615c8 by Senthil Kumaran in branch '2.7': closes issue14257 minor error in glossary wording regarding __hash__ http://hg.python.org/cpython/rev/f0a5f39615c8 New changeset 3f15c069454d by Senthil Kumaran in branch '3.2': closes issue14257 - 3.2 minor error in glossary wording regarding __hash__ http://hg.python.org/cpython/rev/3f15c069454d New changeset 2b7c39db2150 by Senthil Kumaran in branch 'default': closes issue14257 - cpython - minor error in glossary wording regarding __hash__ http://hg.python.org/cpython/rev/2b7c39db2150 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 05:18:49 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 12 Mar 2012 04:18:49 +0000 Subject: [issue13532] In IDLE, sys.stdout.write and sys.stderr can write any pickleable object In-Reply-To: <1323094063.21.0.960772272227.issue13532@psf.upfronthosting.co.za> Message-ID: <1331525929.48.0.812486953086.issue13532@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Just a minor comment on the patch - It should be %r instead of %s. - raise TypeError('must be str, not %s' % type(s)) + raise TypeError('must be str, not %r' % type(s)) If there is any test for this, it could be added. I find this approach 'OK'. ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 06:22:56 2012 From: report at bugs.python.org (py.user) Date: Mon, 12 Mar 2012 05:22:56 +0000 Subject: [issue14259] regex.finditer() doesn't accept keyword arguments Message-ID: <1331529776.72.0.83899551616.issue14259@psf.upfronthosting.co.za> New submission from py.user : >>> import re >>> p = re.compile(r'abc') >>> res = p.search('abcdefabcdef', pos=1, endpos=10) >>> res = p.match('abcdefabcdef', pos=1, endpos=10) >>> res = p.findall('abcdefabcdef', pos=1, endpos=10) >>> res = p.finditer('abcdefabcdef', pos=1, endpos=10) Traceback (most recent call last): File "", line 1, in TypeError: finditer() takes no keyword arguments >>> ---------- components: Regular Expressions messages: 155441 nosy: ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: regex.finditer() doesn't accept keyword arguments type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 06:26:56 2012 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 12 Mar 2012 05:26:56 +0000 Subject: [issue14259] re.finditer() doesn't accept keyword arguments In-Reply-To: <1331529776.72.0.83899551616.issue14259@psf.upfronthosting.co.za> Message-ID: <1331530016.84.0.0997183655787.issue14259@psf.upfronthosting.co.za> Changes by Eric V. Smith : ---------- title: regex.finditer() doesn't accept keyword arguments -> re.finditer() doesn't accept keyword arguments _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 06:28:23 2012 From: report at bugs.python.org (py.user) Date: Mon, 12 Mar 2012 05:28:23 +0000 Subject: [issue14260] regex.groupindex available for modification and continues to work, having incorrect data inside it Message-ID: <1331530103.22.0.0779581075646.issue14260@psf.upfronthosting.co.za> New submission from py.user : >>> import re >>> p = re.compile(r'abc(?Pdef)') >>> p.sub(r'\g', 'abcdef123abcdef') 'def123def' >>> p.groupindex['n'] = 2 >>> p.sub(r'\g', 'abcdef123abcdef') 'def123def' >>> p.groupindex {'n': 2} >>> ---------- components: Regular Expressions messages: 155442 nosy: ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: regex.groupindex available for modification and continues to work, having incorrect data inside it type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 06:35:27 2012 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 12 Mar 2012 05:35:27 +0000 Subject: [issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it In-Reply-To: <1331530103.22.0.0779581075646.issue14260@psf.upfronthosting.co.za> Message-ID: <1331530527.68.0.804000602125.issue14260@psf.upfronthosting.co.za> Changes by Eric V. Smith : ---------- title: regex.groupindex available for modification and continues to work, having incorrect data inside it -> re.groupindex available for modification and continues to work, having incorrect data inside it _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 06:42:24 2012 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 12 Mar 2012 05:42:24 +0000 Subject: [issue14256] test_logging fails if zlib is not present In-Reply-To: <1331515457.08.0.269897538589.issue14256@psf.upfronthosting.co.za> Message-ID: <1331530944.64.0.665908132499.issue14256@psf.upfronthosting.co.za> Changes by Eric V. Smith : ---------- assignee: -> eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 06:42:47 2012 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 12 Mar 2012 05:42:47 +0000 Subject: [issue14256] test_logging fails if zlib is not present In-Reply-To: <1331515457.08.0.269897538589.issue14256@psf.upfronthosting.co.za> Message-ID: <1331530967.75.0.103765593336.issue14256@psf.upfronthosting.co.za> Changes by Eric V. Smith : ---------- stage: -> patch review type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 06:47:35 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Mar 2012 05:47:35 +0000 Subject: [issue14256] test_logging fails if zlib is not present In-Reply-To: <1331515457.08.0.269897538589.issue14256@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 4b54a686541f by Eric V. Smith in branch 'default': Make test_logging no longer fail if zlib not present. Closes #14256. Patch by Pedro Kroger. http://hg.python.org/cpython/rev/4b54a686541f ---------- nosy: +python-dev resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 09:42:34 2012 From: report at bugs.python.org (Juhana Jauhiainen) Date: Mon, 12 Mar 2012 08:42:34 +0000 Subject: [issue8739] Update to smtpd.py to RFC 5321 In-Reply-To: <1274103249.44.0.284620021799.issue8739@psf.upfronthosting.co.za> Message-ID: <1331541754.55.0.434583268464.issue8739@psf.upfronthosting.co.za> Juhana Jauhiainen added the comment: Since Michele has been already working on this I could help with the cleanup once it's separated as a new issue. David: Thanks for your comments. I wasn't sure if I should make a general solution or not and ended up making this one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 10:16:30 2012 From: report at bugs.python.org (Chris Rebert) Date: Mon, 12 Mar 2012 09:16:30 +0000 Subject: [issue14257] minor error in glossary wording regarding __hash__ In-Reply-To: <1331515626.11.0.049158499672.issue14257@psf.upfronthosting.co.za> Message-ID: <1331543790.78.0.0177793307274.issue14257@psf.upfronthosting.co.za> Chris Rebert added the comment: I regret to inform you that those changes made the sentence in question ungrammatical. Removing the word "method" will make it grammatical again (as originally suggested). ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 12:19:48 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Mon, 12 Mar 2012 11:19:48 +0000 Subject: [issue8739] Update to smtpd.py to RFC 5321 In-Reply-To: <1274103249.44.0.284620021799.issue8739@psf.upfronthosting.co.za> Message-ID: <1331551188.74.0.358491293111.issue8739@psf.upfronthosting.co.za> Michele Orr? added the comment: Patch attached. A few considerations: in case of syntax error, the server responds with " MAIL FROM:
[SP ] " according to http://tools.ietf.org/html/rfc5321#section-3.3 (instead of "MAIL FROM:
"). Note that this could break something, as far as backwards compatibility is concerned. Looking at http://tools.ietf.org/html/rfc3030#section-4.2 , I was wondering whether the size parameter on MAIL FROM should have implications on the RCPT TO command (i.e., we should check that the foreign email accepts that size). Finally, right now the size parameter is not considered until greater than max_message_size. This could let the user push an email with a size greater than the on declared (but smaller than max_message_size). Tests for command line and cleanup will be on another issue. Waiting for directives :) , -- ? ---------- Added file: http://bugs.python.org/file24793/issue8739.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 12:50:36 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Mon, 12 Mar 2012 11:50:36 +0000 Subject: [issue1531415] parsetok.c emits warnings by writing to stderr Message-ID: <1331553036.01.0.375355957566.issue1531415@psf.upfronthosting.co.za> Michele Orr? added the comment: > This is not the proper workflow for bug tracking. "No one is working > on this right now" is not the same as "This bug is invalid". No one > worked on this ticket almost *seven years* after I filed it. You are right. Sorry for that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 13:04:11 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Mon, 12 Mar 2012 12:04:11 +0000 Subject: [issue14261] Cleanup in smtpd module Message-ID: <1331553850.91.0.315576733805.issue14261@psf.upfronthosting.co.za> New submission from Michele Orr? : This issue is related to 8739 . As pointed in http://bugs.python.org/issue8739#msg155385, ? tests are in the form FooTest instead of TestFoo, smtpd imports modules used only in __main__, warnings can be handled the appropriate module, __import__ shall not be used ? and, as bitdancer said in http://bugs.python.org/issue8739#msg153244 ?there are no tests for the smtpd command line functionality? Also, note that currently the main has a bug: s/options\.max_message_size/size_limit/ ---------- components: Library (Lib) messages: 155448 nosy: Juhana.Jauhiainen, ezio.melotti, maker, r.david.murray priority: normal severity: normal status: open title: Cleanup in smtpd module type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 14:13:08 2012 From: report at bugs.python.org (Ram Rachum) Date: Mon, 12 Mar 2012 13:13:08 +0000 Subject: [issue14262] Allow using decimals as arguments to `timedelta` Message-ID: <1331557988.1.0.944940856764.issue14262@psf.upfronthosting.co.za> New submission from Ram Rachum : Please allow using decimals as arguments to `timedelta`, so the following code won't raise an exception: Python 3.3.0a1 (default, Mar 4 2012, 17:27:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> import decimal >>> datetime.timedelta(hours=decimal.Decimal(7)) Traceback (most recent call last): File "", line 1, in TypeError: unsupported type for timedelta hours component: Decimal It's really annoying to have to convert all the arguments to `float` every time I instantiate a `timedelta`. ---------- components: Library (Lib) messages: 155449 nosy: cool-RR priority: normal severity: normal status: open title: Allow using decimals as arguments to `timedelta` versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 14:38:31 2012 From: report at bugs.python.org (Patrick) Date: Mon, 12 Mar 2012 13:38:31 +0000 Subject: [issue10296] ctypes catches BreakPoint error on windows 32 In-Reply-To: <1288772433.69.0.284335189868.issue10296@psf.upfronthosting.co.za> Message-ID: <1331559511.52.0.998949841613.issue10296@psf.upfronthosting.co.za> Patrick added the comment: This affects me too. ---------- nosy: +pjlbyrne _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 14:58:57 2012 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Mon, 12 Mar 2012 13:58:57 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: <1331560737.38.0.974497946813.issue14204@psf.upfronthosting.co.za> Changes by Jes?s Cea Avi?n : ---------- nosy: +jcea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 16:10:59 2012 From: report at bugs.python.org (Ingo Fischer) Date: Mon, 12 Mar 2012 15:10:59 +0000 Subject: [issue14102] argparse: add ability to create a man page In-Reply-To: <1330031760.56.0.8938390885.issue14102@psf.upfronthosting.co.za> Message-ID: <1331565059.97.0.367211147056.issue14102@psf.upfronthosting.co.za> Changes by Ingo Fischer : ---------- nosy: +Ingo.Fischer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 16:43:25 2012 From: report at bugs.python.org (Stefan Krah) Date: Mon, 12 Mar 2012 15:43:25 +0000 Subject: [issue14249] unicodeobject.c: aliasing warnings In-Reply-To: <1331520454.11.0.297588427828.issue14249@psf.upfronthosting.co.za> Message-ID: <20120312154323.GA5920@sleipnir.bytereef.org> Stefan Krah added the comment: Benjamin Peterson wrote: > gcc 4.5 doesn't warn for me. Is this a compiler bug in 4.4 or 4.5? > That is, are these actual aliasing violations? I see this with 4.4 but also with 4.6 when using -Wstrict-aliasing=2. However, nothing bad happens when I compile with -fstrict-aliasing. I think, but I would have to consult the standard again to be sure, that technically this might be an aliasing violation in C99, since 'pblock' does not have the type of 'block'. unsigned long block = * (unsigned long *) _q; unsigned short *pblock = (unsigned short*)█ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 16:56:04 2012 From: report at bugs.python.org (GaaL33) Date: Mon, 12 Mar 2012 15:56:04 +0000 Subject: [issue1648923] HP-UX: -lcurses missing for readline.so Message-ID: <1331567764.69.0.231357301596.issue1648923@psf.upfronthosting.co.za> GaaL33 added the comment: I confirm that there's still a build issue. I've tried to compile python 2.7.2 on HP-UX 11.31. And it crashes with : ld -b build/temp.hp-ux-B.11.31-ia64-2.7/images/Python-2.7.2/Modules/readline.o -L/usr/lib/termcap -L/usr/local/lib -L/usr/local/lib/hpux32 -lreadline -o build/lib.hp-ux-B.11.31-ia64-2.7/readline.so /usr/lib/hpux32/dld.so: Unsatisfied code symbol 'tgetent' in load module '/usr/local/lib/hpux32/libreadline.so'. sh[3]: 11780 Killed *** Error exit code 137 adding "-lcurses" to the command resolves the problem. ---------- nosy: +gaal33 versions: +Python 2.7 -Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 17:50:33 2012 From: report at bugs.python.org (Tatiana Al-Chueyr) Date: Mon, 12 Mar 2012 16:50:33 +0000 Subject: [issue8942] __path__ attribute of modules loaded by zipimporter is untested In-Reply-To: <1276013732.57.0.515191754786.issue8942@psf.upfronthosting.co.za> Message-ID: <1331571033.69.0.86674706134.issue8942@psf.upfronthosting.co.za> Tatiana Al-Chueyr added the comment: I'm working on it ---------- nosy: +tati_alchueyr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 17:51:07 2012 From: report at bugs.python.org (R. David Murray) Date: Mon, 12 Mar 2012 16:51:07 +0000 Subject: [issue1648923] HP-UX: -lcurses missing for readline.so Message-ID: <1331571067.09.0.57719643713.issue1648923@psf.upfronthosting.co.za> R. David Murray added the comment: OK, reopening. I've added 3.2 and 3.3 as I imagine the same problem will exist there. Now we need someone to propose a patch to fix it. ---------- resolution: out of date -> stage: test needed -> needs patch status: closed -> open versions: +Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 17:56:23 2012 From: report at bugs.python.org (Tim Lesher) Date: Mon, 12 Mar 2012 16:56:23 +0000 Subject: [issue8070] Infinite loop in PyRun_InteractiveLoopFlags() if PyRun_InteractiveOneFlags() raises an error In-Reply-To: <1267793425.09.0.566406511799.issue8070@psf.upfronthosting.co.za> Message-ID: <1331571383.47.0.648065568645.issue8070@psf.upfronthosting.co.za> Tim Lesher added the comment: Corrected const warning in previous patch. ---------- Added file: http://bugs.python.org/file24794/8070-use-default-encoding-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 18:18:18 2012 From: report at bugs.python.org (Tim Lesher) Date: Mon, 12 Mar 2012 17:18:18 +0000 Subject: [issue8010] tkFileDialog.askopenfiles crashes on Windows 7 In-Reply-To: <1267005125.4.0.826921627128.issue8010@psf.upfronthosting.co.za> Message-ID: <1331572698.49.0.88157008794.issue8010@psf.upfronthosting.co.za> Changes by Tim Lesher : ---------- nosy: +tlesher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 18:51:02 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 12 Mar 2012 17:51:02 +0000 Subject: [issue12919] Control what module is imported first In-Reply-To: <1315331616.23.0.265275073086.issue12919@psf.upfronthosting.co.za> Message-ID: <1331574662.42.0.0784082297473.issue12919@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +carljm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 18:52:24 2012 From: report at bugs.python.org (Anthony Tuininga) Date: Mon, 12 Mar 2012 17:52:24 +0000 Subject: [issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger() In-Reply-To: <1188940010.27.0.383470464739.issue1102@psf.upfronthosting.co.za> Message-ID: <1331574744.19.0.703917878082.issue1102@psf.upfronthosting.co.za> Anthony Tuininga added the comment: All, I have trimmed this patch down to the bare minimum required to solve this problem. Please review this as I would dearly love to have this committed. The error received without this patch is MSIError: unknown error 103 This occurs when there are no more records to fetch from the view. The patch simply returns None when there are no more records to fetch -- similar to what is done by the DB API. ---------- Added file: http://bugs.python.org/file24795/_msi_fetch.patch.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 18:59:52 2012 From: report at bugs.python.org (Dave Abrahams) Date: Mon, 12 Mar 2012 17:59:52 +0000 Subject: [issue14243] NamedTemporaryFile unusable under Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1331575192.82.0.86730352066.issue14243@psf.upfronthosting.co.za> Dave Abrahams added the comment: Nick, not to belabor this, but I guess you don't understand the use-case in question very well, or you'd see that delete=False doesn't cover it. The use case is this: I have to write a test for a function that takes a filename as a parameter and opens and reads from the file with that name. The test should conjure up an appropriate file, call the function, check the results, and clean up the file afterwards. It doesn't matter when the file gets cleaned up, as long as it is cleaned up "eventually." Having to explicitly delete the file is exactly the kind of boilerplate one wants to avoid in situations like this. Even if Windows allows a file to be opened for reading (in some circumstances) when it is already open for writing, it isn't hard to imagine that Python might someday have to support an OS that didn't allow it under any circumstances. It is also a bit perverse to have to keep the file open for writing after you're definitively done writing it, just to prevent it from being deleted prematurely. I can understand most of the arguments you make against close-without-delete, except those (like the above) that seem to come from a "you shouldn't want that; it's just wrong" stance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 18:59:58 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 12 Mar 2012 17:59:58 +0000 Subject: [issue14243] NamedTemporaryFile unusable under Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1331575198.65.0.996292992197.issue14243@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 19:05:19 2012 From: report at bugs.python.org (Tatiana Al-Chueyr) Date: Mon, 12 Mar 2012 18:05:19 +0000 Subject: [issue8942] __path__ attribute of modules loaded by zipimporter is untested In-Reply-To: <1276013732.57.0.515191754786.issue8942@psf.upfronthosting.co.za> Message-ID: <1331575519.84.0.541387525486.issue8942@psf.upfronthosting.co.za> Tatiana Al-Chueyr added the comment: Improved test so the __path__ of a package loaded from a zip file, using zipimporter, is checked. ---------- keywords: +patch Added file: http://bugs.python.org/file24796/issue8942_test_for_zipimporter.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 19:16:41 2012 From: report at bugs.python.org (Matthew Barnett) Date: Mon, 12 Mar 2012 18:16:41 +0000 Subject: [issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it In-Reply-To: <1331530103.22.0.0779581075646.issue14260@psf.upfronthosting.co.za> Message-ID: <1331576201.34.0.969317081394.issue14260@psf.upfronthosting.co.za> Matthew Barnett added the comment: The re module creates the dict purely for the benefit of the user, and as it's a normal dict, it's mutable. An alternative would to use an immutable dict or dict-like object, but Python doesn't have such a class, and it's probably not worth writing one just for this use-case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 19:45:34 2012 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Mar 2012 18:45:34 +0000 Subject: [issue13842] Cannot pickle Ellipsis or NotImplemented In-Reply-To: <1327346659.12.0.712807876778.issue13842@psf.upfronthosting.co.za> Message-ID: <1331577934.49.0.9862339503.issue13842@psf.upfronthosting.co.za> ?ukasz Langa added the comment: There is indeed a 5% performance gain from using PyUnicode_FromString instead of the generic Py_BuildValue function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 19:52:35 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 12 Mar 2012 18:52:35 +0000 Subject: [issue12342] characters with ord above 65535 fail to display in IDLE In-Reply-To: <1308171600.34.0.388895530939.issue12342@psf.upfronthosting.co.za> Message-ID: <1331578355.02.0.478397266438.issue12342@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:00:06 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Mar 2012 19:00:06 +0000 Subject: [issue13842] Cannot pickle Ellipsis or NotImplemented In-Reply-To: <1327346659.12.0.712807876778.issue13842@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 5832d3622473 by ?ukasz Langa in branch 'default': Fixes #13842: cannot pickle Ellipsis or NotImplemented. http://hg.python.org/cpython/rev/5832d3622473 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:01:05 2012 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Mar 2012 19:01:05 +0000 Subject: [issue13842] Cannot pickle Ellipsis or NotImplemented In-Reply-To: <1327346659.12.0.712807876778.issue13842@psf.upfronthosting.co.za> Message-ID: <1331578865.01.0.245264310587.issue13842@psf.upfronthosting.co.za> Changes by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:03:52 2012 From: report at bugs.python.org (Michael Foord) Date: Mon, 12 Mar 2012 19:03:52 +0000 Subject: [issue11664] Add patch method to unittest.TestCase In-Reply-To: <1300999439.71.0.376555102459.issue11664@psf.upfronthosting.co.za> Message-ID: <1331579032.55.0.25133697076.issue11664@psf.upfronthosting.co.za> Michael Foord added the comment: mock is being added to Python 3.3 as unittest.mock - so a helper TestCase.patch should delegate to unittest.mock.patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:29:35 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 19:29:35 +0000 Subject: [issue14263] switch_index_if_fails fails on py2 Message-ID: <1331580575.36.0.0269890072564.issue14263@psf.upfronthosting.co.za> New submission from Tarek Ziad? : distutils2 pysetup install is not working on py2 because the wrapper tries to pull func.f_name, which does not exist. ---------- assignee: tarek messages: 155463 nosy: eric.araujo, j1m, tarek priority: critical severity: normal status: open title: switch_index_if_fails fails on py2 versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:29:45 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 19:29:45 +0000 Subject: [issue14263] switch_index_if_fails fails on py2 In-Reply-To: <1331580575.36.0.0269890072564.issue14263@psf.upfronthosting.co.za> Message-ID: <1331580585.31.0.454164065672.issue14263@psf.upfronthosting.co.za> Changes by Tarek Ziad? : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:29:58 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 19:29:58 +0000 Subject: [issue14263] switch_index_if_fails fails on py2 In-Reply-To: <1331580575.36.0.0269890072564.issue14263@psf.upfronthosting.co.za> Message-ID: <1331580598.69.0.264527740971.issue14263@psf.upfronthosting.co.za> Changes by Tarek Ziad? : ---------- components: +Distutils2 nosy: +alexis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:30:56 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 19:30:56 +0000 Subject: [issue14264] can't install zope.event 3.4.0 Message-ID: <1331580656.26.0.657615907174.issue14264@psf.upfronthosting.co.za> Changes by Tarek Ziad? : ---------- assignee: tarek components: Distutils2 nosy: alexis, eric.araujo, j1m, tarek priority: high severity: normal status: open title: can't install zope.event 3.4.0 type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:31:13 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 19:31:13 +0000 Subject: [issue14264] can't install zope.event 3.4.0 Message-ID: <1331580673.39.0.274980477917.issue14264@psf.upfronthosting.co.za> New submission from Tarek Ziad? : it gets 3.4.1 for some reason ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:38:29 2012 From: report at bugs.python.org (Ali Ikinci) Date: Mon, 12 Mar 2012 19:38:29 +0000 Subject: [issue14238] python shouldn't need username in passwd database In-Reply-To: <1331284920.1.0.720164223022.issue14238@psf.upfronthosting.co.za> Message-ID: <1331581109.45.0.415091959491.issue14238@psf.upfronthosting.co.za> Ali Ikinci added the comment: I have started to work on this. ---------- nosy: +aikinci _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:41:06 2012 From: report at bugs.python.org (Jan-Jaap Driessen) Date: Mon, 12 Mar 2012 19:41:06 +0000 Subject: [issue14264] can't install zope.event 3.4.0 In-Reply-To: <1331580673.39.0.274980477917.issue14264@psf.upfronthosting.co.za> Message-ID: <1331581266.03.0.709134460294.issue14264@psf.upfronthosting.co.za> Changes by Jan-Jaap Driessen : ---------- nosy: +janjaapdriessen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:53:48 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Mar 2012 19:53:48 +0000 Subject: [issue14263] switch_index_if_fails fails on py2 In-Reply-To: <1331580575.36.0.0269890072564.issue14263@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 32a95541829c by Tarek Ziade in branch 'default': Fixed a function name lookup in distutils2.pypi.wrapper (#14263) http://hg.python.org/distutils2/rev/32a95541829c ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 20:59:47 2012 From: report at bugs.python.org (Michael Foord) Date: Mon, 12 Mar 2012 19:59:47 +0000 Subject: [issue14265] Fully qualified test name in failure output Message-ID: <1331582387.93.0.923571160232.issue14265@psf.upfronthosting.co.za> New submission from Michael Foord : Somewhere in the failure message for tests Guido would like to see the fully qualified test name, suitable for copying and pasting into a test runner invocation for running just that test. ---------- assignee: michael.foord components: Library (Lib) messages: 155467 nosy: michael.foord priority: normal severity: normal status: open title: Fully qualified test name in failure output versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 21:02:18 2012 From: report at bugs.python.org (R. David Murray) Date: Mon, 12 Mar 2012 20:02:18 +0000 Subject: [issue14265] Fully qualified test name in failure output In-Reply-To: <1331582387.93.0.923571160232.issue14265@psf.upfronthosting.co.za> Message-ID: <1331582538.39.0.0838443009643.issue14265@psf.upfronthosting.co.za> R. David Murray added the comment: +10 :) ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 21:02:52 2012 From: report at bugs.python.org (Michael Foord) Date: Mon, 12 Mar 2012 20:02:52 +0000 Subject: [issue13476] Simple exclusion filter for unittest autodiscovery In-Reply-To: <1322186223.31.0.112270498917.issue13476@psf.upfronthosting.co.za> Message-ID: <1331582572.76.0.222647310606.issue13476@psf.upfronthosting.co.za> Michael Foord added the comment: This would be nice (more powerful) as a general test method exclusion filter: so run test discovery or fetch the specified test module / class and then exclude individual tests that match the pattern. We're looking to add a general test include filter, so it is the natural complement to that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 21:08:32 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 12 Mar 2012 20:08:32 +0000 Subject: [issue14264] can't install zope.event 3.4.0 In-Reply-To: <1331580673.39.0.274980477917.issue14264@psf.upfronthosting.co.za> Message-ID: <1331582912.1.0.443738280586.issue14264@psf.upfronthosting.co.za> ?ric Araujo added the comment: Can you increase logging level and paste log messages? ---------- stage: -> test needed versions: +3rd party, Python 3.3 -Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 21:09:15 2012 From: report at bugs.python.org (Tatiana Al-Chueyr) Date: Mon, 12 Mar 2012 20:09:15 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1331582955.84.0.0106305360564.issue5758@psf.upfronthosting.co.za> Tatiana Al-Chueyr added the comment: Working on this ---------- nosy: +tati_alchueyr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 21:37:34 2012 From: report at bugs.python.org (Jon Vaughan) Date: Mon, 12 Mar 2012 20:37:34 +0000 Subject: [issue13703] Hash collision security issue In-Reply-To: <1325619410.45.0.862265945379.issue13703@psf.upfronthosting.co.za> Message-ID: <1331584654.73.0.742366110385.issue13703@psf.upfronthosting.co.za> Jon Vaughan added the comment: FWIW I upgraded to ubuntu pangolin beta over the weekend, which includes 2.7.3rc1, and I'm also experiencing a problem with urandom. File "/usr/lib/python2.7/email/utils.py", line 27, in import random File "/usr/lib/python2.7/random.py", line 47, in from os import urandom as _urandom ImportError: cannot import name urandom Given Roger Serwy's comment it sounds like a beta ubuntu problem, but thought it worth mentioning. ---------- nosy: +jsvaughan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 21:42:49 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 12 Mar 2012 20:42:49 +0000 Subject: [issue14264] Comparison bug in distutils2.version In-Reply-To: <1331580673.39.0.274980477917.issue14264@psf.upfronthosting.co.za> Message-ID: <1331584969.63.0.0434919215344.issue14264@psf.upfronthosting.co.za> ?ric Araujo added the comment: More info: The command to reproduce the bug is ?pysetup install "zope.event (3.4.0)"?, which gets zope.event 3.4.1. The bug comes from d2.version.VersionPredicate.match: >>> predicate = VersionPredicate('zope.event (3.4.0)') >>> predicate.match('3.4.0') True >>> predicate.match('3.4.1') True >>> predicate.match('3.4.2') True >>> predicate.match('3.6.2') False ---------- title: can't install zope.event 3.4.0 -> Comparison bug in distutils2.version _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 21:44:54 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 12 Mar 2012 20:44:54 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331585094.25.0.725898169479.issue14234@psf.upfronthosting.co.za> Gregory P. Smith added the comment: reviewing now. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:00:21 2012 From: report at bugs.python.org (Colin Marc) Date: Mon, 12 Mar 2012 21:00:21 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: <1331586021.57.0.956684121241.issue14204@psf.upfronthosting.co.za> Colin Marc added the comment: More updates to the patch. ---------- Added file: http://bugs.python.org/file24797/npn_patch_py3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:00:37 2012 From: report at bugs.python.org (Michael Foord) Date: Mon, 12 Mar 2012 21:00:37 +0000 Subject: [issue14266] pyunit script as shorthand for python -m unittest Message-ID: <1331586037.12.0.876793471383.issue14266@psf.upfronthosting.co.za> New submission from Michael Foord : "python -m unittest ..." is a pain to type. A "pyunit" script would be a nice shorthand. (unittest2 has a unit2 script that does this.) ---------- assignee: michael.foord components: Library (Lib) messages: 155476 nosy: michael.foord priority: normal severity: normal stage: needs patch status: open title: pyunit script as shorthand for python -m unittest versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:03:17 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 12 Mar 2012 21:03:17 +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: <1331586197.84.0.781248564605.issue14266@psf.upfronthosting.co.za> Antoine Pitrou added the comment: And it should do "discover" by default, IMO (like nose does). ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:03:54 2012 From: report at bugs.python.org (Nicholas Riley) Date: Mon, 12 Mar 2012 21:03:54 +0000 Subject: [issue14104] Implement time.monotonic() on Mac OS X In-Reply-To: <1330038555.4.0.559569598295.issue14104@psf.upfronthosting.co.za> Message-ID: <1331586234.76.0.662955552288.issue14104@psf.upfronthosting.co.za> Nicholas Riley added the comment: Attached is a patch which implements time.monotonic() using mach_absolute_time() / mach_timebase_info(). This was recommended by Apple in their technical Q&A 1398: https://developer.apple.com/library/mac/#qa/qa1398/ ---------- keywords: +patch nosy: +nriley Added file: http://bugs.python.org/file24798/monotonic.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:05:49 2012 From: report at bugs.python.org (Michael Foord) Date: Mon, 12 Mar 2012 21:05:49 +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: <1331586349.06.0.834161393578.issue14266@psf.upfronthosting.co.za> Michael Foord added the comment: Right "unit2" on its own does discover by default now. (On head, not sure if that's released yet.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:07:14 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Mar 2012 21:07:14 +0000 Subject: [issue14264] Comparison bug in distutils2.version In-Reply-To: <1331580673.39.0.274980477917.issue14264@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 1e0ca4594a2a by Tarek Ziade in branch 'default': Removed the trailing zero wiping (#14264) http://hg.python.org/distutils2/rev/1e0ca4594a2a ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:15:42 2012 From: report at bugs.python.org (Brett Cannon) Date: Mon, 12 Mar 2012 21:15:42 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1331586942.17.0.312169678581.issue2377@psf.upfronthosting.co.za> Brett Cannon added the comment: So after looking at import.c and how it handles stuff, I have decided how I already implemented __import__() triggering __import__() itself is fine. So Antoine can just stay confused by my comment as it is now a moot point. =) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:18:40 2012 From: report at bugs.python.org (Matt Mullins) Date: Mon, 12 Mar 2012 21:18:40 +0000 Subject: [issue14267] TimedRotatingFileHandler chooses wrong file name due to daylight saving time "spring forward" Message-ID: <1331587120.0.0.484868698983.issue14267@psf.upfronthosting.co.za> New submission from Matt Mullins : As logs were rotated at midnight this morning (at the end of the day 2012-03-11), we detected that the logs were incorrectly renamed to *.log.2012-03-10, causing logs from Saturday to be overwritten. I believe this bug is related to the transition to daylight saving time, as this is the only day in recent history that this has occurred. I have attached a script to reproduce this bug. This works reliably in the US/Pacific time zone. To run it, execute "rm foo.log* ; sudo date 03112359.55 && python logger_test.py". This will cause ten records to be logged, across the midnight boundary from 2012-03-11 23:59:55 to 2012-03-12 00:00:05. Expected behavior: the logs from 2012-03-11 up to, but not including, 2012-03-12 00:00:00 should be written to a file named "foo.log.2012-03-11", and the remainder of the log entries should be written to "foo.log". Actual behavior: the logs from 2012-03-11 23:59 through, but not including, 2012-03-12 00:00 are instead written to a file named "foo.log.2012-03-10", and the remainder of the log entries are written to "foo.log". This does not happen for any other day. For example: running "sudo date 02152359.55" in the above procedure correctly names the file "foo.log.2012-02-15". ---------- components: Library (Lib) files: logger_test.py messages: 155482 nosy: Matt.Mullins priority: normal severity: normal status: open title: TimedRotatingFileHandler chooses wrong file name due to daylight saving time "spring forward" type: behavior versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file24799/logger_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:33:35 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 21:33:35 +0000 Subject: [issue14268] _move_file is broken because of a bad mock Message-ID: <1331588015.42.0.677494046367.issue14268@psf.upfronthosting.co.za> New submission from Tarek Ziad? : the mocked list_installed_files() returns a list of files instead of a list of (path, md5, path) ---------- assignee: tarek components: Distutils2 messages: 155483 nosy: alexis, eric.araujo, tarek priority: normal severity: normal status: open title: _move_file is broken because of a bad mock versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:37:18 2012 From: report at bugs.python.org (py.user) Date: Mon, 12 Mar 2012 21:37:18 +0000 Subject: [issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it In-Reply-To: <1331530103.22.0.0779581075646.issue14260@psf.upfronthosting.co.za> Message-ID: <1331588238.77.0.980984426494.issue14260@psf.upfronthosting.co.za> py.user added the comment: Matthew Barnett wrote: > The re module creates the dict purely for the benefit of the user this dict affects on regex.sub() >>> import re >>> p = re.compile(r'abc(?Pdef)') >>> p.groupindex {'n': 1} >>> p.groupindex['n'] = 2 >>> p.sub(r'\g', 'abcdef') Traceback (most recent call last): File "/usr/local/lib/python3.2/sre_parse.py", line 811, in expand_template literals[index] = s = g(group) IndexError: no such group During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.2/re.py", line 286, in filter return sre_parse.expand_template(template, match) File "/usr/local/lib/python3.2/sre_parse.py", line 815, in expand_template raise error("invalid group reference") sre_constants.error: invalid group reference >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:38:38 2012 From: report at bugs.python.org (Brett Cannon) Date: Mon, 12 Mar 2012 21:38:38 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1331588318.61.0.166718923548.issue2377@psf.upfronthosting.co.za> Brett Cannon added the comment: Looks like Windows as a PC/import_nt.c:_PyWin_FindRegisteredModule() function used to find modules in the registry. Probably should care about that at some point (I guess). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:44:33 2012 From: report at bugs.python.org (Ali Ikinci) Date: Mon, 12 Mar 2012 21:44:33 +0000 Subject: [issue14238] python shouldn't need username in passwd database In-Reply-To: <1331284920.1.0.720164223022.issue14238@psf.upfronthosting.co.za> Message-ID: <1331588673.34.0.346538905139.issue14238@psf.upfronthosting.co.za> Ali Ikinci added the comment: This patch fixes the issue but needs review. It is my first patch ever so be nice :) ---------- keywords: +patch Added file: http://bugs.python.org/file24800/issue14238.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:46:04 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Mar 2012 21:46:04 +0000 Subject: [issue14268] _move_file is broken because of a bad mock In-Reply-To: <1331588015.42.0.677494046367.issue14268@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset c0a9ba08ebe3 by Tarek Ziade in branch 'default': fixed a test mock issue (#14268) http://hg.python.org/distutils2/rev/c0a9ba08ebe3 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:50:51 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 12 Mar 2012 21:50:51 +0000 Subject: [issue14238] python shouldn't need username in passwd database In-Reply-To: <1331284920.1.0.720164223022.issue14238@psf.upfronthosting.co.za> Message-ID: <1331589051.01.0.933561018869.issue14238@psf.upfronthosting.co.za> ?ric Araujo added the comment: Thanks you for your contribution! I hope you?ll find fun bugs to make patches for. Your patch looks too simplistic; in the discussion, we agreed that if the lookup fails, the site module should not add user site directories (see http://docs.python.org/library/site#site.USER_SITE or PEP 370), and your patch does not seem to do that. Moreover, this bug has repercussions on the sysconfig module (see my previous message), which needs edits too. BTW, I don?t know how we can test a patch for this bug; arekm, how do you run Python from a UID without passwd entry? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:57:40 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Mar 2012 21:57:40 +0000 Subject: [issue13394] Patch to increase aifc lib test coverage In-Reply-To: <1321169659.12.0.870815067565.issue13394@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset fc3a63ed1f67 by Ezio Melotti in branch '3.2': #13394: add more tests for the aifc module. Patch by Oleg Plakhotnyuk. http://hg.python.org/cpython/rev/fc3a63ed1f67 New changeset 512d3ad81fb9 by Ezio Melotti in branch 'default': #13394: add more tests for the aifc module and use warnings.warn instead of print. Patch by Oleg Plakhotnyuk. http://hg.python.org/cpython/rev/512d3ad81fb9 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:58:36 2012 From: report at bugs.python.org (Dan Boswell) Date: Mon, 12 Mar 2012 21:58:36 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO Message-ID: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> New submission from Dan Boswell : The current SMTP RFC (5321) states that 'a client MUST issue HELO or EHLO before starting a mail transaction'. The SMTP server should issue '503 Bad sequence of commands' if a client sends MAIL, RCPT or DATA commands before it sends an HELO/EHLO; currently it does not. To reproduce: 1. Start smtpd.py 2. Telnet to localhost 8025 3. Send 'MAIL from:' To which you'll see '250 OK' instead of '503 Bad sequence of commands' ---------- components: Library (Lib) messages: 155490 nosy: fruitnuke priority: normal severity: normal status: open title: SMTPD server does not enforce client starting mail transaction with HELO or EHLO type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:59:18 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 12 Mar 2012 21:59:18 +0000 Subject: [issue14235] test_cmd.py does not correctly call reload() In-Reply-To: <1331255570.35.0.441826601517.issue14235@psf.upfronthosting.co.za> Message-ID: <1331589558.24.0.0304516903492.issue14235@psf.upfronthosting.co.za> ?ric Araujo added the comment: Ah, right. Will apply your patch. ---------- assignee: -> eric.araujo versions: +Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 22:59:55 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Mar 2012 21:59:55 +0000 Subject: [issue13842] Cannot pickle Ellipsis or NotImplemented In-Reply-To: <1327346659.12.0.712807876778.issue13842@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 5353357382e2 by ?ukasz Langa in branch 'default': #13842: check whether PyUnicode_FromString succeeded http://hg.python.org/cpython/rev/5353357382e2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:04:57 2012 From: report at bugs.python.org (Arkadiusz Miskiewicz Arkadiusz Miskiewicz) Date: Mon, 12 Mar 2012 22:04:57 +0000 Subject: [issue14238] python shouldn't need username in passwd database In-Reply-To: <1331284920.1.0.720164223022.issue14238@psf.upfronthosting.co.za> Message-ID: <1331589897.24.0.0291637949911.issue14238@psf.upfronthosting.co.za> Arkadiusz Miskiewicz Arkadiusz Miskiewicz added the comment: $ LC_ALL=C sudo -u '#9999' -g '#9999' /bin/sh -c 'unset HOME ; python -c ""' Traceback (most recent call last): File "/usr/share/python2.7/site.py", line 567, in main() File "/usr/share/python2.7/site.py", line 549, in main known_paths = addusersitepackages(known_paths) File "/usr/share/python2.7/site.py", line 278, in addusersitepackages user_site = getusersitepackages() File "/usr/share/python2.7/site.py", line 253, in getusersitepackages user_base = getuserbase() # this will also set USER_BASE File "/usr/share/python2.7/site.py", line 243, in getuserbase USER_BASE = get_config_var('userbase') File "/usr/share/python2.7/sysconfig.py", line 522, in get_config_var return get_config_vars().get(name) File "/usr/share/python2.7/sysconfig.py", line 426, in get_config_vars _CONFIG_VARS['userbase'] = _getuserbase() File "/usr/share/python2.7/sysconfig.py", line 184, in _getuserbase return env_base if env_base else joinuser("~", ".local") File "/usr/share/python2.7/sysconfig.py", line 171, in joinuser return os.path.expanduser(os.path.join(*args)) File "/usr/share/python2.7/posixpath.py", line 260, in expanduser userhome = pwd.getpwuid(os.getuid()).pw_dir KeyError: 'getpwuid(): uid not found: 9999' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:07:28 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Mar 2012 22:07:28 +0000 Subject: [issue14238] python shouldn't need username in passwd database In-Reply-To: <1331284920.1.0.720164223022.issue14238@psf.upfronthosting.co.za> Message-ID: <1331590048.11.0.435903611705.issue14238@psf.upfronthosting.co.za> STINNER Victor added the comment: See also the issue #10496. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:07:57 2012 From: report at bugs.python.org (Tetsuya Morimoto) Date: Mon, 12 Mar 2012 22:07:57 +0000 Subject: [issue14002] distutils2 fails to install a package from PyPI on Python 2.7.2 In-Reply-To: <1329147128.07.0.548553326464.issue14002@psf.upfronthosting.co.za> Message-ID: <1331590077.41.0.975306061838.issue14002@psf.upfronthosting.co.za> Tetsuya Morimoto added the comment: I can reproduce it on Mac OS X. I made a patch which checks the "func_name" attribute of function before it refers. It works for me. However, I wonder if a function has both "func.im_self" and "func.func_name"? Tell me the background because I'm newbie for distutils2. ---------- keywords: +patch nosy: +t2y Added file: http://bugs.python.org/file24801/distutils2_pypi_wrapper.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:10:26 2012 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 12 Mar 2012 22:10:26 +0000 Subject: [issue13394] Patch to increase aifc lib test coverage In-Reply-To: <1321169659.12.0.870815067565.issue13394@psf.upfronthosting.co.za> Message-ID: <1331590226.96.0.557162719015.issue13394@psf.upfronthosting.co.za> Ezio Melotti added the comment: Fixed, thanks for the patches! ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:10:47 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 22:10:47 +0000 Subject: [issue14002] distutils2 fails to install a package from PyPI on Python 2.7.2 In-Reply-To: <1329147128.07.0.548553326464.issue14002@psf.upfronthosting.co.za> Message-ID: <1331590247.16.0.206904698386.issue14002@psf.upfronthosting.co.za> Tarek Ziad? added the comment: see Bug 14263 also ---------- dependencies: +switch_index_if_fails fails on py2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:18:25 2012 From: report at bugs.python.org (Mathieu Leduc-Hamel) Date: Mon, 12 Mar 2012 22:18:25 +0000 Subject: [issue14270] Can't install a package in a specific directory Message-ID: <1331590705.94.0.0465168087698.issue14270@psf.upfronthosting.co.za> New submission from Mathieu Leduc-Hamel : When using distutils2.install.install_from_infos to install a package, no matter if you have an install_path parameter or not, it doesn't work. The problem seems to resided at: distutils2.install._run_install_from_archive Doesn't have any dest_dir parameter ---------- assignee: eric.araujo components: Distutils2 messages: 155498 nosy: alexis, eric.araujo, mlhamel, tarek priority: normal severity: normal status: open title: Can't install a package in a specific directory versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:18:45 2012 From: report at bugs.python.org (Ali Ikinci) Date: Mon, 12 Mar 2012 22:18:45 +0000 Subject: [issue14238] python shouldn't need username in passwd database In-Reply-To: <1331284920.1.0.720164223022.issue14238@psf.upfronthosting.co.za> Message-ID: <1331590725.08.0.525653066098.issue14238@psf.upfronthosting.co.za> Ali Ikinci added the comment: I would suggest that this issue is the same as http://bugs.python.org/issue10496 like Victor pointed out and would say close it because it is a duplicate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:29:21 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Mar 2012 22:29:21 +0000 Subject: [issue13450] add assertions to implement the intent in ''.format_map test In-Reply-To: <1321922556.51.0.541780569618.issue13450@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 995cddd15313 by Eric V. Smith in branch '3.2': str.format_map tests don't do what they say: fix to actually implement the intent of the test. Closes #13450. http://hg.python.org/cpython/rev/995cddd15313 New changeset 0df295d590a8 by Eric V. Smith in branch 'default': str.format_map tests don't do what they say: fix to actually implement the intent of the test. Closes #13450. Patch by Akira Li. http://hg.python.org/cpython/rev/0df295d590a8 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:35:21 2012 From: report at bugs.python.org (Dan Boswell) Date: Mon, 12 Mar 2012 22:35:21 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1331591721.46.0.736154107034.issue14269@psf.upfronthosting.co.za> Dan Boswell added the comment: Attached a diff containing a unit-test for this behavior. ---------- keywords: +patch Added file: http://bugs.python.org/file24802/failing_test.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:41:52 2012 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 12 Mar 2012 22:41:52 +0000 Subject: [issue13394] Patch to increase aifc lib test coverage In-Reply-To: <1321169659.12.0.870815067565.issue13394@psf.upfronthosting.co.za> Message-ID: <1331592112.17.0.611725363494.issue13394@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- assignee: -> ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:42:52 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Mar 2012 22:42:52 +0000 Subject: [issue14104] Implement time.monotonic() on Mac OS X In-Reply-To: <1330038555.4.0.559569598295.issue14104@psf.upfronthosting.co.za> Message-ID: <1331592172.07.0.49891573878.issue14104@psf.upfronthosting.co.za> STINNER Victor added the comment: > Attached is a patch which implements time.monotonic() using > mach_absolute_time() / mach_timebase_info(). Is it possible that mach_timebase_info() fails? No according to the Technical Q&A QA1398. > time * timebase.numer / timebase.denom "time * timebase.numer" may overflow, you should maybe multiply using the double type to avoid the overflow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:48:42 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 22:48:42 +0000 Subject: [issue14271] remove setup.py from the doc Message-ID: <1331592522.15.0.530448114821.issue14271@psf.upfronthosting.co.za> New submission from Tarek Ziad? : http://docs.python.org/dev/packaging/index.html we still have setup.py pages here from the old doc ---------- assignee: eric.araujo components: Distutils2 messages: 155503 nosy: alexis, eric.araujo, j1m, tarek priority: normal severity: normal status: open title: remove setup.py from the doc versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:48:53 2012 From: report at bugs.python.org (Stefan Krah) Date: Mon, 12 Mar 2012 22:48:53 +0000 Subject: [issue14272] ast.c: windows compile error Message-ID: <1331592533.68.0.501543996641.issue14272@psf.upfronthosting.co.za> New submission from Stefan Krah : The Windows build seems to be broken: Python-ast.c ..\Python\Python-ast.c(459) : error C2059: syntax error : ';' ..\Python\Python-ast.c(461) : error C2059: syntax error : '}' ..\Python\Python-ast.c(549) : error C2065: 'AST_object' : undeclared identifier ..\Python\Python-ast.c(581) : error C2065: 'AST_object' : undeclared identifier ..\Python\Python-ast.c(581) : error C2059: syntax error : ')' ..\Python\Python-ast.c(596) : fatal error C1903: unable to recover from previous error(s); stopping compilatio n dtoa.c 10>..\Python\dtoa.c ---------- components: Build messages: 155504 nosy: skrah priority: normal severity: normal status: open title: ast.c: windows compile error type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:51:06 2012 From: report at bugs.python.org (Nicholas Riley) Date: Mon, 12 Mar 2012 22:51:06 +0000 Subject: [issue12978] Figure out extended attributes on BSDs In-Reply-To: <1316014526.21.0.982877507813.issue12978@psf.upfronthosting.co.za> Message-ID: <1331592666.21.0.069109435319.issue12978@psf.upfronthosting.co.za> Nicholas Riley added the comment: I've spent a few hours looking at xattr and the Linux/OS X (10.4+) implementations. Bob Ippolito's xattr module implements the OS X xattr interface on Linux, Solaris (9+) and FreeBSD. Linux and OS X are pretty close; FreeBSD and Solaris are substantially different from either and the Solaris implementation is somewhat incomplete/broken. The OS X differences from Linux are: ? Instead of l* functions, the XATTR_NOFOLLOW option ? XATTR_NOSECURITY and XATTR_NODEFAULT are in the headers but essentially unavailable as the kernel code always returns EINVAL for them. ? XATTR_SHOWCOMPRESSION to expose the HFS compression stuff, which I can't imagine many people needing ? XATTR_MAXNAMELEN (but no equivalent to XATTR_SIZE_MAX). Linux has a corresponding XATTR_NAME_MAX, which we should probably expose too. ? XATTR_FINDERINFO_NAME and XATTR_RESOURCEFORK_NAME for some standard attribute names. I would imagine these are worth exposing. I don't see any problems supporting the currently exposed Linux API on OS X (I could probably find a usable value for XATTR_SIZE_MAX), but it's unclear if that is the right way to go forward. Suggestions? ---------- nosy: +nriley _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:52:04 2012 From: report at bugs.python.org (Nicholas Riley) Date: Mon, 12 Mar 2012 22:52:04 +0000 Subject: [issue12978] Figure out extended attributes on BSDs In-Reply-To: <1316014526.21.0.982877507813.issue12978@psf.upfronthosting.co.za> Message-ID: <1331592724.37.0.190522044306.issue12978@psf.upfronthosting.co.za> Changes by Nicholas Riley : ---------- nosy: +bob.ippolito _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:53:55 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 12 Mar 2012 22:53:55 +0000 Subject: [issue14271] remove setup.py from the doc In-Reply-To: <1331592522.15.0.530448114821.issue14271@psf.upfronthosting.co.za> Message-ID: <1331592835.27.0.686172646598.issue14271@psf.upfronthosting.co.za> ?ric Araujo added the comment: I have a clone with this fix and many more improvements. ---------- resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> Update packaging documentation versions: +3rd party -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:54:32 2012 From: report at bugs.python.org (Nicholas Riley) Date: Mon, 12 Mar 2012 22:54:32 +0000 Subject: [issue14104] Implement time.monotonic() on Mac OS X In-Reply-To: <1330038555.4.0.559569598295.issue14104@psf.upfronthosting.co.za> Message-ID: <1331592872.56.0.155330414974.issue14104@psf.upfronthosting.co.za> Nicholas Riley added the comment: timebase.numer and timebase.denom are always 1 in practice (see the "note" in the tech Q&A); I included them for completeness, but maybe it's just better to not bother? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:55:20 2012 From: report at bugs.python.org (Ned Deily) Date: Mon, 12 Mar 2012 22:55:20 +0000 Subject: [issue14184] test_recursion_limit fails on OS X when compiled with clang In-Reply-To: <1330799175.64.0.584066086457.issue14184@psf.upfronthosting.co.za> Message-ID: <1331592920.27.0.330150100024.issue14184@psf.upfronthosting.co.za> Ned Deily added the comment: 3.2 also fails when compiled on 10.7 with clang. Issue9670 had increased the secondary stack size for OS X and FreeBSD by an empirically-determined amount to reduce the chance of crashes for recursive function calls. Continuing that somewhat kludgey strategy, the attached patch increases the stack size on OS X to a value such that the test no longer crashes. It also separates the values for FreeBSD and OS X. ---------- keywords: +patch stage: needs patch -> patch review versions: +Python 3.2 Added file: http://bugs.python.org/file24803/issue14184.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:56:18 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 22:56:18 +0000 Subject: [issue14273] handler not properly initialized Message-ID: <1331592978.94.0.127505196077.issue14273@psf.upfronthosting.co.za> New submission from Tarek Ziad? : $ ./pysetup dwqqwddwq No handlers could be found for logger "distutils2" ---------- assignee: eric.araujo components: Distutils2 messages: 155509 nosy: alexis, eric.araujo, tarek priority: high severity: normal status: open title: handler not properly initialized versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:57:38 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 12 Mar 2012 22:57:38 +0000 Subject: [issue14267] TimedRotatingFileHandler chooses wrong file name due to daylight saving time "spring forward" In-Reply-To: <1331587120.0.0.484868698983.issue14267@psf.upfronthosting.co.za> Message-ID: <1331593058.91.0.781946918776.issue14267@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +vinay.sajip versions: +Python 3.2, Python 3.3 -Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:58:34 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 12 Mar 2012 22:58:34 +0000 Subject: [issue14273] distutils2: logging handler not properly initialized In-Reply-To: <1331592978.94.0.127505196077.issue14273@psf.upfronthosting.co.za> Message-ID: <1331593114.92.0.406668025824.issue14273@psf.upfronthosting.co.za> ?ric Araujo added the comment: I?ve seen that too when running ?python -m packaging.run?, but I don?t understand why the behavior is different when running pysetup vs. ./pysetup vs. python -m: all of these run the same code. ---------- nosy: +vinay.sajip title: handler not properly initialized -> distutils2: logging handler not properly initialized versions: +3rd party -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:58:37 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Mar 2012 22:58:37 +0000 Subject: [issue14104] Implement time.monotonic() on Mac OS X In-Reply-To: <1330038555.4.0.559569598295.issue14104@psf.upfronthosting.co.za> Message-ID: <1331593117.66.0.274871237218.issue14104@psf.upfronthosting.co.za> STINNER Victor added the comment: > timebase.numer and timebase.denom are always 1 in practice In this case, you will not lose precision and it's safe to cast to double to multiply and divide ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 12 23:58:50 2012 From: report at bugs.python.org (Sean Reifschneider) Date: Mon, 12 Mar 2012 22:58:50 +0000 Subject: [issue14259] re.finditer() doesn't accept keyword arguments In-Reply-To: <1331529776.72.0.83899551616.issue14259@psf.upfronthosting.co.za> Message-ID: <1331593130.09.0.460442738932.issue14259@psf.upfronthosting.co.za> Sean Reifschneider added the comment: Working on this. ---------- nosy: +jafo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:02:00 2012 From: report at bugs.python.org (Ned Deily) Date: Mon, 12 Mar 2012 23:02:00 +0000 Subject: [issue14104] Implement time.monotonic() on Mac OS X In-Reply-To: <1330038555.4.0.559569598295.issue14104@psf.upfronthosting.co.za> Message-ID: <1331593320.76.0.69580328326.issue14104@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:04:24 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 23:04:24 +0000 Subject: [issue14274] pysetup does not look at requires.txt Message-ID: <1331593464.56.0.104629100703.issue14274@psf.upfronthosting.co.za> New submission from Tarek Ziad? : the installer needs to read requires.txt to build the deps list as well ---------- assignee: eric.araujo components: Distutils2 messages: 155513 nosy: alexis, eric.araujo, tarek priority: normal severity: normal status: open title: pysetup does not look at requires.txt type: behavior versions: 3rd party, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:04:42 2012 From: report at bugs.python.org (=?utf-8?q?Tarek_Ziad=C3=A9?=) Date: Mon, 12 Mar 2012 23:04:42 +0000 Subject: [issue14274] pysetup does not look at requires.txt In-Reply-To: <1331593464.56.0.104629100703.issue14274@psf.upfronthosting.co.za> Message-ID: <1331593482.85.0.823348489389.issue14274@psf.upfronthosting.co.za> Changes by Tarek Ziad? : ---------- assignee: eric.araujo -> alexis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:11:58 2012 From: report at bugs.python.org (Jan-Jaap Driessen) Date: Mon, 12 Mar 2012 23:11:58 +0000 Subject: [issue14275] pysetup create doesn't handle install requirements Message-ID: <1331593918.19.0.128575459883.issue14275@psf.upfronthosting.co.za> New submission from Jan-Jaap Driessen : Distutils2 pysetup can take an existing setuptools based project and convert it into the distutils2 setup.cfg syntax using `pysetup create`. The install requirements are not converted: {{{ svn co svn+ssh://svn.zope.org/repos/main/zope.dublincore/trunk pysetup create }}} The original dependencies in 'install_requires' in setup.py are not found in the resulting setup.cfg. ---------- assignee: eric.araujo components: Distutils2 messages: 155514 nosy: alexis, eric.araujo, j1m, janjaapdriessen, tarek priority: normal severity: normal status: open title: pysetup create doesn't handle install requirements type: behavior versions: Python 2.6, Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:17:04 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 12 Mar 2012 23:17:04 +0000 Subject: [issue14259] re.finditer() doesn't accept keyword arguments In-Reply-To: <1331529776.72.0.83899551616.issue14259@psf.upfronthosting.co.za> Message-ID: <1331594224.92.0.278851531348.issue14259@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo versions: +Python 3.3 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:18:03 2012 From: report at bugs.python.org (Nicholas Riley) Date: Mon, 12 Mar 2012 23:18:03 +0000 Subject: [issue14104] Implement time.monotonic() on Mac OS X In-Reply-To: <1330038555.4.0.559569598295.issue14104@psf.upfronthosting.co.za> Message-ID: <1331594283.8.0.0804147348139.issue14104@psf.upfronthosting.co.za> Nicholas Riley added the comment: OK, you have a point :-) New patch attached. ---------- Added file: http://bugs.python.org/file24804/monotonic-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:22:28 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 12 Mar 2012 23:22:28 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331594548.77.0.846970895786.issue14234@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Oddly, test_sax fails once this patch is applied (using 3.1). debugging now. test_sax test test_sax failed -- Traceback (most recent call last): File "/home/greg/sandbox/python/cpython/3.1/Lib/xml/sax/expatreader.py", line 207, in feed self._parser.Parse(data, isFinal) xml.parsers.expat.ExpatError: unbound prefix: line 1, column 59 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/greg/sandbox/python/cpython/3.1/Lib/test/test_sax.py", line 310, in test_5027_1 parser.parse(test_xml) File "/home/greg/sandbox/python/cpython/3.1/Lib/xml/sax/expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "/home/greg/sandbox/python/cpython/3.1/Lib/xml/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/home/greg/sandbox/python/cpython/3.1/Lib/xml/sax/expatreader.py", line 211, in feed self._err_handler.fatalError(exc) File "/home/greg/sandbox/python/cpython/3.1/Lib/xml/sax/handler.py", line 38, in fatalError raise exception xml.sax._exceptions.SAXParseException: :1:59: unbound prefix ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:22:50 2012 From: report at bugs.python.org (Jan-Jaap Driessen) Date: Mon, 12 Mar 2012 23:22:50 +0000 Subject: [issue14276] install latest version of a package Message-ID: <1331594570.15.0.87827411475.issue14276@psf.upfronthosting.co.za> New submission from Jan-Jaap Driessen : I would like to install the latest version of a package. The pysetup command does not give me easy access to do this. Can we add an 'upgrade' method? ---------- assignee: eric.araujo components: Distutils2 messages: 155517 nosy: alexis, eric.araujo, janjaapdriessen, tarek priority: normal severity: normal status: open title: install latest version of a package versions: Python 2.6, Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:24:44 2012 From: report at bugs.python.org (Nicholas Riley) Date: Mon, 12 Mar 2012 23:24:44 +0000 Subject: [issue14277] time.monotonic docstring does not mention the time unit returned Message-ID: <1331594684.47.0.548556595506.issue14277@psf.upfronthosting.co.za> New submission from Nicholas Riley : Currently: >>> help(time.monotonic) Help on built-in function monotonic in module time: monotonic(...) monotonic() -> float Monotonic clock. The reference point of the returned value is undefined so only the difference of consecutive calls is valid. ---------- components: Library (Lib) messages: 155518 nosy: nriley priority: normal severity: normal status: open title: time.monotonic docstring does not mention the time unit returned versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:25:58 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Mar 2012 23:25:58 +0000 Subject: [issue14179] Test coverage for lib/re.py In-Reply-To: <1330711634.92.0.5841595214.issue14179@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset cc48eef234dd by Ezio Melotti in branch '2.7': #14179: add tests for re.compile. Patch by Florian Mladitsch. http://hg.python.org/cpython/rev/cc48eef234dd ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:27:09 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Mar 2012 23:27:09 +0000 Subject: [issue14104] Implement time.monotonic() on Mac OS X In-Reply-To: <1330038555.4.0.559569598295.issue14104@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 3c875719e46d by Victor Stinner in branch 'default': Issue #14104: Implement time.monotonic() on Mac OS X, http://hg.python.org/cpython/rev/3c875719e46d ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:27:28 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Mar 2012 23:27:28 +0000 Subject: [issue14104] Implement time.monotonic() on Mac OS X In-Reply-To: <1330038555.4.0.559569598295.issue14104@psf.upfronthosting.co.za> Message-ID: <1331594848.95.0.515414839673.issue14104@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:29:15 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Mar 2012 23:29:15 +0000 Subject: [issue14104] Implement time.monotonic() on Mac OS X In-Reply-To: <1330038555.4.0.559569598295.issue14104@psf.upfronthosting.co.za> Message-ID: <1331594955.18.0.487308394014.issue14104@psf.upfronthosting.co.za> STINNER Victor added the comment: Path commited, thanks for the patch Nicholas! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:30:14 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 12 Mar 2012 23:30:14 +0000 Subject: [issue14276] installing latest version of a project In-Reply-To: <1331594570.15.0.87827411475.issue14276@psf.upfronthosting.co.za> Message-ID: <1331595014.16.0.756197279838.issue14276@psf.upfronthosting.co.za> ?ric Araujo added the comment: When you install a project for the first time and you don?t specify a version number, i.e. pysetup install spam, the latest version (or the latest final version (non-alpha/beta/rc), Alexis knows better) should be installed. This could be added to the docs. If you later run ?pysetup install "spam (X.Y)"? where X.Y is a higher version than what?s installed, then the project should be upgraded, unless it breaks other project?s dependencies (i.e. ham depends on spam < X.Y). There aren?t probably any tests for this. If you have a version of spam installed and want to upgrade to the latest version that still satisfies other installed projects? dependencies, without having to give a version number, (your request IIUC), then you could use a trick like ?pysetup install "spam (< 99.99)"? (untested). However, I agree that ?pysetup install --upgrade spam? is a better UI: it?s less kludgy and already familiar to pip and easy_install users. ---------- stage: -> needs patch title: install latest version of a package -> installing latest version of a project versions: +3rd party -Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:33:52 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Mar 2012 23:33:52 +0000 Subject: [issue14179] Test coverage for lib/re.py In-Reply-To: <1330711634.92.0.5841595214.issue14179@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset fafe12f2a030 by Ezio Melotti in branch '3.2': #14179: add tests for re.compile. Patch by Florian Mladitsch. http://hg.python.org/cpython/rev/fafe12f2a030 New changeset 4a5eafcdde11 by Ezio Melotti in branch 'default': #14179: merge with 3.2. http://hg.python.org/cpython/rev/4a5eafcdde11 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:35:03 2012 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 12 Mar 2012 23:35:03 +0000 Subject: [issue14179] Test coverage for lib/re.py In-Reply-To: <1330711634.92.0.5841595214.issue14179@psf.upfronthosting.co.za> Message-ID: <1331595303.95.0.795827542933.issue14179@psf.upfronthosting.co.za> Ezio Melotti added the comment: Fixed, thanks for the patch! ---------- assignee: -> ezio.melotti resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:36:20 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Mar 2012 23:36:20 +0000 Subject: [issue14277] time.monotonic docstring does not mention the time unit returned In-Reply-To: <1331594684.47.0.548556595506.issue14277@psf.upfronthosting.co.za> Message-ID: <1331595380.72.0.717986946814.issue14277@psf.upfronthosting.co.za> STINNER Victor added the comment: time.monotonic() has 3 implementations: * Windows: QueryPerformanceCounter() with QueryPerformanceFrequency() * Mac OS X: mach_absolute_time() with mach_timebase_info() * UNIX: clock_gettime(CLOCK_MONOTONIC_RAW) or clock_gettime(CLOCK_MONOTONIC) QueryPerformanceFrequency() returns the frequency "in counts per second" according to the doc. http://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx mach_absolute_time() with mach_timebase_info() returns a number of seconds, but Python uses *1e-9. clock_gettime() uses a timespec structure and Python uses *1e-9. It looks like to mention that time.monotonic() unit is seconds. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:46:43 2012 From: report at bugs.python.org (Sean Reifschneider) Date: Mon, 12 Mar 2012 23:46:43 +0000 Subject: [issue14259] re.finditer() doesn't accept keyword arguments In-Reply-To: <1331529776.72.0.83899551616.issue14259@psf.upfronthosting.co.za> Message-ID: <1331596003.65.0.0946050035302.issue14259@psf.upfronthosting.co.za> Sean Reifschneider added the comment: Attached is a patch which implements this, including updated tests. I would appreciate a review of this patch. ---------- assignee: -> ezio.melotti keywords: +needs review, patch stage: -> patch review Added file: http://bugs.python.org/file24805/cpython-re-finditer-kwargs.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:51:18 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Mar 2012 23:51:18 +0000 Subject: [issue13703] Hash collision security issue In-Reply-To: <1325619410.45.0.862265945379.issue13703@psf.upfronthosting.co.za> Message-ID: <1331596278.12.0.179728819042.issue13703@psf.upfronthosting.co.za> STINNER Victor added the comment: > FWIW I upgraded to ubuntu pangolin beta over the weekend, > which includes 2.7.3rc1, ... > > File "/usr/lib/python2.7/random.py", line 47, in > from os import urandom as _urandom > ImportError: cannot import name urandom It looks like you are using random.py of Python 2.7.3 with the Python program 2.7.2, because os.urandom() is now always available in Python 2.7.3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:53:44 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 12 Mar 2012 23:53:44 +0000 Subject: [issue1178863] Variable.__init__ uses self.set(), blocking specialization Message-ID: <1331596424.05.0.9708456312.issue1178863@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- keywords: +patch versions: +Python 3.3 -Python 3.2 Added file: http://bugs.python.org/file24806/tk.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 00:54:04 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Mon, 12 Mar 2012 23:54:04 +0000 Subject: [issue1178863] Variable.__init__ uses self.set(), blocking specialization Message-ID: <1331596444.01.0.613930739379.issue1178863@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:03:03 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 00:03:03 +0000 Subject: [issue14270] Can't install a project in a specific directory In-Reply-To: <1331590705.94.0.0465168087698.issue14270@psf.upfronthosting.co.za> Message-ID: <1331596983.85.0.433143424886.issue14270@psf.upfronthosting.co.za> ?ric Araujo added the comment: Mathieu is working on a patch. ---------- stage: -> test needed title: Can't install a package in a specific directory -> Can't install a project in a specific directory versions: +3rd party -Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:04:10 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 00:04:10 +0000 Subject: [issue14238] python shouldn't need username in passwd database In-Reply-To: <1331284920.1.0.720164223022.issue14238@psf.upfronthosting.co.za> Message-ID: <1331597050.72.0.237636404622.issue14238@psf.upfronthosting.co.za> ?ric Araujo added the comment: Indeed. ---------- resolution: -> duplicate stage: needs patch -> committed/rejected status: open -> closed superseder: -> "import site failed" when Python can't find home directory (sysconfig._getuserbase) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:06:16 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 00:06:16 +0000 Subject: [issue10496] Python startup should not require passwd entry In-Reply-To: <1290398281.89.0.568058332092.issue10496@psf.upfronthosting.co.za> Message-ID: <1331597176.35.0.00613504339359.issue10496@psf.upfronthosting.co.za> ?ric Araujo added the comment: Adding people from the duplicate report #14238. Georg said: > there should be a guard here that just doesn't add user site directories if the lookup fails. I concurred and added: > we also need to fix sysconfig; I think the right thing to do would be not to have a config var > named 'userbase' when run from a UID without passwd entry. This implies that the functions > listed under http://docs.python.org/library/sysconfig#installation-paths would also need to omit > *user schemes. ---------- assignee: tarek -> eric.araujo nosy: +aikinci, arekm, georg.brandl, loewis, nadeem.vawda title: "import site failed" when Python can't find home directory (sysconfig._getuserbase) -> Python startup should not require passwd entry versions: -Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:07:41 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Mar 2012 00:07:41 +0000 Subject: [issue14238] python shouldn't need username in passwd database In-Reply-To: <1331284920.1.0.720164223022.issue14238@psf.upfronthosting.co.za> Message-ID: <1331597261.38.0.448406359092.issue14238@psf.upfronthosting.co.za> STINNER Victor added the comment: > This patch fixes the issue but needs review. > It is my first patch ever so be nice :) Python should not decide what is the default home directory. The issue is in the site module: I proposed nonexistent_user.patch in the issue #10496 to fix the issue in the site module instead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:10:06 2012 From: report at bugs.python.org (Tatiana Al-Chueyr) Date: Tue, 13 Mar 2012 00:10:06 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1331597406.07.0.33793421598.issue5758@psf.upfronthosting.co.za> Tatiana Al-Chueyr added the comment: I had a lot of help of R. David Murray, could someone review our patch, please? We are specially concerned about backward compatibility. ---------- keywords: +patch Added file: http://bugs.python.org/file24807/issue5758_fileinput_gzip_with_encoding.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:11:31 2012 From: report at bugs.python.org (Ezio Melotti) Date: Tue, 13 Mar 2012 00:11:31 +0000 Subject: [issue14251] HTMLParser decode issue In-Reply-To: <1331432595.42.0.705024671549.issue14251@psf.upfronthosting.co.za> Message-ID: <1331597491.43.0.934801601049.issue14251@psf.upfronthosting.co.za> Ezio Melotti added the comment: I test this again and indeed a bare s.decode() is not enough to fix the problem. The attribute might contain non-ascii characters, and that will result in an error (see for example the "test.py" script attached to #3932). The correct solution is to decode the page before passing it to the parser. ---------- resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> HTMLParser cannot handle '&' and non-ascii characters in attribute names versions: -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:12:29 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 00:12:29 +0000 Subject: [issue10496] Python startup should not require passwd entry In-Reply-To: <1290398281.89.0.568058332092.issue10496@psf.upfronthosting.co.za> Message-ID: <1331597549.16.0.261962120713.issue10496@psf.upfronthosting.co.za> ?ric Araujo added the comment: I reviewed haypo?s patch. I?d be happy to update it to address my remarks if you want me to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:14:01 2012 From: report at bugs.python.org (Brian Jones) Date: Tue, 13 Mar 2012 00:14:01 +0000 Subject: [issue14278] email.utils.localtime throws exception if time.daylight is False Message-ID: <1331597641.5.0.510268852561.issue14278@psf.upfronthosting.co.za> New submission from Brian Jones : In email.utils.localtime, there's a variable 'offset' that will only exist if time.daylight evaluates to True. If time.daylight evaluates to False, you'll get an UnboundLocalError, because 'offset' is being referenced without being assigned. The attached patch fixes that issue, adds several tests, and also refactors an existing test containing 4-5 assertions into a test for each assertion. ---------- components: Library (Lib) files: localtime_fix.patch keywords: patch messages: 155535 nosy: Brian.Jones priority: normal severity: normal status: open title: email.utils.localtime throws exception if time.daylight is False versions: Python 3.3 Added file: http://bugs.python.org/file24808/localtime_fix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:22:55 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 00:22:55 +0000 Subject: [issue14259] re.finditer() doesn't accept keyword arguments In-Reply-To: <1331529776.72.0.83899551616.issue14259@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 1adb114343f9 by Sean Reifschneider in branch 'default': closes #14259 re.finditer() now takes keyword arguments: pos, endpos. http://hg.python.org/cpython/rev/1adb114343f9 ---------- nosy: +python-dev resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:29:48 2012 From: report at bugs.python.org (Jim Fulton) Date: Tue, 13 Mar 2012 00:29:48 +0000 Subject: [issue14279] simple indexes (in wrappers) should support flat directories of distributions Message-ID: <1331598588.13.0.0229993351988.issue14279@psf.upfronthosting.co.za> New submission from Jim Fulton : Currently, distutils2.pypi.wrapper has a notion of a simple index, which has subdirectories for each project as pypi/simple does. This is good. It should also support flat indexes ala a directory of files. ---------- assignee: eric.araujo components: Distutils2 messages: 155537 nosy: alexis, eric.araujo, j1m, tarek priority: normal severity: normal status: open title: simple indexes (in wrappers) should support flat directories of distributions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:30:36 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 00:30:36 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1331598636.18.0.555026858207.issue5758@psf.upfronthosting.co.za> ?ric Araujo added the comment: Thanks for the patch. I commented on not-so-important things on the code review site (which should have sent an email to Tatiana) and wanted to raise an issue here. Is it best that the encoding used defaults to Python?s default encoding (UTF-8) or the I/O default encoding (depends on the OS and locale), like what open does? ---------- nosy: +eric.araujo, haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:31:10 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 00:31:10 +0000 Subject: [issue14279] packaging.pypi should support flat directories of distributions In-Reply-To: <1331598588.13.0.0229993351988.issue14279@psf.upfronthosting.co.za> Message-ID: <1331598670.82.0.930272700704.issue14279@psf.upfronthosting.co.za> ?ric Araujo added the comment: +1 ---------- stage: -> needs patch title: simple indexes (in wrappers) should support flat directories of distributions -> packaging.pypi should support flat directories of distributions versions: +3rd party, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:34:21 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Mar 2012 00:34:21 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1331598861.05.0.31061450079.issue5758@psf.upfronthosting.co.za> R. David Murray added the comment: I think it should use the same default as open, but frankly I couldn't remember the right way to achieve that. Suggestions welcome :) ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:38:48 2012 From: report at bugs.python.org (Nicholas Riley) Date: Tue, 13 Mar 2012 00:38:48 +0000 Subject: [issue14277] time.monotonic docstring does not mention the time unit returned In-Reply-To: <1331594684.47.0.548556595506.issue14277@psf.upfronthosting.co.za> Message-ID: <1331599128.0.0.616247297906.issue14277@psf.upfronthosting.co.za> Nicholas Riley added the comment: According to http://juliusdavies.ca/posix_clocks/clock_realtime_linux_faq.html, CLOCK_REALTIME can go backwards. CLOCK_MONOTONIC_RAW is best where available (like QueryPerformanceFrequency / mach_absolute_time) and CLOCK_MONOTONIC is pretty good. So I have updated both the docs for time.monotonic and time.wallclock to hopefully better explain things... may need to be another issue here too. ---------- keywords: +patch Added file: http://bugs.python.org/file24809/monotonic-doc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:40:35 2012 From: report at bugs.python.org (Jim Fulton) Date: Tue, 13 Mar 2012 00:40:35 +0000 Subject: [issue14280] simple indexes (in wrappers) should not require md5 hashes Message-ID: <1331599235.17.0.307385355427.issue14280@psf.upfronthosting.co.za> New submission from Jim Fulton : Requiring md5s makes it hard to implement simple indexes with simple web servers, where simple indexes include flat directories of distributions. ---------- assignee: eric.araujo components: Distutils2 messages: 155542 nosy: alexis, eric.araujo, j1m, tarek priority: normal severity: normal status: open title: simple indexes (in wrappers) should not require md5 hashes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:40:43 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 00:40:43 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1331599243.58.0.349501803676.issue5758@psf.upfronthosting.co.za> ?ric Araujo added the comment: We can use locale.getpreferredencoding, or be smarter and just pass down encoding=encoding to TextIOWrapper and let *it* call getpreferredencoding if it?s given a None :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:42:21 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 00:42:21 +0000 Subject: [issue14280] packaging.pypi should not require checksums In-Reply-To: <1331599235.17.0.307385355427.issue14280@psf.upfronthosting.co.za> Message-ID: <1331599341.08.0.848326159697.issue14280@psf.upfronthosting.co.za> ?ric Araujo added the comment: I?m not sure that this report should not be merged with #14279, but Alexis will judge that. ---------- assignee: eric.araujo -> alexis title: simple indexes (in wrappers) should not require md5 hashes -> packaging.pypi should not require checksums versions: +3rd party, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:47:48 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 00:47:48 +0000 Subject: [issue1178863] Variable.__init__ uses self.set(), blocking specialization Message-ID: Roundup Robot added the comment: New changeset 79bb99ec2464 by Martin v. L?wis in branch 'default': Issue #1178863: Separate initialisation from setting when initializing http://hg.python.org/cpython/rev/79bb99ec2464 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:52:19 2012 From: report at bugs.python.org (Matthew Barnett) Date: Tue, 13 Mar 2012 00:52:19 +0000 Subject: [issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it In-Reply-To: <1331530103.22.0.0779581075646.issue14260@psf.upfronthosting.co.za> Message-ID: <1331599939.15.0.701252208172.issue14260@psf.upfronthosting.co.za> Matthew Barnett added the comment: It appears I was wrong. :-( The simplest solution in that case is for it to return a _copy_ of the dict. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:57:29 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 13 Mar 2012 00:57:29 +0000 Subject: [issue2843] New methods for existing Tkinter widgets In-Reply-To: <1210648562.38.0.607141778412.issue2843@psf.upfronthosting.co.za> Message-ID: <1331600249.24.0.837539704049.issue2843@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov versions: +Python 3.3 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 01:59:41 2012 From: report at bugs.python.org (Michael Foord) Date: Tue, 13 Mar 2012 00:59:41 +0000 Subject: [issue10543] Test discovery (unittest) does not work with jython In-Reply-To: <1290790738.08.0.631602172773.issue10543@psf.upfronthosting.co.za> Message-ID: <1331600381.25.0.0436738277487.issue10543@psf.upfronthosting.co.za> Michael Foord added the comment: Fixed in 2.7. Worth fixing in Python 3.2 / 3.2 anyway as sourceless distributions (bytecode only) are still possible. ---------- versions: +Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 02:03:13 2012 From: report at bugs.python.org (Tatiana Al-Chueyr) Date: Tue, 13 Mar 2012 01:03:13 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1331600593.72.0.318425428513.issue5758@psf.upfronthosting.co.za> Tatiana Al-Chueyr added the comment: Excellent! Thanks for all remarks, ?ric! I'll follow your suggestions and will submit a new patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 02:06:24 2012 From: report at bugs.python.org (Ned Deily) Date: Tue, 13 Mar 2012 01:06:24 +0000 Subject: [issue14184] test_recursion_limit fails on OS X when compiled with clang In-Reply-To: <1330799175.64.0.584066086457.issue14184@psf.upfronthosting.co.za> Message-ID: <1331600784.43.0.00933437120642.issue14184@psf.upfronthosting.co.za> Ned Deily added the comment: It looks like the increase isn't quite big enough for the clang in Xcode 4.2. Revised patch uses a slightly bigger size. ---------- Added file: http://bugs.python.org/file24810/issue14184_rev1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 02:15:58 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 01:15:58 +0000 Subject: [issue14002] AttributeError in distutils2.pypi.wrapper In-Reply-To: <1329147128.07.0.548553326464.issue14002@psf.upfronthosting.co.za> Message-ID: <1331601358.95.0.594505967073.issue14002@psf.upfronthosting.co.za> ?ric Araujo added the comment: [Paul] > To what? The individual packages? No, I meant distutils2 bugs. I will open them when I get a minute. You?re right that projects using metadata 1.0 or 1.1 don?t have to use a version conforming to PEP 386, and that packaging should warn when using the create and install actions and the check command, not when iterating over installed distributions. [Tetsuya Morimoto] > I made a patch which checks the "func_name" attribute of function before it refers. It > works for me. However, I wonder if a function has both "func.im_self" and > "func.func_name"? Tell me the background because I'm newbie for distutils2. It?s not really a distutils2 detail but a general Python thing: functions and methods have these func_name (or __name__ in Python 3) attributes, and the somewhat complicated code in distutils2.pypi uses them to do its thing. Alexis intends to clean up that code a bit and we?ll also need more tests. If you?re new to distutils2, I think this bug is not easy or fun enough and you would have more luck working on another one. ---------- assignee: eric.araujo -> alexis title: distutils2 fails to install a package from PyPI on Python 2.7.2 -> AttributeError in distutils2.pypi.wrapper _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 02:17:15 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 01:17:15 +0000 Subject: [issue8942] __path__ attribute of modules loaded by zipimporter is untested In-Reply-To: <1276013732.57.0.515191754786.issue8942@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 7e576ad85663 by R David Murray in branch 'default': #8942: add test for __path__ contents in zipimport tests http://hg.python.org/cpython/rev/7e576ad85663 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 02:20:25 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Mar 2012 01:20:25 +0000 Subject: [issue8942] __path__ attribute of modules loaded by zipimporter is untested In-Reply-To: <1276013732.57.0.515191754786.issue8942@psf.upfronthosting.co.za> Message-ID: <1331601625.1.0.409886378805.issue8942@psf.upfronthosting.co.za> R. David Murray added the comment: I committed Tatiana's patch because it looks reasonable to me, but I'm not familiar enough with zipimport to know if additional tests are needed. If you think there are additional tests that should be added, please reopen the issue. ---------- nosy: +r.david.murray resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed type: -> enhancement versions: -Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 02:20:53 2012 From: report at bugs.python.org (Tetsuya Morimoto) Date: Tue, 13 Mar 2012 01:20:53 +0000 Subject: [issue14002] AttributeError in distutils2.pypi.wrapper In-Reply-To: <1329147128.07.0.548553326464.issue14002@psf.upfronthosting.co.za> Message-ID: <1331601653.94.0.359469224307.issue14002@psf.upfronthosting.co.za> Changes by Tetsuya Morimoto : Removed file: http://bugs.python.org/file24801/distutils2_pypi_wrapper.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 02:26:26 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Mar 2012 01:26:26 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1331601986.04.0.375530322243.issue5758@psf.upfronthosting.co.za> R. David Murray added the comment: Duh. I should have remembered that the io module used None to represent the default encoding. Thanks, ?ric. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 02:27:18 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 01:27:18 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1331602038.17.0.415302468798.issue5758@psf.upfronthosting.co.za> ?ric Araujo added the comment: Nobody can remember everything: I tried in a shell and looked at the docs to find it :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 02:43:43 2012 From: report at bugs.python.org (Brett Cannon) Date: Tue, 13 Mar 2012 01:43:43 +0000 Subject: [issue13959] Re-implement parts of imp in pure Python In-Reply-To: <1328575890.24.0.0737633689073.issue13959@psf.upfronthosting.co.za> Message-ID: <1331603023.21.0.52300072837.issue13959@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 02:46:09 2012 From: report at bugs.python.org (Sean Reifschneider) Date: Tue, 13 Mar 2012 01:46:09 +0000 Subject: [issue1531415] parsetok.c emits warnings by writing to stderr Message-ID: <1331603169.73.0.177520567611.issue1531415@psf.upfronthosting.co.za> Sean Reifschneider added the comment: Michele: Do you know what needs to be done to determine the resolution to the _warnings/pgen question? If not, maybe asking the question on python-dev could get some advice. ---------- nosy: +jafo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 03:04:01 2012 From: report at bugs.python.org (Sean Reifschneider) Date: Tue, 13 Mar 2012 02:04:01 +0000 Subject: [issue10037] multiprocessing.pool processes started by worker handler stops working In-Reply-To: <1286364358.68.0.746245038707.issue10037@psf.upfronthosting.co.za> Message-ID: <1331604241.8.0.875407879799.issue10037@psf.upfronthosting.co.za> Sean Reifschneider added the comment: The attached patch does change the semantics somewhat, but I don't fully understand how much. In particular: It changes the "get()" call to be turned into "get(timeout=1.0)" if inqueue doesn't have a _reader attribute. In the case that inqueue doesn't have a _reader attribute, and "inqueue._reader.poll(timeout)" is false, "get()" isn't called at all. It introduces a continue. I'd want Jesse to pronounce on this. ---------- assignee: -> jnoller nosy: +jafo, jnoller _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 03:06:54 2012 From: report at bugs.python.org (Sean Reifschneider) Date: Tue, 13 Mar 2012 02:06:54 +0000 Subject: [issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express In-Reply-To: <1260858478.84.0.495655867168.issue7511@psf.upfronthosting.co.za> Message-ID: <1331604414.98.0.596791809735.issue7511@psf.upfronthosting.co.za> Sean Reifschneider added the comment: Martin: They are looking for you to review this, in particular see: http://bugs.python.org/issue7511#msg106420 ---------- assignee: tarek -> loewis nosy: +jafo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 03:17:02 2012 From: report at bugs.python.org (py.user) Date: Tue, 13 Mar 2012 02:17:02 +0000 Subject: [issue14250] for string patterns regex.flags is never equal to 0 In-Reply-To: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> Message-ID: <1331605022.03.0.45101634433.issue14250@psf.upfronthosting.co.za> py.user added the comment: >>> import re >>> p = re.compile(br'') >>> p.flags 0 >>> ---------- title: regex.flags is never equal to 0 -> for string patterns regex.flags is never equal to 0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 03:20:37 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Mar 2012 02:20:37 +0000 Subject: [issue14250] for string patterns regex.flags is never equal to 0 In-Reply-To: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> Message-ID: <1331605237.09.0.843095687115.issue14250@psf.upfronthosting.co.za> R. David Murray added the comment: Heh. Good point. Documenting this is a clear way may be non-trivial. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 03:30:15 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 02:30:15 +0000 Subject: [issue8070] Infinite loop in PyRun_InteractiveLoopFlags() if PyRun_InteractiveOneFlags() raises an error In-Reply-To: <1267793425.09.0.566406511799.issue8070@psf.upfronthosting.co.za> Message-ID: <1331605815.49.0.326178307432.issue8070@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- versions: +Python 3.3 -Python 2.6, Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 03:32:01 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 02:32:01 +0000 Subject: [issue14262] Allow using decimals as arguments to `timedelta` In-Reply-To: <1331557988.1.0.944940856764.issue14262@psf.upfronthosting.co.za> Message-ID: <1331605921.9.0.533748408135.issue14262@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +belopolsky, facundobatista, haypo, mark.dickinson, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 03:34:27 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 02:34:27 +0000 Subject: [issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it In-Reply-To: <1331530103.22.0.0779581075646.issue14260@psf.upfronthosting.co.za> Message-ID: <1331606067.92.0.24254938196.issue14260@psf.upfronthosting.co.za> ?ric Araujo added the comment: But regex.sub is affected only if you manually muck with the dict, right? If so, then it looks like a case of ?it hurts when I do this? (the doctor?s reply: ?Don?t do this.?) ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 03:36:54 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 02:36:54 +0000 Subject: [issue14255] tempfile.gettempdir() didn't return the path with correct case. In-Reply-To: <1331514762.82.0.635964063955.issue14255@psf.upfronthosting.co.za> Message-ID: <1331606214.88.0.945374337197.issue14255@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +brian.curtin, georg.brandl, ncoghlan, tim.golden stage: -> test needed type: -> behavior versions: -Python 2.6, Python 3.1, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 03:55:45 2012 From: report at bugs.python.org (Eli Bendersky) Date: Tue, 13 Mar 2012 02:55:45 +0000 Subject: [issue14250] for string patterns regex.flags is never equal to 0 In-Reply-To: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> Message-ID: <1331607345.06.0.505319754778.issue14250@psf.upfronthosting.co.za> Eli Bendersky added the comment: Issue #13358 may be related ---------- nosy: +eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 04:03:21 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Mar 2012 03:03:21 +0000 Subject: [issue14250] for string patterns regex.flags is never equal to 0 In-Reply-To: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> Message-ID: <1331607801.3.0.880147405573.issue14250@psf.upfronthosting.co.za> R. David Murray added the comment: It doesn't look like it. Is that the right issue number? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 04:05:10 2012 From: report at bugs.python.org (Brian Landers) Date: Tue, 13 Mar 2012 03:05:10 +0000 Subject: [issue14281] Add unit test for cgi.escape method Message-ID: <1331607910.6.0.875213556559.issue14281@psf.upfronthosting.co.za> New submission from Brian Landers : The cgi.escape method is deprecated, but it should still have test coverage. This patch adds a test for it. ---------- components: Tests files: cgi_test_escape.patch keywords: patch messages: 155563 nosy: packetslave priority: normal severity: normal status: open title: Add unit test for cgi.escape method type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24811/cgi_test_escape.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 04:18:41 2012 From: report at bugs.python.org (Eli Bendersky) Date: Tue, 13 Mar 2012 03:18:41 +0000 Subject: [issue14250] for string patterns regex.flags is never equal to 0 In-Reply-To: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> Message-ID: <1331608721.65.0.94981583055.issue14250@psf.upfronthosting.co.za> Eli Bendersky added the comment: Oh, sorry I meant http://bugs.python.org/issue13385 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 04:26:27 2012 From: report at bugs.python.org (Dan Boswell) Date: Tue, 13 Mar 2012 03:26:27 +0000 Subject: [issue8739] Update to smtpd.py to RFC 5321 In-Reply-To: <1274103249.44.0.284620021799.issue8739@psf.upfronthosting.co.za> Message-ID: <1331609187.45.0.633066713962.issue8739@psf.upfronthosting.co.za> Dan Boswell added the comment: I built on Michele's patch during the pycon sprint, addressing some of the concerns rightly raised in previous comment: 1. Turn off the SIZE extension if client uses HELO (though limits are still used internally to limit message size for DoS protection), and report syntax of MAIL/RCPT correctly depending on whether HELO is issued. 2. Extend max command size by 26 chars when SIZE extension is enabled, as required by RFC 1870. 3. First cut at adding parameters to RCPT command for SMTP extensions as required by RFC 1869/5321. 4. Return 555 for MAIL/RCPT parameters that are valid but not implemented. and some other issues: 1. Fix typo 'maximium' -> 'maximum' 2. Add test to show failure to parse localpart of email address (left as expected failure as a correct parse will require version 6 of the email package). 3. Fix up command line arg for specifying SIZE extension. Still some issues to resolve, I already came up with a couple in testing, and some of the (new) code can be cleaned up. So far this server implements the SIZE and 8BITMIME extensions in a tightly-coupled manner, and does not make it easy for subclasses to implement additional smtp extensions. Ideally we would make SMTPChannel extensible in this way but that may require extensive refactoring and would be better raised and addressed as another issue. ---------- nosy: +fruitnuke Added file: http://bugs.python.org/file24812/issue8739.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 05:23:45 2012 From: report at bugs.python.org (python272) Date: Tue, 13 Mar 2012 04:23:45 +0000 Subject: [issue12640] test_ctypes seg fault (test_callback_register_double); armv7; gcc 4.5.1 In-Reply-To: <1311637071.74.0.758300374846.issue12640@psf.upfronthosting.co.za> Message-ID: <1331612625.75.0.364450758314.issue12640@psf.upfronthosting.co.za> python272 added the comment: test_ctypes is successful in 2.7.3rc1, armv7l (using --with-system-ffi (3.0.10); i haven't tested w/out that config option) note: Python-2.7.3rc1/Modules/_ctypes/libffi/configure contains this line: VERSION='3.0.10rc0' (2.7.2 has the same line) but upstream libffi 3.0.10 (not rc) has been released for awhile now ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 05:32:35 2012 From: report at bugs.python.org (Eli Bendersky) Date: Tue, 13 Mar 2012 04:32:35 +0000 Subject: [issue14246] Accelerated ETree XMLParser cannot handle io.StringIO In-Reply-To: <1331377442.17.0.542633134085.issue14246@psf.upfronthosting.co.za> Message-ID: <1331613155.85.0.0180803077913.issue14246@psf.upfronthosting.co.za> Eli Bendersky added the comment: Attaching a patch that fixes the problem and adds a test. xmlparser_parse from _elementtree will now be able to handle Unicode, encoding it to bytes with UTF-8, parallel to the way it's done in pyexpat. I would appreciate a review for the patch. ---------- keywords: +patch nosy: +effbot, flox, scoder stage: needs patch -> patch review Added file: http://bugs.python.org/file24813/issue14246.1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 05:34:30 2012 From: report at bugs.python.org (Sean Reifschneider) Date: Tue, 13 Mar 2012 04:34:30 +0000 Subject: [issue8954] wininst regression: errors when building on linux In-Reply-To: <1276093244.44.0.895217979727.issue8954@psf.upfronthosting.co.za> Message-ID: <1331613270.54.0.0104942297109.issue8954@psf.upfronthosting.co.za> Sean Reifschneider added the comment: ?ric: In http://bugs.python.org/issue8954#msg135902 are you saying: This issue needs to be re-targeted to a newer Python. Close -- won't fix. Something else? This issue seems to be stuck here, any ideas on what needs to be done to move this forward? ---------- nosy: +jafo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 05:58:03 2012 From: report at bugs.python.org (Luke Macken) Date: Tue, 13 Mar 2012 04:58:03 +0000 Subject: [issue14282] lib2to3.fixer_util.touch_import('__future__', ...) can lead to SyntaxError in code Message-ID: <1331614683.04.0.297382545344.issue14282@psf.upfronthosting.co.za> New submission from Luke Macken : Problem: lib2to3.fixer_util.touch_import('__future__', ...) will insert the import statement below all other imports. This will then trigger the following error: SyntaxError: from __future__ imports must occur at the beginning of the file How to reproduce the issue (using modernize, which uses lib2to3): $ git clone https://github.com/mitsuhiko/python-modernize.git $ cd python-modernize $ echo << EOF >> test.py # test.py "Test case for lib2to3.fixer_util.touch_import('__future__', ...)" import os print "hi" EOF $ python modernize.py test.py --- test.py (original) +++ test.py (refactored) @@ -1,4 +1,5 @@ # test.py "Test case for lib2to3.fixer_util.touch_import('__future__', ...)" import os -print "hi" +from __future__ import print_function +print("hi") $ python3 test.py File "test.py", line 4 from __future__ import print_function ^ SyntaxError: from __future__ imports must occur at the beginning of the file The following patch to lib2to3 seems to solve the issue: --- /usr/lib64/python2.7/lib2to3/fixer_util.py.orig 2012-03-09 21:53:10.841083479 -0800 +++ /usr/lib64/python2.7/lib2to3/fixer_util.py 2012-03-09 21:58:18.678946683 -0800 @@ -306,14 +306,15 @@ # figure out where to insert the new import. First try to find # the first import and then skip to the last one. insert_pos = offset = 0 - for idx, node in enumerate(root.children): - if not is_import_stmt(node): - continue - for offset, node2 in enumerate(root.children[idx:]): - if not is_import_stmt(node2): - break - insert_pos = idx + offset - break + if package != '__future__': + for idx, node in enumerate(root.children): + if not is_import_stmt(node): + continue + for offset, node2 in enumerate(root.children[idx:]): + if not is_import_stmt(node2): + break + insert_pos = idx + offset + break # if there are no imports where we can insert, find the docstring. # if that also fails, we stick to the beginning of the file After the patch, all is well: $ python modernize.py test.py --- test.py (original) +++ test.py (refactored) @@ -1,4 +1,5 @@ # test.py "Test case for lib2to3.fixer_util.touch_import('__future__', ...)" +from __future__ import print_function import os -print "hi" +print("hi") $ python3 test.py hi ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 155569 nosy: lmacken priority: normal severity: normal status: open title: lib2to3.fixer_util.touch_import('__future__', ...) can lead to SyntaxError in code type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 06:02:23 2012 From: report at bugs.python.org (py.user) Date: Tue, 13 Mar 2012 05:02:23 +0000 Subject: [issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it In-Reply-To: <1331530103.22.0.0779581075646.issue14260@psf.upfronthosting.co.za> Message-ID: <1331614943.94.0.562977115011.issue14260@psf.upfronthosting.co.za> py.user added the comment: the first message shows how it can work with a broken dict ?ric Araujo wrote: > But regex.sub is affected only if you manually muck with the dict, right? I can get code from anywhere ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 06:06:49 2012 From: report at bugs.python.org (py.user) Date: Tue, 13 Mar 2012 05:06:49 +0000 Subject: [issue14283] match.pos describes that match object has methods search() and match() Message-ID: <1331615209.27.0.948367520003.issue14283@psf.upfronthosting.co.za> New submission from py.user : http://docs.python.org/py3k/library/re.html#re.match.pos http://docs.python.org/py3k/library/re.html#re.match.endpos "which was passed to the search() or match() method of a match object." http://docs.python.org/py3k/library/re.html#re.match.re match object -> regular expression object ---------- assignee: docs at python components: Documentation, Regular Expressions messages: 155571 nosy: docs at python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: match.pos describes that match object has methods search() and match() versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 06:07:31 2012 From: report at bugs.python.org (Luke Macken) Date: Tue, 13 Mar 2012 05:07:31 +0000 Subject: [issue14282] lib2to3.fixer_util.touch_import('__future__', ...) can lead to SyntaxError in code In-Reply-To: <1331614683.04.0.297382545344.issue14282@psf.upfronthosting.co.za> Message-ID: <1331615251.41.0.61509289831.issue14282@psf.upfronthosting.co.za> Changes by Luke Macken : ---------- keywords: +patch Added file: http://bugs.python.org/file24814/python-lib2to3-touch-future-import.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 07:22:29 2012 From: report at bugs.python.org (=?utf-8?q?Herv=C3=A9_Coatanhay?=) Date: Tue, 13 Mar 2012 06:22:29 +0000 Subject: [issue14284] unicodeobject error on macosx in build process Message-ID: <1331619748.31.0.990464365996.issue14284@psf.upfronthosting.co.za> New submission from Herv? Coatanhay : On a fresh install from mercurial on macosx. ./python -SE -m sysconfig --generate-posix-vars Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] Assertion failed: (compact->utf8_length == 0), function _PyUnicode_CheckConsistency, file Objects/unicodeobject.c, line 369. make: *** [Lib/_sysconfigdata.py] Abort trap: 6 This is reproduced with the following mercurial changesets: changeset reproduced 368a5d7d8a15 no (3.2 branch) fafe12f2a030 no (3.2 branch) 4a5eafcdde11 yes 6b8dd7724ec0 yes 0df295d590a8 yes 7e576ad85663 yes (tip on default) When compiled with pydebug I've got the following in gdb: #0 0x00007fff86c0282a in __kill () #1 0x00007fff8e61aa9c in abort () #2 0x00007fff8e64d5de in __assert_rtn () #3 0x00000001000d5589 in _PyUnicode_CheckConsistency (op=0x101024c40, check_content=0) at unicodeobject.c:369 #4 0x00000001000df567 in unicode_dealloc (unicode=0x101024c40) at unicodeobject.c:1503 #5 0x000000010009f025 in _Py_Dealloc (op=0x101024c40) at object.c:1765 #6 0x000000010019df6a in decode_unicode (c=0x7fff5fbf6d58, s=0x10087cc36 "ois Pinard]\n\nHeaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for\nall k, counting elements from 0. For the sake of comparison,\nnon-existing elements are considered to be infinite. Th"..., len=4720, rawmode=0, encoding=0x1002c6710 "utf-8") at ast.c:3759 #7 0x000000010019e3c6 in parsestr (c=0x7fff5fbf6d58, n=0x10103a118, bytesmode=0x7fff5fbf6944) at ast.c:3829 #8 0x000000010019e839 in parsestrplus (c=0x7fff5fbf6d58, n=0x10103a0d0, bytesmode=0x7fff5fbf6944) at ast.c:3874 #9 0x000000010019597a in ast_for_atom (c=0x7fff5fbf6d58, n=0x10103a0d0) at ast.c:1869 #10 0x000000010019744d in ast_for_power (c=0x7fff5fbf6d58, n=0x10103a088) at ast.c:2228 #11 0x0000000100197fa6 in ast_for_expr (c=0x7fff5fbf6d58, n=0x10103a088) at ast.c:2428 #12 0x0000000100198a11 in ast_for_testlist (c=0x7fff5fbf6d58, n=0x1007c1c90) at ast.c:2584 #13 0x0000000100198fbe in ast_for_expr_stmt (c=0x7fff5fbf6d58, n=0x10048b868) at ast.c:2680 #14 0x000000010019d248 in ast_for_stmt (c=0x7fff5fbf6d58, n=0x10048b868) at ast.c:3600 #15 0x0000000100191530 in PyAST_FromNode (n=0x10048b280, flags=0x7fff5fbf6f60, filename=0x100794ee0 "/Users/herve/Documents/workspace/mercurial_repository/python-vanilla/Lib/heapq.py", arena=0x10051f8f0) at ast.c:760 #16 0x000000010021b86f in PyParser_ASTFromFile (fp=0x7fff77c75140, filename=0x100794ee0 "/Users/herve/Documents/workspace/mercurial_repository/python-vanilla/Lib/heapq.py", enc=0x0, start=257, ps1=0x0, ps2=0x0, flags=0x7fff5fbf6f60, errcode=0x0, arena=0x10051f8f0) at pythonrun.c:1982 #17 0x00000001001f6d04 in parse_source_module (pathname=0x1007a5320, fp=0x7fff77c75140) at import.c:1186 #18 0x00000001001f822d in load_source_module (name=0x1007bd178, pathname=0x1007a5320, fp=0x7fff77c75140) at import.c:1509 #19 0x00000001001fd345 in load_module (name=0x1007bd178, fp=0x7fff77c75140, pathname=0x1007a5320, type=1, loader=0x0) at import.c:2477 #20 0x00000001002011f7 in import_submodule (mod=0x100340f80, subname=0x1007bd178, fullname=0x1007bd178) at import.c:3338 #21 0x00000001001ffb97 in load_next (mod=0x100340f80, altmod=0x100340f80, inputname=0x1007bd178, p_outputname=0x7fff5fbf7350, p_prefix=0x7fff5fbf7338) at import.c:3149 #22 0x00000001001fe5c7 in import_module_level (name=0x1007bd178, globals=0x10077cbe8, locals=0x10077cbe8, fromlist=0x100340f80, level=0) at import.c:2842 #23 0x00000001001feb00 in PyImport_ImportModuleLevelObject (name=0x1007bd178, globals=0x10077cbe8, locals=0x10077cbe8, fromlist=0x100340f80, level=0) at import.c:2904 #24 0x000000010019fd85 in builtin___import__ (self=0x100607420, args=0x10079e9f0, kwds=0x0) at bltinmodule.c:195 #25 0x0000000100096214 in PyCFunction_Call (func=0x100607510, arg=0x10079e9f0, kw=0x0) at methodobject.c:84 #26 0x0000000100010656 in PyObject_Call (func=0x100607510, arg=0x10079e9f0, kw=0x0) at abstract.c:2150 #27 0x00000001001c597d in PyEval_CallObjectWithKeywords (func=0x100607510, arg=0x10079e9f0, kw=0x0) at ceval.c:3932 #28 0x00000001001ba572 in PyEval_EvalFrameEx (f=0x10052f5d0, throwflag=0) at ceval.c:2332 #29 0x00000001001c3681 in PyEval_EvalCodeEx (_co=0x1007b9dc0, globals=0x10077cbe8, locals=0x10077cbe8, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at ceval.c:3426 #30 0x00000001001aaf0b in PyEval_EvalCode (co=0x1007b9dc0, globals=0x10077cbe8, locals=0x10077cbe8) at ceval.c:771 #31 0x00000001001f2d62 in PyImport_ExecCodeModuleObject (name=0x10077b9e0, co=0x1007b9dc0, pathname=0x10060ed60, cpathname=0x10060ed60) at import.c:868 #32 0x00000001001f820e in load_source_module (name=0x10077b9e0, pathname=0x1004bbbf8, fp=0x7fff77c750a8) at import.c:1505 #33 0x00000001001fd345 in load_module (name=0x10077b9e0, fp=0x7fff77c750a8, pathname=0x1004bbbf8, type=1, loader=0x0) at import.c:2477 #34 0x00000001001f8c71 in load_package (name=0x10077b9e0, pathname=0x1006ad6b8) at import.c:1640 #35 0x00000001001fd3a1 in load_module (name=0x10077b9e0, fp=0x0, pathname=0x1006ad6b8, type=5, loader=0x0) at import.c:2491 #36 0x00000001002011f7 in import_submodule (mod=0x100340f80, subname=0x10077b9e0, fullname=0x10077b9e0) at import.c:3338 #37 0x00000001001ffb97 in load_next (mod=0x100340f80, altmod=0x100340f80, inputname=0x100765510, p_outputname=0x7fff5fbf93c0, p_prefix=0x7fff5fbf93a8) at import.c:3149 #38 0x00000001001fe5c7 in import_module_level (name=0x100765510, globals=0x1006ac2f0, locals=0x1006ac2f0, fromlist=0x1007578b0, level=0) at import.c:2842 #39 0x00000001001feb00 in PyImport_ImportModuleLevelObject (name=0x100765510, globals=0x1006ac2f0, locals=0x1006ac2f0, fromlist=0x1007578b0, level=0) at import.c:2904 #40 0x000000010019fd85 in builtin___import__ (self=0x100607420, args=0x100760180, kwds=0x0) at bltinmodule.c:195 #41 0x0000000100096214 in PyCFunction_Call (func=0x100607510, arg=0x100760180, kw=0x0) at methodobject.c:84 #42 0x0000000100010656 in PyObject_Call (func=0x100607510, arg=0x100760180, kw=0x0) at abstract.c:2150 #43 0x00000001001c597d in PyEval_CallObjectWithKeywords (func=0x100607510, arg=0x100760180, kw=0x0) at ceval.c:3932 #44 0x00000001001ba572 in PyEval_EvalFrameEx (f=0x10052ae70, throwflag=0) at ceval.c:2332 #45 0x00000001001c3681 in PyEval_EvalCodeEx (_co=0x1007644c0, globals=0x1006ac2f0, locals=0x1006ac2f0, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at ceval.c:3426 #46 0x00000001001aaf0b in PyEval_EvalCode (co=0x1007644c0, globals=0x1006ac2f0, locals=0x1006ac2f0) at ceval.c:771 #47 0x00000001001f2d62 in PyImport_ExecCodeModuleObject (name=0x1006b04b8, co=0x1007644c0, pathname=0x1004bb748, cpathname=0x1004bb748) at import.c:868 #48 0x00000001001f820e in load_source_module (name=0x1006b04b8, pathname=0x1006b43b0, fp=0x7fff77c75010) at import.c:1505 #49 0x00000001001fd345 in load_module (name=0x1006b04b8, fp=0x7fff77c75010, pathname=0x1006b43b0, type=1, loader=0x0) at import.c:2477 #50 0x00000001002011f7 in import_submodule (mod=0x100340f80, subname=0x1006b04b8, fullname=0x1006b04b8) at import.c:3338 #51 0x00000001001ffb97 in load_next (mod=0x100340f80, altmod=0x100340f80, inputname=0x1006b04b8, p_outputname=0x7fff5fbfb310, p_prefix=0x7fff5fbfb2f8) at import.c:3149 #52 0x00000001001fe5c7 in import_module_level (name=0x1006b04b8, globals=0x1006ac1a8, locals=0x1006ac1a8, fromlist=0x100340f80, level=0) at import.c:2842 #53 0x00000001001feb00 in PyImport_ImportModuleLevelObject (name=0x1006b04b8, globals=0x1006ac1a8, locals=0x1006ac1a8, fromlist=0x100340f80, level=0) at import.c:2904 #54 0x000000010019fd85 in builtin___import__ (self=0x100607420, args=0x1006a6960, kwds=0x0) at bltinmodule.c:195 #55 0x0000000100096214 in PyCFunction_Call (func=0x100607510, arg=0x1006a6960, kw=0x0) at methodobject.c:84 #56 0x0000000100010656 in PyObject_Call (func=0x100607510, arg=0x1006a6960, kw=0x0) at abstract.c:2150 #57 0x00000001001c597d in PyEval_CallObjectWithKeywords (func=0x100607510, arg=0x1006a6960, kw=0x0) at ceval.c:3932 #58 0x00000001001ba572 in PyEval_EvalFrameEx (f=0x100529180, throwflag=0) at ceval.c:2332 #59 0x00000001001c3681 in PyEval_EvalCodeEx (_co=0x1006bd1c0, globals=0x1006ac1a8, locals=0x1006ac1a8, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at ceval.c:3426 #60 0x00000001001aaf0b in PyEval_EvalCode (co=0x1006bd1c0, globals=0x1006ac1a8, locals=0x1006ac1a8) at ceval.c:771 #61 0x00000001001f2d62 in PyImport_ExecCodeModuleObject (name=0x1006938c8, co=0x1006bd1c0, pathname=0x1004aead0, cpathname=0x1004aead0) at import.c:868 #62 0x00000001001f820e in load_source_module (name=0x1006938c8, pathname=0x1006ad040, fp=0x7fff77c74f78) at import.c:1505 #63 0x00000001001fd345 in load_module (name=0x1006938c8, fp=0x7fff77c74f78, pathname=0x1006ad040, type=1, loader=0x0) at import.c:2477 #64 0x00000001002011f7 in import_submodule (mod=0x100340f80, subname=0x1006938c8, fullname=0x1006938c8) at import.c:3338 #65 0x00000001001ffb97 in load_next (mod=0x100340f80, altmod=0x100340f80, inputname=0x1006938c8, p_outputname=0x7fff5fbfd260, p_prefix=0x7fff5fbfd248) at import.c:3149 #66 0x00000001001fe5c7 in import_module_level (name=0x1006938c8, globals=0x1006a0e78, locals=0x1006a0e78, fromlist=0x10063a1b0, level=0) at import.c:2842 #67 0x00000001001feb00 in PyImport_ImportModuleLevelObject (name=0x1006938c8, globals=0x1006a0e78, locals=0x1006a0e78, fromlist=0x10063a1b0, level=0) at import.c:2904 #68 0x000000010019fd85 in builtin___import__ (self=0x100607420, args=0x1006a6330, kwds=0x0) at bltinmodule.c:195 #69 0x0000000100096214 in PyCFunction_Call (func=0x100607510, arg=0x1006a6330, kw=0x0) at methodobject.c:84 #70 0x0000000100010656 in PyObject_Call (func=0x100607510, arg=0x1006a6330, kw=0x0) at abstract.c:2150 #71 0x00000001001c597d in PyEval_CallObjectWithKeywords (func=0x100607510, arg=0x1006a6330, kw=0x0) at ceval.c:3932 #72 0x00000001001ba572 in PyEval_EvalFrameEx (f=0x100528b00, throwflag=0) at ceval.c:2332 #73 0x00000001001c3681 in PyEval_EvalCodeEx (_co=0x1006a7700, globals=0x1006a0e78, locals=0x1006a0e78, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at ceval.c:3426 #74 0x00000001001aaf0b in PyEval_EvalCode (co=0x1006a7700, globals=0x1006a0e78, locals=0x1006a0e78) at ceval.c:771 #75 0x00000001001f2d62 in PyImport_ExecCodeModuleObject (name=0x100693380, co=0x1006a7700, pathname=0x1004ae520, cpathname=0x1004ae520) at import.c:868 #76 0x00000001001f820e in load_source_module (name=0x100693380, pathname=0x1004a8600, fp=0x7fff77c74ee0) at import.c:1505 #77 0x00000001001fd345 in load_module (name=0x100693380, fp=0x7fff77c74ee0, pathname=0x1004a8600, type=1, loader=0x0) at import.c:2477 #78 0x00000001002011f7 in import_submodule (mod=0x100340f80, subname=0x100693380, fullname=0x100693380) at import.c:3338 #79 0x00000001001ffb97 in load_next (mod=0x100340f80, altmod=0x100340f80, inputname=0x100693380, p_outputname=0x7fff5fbff1b0, p_prefix=0x7fff5fbff198) at import.c:3149 #80 0x00000001001fe5c7 in import_module_level (name=0x100693380, globals=0x1006a0d30, locals=0x1006a0d30, fromlist=0x10061c6f0, level=0) at import.c:2842 #81 0x00000001001feb00 in PyImport_ImportModuleLevelObject (name=0x100693380, globals=0x1006a0d30, locals=0x1006a0d30, fromlist=0x10061c6f0, level=0) at import.c:2904 #82 0x000000010019fd85 in builtin___import__ (self=0x100607420, args=0x100621b10, kwds=0x0) at bltinmodule.c:195 #83 0x0000000100096214 in PyCFunction_Call (func=0x100607510, arg=0x100621b10, kw=0x0) at methodobject.c:84 #84 0x0000000100010656 in PyObject_Call (func=0x100607510, arg=0x100621b10, kw=0x0) at abstract.c:2150 #85 0x0000000100010863 in call_function_tail (callable=0x100607510, args=0x100621b10) at abstract.c:2182 #86 0x0000000100010ab7 in PyObject_CallFunction (callable=0x100607510, format=0x1002e379f "OOOOi") at abstract.c:2206 #87 0x000000010020226c in PyImport_Import (module_name=0x100693380) at import.c:3533 #88 0x00000001001fdf6f in PyImport_ImportModule (name=0x1002cdeb8 "runpy") at import.c:2728 #89 0x00000001002484f1 in RunModule (modname=0x10048b0d0, set_argv0=1) at main.c:171 #90 0x000000010024a0a8 in Py_Main (argc=5, argv=0x10048b040) at main.c:663 #91 0x000000010000128b in main (argc=5, argv=0x7fff5fbffa40) at python.c:63 ---------- assignee: ronaldoussoren components: Macintosh messages: 155572 nosy: Alzakath, ronaldoussoren priority: normal severity: normal status: open title: unicodeobject error on macosx in build process type: compile error versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 07:26:37 2012 From: report at bugs.python.org (Ezio Melotti) Date: Tue, 13 Mar 2012 06:26:37 +0000 Subject: [issue14284] unicodeobject error on macosx in build process In-Reply-To: <1331619748.31.0.990464365996.issue14284@psf.upfronthosting.co.za> Message-ID: <1331619997.28.0.060167319583.issue14284@psf.upfronthosting.co.za> Ezio Melotti added the comment: See #13241. ---------- nosy: +ezio.melotti resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 07:50:36 2012 From: report at bugs.python.org (Marc Schlaich) Date: Tue, 13 Mar 2012 06:50:36 +0000 Subject: [issue14285] Traceback wrong on ImportError while executing a package Message-ID: <1331621436.28.0.000669565075438.issue14285@psf.upfronthosting.co.za> New submission from Marc Schlaich : It is very simple to reproduce this error. There is an executable package: package/ __init__.py __main__.py The __init__ imports a missing module: import missing_module And the __main__ imports from it: from . import missing_module Now I get the following output which is not what I am expecting: C:\Python27\python.exe: No module named missing_module; 'package' is a package and cannot be directly executed ---------- messages: 155574 nosy: ms4py priority: normal severity: normal status: open title: Traceback wrong on ImportError while executing a package type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 08:17:23 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 07:17:23 +0000 Subject: [issue14257] minor error in glossary wording regarding __hash__ In-Reply-To: <1331515626.11.0.049158499672.issue14257@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 0f146020d8e9 by Senthil Kumaran in branch '3.2': closes issue14257 - Grammatical fix http://hg.python.org/cpython/rev/0f146020d8e9 New changeset c5833f277258 by Senthil Kumaran in branch 'default': closes issue14257 - Grammatical fix http://hg.python.org/cpython/rev/c5833f277258 New changeset f3c8bdbe2cf3 by Senthil Kumaran in branch '2.7': closes issue14257 - Grammatical fix http://hg.python.org/cpython/rev/f3c8bdbe2cf3 ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 08:24:15 2012 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 13 Mar 2012 07:24:15 +0000 Subject: [issue14246] Accelerated ETree XMLParser cannot handle io.StringIO In-Reply-To: <1331377442.17.0.542633134085.issue14246@psf.upfronthosting.co.za> Message-ID: <1331623455.82.0.303366058574.issue14246@psf.upfronthosting.co.za> Stefan Behnel added the comment: FWIW, lxml also has support for parsing Unicode strings. It doesn't encode the input, however, but parses straight from the underlying buffer (after detecting the buffer layout etc. at module init time - and yes, I still haven't fixed this up for PEP393). There is one problem that I see with encoding it to UTF-8 first, even disregarding the obvious inefficiency in terms of both memory and processing time. At least for string parsing, lxml has an additional check in place that rejects Unicode string input containing an encoding declaration, because that would be very unlikely to match the buffer encoding on a given platform. In your case, it would be good to have something similar, because when you get a Unicode string with, say, an ISO8859-1 encoding declaration, encoding it to UTF-8 and then passing that to pyexpat will silently generate incorrect content - unless you can safely enforce a specific encoding regardless of the declaration, don't know how expat handles this (you are clearly not handling it in your patch, which, I take it, only adapts the behaviour to what pyET currently does). The problem here is that it's not so easy to do this for file-like objects, because they may return text that contains "". The XML parser could handle this, but doing it in a preprocessing step would be some work. In any case, silently returning broken data is not a good idea. Maybe it would work to check the encoding that the parser uses against the one we expect? If the parser switches encodings at some point even though we are sure it *must* be utf-8 (in whatever spelling), we can still raise an error at that point. I'll consider letting lxml do this check as well, it sounds more efficient than what it currently does. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 08:36:45 2012 From: report at bugs.python.org (Tatiana Al-Chueyr) Date: Tue, 13 Mar 2012 07:36:45 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1331624205.06.0.324875670374.issue5758@psf.upfronthosting.co.za> Tatiana Al-Chueyr added the comment: Improved patch, according to eric.araujo's suggestions and mnewman's guidance. ---------- Added file: http://bugs.python.org/file24815/issue5758_fileinput_gzip_with_encoding_v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 09:03:58 2012 From: report at bugs.python.org (Jeff McNeil) Date: Tue, 13 Mar 2012 08:03:58 +0000 Subject: [issue12890] cgitb displays

tags when executed in text mode In-Reply-To: <1315016521.13.0.175763253408.issue12890@psf.upfronthosting.co.za> Message-ID: <1331625838.45.0.498730148424.issue12890@psf.upfronthosting.co.za> Jeff McNeil added the comment: Did this ever get committed? Is there anything left for me to do here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 09:24:20 2012 From: report at bugs.python.org (Eli Bendersky) Date: Tue, 13 Mar 2012 08:24:20 +0000 Subject: [issue14246] Accelerated ETree XMLParser cannot handle io.StringIO In-Reply-To: <1331377442.17.0.542633134085.issue14246@psf.upfronthosting.co.za> Message-ID: <1331627060.08.0.8066115602.issue14246@psf.upfronthosting.co.za> Eli Bendersky added the comment: Stefan, Thanks a lot for taking the time to review the patch. As you correctly say, the current pathch's goal is just to align with existing behavior in the Python implementation of ET. I understand the problem you are describing, but at least it's not a regression vs. previous behavior, while the original problem this issue complains about *is* a regression. I propose to commit this to fix the regression and open a separate issue with the insight you provided. One easy solution could be to just require the encoding to be UTF-8 when passing unicode to the module, and to document it explicitly. Another solution would be to actually fix it in the module itself. If there is a decision to fix it, the fix should then cover both the C and Python implementations, in all possible places (all functions reading XML from strings will also suffer from the same problem, since they get passed to xmlparse_Parse in pyexpat, which just uses PyArg_ParseTuple with the "s#" format - encoding unicode in utf-8 without looking at the XML encoding itself). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 09:36:02 2012 From: report at bugs.python.org (Jeff McNeil) Date: Tue, 13 Mar 2012 08:36:02 +0000 Subject: [issue1666318] shutil.copytree doesn't give control over directory permissions Message-ID: <1331627762.87.0.24570797079.issue1666318@psf.upfronthosting.co.za> Jeff McNeil added the comment: I made the change suggested in the last comment, patch is attached. Trying to clean up any bugs I've got my name on! ---------- keywords: +patch Added file: http://bugs.python.org/file24816/makedirs_function.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 09:51:34 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 08:51:34 +0000 Subject: [issue14281] Add unit test for cgi.escape method In-Reply-To: <1331607910.6.0.875213556559.issue14281@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 757afb3af762 by Senthil Kumaran in branch '2.7': Fix closes Issue14281 - Test for cgi.escape by Brian Landers http://hg.python.org/cpython/rev/757afb3af762 New changeset 13922f6d87f2 by Senthil Kumaran in branch '3.2': 3.2 - Fix closes Issue14281 - Test for cgi.escape by Brian Landers http://hg.python.org/cpython/rev/13922f6d87f2 New changeset 70712a806bdb by Senthil Kumaran in branch 'default': merge to 3.3 - Fix closes Issue14281 - Test for cgi.escape by Brian Landers http://hg.python.org/cpython/rev/70712a806bdb ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 09:53:33 2012 From: report at bugs.python.org (Jeff McNeil) Date: Tue, 13 Mar 2012 08:53:33 +0000 Subject: [issue12365] URLopener should support context manager protocol In-Reply-To: <1308504365.98.0.668285563314.issue12365@psf.upfronthosting.co.za> Message-ID: <1331628813.1.0.176667650807.issue12365@psf.upfronthosting.co.za> Jeff McNeil added the comment: Documentation patch to outline the use of context manager protocol attached. Trying to cleanup any bugs with my name on them. ---------- keywords: +patch Added file: http://bugs.python.org/file24817/urllib_request_doc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 09:57:54 2012 From: report at bugs.python.org (Jeff McNeil) Date: Tue, 13 Mar 2012 08:57:54 +0000 Subject: [issue10050] urllib.request still has old 2.x urllib primitives In-Reply-To: <1286536471.26.0.454336144311.issue10050@psf.upfronthosting.co.za> Message-ID: <1331629074.76.0.356539406241.issue10050@psf.upfronthosting.co.za> Changes by Jeff McNeil : ---------- nosy: -mcjeff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 10:11:05 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Mar 2012 09:11:05 +0000 Subject: [issue14262] Allow using decimals as arguments to `timedelta` In-Reply-To: <1331557988.1.0.944940856764.issue14262@psf.upfronthosting.co.za> Message-ID: <1331629865.27.0.891048640793.issue14262@psf.upfronthosting.co.za> STINNER Victor added the comment: The PEP 410 was rejected. See also the issue #13882. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 10:11:52 2012 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 13 Mar 2012 09:11:52 +0000 Subject: [issue14273] distutils2: logging handler not properly initialized In-Reply-To: <1331592978.94.0.127505196077.issue14273@psf.upfronthosting.co.za> Message-ID: <1331629912.85.0.850354907469.issue14273@psf.upfronthosting.co.za> Vinay Sajip added the comment: I cannot reproduce this, and in fact couldn't find anywhere in packaging in the default branch where a "distutils2" logger is set up. I used grep to look for "getLogger.*(distutils2|__name__)", could some other logic be in use to construct the logger name? Looking at packaging.run.main() - it calls Dispatcher(args), and any exception in Dispatcher.__init__() before the call to _set_logger could lead to a logging call being made before a handler is set up. Suggestion: set the handler as early as possible, perhaps in main() where the other handlers logic is, and just set the level later (as that is the only thing that depends on verbosity settings passed in via command line flags). A couple of things I don't quite understand: 1. Why are the packaging logger's handlers are saved and restored en masse - all that is happening is that a handler is being added in Dispatcher._set_logger, so it would seem to be enough to call removeHandler(). 2. There should normally be no need to set both the logger's *and* and handler's level to the same value - if the event fails the logger's level test, it will not be passed to handlers anyway. In packaging code I found no reference to any other loggers than "packaging" - i.e. no child loggers whose events might need to be blocked at the handler level. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 10:14:05 2012 From: report at bugs.python.org (Jeff McNeil) Date: Tue, 13 Mar 2012 09:14:05 +0000 Subject: [issue1429] FD leak in SocketServer In-Reply-To: <1194870454.07.0.621713310435.issue1429@psf.upfronthosting.co.za> Message-ID: <1331630045.59.0.954410360913.issue1429@psf.upfronthosting.co.za> Jeff McNeil added the comment: In an effort to walk through bugs in my nosy list, I dug into this and tried to reproduce it to no avail. Also, as the handle_error method is supposed to handle problems gracefully, calling shutdown on handle_error exception is probably questionable. I'd be happy to submit a patch to do just that if those smarter than I think it is worthwhile, but I don't so much believe it is. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 10:56:09 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 13 Mar 2012 09:56:09 +0000 Subject: [issue14272] ast.c: windows compile error In-Reply-To: <1331592533.68.0.501543996641.issue14272@psf.upfronthosting.co.za> Message-ID: <1331632569.29.0.119199597241.issue14272@psf.upfronthosting.co.za> Stefan Krah added the comment: Looks fixed in 6bee4eea1efa. ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 11:16:01 2012 From: report at bugs.python.org (Ram Rachum) Date: Tue, 13 Mar 2012 10:16:01 +0000 Subject: [issue14262] Allow using decimals as arguments to `timedelta` In-Reply-To: <1331557988.1.0.944940856764.issue14262@psf.upfronthosting.co.za> Message-ID: <1331633761.67.0.0119617853065.issue14262@psf.upfronthosting.co.za> Ram Rachum added the comment: I'm not proposing that `timedelta` will use `Decimal` internally, but that it would handle the conversion to `float` itself, instead of the user having to do it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 11:25:30 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 13 Mar 2012 10:25:30 +0000 Subject: [issue14286] xxlimited.obj: unresolved external symbol __imp__PyObject_New Message-ID: <1331634330.54.0.0691133791003.issue14286@psf.upfronthosting.co.za> New submission from Stefan Krah : Linking fails on Windows 64-bit. Perhaps Py_LIMITED_API ifdefs are missing. Creating library C:\Users\stefan\hg\cpython\PCbuild\\amd64\\xxlimited.lib and object C:\Users\stefan\hg\c python\PCbuild\\amd64\\xxlimited.exp xxlimited.obj : error LNK2001: unresolved external symbol __imp__PyObject_New xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyType_FromSpec xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyDict_New xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyDict_DelItemString xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyDict_GetItem xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyObject_GenericGetAttr xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyUnicode_Type xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyExc_AttributeError xxlimited.obj : error LNK2001: unresolved external symbol __imp__Py_NoneStruct xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyArg_ParseTuple xxlimited.obj : error LNK2001: unresolved external symbol __imp__Py_NotImplementedStruct xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyObject_Free xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyErr_SetString xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyModule_Create2 xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyErr_NewException xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyLong_FromLong xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyBaseObject_Type xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyType_GenericNew xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyModule_AddObject xxlimited.obj : error LNK2001: unresolved external symbol __imp_PyDict_SetItemString C:\Users\stefan\hg\cpython\PCbuild\\amd64\\xxlimited.pyd : fatal error LNK1120: 20 unresolved externals ---------- components: Build messages: 155588 nosy: brett.cannon, skrah priority: normal severity: normal stage: needs patch status: open title: xxlimited.obj: unresolved external symbol __imp__PyObject_New type: compile error versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 12:13:09 2012 From: report at bugs.python.org (Nir Soffer) Date: Tue, 13 Mar 2012 11:13:09 +0000 Subject: [issue1762561] unable to serialize Infinity or NaN on ARM using marshal Message-ID: <1331637189.52.0.527134027358.issue1762561@psf.upfronthosting.co.za> Nir Soffer added the comment: As someone who has to develop on ARM OABI, I find this won't fix policy rather frustrating. If you happen to need this patch on 2.7, this is the same patch as arm-float2.diff, which can be applied cleanly to release 2.7.2. Changes from arm-float2.diff: - Remove whitespace only changes - Replace tabs with spaces - Fixed indentation in changed code Enjoy. ---------- nosy: +nirs Added file: http://bugs.python.org/file24818/arm-oabi-float-2.7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 12:47:32 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 13 Mar 2012 11:47:32 +0000 Subject: [issue13889] str(float) and round(float) issues with FPU precision In-Reply-To: <1327676303.66.0.487112802864.issue13889@psf.upfronthosting.co.za> Message-ID: <1331639252.57.0.280781355485.issue13889@psf.upfronthosting.co.za> Stefan Krah added the comment: I've looked at the latest patch: It seems that new_387controlword is not set if old_387controlword already has the desired precision and rounding mode. Attached is a revised patch that uses the same logic as the Linux version. A couple of remarks: - It would be possible to negate (_PC_53|_RC_NEAR) instead of enumerating (_MCW_DN|_MCW_EM|_MCW_IC). I found it nice to see all possibilities listed. - Technically we might need to use #pragma fenv_access (on). I'm not sure where though: If it is set in pyport.h, VS complains that Py_MATH_PI / 180.0 is not constant. The patch is tested on win32/x64. Additionally, the patch is tested with setting the rounding mode to _PC_64 in main.c. Then, the patch is tested with replacing the 'if' bodies by 'abort()'. This shows that in the regular build (_PC_53 on startup) the bodies of the if statements are never executed. Finally, inserting an #error after #if defined(_MSC_VER) && !defined(_WIN64) on the x64 build shows that !defined(_WIN64) really does its job. ---------- Added file: http://bugs.python.org/file24819/issue13889.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 12:50:53 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 11:50:53 +0000 Subject: [issue10945] bdist_wininst depends on MBCS codec, unavailable on non-Windows In-Reply-To: <1295450896.02.0.86964827296.issue10945@psf.upfronthosting.co.za> Message-ID: <1331639453.67.0.915013604703.issue10945@psf.upfronthosting.co.za> ?ric Araujo added the comment: The proposition of using other C functions and changing the bdist_wininst code looks risky to me, especially as I don?t know how compatibility would be affected (see my previous message). We are free to improve the wininst code in distutils2, or discuss a replacement (Jeremy Kloth was working on something with all the features of MSI and wininst), but for distutils I would very much prefer the simplest fix that could possibly works. bdist_msi decodes data read from setup.py with MBCS on Windows; on other OSes, couldn?t the locale preferred encoding be used? ---------- priority: high -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 12:51:00 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 11:51:00 +0000 Subject: [issue8954] wininst regression: errors when building on linux In-Reply-To: <1276093244.44.0.895217979727.issue8954@psf.upfronthosting.co.za> Message-ID: <1331639460.36.0.703004214343.issue8954@psf.upfronthosting.co.za> ?ric Araujo added the comment: Sean: In msg135902 I am merely explaining why I removed 2.6 from the list of versions. Only 2.7, 3.2 and 3.3 can get fixed. If you look at my previous message or the list of dependencies, you can see that #10945 needs to be fixed first before I can review the patch provided for this issue. ---------- components: +Distutils2 nosy: +alexis priority: critical -> normal versions: +3rd party, Python 3.3 -Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 12:54:14 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 11:54:14 +0000 Subject: [issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it In-Reply-To: <1331530103.22.0.0779581075646.issue14260@psf.upfronthosting.co.za> Message-ID: <1331639654.66.0.299408840643.issue14260@psf.upfronthosting.co.za> ?ric Araujo added the comment: > I can get code from anywhere I am afraid I don?t understand. Could you start again and explain what bug you ran into, i.e. what behavior does not match what the docs say? At present this report looks like it is saying ?when I put random things in an internal data structures then bad things happen?, and I don?t think Python promises to not break when people do random editions to internal data structures. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 13:04:23 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 13 Mar 2012 12:04:23 +0000 Subject: [issue14282] lib2to3.fixer_util.touch_import('__future__', ...) can lead to SyntaxError in code In-Reply-To: <1331614683.04.0.297382545344.issue14282@psf.upfronthosting.co.za> Message-ID: <1331640263.84.0.0322553583309.issue14282@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I think that's actually a bug in python-modernize, not in touch_import - or, rather, touch_import shouldn't be used to add future imports. Instead, I think there should be a touch_future function which adds a future import, taking into account that future imports need to go before all other imports, but after a possible docstring. ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 13:11:44 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 12:11:44 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1331640704.27.0.938069259278.issue5758@psf.upfronthosting.co.za> ?ric Araujo added the comment: Thanks. Unless another core dev wants to do a complementary review I will slightly tweak the patch and commit it. I need to finish waking up and eat some food before I do that :) Technically adding a new argument means that this is a new feature and cannot be applied to the stable 3.2 version, but something needs to be done for this bug in 3.2 too, like a recipe in the docs for a hook_compressed that returns strings (i.e. a function that calls fileinput.hook_compressed and wraps it in a TextIOWrapper), or at least a note to warn about this bug. ---------- assignee: -> eric.araujo versions: +Python 3.3 -Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 13:13:33 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 12:13:33 +0000 Subject: [issue12890] cgitb displays

tags when executed in text mode In-Reply-To: <1315016521.13.0.175763253408.issue12890@psf.upfronthosting.co.za> Message-ID: <1331640813.09.0.876120662365.issue12890@psf.upfronthosting.co.za> ?ric Araujo added the comment: I?ll apply it shortly. ---------- assignee: -> eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 13:19:43 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 12:19:43 +0000 Subject: [issue14267] TimedRotatingFileHandler chooses wrong file name due to daylight saving time "spring forward" In-Reply-To: <1331587120.0.0.484868698983.issue14267@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset a5c4b8ccca8b by Vinay Sajip in branch '2.7': Closes #14267: Corrected computation of rollover filename. http://hg.python.org/cpython/rev/a5c4b8ccca8b New changeset a1d9466441ff by Vinay Sajip in branch '3.2': Closes #14267: Corrected computation of rollover filename. http://hg.python.org/cpython/rev/a1d9466441ff New changeset 30fe8a62046e by Vinay Sajip in branch 'default': Closes #14267: Merged fix from 3.2. http://hg.python.org/cpython/rev/30fe8a62046e ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 13:23:19 2012 From: report at bugs.python.org (Eli Bendersky) Date: Tue, 13 Mar 2012 12:23:19 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: <1331641399.66.0.123588273996.issue14202@psf.upfronthosting.co.za> Eli Bendersky added the comment: I reviewed the patch in http://bugs.python.org/review/14202/show ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 13:25:52 2012 From: report at bugs.python.org (Tomas Hoger) Date: Tue, 13 Mar 2012 12:25:52 +0000 Subject: [issue13885] CVE-2011-3389: _ssl module always disables the CBC IV attack countermeasure In-Reply-To: <1327652753.95.0.174471030951.issue13885@psf.upfronthosting.co.za> Message-ID: <1331641552.36.0.279582608986.issue13885@psf.upfronthosting.co.za> Tomas Hoger added the comment: Is the final patch going to enable empty fragments unconditionally and will ofter no way to disable them? curl did that recently and ended up adding option to allow users to disable empty fragments when they break compatibility: http://curl.haxx.se/docs/adv_20120124B.html http://thread.gmane.org/gmane.comp.web.curl.library/34659 http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTSSLOPTIONS http://curl.haxx.se/docs/manpage.html#--ssl-allow-beast ---------- nosy: +thoger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 13:38:43 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 12:38:43 +0000 Subject: [issue14180] Factorize code to convert int/float to time_t, timeval or timespec In-Reply-To: <1330733422.24.0.352066771242.issue14180@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 1e9cc1a03365 by Victor Stinner in branch 'default': Close #14180: Factorize code to convert a number of seconds to time_t, timeval or timespec http://hg.python.org/cpython/rev/1e9cc1a03365 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 13:50:40 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 12:50:40 +0000 Subject: [issue14180] Factorize code to convert int/float to time_t, timeval or timespec In-Reply-To: <1330733422.24.0.352066771242.issue14180@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset ed73006bac42 by Victor Stinner in branch 'default': Issue #14180: Remove commented code http://hg.python.org/cpython/rev/ed73006bac42 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 13:51:49 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Mar 2012 12:51:49 +0000 Subject: [issue14262] Allow using decimals as arguments to `timedelta` In-Reply-To: <1331557988.1.0.944940856764.issue14262@psf.upfronthosting.co.za> Message-ID: <1331643109.56.0.94645415004.issue14262@psf.upfronthosting.co.za> STINNER Victor added the comment: Attached patch changes timedelta constructor to accept decimal.Decimal. See also the issue #14180. ---------- keywords: +patch Added file: http://bugs.python.org/file24820/timedelta_decimal.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 13:53:43 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Mar 2012 12:53:43 +0000 Subject: [issue10945] bdist_wininst depends on MBCS codec, unavailable on non-Windows In-Reply-To: <1295450896.02.0.86964827296.issue10945@psf.upfronthosting.co.za> Message-ID: <1331643223.05.0.666174655709.issue10945@psf.upfronthosting.co.za> STINNER Victor added the comment: > Would the proposed change mean that a bdist_wininst built > with 3.2.0 won?t work with a patched 3.2.3? The installer doesn't use distutils to read its configuration, so such binary runs with any installed Python version. > bdist_msi decodes data read from setup.py with MBCS on Windows; > on other OSes, couldn?t the locale preferred encoding be used? It would be worse: Linux doesn't use Windows code page. Most modern OSes are now using UTF-8 locale encoding, whereas Windows never use UTF-8 as the ANSI code page. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 14:02:05 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Mar 2012 13:02:05 +0000 Subject: [issue10148] st_mtime differs after shutil.copy2 In-Reply-To: <1287530071.19.0.608159353416.issue10148@psf.upfronthosting.co.za> Message-ID: <1331643725.86.0.9964484914.issue10148@psf.upfronthosting.co.za> STINNER Victor added the comment: This issue is a duplicate of #14127. ---------- nosy: +haypo resolution: -> duplicate status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 14:05:09 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Mar 2012 13:05:09 +0000 Subject: [issue14127] os.stat and os.utime: allow preserving exact metadata In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331643909.16.0.423449986553.issue14127@psf.upfronthosting.co.za> STINNER Victor added the comment: I'm lost in all issues related to os.stat/utime and nanosecond, here is a list: - #10148: duplicate - #11457: closed (was related the the rejected PEP 410) - #12904: closed, it was the first step to fix os.stat/os.utime - #13882: closed (implementation of the PEP 410) - #13964: duplicate - #14127: this issue, open :-) ---------- nosy: +eric.araujo, maubp, python-dev, shaurz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 14:05:16 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Mar 2012 13:05:16 +0000 Subject: [issue13964] os.utimensat() and os.futimes() should accept (sec, nsec), drop os.futimens() In-Reply-To: <1328663994.2.0.189878263913.issue13964@psf.upfronthosting.co.za> Message-ID: <1331643916.37.0.38341418665.issue13964@psf.upfronthosting.co.za> STINNER Victor added the comment: This issue is a duplicate of #14127. ---------- resolution: -> duplicate status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 14:06:42 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Mar 2012 13:06:42 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331644002.8.0.793971664047.issue14127@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: os.stat and os.utime: allow preserving exact metadata -> add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 14:17:19 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 13 Mar 2012 13:17:19 +0000 Subject: [issue14282] lib2to3.fixer_util.touch_import('__future__', ...) can lead to SyntaxError in code In-Reply-To: <1331614683.04.0.297382545344.issue14282@psf.upfronthosting.co.za> Message-ID: <1331644639.4.0.891441658638.issue14282@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Instead of changing touch_import, I propose to add a function similar to https://github.com/loewis/python-modernize/commit/0db885e616807d0cc6859b4035d81fd260b06a67 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 14:26:54 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Mar 2012 13:26:54 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331645214.24.0.106742603471.issue14127@psf.upfronthosting.co.za> STINNER Victor added the comment: The following changes has to be done to fix this issue: - add st_atime_ns, st_mtime_ns and st_ctime_ns fileds to os.stat() result: number of nanoseconds since Epoch (1970.1.1), an integer - change os.*utime*() functions (see below) - shutil.copystat() should use os.utime(ns=...) and os.ltime(ns=...) List of the os.*utime*() functions: - os.futimes(): use futimens() or futimes() - os.futimens(): use futimens(); UTIME_NOW and UTIME_OMIT flags - os.futimesat(): use utimensat() or futimesat() - os.lutimes(): use futimesat(AT_SYMLINK_NOFOLLOW) or lutimes() - os.utime(): use SetFileTime() (Windows), utimensat(), utimes() or utime() - os.utimensat(): use utimensat(); UTIME_NOW and UTIME_OMIT flags Changes on the os.*utime*() functions: - add ns keyword to: * os.futimes() * os.futimesat() * os.lutimes() * os.utime() - except a number of nanoseconds instead of a number of seconds: * os.futimens() * os.utimensat() The ns keyword is an exclusive parameter with existing times parameter. Examples: * seconds: os.utime(name, (1, 2)) * seconds: os.utime(name, times=(1, 2)) * nanoseconds: os.utime(name, ns=(1, 2)) * INVALID! os.utime(name, (1, 2), ns=(1, 2)) * INVALID! os.utime(name, times=(1, 2), ns=(1, 2)) I don't want to remove os.futimens() and os.utimensat() because they add a feature: UTIME_NOW and UTIME_OMIT flags. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 14:37:26 2012 From: report at bugs.python.org (Ram Rachum) Date: Tue, 13 Mar 2012 13:37:26 +0000 Subject: [issue14262] Allow using decimals as arguments to `timedelta` In-Reply-To: <1331557988.1.0.944940856764.issue14262@psf.upfronthosting.co.za> Message-ID: <1331645846.28.0.748368928384.issue14262@psf.upfronthosting.co.za> Ram Rachum added the comment: Thanks for the patch! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 15:02:52 2012 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 13 Mar 2012 14:02:52 +0000 Subject: [issue13889] str(float) and round(float) issues with FPU precision In-Reply-To: <1327676303.66.0.487112802864.issue13889@psf.upfronthosting.co.za> Message-ID: <1331647372.59.0.975659257825.issue13889@psf.upfronthosting.co.za> Mark Dickinson added the comment: BTW, the MSDN documentation at http://msdn.microsoft.com/en-us/library/e9b52ceh(v=vs.100).aspx is a bit confusing. Question 1: when doing __control87_2(new, mask, &old, NULL), does the resulting value in old reflect the *new* FPU state or the old one? Question 2: in the example near the bottom of that page, there's code like: control_word_x87 = __control87_2(_PC_24, MCW_PC, &control_word_x87, 0); This looks very odd: we're assigning to control_word_x87, *and* passing it as an output parameter to the call. Moreover, from the documentation the return value from __control87_2 is always 1 to indicate success, so I'm not sure why it's being assigned to control_word_x87. Am I the only person who's confused by this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 15:03:33 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 14:03:33 +0000 Subject: [issue14217] text output pretends to be code In-Reply-To: <1331108351.7.0.269278733631.issue14217@psf.upfronthosting.co.za> Message-ID: <1331647413.38.0.421405891634.issue14217@psf.upfronthosting.co.za> ?ric Araujo added the comment: This issue does not apply to 2.7 docs because they lack the local/nonlocal assignment example; do you agree it would be good to backport that? Tshepang, if you find more instances of the same problem, please report them. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 15:07:05 2012 From: report at bugs.python.org (Musashi Tamura) Date: Tue, 13 Mar 2012 14:07:05 +0000 Subject: [issue14287] sys.stdin.readline and KeyboardInterrupt on windows Message-ID: <1331647625.41.0.2361094593.issue14287@psf.upfronthosting.co.za> New submission from Musashi Tamura : I run z.py and press Ctrl-C. '' Traceback (most recent call last): File "z.py", line 7, in print(repr(x)) KeyboardInterrupt I think '' should not be printed. This sometimes occurs on Python 3.2.2 and 2.7.2 AMD64 on Windows7, but doesn't occur on ubuntu. ---------- components: Windows files: z.py messages: 155612 nosy: miwa priority: normal severity: normal status: open title: sys.stdin.readline and KeyboardInterrupt on windows type: behavior versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file24821/z.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 15:07:37 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 14:07:37 +0000 Subject: [issue1666318] shutil.copytree doesn't give control over directory permissions Message-ID: <1331647657.67.0.0459536185771.issue1666318@psf.upfronthosting.co.za> ?ric Araujo added the comment: Patch looks good. I don?t know if I should fix this in 3.3 with your patch or go back to the first idea of adding a copystat(src, dst) after the mkdir call. I just don?t know if it?s important that this behavior does not change in stable versions, or if it?s clearly a bug and we can change it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 15:18:12 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 14:18:12 +0000 Subject: [issue14273] distutils2: logging handler not properly initialized In-Reply-To: <1331592978.94.0.127505196077.issue14273@psf.upfronthosting.co.za> Message-ID: <1331648292.21.0.150739847327.issue14273@psf.upfronthosting.co.za> ?ric Araujo added the comment: We didn?t give enough info, sorry. This bug is not reproducible with packaging, it only shows when using the distutils2 repository with Python 2.5, 2.6 or 3.1. I think it?s related to the absence of built-in handler of last resort. (packaging?s logger is named ?packaging? and d2?s is ?distutils2?, that?s why your grep did not find it. This is one of the few differences between both codebases that I will fix before the betas.) > Looking at packaging.run.main() - it calls Dispatcher(args), and any exception in Dispatcher.__init__() > before the call to _set_logger could lead to a logging call being made before a handler is set up. > Suggestion: set the handler as early as possible, perhaps in main() where the other handlers logic is, and > just set the level later (as that is the only thing that depends on verbosity settings passed in via > command line flags). Thanks, I will try that! > 1. Why are the packaging logger's handlers are saved and restored en masse - all that is happening is that > a handler is being added in Dispatcher._set_logger, so it would seem to be enough to call removeHandler(). Tarek added that in d53e813ffe58 to fix regrtest warnings about test_packaging modifying logging._handlers. > 2. There should normally be no need to set both the logger's *and* and handler's level to the same value - > if the event fails the logger's level test, it will not be passed to handlers anyway. In packaging code I > found no reference to any other loggers than "packaging" - i.e. no child loggers whose events might need to > be blocked at the handler level. Yes, the whole package only uses one logger, and we don?t want to stop messages: the application (pysetup, pip, etc.) must be able to set the level. I?ll remove the code that sets a level on the logger and write a test to make sure that a client can get all messages. ---------- priority: high -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 15:29:56 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 14:29:56 +0000 Subject: [issue12365] URLopener should support context manager protocol In-Reply-To: <1308504365.98.0.668285563314.issue12365@psf.upfronthosting.co.za> Message-ID: <1331648996.98.0.856331588607.issue12365@psf.upfronthosting.co.za> ?ric Araujo added the comment: Thanks for the patch. - This function returns a file-like object with two additional methods from + This function returns a file-like object that supports the Context Manager + protocol, with two additional methods from The capitalization seems unneeded to me. Also, in my opinion saying ?file-like? implies support for the context manager protocol, even if not all file-likes do, and anyway not all users share my assumption. What do you think about this wording: This function returns a file-like object that works as a :term:`context manager` and has two additional methods from the :mod:`urllib.response` module The term role creates a link to the glossary. (BTW the entry for context manager could be improved to give open as example; I?ll do that.) +It is also possible to achieve the same result using a context manager +approach. :: I would rather use with statements everywhere, or if it makes sense to have examples both with and without with, to put the example with with first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 15:31:01 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 14:31:01 +0000 Subject: [issue14180] Factorize code to convert int/float to time_t, timeval or timespec In-Reply-To: <1330733422.24.0.352066771242.issue14180@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 1eaf6e899f02 by Victor Stinner in branch 'default': Issue #14180: Fix select.select() compilation on BSD and a typo in kqueue_queue_control() http://hg.python.org/cpython/rev/1eaf6e899f02 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 15:35:06 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 13 Mar 2012 14:35:06 +0000 Subject: [issue13889] str(float) and round(float) issues with FPU precision In-Reply-To: <1331647372.59.0.975659257825.issue13889@psf.upfronthosting.co.za> Message-ID: <20120313143505.GA15416@sleipnir.bytereef.org> Stefan Krah added the comment: Mark Dickinson wrote: > http://msdn.microsoft.com/en-us/library/e9b52ceh(v=vs.100).aspx > Question 1: when doing __control87_2(new, mask, &old, NULL), does the > resulting value in old reflect the *new* FPU state or the old one? The new one, but I had to test that manually (see below). > Question 2: in the example near the bottom of that page, there's code like: > > control_word_x87 = __control87_2(_PC_24, MCW_PC, > &control_word_x87, 0); > > This looks very odd: we're assigning to control_word_x87, *and* passing it as an output parameter to the call. Moreover, from the documentation the return value from __control87_2 is always 1 to indicate success, so I'm not sure why it's being assigned to control_word_x87. > > Am I the only person who's confused by this? I was confused as well. I'm positive that it's a cut-and-paste bug in the docs: Probably they had _control87() in that place before, which *does* return the new control word. As you say, the example above clobbers the value that was set via the pointer reference, so the result is always 1. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 15:41:45 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Mar 2012 14:41:45 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1331649705.82.0.466788255053.issue5758@psf.upfronthosting.co.za> R. David Murray added the comment: For 3.2 could we use the same fix, but without exposing the ability to *change* the encoding? That is, we use TextIOWrapper but always with the default None for encoding. It also occurs to me that this really exposes a weakness in the design. What if the user wants to specify other open parameters? I wonder if we should say that for better future-proofing openhooks should always take **kw. You could even envision fileinput accepting **kw and passing them along to the openhook. I think charset is the most important open paramenter in this context, though, so I don't think we have to solve the general problem in this fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 15:48:16 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 13 Mar 2012 14:48:16 +0000 Subject: [issue13889] str(float) and round(float) issues with FPU precision In-Reply-To: <20120313143505.GA15416@sleipnir.bytereef.org> Message-ID: <20120313144812.GA15591@sleipnir.bytereef.org> Stefan Krah added the comment: Stefan Krah wrote: > > Stefan Krah added the comment: > > Mark Dickinson wrote: > > http://msdn.microsoft.com/en-us/library/e9b52ceh(v=vs.100).aspx > > Question 1: when doing __control87_2(new, mask, &old, NULL), does the > > resulting value in old reflect the *new* FPU state or the old one? > > The new one, but I had to test that manually (see below). Well of course, unless both new and mask are 0, in which case it's the existing state. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 15:57:18 2012 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 13 Mar 2012 14:57:18 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1331645214.24.0.106742603471.issue14127@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: Larry, are you sprinting on this? I'd love to help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 16:08:16 2012 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 13 Mar 2012 15:08:16 +0000 Subject: [issue14273] distutils2: logging handler not properly initialized In-Reply-To: <1331648292.21.0.150739847327.issue14273@psf.upfronthosting.co.za> Message-ID: <1331651294.54131.YahooMailNeo@web171320.mail.ir2.yahoo.com> Vinay Sajip added the comment: > Yes, the whole package only uses one logger, and we don?t want to stop messages: > the application (pysetup, pip, etc.) must be able to set the level.? I?ll remove > the code that sets a level on the logger and write a test to make sure that a > client can get all messages. I think you might mean "sets a level on the handler" - the logger should still have the level set, I think. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 16:11:24 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Mar 2012 15:11:24 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1331651484.99.0.171697742283.issue5758@psf.upfronthosting.co.za> R. David Murray added the comment: It also occurs to me that this fix makes the charset hook look rather odd. We could render it redundant by passing charset to open in the non-openhook case, and mark it deprecated. There is also a bug in the hook_encoding docs. It says the file is opened with codecs.open, but that is not the case, regular open is used. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 16:16:16 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 15:16:16 +0000 Subject: [issue14273] distutils2: logging handler not properly initialized In-Reply-To: <1331592978.94.0.127505196077.issue14273@psf.upfronthosting.co.za> Message-ID: <1331651776.57.0.871222238168.issue14273@psf.upfronthosting.co.za> ?ric Araujo added the comment: > I think you might mean "sets a level on the handler" - the logger should still have the level set IIUC the logger should be set to DEBUG, otherwise even if e.g. pip wants to get INFO messages it won?t see them. Is that right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 16:20:47 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 15:20:47 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1331652047.49.0.531766126935.issue5758@psf.upfronthosting.co.za> ?ric Araujo added the comment: > For 3.2 could we use the same fix, but without exposing the ability to *change* the encoding? > That is, we use TextIOWrapper but always with the default None for encoding. Yes! > It also occurs to me that this really exposes a weakness in the design. What if the user wants to > specify other open parameters? I wonder if we should say that for better future-proofing openhooks > should always take **kw. You could even envision fileinput accepting **kw and passing them along > to the openhook. I think charset is the most important open paramenter in this context, though, so > I don't think we have to solve the general problem in this fix. I concur. I?ve never had to care about buffering for example, but mode is another parameter of open that people may want to give. I?ll commit the minimal fix to 3.2 and merge in 3.3, and then we can discuss on a new RFE bug about adding encoding vs. **kwargs for 3.3. Agreed on deprecating the charset hook when it becomes redundant. Will fix the doc bug about codecs.open too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 16:25:46 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 15:25:46 +0000 Subject: [issue14180] Factorize code to convert int/float to time_t, timeval or timespec In-Reply-To: <1330733422.24.0.352066771242.issue14180@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset cb1c877a27f2 by Victor Stinner in branch 'default': Issue #14180: Fix another typo in kqueue_queue_control() http://hg.python.org/cpython/rev/cb1c877a27f2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 17:10:24 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 13 Mar 2012 16:10:24 +0000 Subject: [issue14288] Make iterators pickleable Message-ID: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> New submission from Kristj?n Valur J?nsson : A common theme in many talks last year about cloud computing was the need to suspend execution, pickle state, and resume it on a different node. This patch is the result of last year's stackless sprint at pycon, finally completed and submitted for review. Python does not currently support pickling of many run-time structures, but pickling for things like iterators is trivial. A large piece of Stackless' branch is to make sure that various run-time constructs are pickleable, including function objects. While this patch does not do that, it does add pickling for dictiter, and the lot. This makes it possible to have compilcated data sets, iterate through them, and pickle them in a semi-consumed state. Please note that a slight hack is needed to pickle some iterators. Many of these classes are namely "hidden" and there is no way to access their constructors by name. instead, an unpickling trick is to invoke "iter" on an object of the target type instead. Not the most elegant solution but I didn't want to complicate matters by adding iterator classes into namespaces. Where should stringiter live for example? Be a builtin like str? We also didn't aim to make all iterators copy.copy-able using the __reduce__ protocol. Some iterators actually use internal iterators themselves, and if a (non-deep) copy were to happen, we would have to shallow copy those internal objects. Instead, we just return the internal iterator object directly from __reduce__ and allow recursive pickling to proceed. ---------- files: pickling.patch keywords: patch messages: 155626 nosy: krisvale, loewis, michael.foord priority: normal severity: normal status: open title: Make iterators pickleable type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file24822/pickling.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 17:11:30 2012 From: report at bugs.python.org (Alexander Belopolsky) Date: Tue, 13 Mar 2012 16:11:30 +0000 Subject: [issue14262] Allow using decimals as arguments to `timedelta` In-Reply-To: <1331557988.1.0.944940856764.issue14262@psf.upfronthosting.co.za> Message-ID: <1331655090.9.0.60760833338.issue14262@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I am -0 on the feature and -1 on the implementation. Conversion from Decimal to float is explicit by design. Decimal gives the user fine control over rounding issues allowing for either exact arithmetics (trapping inexact operation) or one of several rounding modes. This said, timedelta() is not much worse than float(), so I will be only -0 if the implementation is such that (1) timedelta() does no loose precision over the entire range of timedelta and rounding is documented; and (2) implementaton does not require an explicit import decimal inside the datetime module. ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 17:20:47 2012 From: report at bugs.python.org (Jeff McNeil) Date: Tue, 13 Mar 2012 16:20:47 +0000 Subject: [issue1666318] shutil.copytree doesn't give control over directory permissions Message-ID: <1331655647.17.0.198248266383.issue1666318@psf.upfronthosting.co.za> Jeff McNeil added the comment: Ah, understood. I kind of like the idea of having the added functionality behind a custom callable, but if it's generally just a bug then copystat is a good solution, too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 17:31:26 2012 From: report at bugs.python.org (Tatiana Al-Chueyr) Date: Tue, 13 Mar 2012 16:31:26 +0000 Subject: [issue14062] UTF-8 Email Subject problem In-Reply-To: <1329725009.21.0.0898146100656.issue14062@psf.upfronthosting.co.za> Message-ID: <1331656286.15.0.0921323182145.issue14062@psf.upfronthosting.co.za> Tatiana Al-Chueyr added the comment: Hi msladek! I tried to reproduce your bug using Python 3.2.2 on MacOS X, but didn't manage - all worked fine. I used gmail both to send and receive the message, on SSL: smtpPort = '465' smtpSrv = 'smtp.gmail.com' As I'm no SMPTP nor email expert, I asked r.david.murray to review the email message code received and it looks fine. Could you provide a smaller example of code that causes the same problem? I just extracted your code to help other people trying to reproduce the bug. It is attached. ---------- nosy: +tati_alchueyr Added file: http://bugs.python.org/file24823/issue14062_buggy_email_subject.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 17:38:13 2012 From: report at bugs.python.org (Jason Killen) Date: Tue, 13 Mar 2012 16:38:13 +0000 Subject: [issue8536] Support new features of ZLIB 1.2.4 In-Reply-To: <1272302591.08.0.11918516326.issue8536@psf.upfronthosting.co.za> Message-ID: <1331656693.33.0.114769571969.issue8536@psf.upfronthosting.co.za> Jason Killen added the comment: Given this is marked as good for a newbie and easy I figured I'd take a crack at it but I'm confused. As example I don't see where inflateReset2 would be useful. I don't see anywhere inflateReset is used and would need to be replaced by inflateReset2. I also don't see where the action of inflateReset2 (End then Init) is currently used. What am I missing? ---------- nosy: +Jason.Killen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 17:42:29 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 16:42:29 +0000 Subject: [issue14180] Factorize code to convert int/float to time_t, timeval or timespec In-Reply-To: <1330733422.24.0.352066771242.issue14180@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 760cf150bb99 by Victor Stinner in branch 'default': Issue #14180: Fix pythoncore.vcproj, Modules/_time.[ch] have been removed http://hg.python.org/cpython/rev/760cf150bb99 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 17:44:01 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 13 Mar 2012 16:44:01 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1331645214.24.0.106742603471.issue14127@psf.upfronthosting.co.za> Message-ID: <4F5F794F.2030208@v.loewis.de> Martin v. L?wis added the comment: > I don't want to remove os.futimens() and os.utimensat() because they add a feature: UTIME_NOW and UTIME_OMIT flags. I'm not sure how this could work: UTIME_NOW and UTIME_OMIT have typically values such as ((1l << 30) - 2l) which could be mistaken as a time stamp if there is a flat nanosecond value. There would be ways to solve this, of course: not passing the value should be considered as UTIME_OMIT, and passing -1 may be treated as UTIME_NOW. ---------- title: add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds -> add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 17:45:00 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 13 Mar 2012 16:45:00 +0000 Subject: [issue1178863] Variable.__init__ uses self.set(), blocking specialization Message-ID: <1331657100.2.0.46548225397.issue1178863@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Thanks for the patch. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 18:06:33 2012 From: report at bugs.python.org (Brian Jones) Date: Tue, 13 Mar 2012 17:06:33 +0000 Subject: [issue14278] email.utils.localtime throws exception if time.daylight is False In-Reply-To: <1331597641.5.0.510268852561.issue14278@psf.upfronthosting.co.za> Message-ID: <1331658393.9.0.358683663266.issue14278@psf.upfronthosting.co.za> Changes by Brian Jones : ---------- nosy: +r.david.murray -Brian.Jones _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 18:11:41 2012 From: report at bugs.python.org (Michal Sladek) Date: Tue, 13 Mar 2012 17:11:41 +0000 Subject: [issue14062] UTF-8 Email Subject problem In-Reply-To: <1329725009.21.0.0898146100656.issue14062@psf.upfronthosting.co.za> Message-ID: <1331658701.13.0.0550224212172.issue14062@psf.upfronthosting.co.za> Michal Sladek added the comment: I tested the code again. Using Gmail SMTP server produces correct results, using server smtp.seznam.cz leads to a problem (I should mention here, that Seznam is the largest free mail provider in the Czech Republic). Here are the differences on receiving side. GMAIL: Return-Path: Received: from mail-bk0-f45.google.com (mail-bk0-f45.google.com [209.85.214.45]) by mx4.volny.cz (Postfix) with ESMTP id 0A3E12E086B for ; Tue, 13 Mar 2012 17:58:03 +0100 (CET) Received: by bkcjg9 with SMTP id jg9so842625bkc.18 for ; Tue, 13 Mar 2012 09:58:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:content-type:mime-version:from:to:subject :x-gm-message-state; bh=Sdb8G6CtN+pEzPJHxwbwCprTgWPJUrR3jiU+qeK1WAs=; b=X88feHvtpL6zBXYNYSjgUQ+1WirGmU8B69k+4fGlAge6F5+pYd6SzuJ6ExdBsp+brw 1QuCne97OdVnYoFmg86ZviFz3m6Cn6N8hgPNa2H7hCPQD4O+cjJQQzze4xXYqgPJQs+D ke4ISEmxL9UFJUvkTyFhrCDefSxQMY+TnnLwWQR+PCD/uB0FgR2UgBjEx9K7EUKQi6W0 78+EZYO3cd+SuuadOUvIpe2cj0576ahcP40dGN0kIe+P4NX5Ij7D2cCa/bWiwFdDRUI4 v8UxJcnbTuOCQFtlItxCAxU9IzZWGekWtpJVnRDBGG63iGXHoTDzp+4+d1FRBGsDQ2pD l5tg== Received: by 10.204.150.73 with SMTP id x9mr6371797bkv.7.1331657883687; Tue, 13 Mar 2012 09:58:03 -0700 (PDT) Received: from dvr.ph.sladkovi.eu (ip-84-42-150-218.net.upcbroadband.cz. [84.42.150.218]) by mx.google.com with ESMTPS id u14sm2783344bkp.2.2012.03.13.09.58.02 (version=SSLv3 cipher=OTHER); Tue, 13 Mar 2012 09:58:02 -0700 (PDT) Message-ID: <4f5f7c9a.0e70cc0a.12f5.75a3 at mx.google.com> Date: Tue, 13 Mar 2012 09:58:02 -0700 (PDT) Content-Type: multipart/mixed; boundary="===============1165280172==" MIME-Version: 1.0 From: michal at sladkovi.eu To: msladek at volny.cz Subject: =?utf-8?b?xb5sdcWlb3XEjWvDvSBrxa/FiA==?= X-Gm-Message-State: ALoCoQmf6k2GVVKdm0ZNbvSyPpZ0Gl1yv/BDc3h3zrh34hWWp3wa/fSBXbWT9FANzBLd5k1qUnEP X-DKIM-Status: neutral X-Virus: no (m2.volny.internal - Tue, 13 Mar 2012 17:58:05 +0100 (CET)) X-Spam: no (m2.volny.internal - Tue, 13 Mar 2012 17:58:07 +0100 (CET)) X-Received-Date: Tue, 13 Mar 2012 17:58:08 +0100 (CET) --===============1165280172== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 w7pwxJtsIMSPw6FiZWxza8OpIMOzZHk= --===============1165280172==-- -------------------------------------------------------------- SEZNAM: Return-Path: Received: from smtp2.seznam.cz (smtp2.seznam.cz [77.75.76.43]) by mx4.volny.cz (Postfix) with ESMTP id 542A32E0868 for ; Tue, 13 Mar 2012 18:00:05 +0100 (CET) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=seznam.cz; h=Received:Content-Type:MIME-Version:From:To:Subject:--===============1097187749==:MIME-Version:Content-Transfer-Encoding:X-Smtpd:X-Seznam-User:X-Session:X-Country:X-Virus-Info:X-Seznam-SPF:X-Seznam-DomainKeys; b=bfwTOSoFJU7vGbB7VvXNIQzhbsj+pDPhwr72BX1aVWAicyK0Cix3evz6c3+srYBba lHDeYd74ZXW5553N6ocfy68pRxpI6K5dKfvcKKLgUN7+N/iQOUtj09D4wN81cjPt7qQ uH5rjcdsDsbZV31EsxyS1P/rn6F7bYOxrpPeHAk= Received: from dvr.ph.sladkovi.eu (ip-84-42-150-218.net.upcbroadband.cz [84.42.150.218]) by email-relay1.ng.seznam.cz (Seznam SMTPD 1.2.15-6 at 18976) with ESMTP; Tue, 13 Mar 2012 17:59:32 +0100 (CET) Content-Type: multipart/mixed; boundary="===============1097187749==" MIME-Version: 1.0 From: Michal.Sladek at seznam.cz To: msladek at volny.cz Subject: =?utf-8?b?xb5sdcWlb3XEjWvDvSBrxa/FiA==?= X-DKIM-Status: fail X-Virus: no (m2.volny.internal - Tue, 13 Mar 2012 18:00:06 +0100 (CET)) X-Spam: no (m2.volny.internal - Tue, 13 Mar 2012 18:00:08 +0100 (CET)) X-Received-Date: Tue, 13 Mar 2012 18:00:08 +0100 (CET) --===============1097187749==:Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 X-Smtpd: 1.2.15-6 at 18976 X-Seznam-User: michal.sladek at seznam.cz X-Session: 5 X-Country: CZ X-Virus-Info:clean X-Seznam-SPF:neutral X-Seznam-DomainKeys:unknown w7pwxJtsIMSPw6FiZWxza8OpIMOzZHk= --===============1097187749==-- -------------------------------------------------------------- As you can see, Seznam is adding a lot of headers into mail's body. Anyway, making utf-8 subject manually like this: base64Subject = base64.b64encode(subject.encode('utf-8')).decode() encodedSubject = '=?UTF-8?B?{0}?='.format(base64Subject) message.add_header('Subject',encodedSubject) works correctly for both SMTP servers. So there must be a difference... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 18:29:46 2012 From: report at bugs.python.org (Larry Hastings) Date: Tue, 13 Mar 2012 17:29:46 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331659786.38.0.719426129679.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: > Larry, are you sprinting on this? I'd love to help. I am. Come on by--mi CPU es tu CPU! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 18:31:05 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 13 Mar 2012 17:31:05 +0000 Subject: [issue2843] New methods for existing Tkinter widgets In-Reply-To: <1210648562.38.0.607141778412.issue2843@psf.upfronthosting.co.za> Message-ID: <1331659865.56.0.768756335431.issue2843@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Fresh patch for current 3.3 head is attached. ---------- keywords: +patch Added file: http://bugs.python.org/file24824/tknewmethods.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 18:45:18 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 13 Mar 2012 17:45:18 +0000 Subject: [issue2843] New methods for existing Tkinter widgets In-Reply-To: <1210648562.38.0.607141778412.issue2843@psf.upfronthosting.co.za> Message-ID: <1331660718.2.0.369914704856.issue2843@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Martin, please review and move it forward if ok. ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 18:51:56 2012 From: report at bugs.python.org (Jack Diederich) Date: Tue, 13 Mar 2012 17:51:56 +0000 Subject: [issue10522] test_telnet exception In-Reply-To: <1290612667.85.0.353730083287.issue10522@psf.upfronthosting.co.za> Message-ID: <1331661116.88.0.729658093715.issue10522@psf.upfronthosting.co.za> Jack Diederich added the comment: Either someone changed the test or I can't understand how the try/except/else could happen where 'conn' is undefined in the else. Either way, I'm marking it closed. ---------- resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 19:12:27 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 18:12:27 +0000 Subject: [issue14180] Factorize code to convert int/float to time_t, timeval or timespec In-Reply-To: <1330733422.24.0.352066771242.issue14180@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 9d69a2418d80 by Victor Stinner in branch 'default': Issue #14180: Fix an invalid rounding when compiler optimization are enabled http://hg.python.org/cpython/rev/9d69a2418d80 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 19:15:55 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 13 Mar 2012 18:15:55 +0000 Subject: [issue3835] tkinter goes into an infinite loop (pydoc.gui) In-Reply-To: <1221139272.34.0.29160759745.issue3835@psf.upfronthosting.co.za> Message-ID: <1331662555.16.0.0686985975766.issue3835@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Push updated patch for tip (3.3) head ---------- nosy: +asvetlov Added file: http://bugs.python.org/file24825/issue_3835_2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 19:30:40 2012 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Tue, 13 Mar 2012 18:30:40 +0000 Subject: [issue14288] Make iterators pickleable In-Reply-To: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> Message-ID: <1331663440.66.0.773957512681.issue14288@psf.upfronthosting.co.za> Changes by Jes?s Cea Avi?n : ---------- nosy: +jcea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 19:33:12 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 18:33:12 +0000 Subject: [issue14184] test_recursion_limit fails on OS X when compiled with clang In-Reply-To: <1330799175.64.0.584066086457.issue14184@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 246e681a4272 by Ned Deily in branch '3.2': Issue #14184: Increase the default stack size for secondary threads on http://hg.python.org/cpython/rev/246e681a4272 New changeset c00ac2b25048 by Ned Deily in branch 'default': Issue #14184: merge http://hg.python.org/cpython/rev/c00ac2b25048 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 19:36:30 2012 From: report at bugs.python.org (Ned Deily) Date: Tue, 13 Mar 2012 18:36:30 +0000 Subject: [issue14184] test_recursion_limit fails on OS X when compiled with clang In-Reply-To: <1330799175.64.0.584066086457.issue14184@psf.upfronthosting.co.za> Message-ID: <1331663790.31.0.308820206036.issue14184@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for the report. Fix applied for 3.2.x (for release in 3.2.4) and default (for 3.3.0). ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 19:36:34 2012 From: report at bugs.python.org (Jason Killen) Date: Tue, 13 Mar 2012 18:36:34 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1331663794.32.0.143059270719.issue14269@psf.upfronthosting.co.za> Jason Killen added the comment: I've generated a patch that checks to see if seen_greeting is set before processing other commands. This is the first time I've submitted a patch so if there is something more I need to do let me know. ---------- nosy: +Jason.Killen Added file: http://bugs.python.org/file24826/smtpd.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 19:44:43 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 13 Mar 2012 18:44:43 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1331664283.28.0.473675230358.issue7652@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Stefan, please feel free to commit the latest patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 19:58:22 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 13 Mar 2012 18:58:22 +0000 Subject: [issue5219] IDLE/Tkinter: edit win stops updating when tooltip is active In-Reply-To: <1234382300.54.0.847679485731.issue5219@psf.upfronthosting.co.za> Message-ID: <1331665102.47.0.331554826308.issue5219@psf.upfronthosting.co.za> Andrew Svetlov added the comment: I confirm: patch5219.diff solves the problem in linux box. ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:04:18 2012 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 13 Mar 2012 19:04:18 +0000 Subject: [issue13889] str(float) and round(float) issues with FPU precision In-Reply-To: <1327676303.66.0.487112802864.issue13889@psf.upfronthosting.co.za> Message-ID: <1331665458.55.0.974017563438.issue13889@psf.upfronthosting.co.za> Mark Dickinson added the comment: Thanks for the responses. As far as I'm concerned, this is good to go into all 3 maintained branches. Having said that, the 2.7 and 3.2 branches are currently at release candidate stage, so I think we should wait until after the releases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:24:05 2012 From: report at bugs.python.org (Frank) Date: Tue, 13 Mar 2012 19:24:05 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331666645.48.0.929340322119.issue829370@psf.upfronthosting.co.za> Frank added the comment: Its true. Python needs it as every scientific programming language needs it. Its a matter of completeness. This is a deficit. ---------- nosy: +fkbreitl versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:31:39 2012 From: report at bugs.python.org (Merlijn van Deen) Date: Tue, 13 Mar 2012 19:31:39 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331667099.97.0.588488186459.issue829370@psf.upfronthosting.co.za> Merlijn van Deen added the comment: numpy.sign does this: http://docs.scipy.org/doc/numpy/reference/generated/numpy.sign.html ---------- nosy: +valhallasw _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:34:15 2012 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 13 Mar 2012 19:34:15 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1331667255.96.0.0894681454838.issue7652@psf.upfronthosting.co.za> Mark Dickinson added the comment: > FWIW, I think we would be better off if this patch were merged in soon. +1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:39:38 2012 From: report at bugs.python.org (Nam Nguyen) Date: Tue, 13 Mar 2012 19:39:38 +0000 Subject: [issue14289] Prebuilt CHM file on Docs download page Message-ID: <1331667578.7.0.0463792055808.issue14289@psf.upfronthosting.co.za> New submission from Nam Nguyen : Before 2.7, one can easily find .CHM files in the Documentation download page. When 2.7 come out, the only way to get CHM files is downloading the Windows installers (EXE or MSI), installing it on Windows, and grabbing the CHM files. This is unwieldy. I am on a Mac at work, have a desktop running Linux and Windows at home. In all cases, I usually rely on the CHM file. It is self-packaged, indexable, and easily searchable. There are CHM readers out there that work across different OSes such as the cross platform xCHM. Therefore, I'd like to request for a prebuilt .CHM file for download, in addition to what there already are. ---------- assignee: docs at python components: Documentation messages: 155650 nosy: Nam.Nguyen, docs at python priority: normal severity: normal status: open title: Prebuilt CHM file on Docs download page _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:40:42 2012 From: report at bugs.python.org (Robert) Date: Tue, 13 Mar 2012 19:40:42 +0000 Subject: [issue14290] Importing script as module causes ImportError with pickle.load Message-ID: <1331667642.01.0.680129740358.issue14290@psf.upfronthosting.co.za> New submission from Robert : I implemented a data-structure as an object in a script, let's call it objectScript.py. I'm using this data-structure in other scripts like so: from objectScript import data-structure Populating this data-structure requires quite a bit of time, so when I'm done with it, I like to pickle it. However, if I try to load it from the pickled file, I get the following error: ImportError: No module named objectScript However, if I replace my 'from objectScript import data-structure' statement with the actual data-structure class definition from the objectScript.py file when I am pickling the object but then revert to the import statement when I am unpickling the object, everything works fine. ---------- components: Library (Lib) messages: 155651 nosy: rj3d priority: normal severity: normal status: open title: Importing script as module causes ImportError with pickle.load type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:41:41 2012 From: report at bugs.python.org (Frank) Date: Tue, 13 Mar 2012 19:41:41 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331667701.41.0.289319844292.issue829370@psf.upfronthosting.co.za> Frank added the comment: That's too much for too little. The math module should cover the basics. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:44:36 2012 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 13 Mar 2012 19:44:36 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331667876.16.0.596359387873.issue829370@psf.upfronthosting.co.za> Mark Dickinson added the comment: I disagree that this is useful enough to make it worth adding to the standard library. Between math.copysign and simple comparisons, I think all the common cases are well covered. And it's a simple one-line function: def signum(x): return (x > 0) - (x < 0) Frank, do you have any convincing use-cases that aren't already covered by math.copysign or simple two-way comparisons (e.g., x >= 0)? ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:46:24 2012 From: report at bugs.python.org (Michael Foord) Date: Tue, 13 Mar 2012 19:46:24 +0000 Subject: [issue10543] Test discovery (unittest) does not work with jython In-Reply-To: <1290790738.08.0.631602172773.issue10543@psf.upfronthosting.co.za> Message-ID: <1331667984.98.0.294825967943.issue10543@psf.upfronthosting.co.za> Michael Foord added the comment: Now fixed. ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:50:27 2012 From: report at bugs.python.org (Georg Brandl) Date: Tue, 13 Mar 2012 19:50:27 +0000 Subject: [issue14289] Prebuilt CHM file on Docs download page In-Reply-To: <1331667578.7.0.0463792055808.issue14289@psf.upfronthosting.co.za> Message-ID: <1331668227.04.0.125069506414.issue14289@psf.upfronthosting.co.za> Georg Brandl added the comment: The CHMs are already on the Python download page, along with the .msi installers. We can add a note to the docs download page that they are to be found there. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:55:34 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Mar 2012 19:55:34 +0000 Subject: [issue14291] Regression in Python3 of email handling of unicode strings in headers Message-ID: <1331668534.02.0.642658515735.issue14291@psf.upfronthosting.co.za> New submission from R. David Murray : In Python2, this works: >>> from email.mime.text import MIMEText >>> m = MIMEText('abc') >>> str(m) 'From nobody Tue Mar 13 15:44:59 2012\nContent-Type: text/plain; charset="us-ascii"\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\n\nabc' >>> m['Subject'] = u'? test' >>> str(m) 'From nobody Tue Mar 13 15:48:11 2012\nContent-Type: text/plain; charset="us-ascii"\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\nSubject: =?utf-8?q?=C3=89_test?=\n\nabc' That is, unicode string automatically get turned into encoded words. In Python3 this no longer works: >>> from email.mime.text import MIMEText >>> m = MIMEText('abc') >>> str(m) 'Content-Type: text/plain; charset="us-ascii"\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\n\nabc' >>> m['Subject'] = u'? test' >>> str(m) Traceback (most recent call last): File "", line 1, in File "/home/rdmurray/python/p33/Lib/email/message.py", line 154, in __str__ return self.as_string() File "/home/rdmurray/python/p33/Lib/email/message.py", line 168, in as_string g.flatten(self, unixfrom=unixfrom) File "/home/rdmurray/python/p33/Lib/email/generator.py", line 99, in flatten self._write(msg) File "/home/rdmurray/python/p33/Lib/email/generator.py", line 152, in _write self._write_headers(msg) File "/home/rdmurray/python/p33/Lib/email/generator.py", line 186, in _write_headers header_name=h) File "/home/rdmurray/python/p33/Lib/email/header.py", line 205, in __init__ self.append(s, charset, errors) File "/home/rdmurray/python/p33/Lib/email/header.py", line 286, in append s.encode(output_charset, errors) UnicodeEncodeError: 'ascii' codec can't encode character '\xc9' in position 0: ordinal not in range(128) Presumably the problem is that the Python2 code tests for 'string' and if it isn't string handles it by CTE encoding it. In Python3 everything is a string. Probably what should happen is the encoding error should be caught, and the CTE encoding done at that point, based on the model of how Python2 handled unicode strings. ---------- assignee: r.david.murray components: Library (Lib) keywords: easy messages: 155656 nosy: aikinci, r.david.murray priority: high severity: normal stage: needs patch status: open title: Regression in Python3 of email handling of unicode strings in headers type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 20:57:07 2012 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 13 Mar 2012 19:57:07 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331668627.54.0.855450103934.issue829370@psf.upfronthosting.co.za> Mark Dickinson added the comment: See also the (fairly) recent python-ideas discussion starting here: http://mail.python.org/pipermail/python-ideas/2010-April/007136.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 21:06:56 2012 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 13 Mar 2012 20:06:56 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331669216.48.0.0591968583825.issue829370@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- versions: -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 21:14:02 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Mar 2012 20:14:02 +0000 Subject: [issue14062] UTF-8 Email Subject problem In-Reply-To: <1329725009.21.0.0898146100656.issue14062@psf.upfronthosting.co.za> Message-ID: <1331669642.65.0.237684217953.issue14062@psf.upfronthosting.co.za> R. David Murray added the comment: It makes no sense that changing how Subject is generated would affect the later formatting of the mime header. There is no coupling that I'm aware of in the code. I notice that your handcrafted version uses uppercase for the charset and CTE code. Can you try using lowercase like the email module does, and see if that reproduces the problem? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 21:32:45 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Mar 2012 20:32:45 +0000 Subject: [issue14278] email.utils.localtime throws exception if time.daylight is False In-Reply-To: <1331597641.5.0.510268852561.issue14278@psf.upfronthosting.co.za> Message-ID: <1331670765.0.0.266319516285.issue14278@psf.upfronthosting.co.za> R. David Murray added the comment: Thanks, Brian. (For the record, this is a bug in email6 code that hasn't been checked into trunk yet.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 21:40:55 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 20:40:55 +0000 Subject: [issue2843] New methods for existing Tkinter widgets In-Reply-To: <1210648562.38.0.607141778412.issue2843@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 71041c0dedd5 by Martin v. L?wis in branch 'default': Issue #2843: Add new Tk API to Tkinter. http://hg.python.org/cpython/rev/71041c0dedd5 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 21:41:17 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 13 Mar 2012 20:41:17 +0000 Subject: [issue2843] New methods for existing Tkinter widgets In-Reply-To: <1210648562.38.0.607141778412.issue2843@psf.upfronthosting.co.za> Message-ID: <1331671277.37.0.880745124854.issue2843@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Thanks both of you for the patches. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 21:43:29 2012 From: report at bugs.python.org (Frank) Date: Tue, 13 Mar 2012 20:43:29 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331671409.49.0.510795630203.issue829370@psf.upfronthosting.co.za> Frank added the comment: Mark, the convincing use-cases apear already on this page. People suggest the usage of numpy or the definition of all kinds of functions to accomplish this trivial task. But the users don't want to worry about this. They just want to use this function and not lose time figuring out how to best implement it in python. Copysign is not very intuitive e.g. because command completion on math.si_ fails and because it will not be a first result by search engines. The discussion is another example for the user request. And I have the feeling that with the time spend on it all different variations of signum functions could have been implemented including their documentation - although the implementation of your two line solution should have been satisfying for almost everybody... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 21:44:25 2012 From: report at bugs.python.org (Nicholas Riley) Date: Tue, 13 Mar 2012 20:44:25 +0000 Subject: [issue14292] OS X installer build script doesn't set $CXX, so it ends up as "c++" Message-ID: <1331671465.67.0.741908765122.issue14292@psf.upfronthosting.co.za> New submission from Nicholas Riley : % python build-installer.py \ --sdk-path=/Developer/SDKs/MacOSX10.6.sdk \ --universal-archs=intel \ --dep-target=10.6 Settings: * Source directory: /Users/nicholas/src/cpython * Build directory: /tmp/_py * SDK location: /Developer/SDKs/MacOSX10.6.sdk * Third-party source: /tmp/_py/third-party * Deployment target: 10.6 * Universal architectures: ('i386', 'x86_64') * C compiler: gcc-4.2 [...] Building a universal python for intel architectures [...] checking for c++... c++ configure: WARNING: By default, distutils will build C++ extension modules with "c++". If this is not intended, then set CXX on the configure command line. ---------- assignee: ronaldoussoren components: Macintosh messages: 155663 nosy: ned.deily, nriley, ronaldoussoren priority: normal severity: normal status: open title: OS X installer build script doesn't set $CXX, so it ends up as "c++" versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 21:59:24 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 20:59:24 +0000 Subject: [issue3835] tkinter goes into an infinite loop (pydoc.gui) In-Reply-To: <1221139272.34.0.29160759745.issue3835@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset d731dcda2611 by Martin v. L?wis in branch 'default': Issue #3835: Refuse to use unthreaded Tcl in threaded Python. http://hg.python.org/cpython/rev/d731dcda2611 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 22:00:09 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 13 Mar 2012 21:00:09 +0000 Subject: [issue3835] tkinter goes into an infinite loop (pydoc.gui) In-Reply-To: <1221139272.34.0.29160759745.issue3835@psf.upfronthosting.co.za> Message-ID: <1331672409.65.0.0277952192465.issue3835@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Thanks for the patch! ---------- nosy: +loewis resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 22:05:05 2012 From: report at bugs.python.org (Nicholas Riley) Date: Tue, 13 Mar 2012 21:05:05 +0000 Subject: [issue13507] Modify OS X installer builds to package liblzma for the new lzma module In-Reply-To: <1322647679.29.0.297920473861.issue13507@psf.upfronthosting.co.za> Message-ID: <1331672705.92.0.749367040149.issue13507@psf.upfronthosting.co.za> Nicholas Riley added the comment: The configure problem is soluble with --disable-dependency-tracking (it was the -M* options to gcc that caused the problem); something similar is used for SQLite. The attached patch should do it... ---------- keywords: +patch nosy: +nriley Added file: http://bugs.python.org/file24827/xz.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 22:06:28 2012 From: report at bugs.python.org (Luke Macken) Date: Tue, 13 Mar 2012 21:06:28 +0000 Subject: [issue14282] lib2to3.fixer_util.touch_import('__future__', ...) can lead to SyntaxError in code In-Reply-To: <1331614683.04.0.297382545344.issue14282@psf.upfronthosting.co.za> Message-ID: <1331672788.14.0.990301456689.issue14282@psf.upfronthosting.co.za> Luke Macken added the comment: Yep, that seems like the right solution. Thanks, Martin. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 22:18:49 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 21:18:49 +0000 Subject: [issue5219] IDLE/Tkinter: edit win stops updating when tooltip is active In-Reply-To: <1234382300.54.0.847679485731.issue5219@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 505c3b7dc539 by Martin v. L?wis in branch 'default': Issue #5219: Prevent event handler cascade in IDLE. http://hg.python.org/cpython/rev/505c3b7dc539 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 22:24:32 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 13 Mar 2012 21:24:32 +0000 Subject: [issue14288] Make iterators pickleable In-Reply-To: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> Message-ID: <1331673872.0.0.444878158645.issue14288@psf.upfronthosting.co.za> Raymond Hettinger added the comment: ISTM that a discussion on python-dev would be of value here. Iterators are a protocol, not a class; hence, the effort to make them all picklable is potentially endless. The effort would also always be incomplete because some iterators are difficult or inconvenient to pickle (esp. those with inputs from local or temporary resources). Experience with SQL hasn't shown a need to save partially consumed cursors and my experience with iterators indicates that the need for pickling would be rare or that is would distract from better solutions (perhaps message based or somesuch). The size of this patch is a hint that the idea is not a minor change and that it would add a maintenance burden. What is far from clear is whether it would have value for any real-world problems. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 22:31:16 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 13 Mar 2012 21:31:16 +0000 Subject: [issue4345] Implement nb_nonzero for PyTclObject In-Reply-To: <1227016875.57.0.463307209634.issue4345@psf.upfronthosting.co.za> Message-ID: <1331674276.04.0.205058480127.issue4345@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I'm closing the issue. People who want to check for an empty string representation can just convert the tcl objects to strings themselves. I agree with Mark that implementing nonzero is too ambiguous. ---------- nosy: +loewis resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 22:32:57 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 13 Mar 2012 21:32:57 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331674377.85.0.564123972889.issue14200@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 22:34:14 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 21:34:14 +0000 Subject: [issue5219] IDLE/Tkinter: edit win stops updating when tooltip is active In-Reply-To: <1234382300.54.0.847679485731.issue5219@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 7e79dbceb039 by Martin v. L?wis in branch '3.2': Issue #5219: Prevent event handler cascade in IDLE. http://hg.python.org/cpython/rev/7e79dbceb039 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 22:35:03 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 13 Mar 2012 21:35:03 +0000 Subject: [issue8247] Can't Import Tkinter In-Reply-To: <1269741569.3.0.106756150038.issue8247@psf.upfronthosting.co.za> Message-ID: <1331674503.12.0.892047390152.issue8247@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Closing because of lack of feedback. ---------- resolution: -> works for me status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 22:37:05 2012 From: report at bugs.python.org (Jeff Ramnani) Date: Tue, 13 Mar 2012 21:37:05 +0000 Subject: [issue7719] distutils: ignore .nfsXXXX files In-Reply-To: <1263669405.52.0.706975841329.issue7719@psf.upfronthosting.co.za> Message-ID: <1331674625.34.0.670444390452.issue7719@psf.upfronthosting.co.za> Jeff Ramnani added the comment: I've updated SilentGhost's patch to include a test and documentation. ---------- nosy: +jramnani Added file: http://bugs.python.org/file24828/issue7719-nfs_silly_rename.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 22:46:38 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 21:46:38 +0000 Subject: [issue5219] IDLE/Tkinter: edit win stops updating when tooltip is active In-Reply-To: <1234382300.54.0.847679485731.issue5219@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset af1f8adc913b by Martin v. L?wis in branch '2.7': Issue #5219: Prevent event handler cascade in IDLE. http://hg.python.org/cpython/rev/af1f8adc913b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 22:47:19 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 13 Mar 2012 21:47:19 +0000 Subject: [issue5219] IDLE/Tkinter: edit win stops updating when tooltip is active In-Reply-To: <1234382300.54.0.847679485731.issue5219@psf.upfronthosting.co.za> Message-ID: <1331675239.78.0.171326456538.issue5219@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Thanks for the patch and the review. ---------- nosy: +loewis resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:02:40 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 22:02:40 +0000 Subject: [issue8315] ./python -m unittest test.test_importlib doesn't work In-Reply-To: <1270481793.28.0.468676978723.issue8315@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 217fdeeaf6e0 by R David Murray in branch 'default': #8315: add automatic unittest test discovery in test.test_email http://hg.python.org/cpython/rev/217fdeeaf6e0 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:05:26 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Mar 2012 22:05:26 +0000 Subject: [issue8315] ./python -m unittest test.test_importlib doesn't work In-Reply-To: <1270481793.28.0.468676978723.issue8315@psf.upfronthosting.co.za> Message-ID: <1331676326.91.0.832554195533.issue8315@psf.upfronthosting.co.za> R. David Murray added the comment: I fixed this for test_email by adding automatic unit test discovery to test_email.__init__. I believe it should be possible for a similar thing to do be done for test_importlib. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:05:33 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 13 Mar 2012 22:05:33 +0000 Subject: [issue14282] lib2to3.fixer_util.touch_import('__future__', ...) can lead to SyntaxError in code In-Reply-To: <1331614683.04.0.297382545344.issue14282@psf.upfronthosting.co.za> Message-ID: <1331676333.66.0.984047963153.issue14282@psf.upfronthosting.co.za> Changes by Benjamin Peterson : ---------- resolution: -> works for me status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:07:31 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 22:07:31 +0000 Subject: [issue5302] Allow package_data specs/globs to match directories In-Reply-To: <1234909934.56.0.127417684931.issue5302@psf.upfronthosting.co.za> Message-ID: <1331676451.15.0.447349043593.issue5302@psf.upfronthosting.co.za> ?ric Araujo added the comment: Or on the contrary, we could remove the special, not-supported-by-other-parts-of-the-stdlib ** syntax and just expand somedir to match all files in subdir and descendents, in package_data and resources. I?ll make a patch for this idea to see how it looks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:12:53 2012 From: report at bugs.python.org (Brian Jones) Date: Tue, 13 Mar 2012 22:12:53 +0000 Subject: [issue14293] Message methods delegated via __getattr__ inaccessible using super(). Message-ID: <1331676773.49.0.0306891177672.issue14293@psf.upfronthosting.co.za> New submission from Brian Jones : In email6, the message.Message class tries to delegate calls to methods not defined in Message to message._HeaderList. However, delegating in this way makes the methods inaccessible when accessing them through a call to super(). This comes into play in the http.HTTPMessage class, which attempts to call the _HeaderList 'get' method as 'super().get()'. An AttributeError is raised in this case, because super is only examining the class, and not the instance, and isn't executing __getattr__ to get at methods defined in _HeaderList methods. I've attached a patch that only patches the appropriate test module to add a test to prove the failure. The fix involves a bit more complexity, and I've had some trouble getting my brain to not reject the kind of conflation of concepts and overlapping of responsibility that needs to take place to implement the ideas I was able to come up with. I'm happy to help implement a sane solution if anyone has other ideas. A couple of ideas that came up (at the PyCon sprints) were: 1. Make _HeaderList *not* extend 'list', and then have Message inherit from _HeaderList. However, that means basically reimplementing all of the methods in the 'list' interface inside of _HeaderList, and by extension, Message becomes something of a 'list' object for the purpose of header manipulation, but not for anything else (like, say, payload). 2. Just get rid of _HeaderList and put it all inside of Message. See item 1 for issues with this idea. 3. Expose a public 'headers' attribute, which opens a lot of doors in terms of design flexibility, elegance, and cleanliness, but changes the API. 4. Create a base class that defines the non-list-specific interface for _HeaderList. _HeaderList would then inherit from this class, adding the list-specific methods on top, and Message would inherit it and only override non-list-specific methods. This could have some benefits in terms of testing, but arguably it muddies the waters for those maintaining/extending the _HeaderList or Message code. Other ideas? Also let me know if I've done something silly in writing the test to trigger the problem. ---------- components: Library (Lib) files: msg_api_subclass_bug_test.patch keywords: patch messages: 155679 nosy: Brian.Jones, r.david.murray priority: normal severity: normal status: open title: Message methods delegated via __getattr__ inaccessible using super(). versions: Python 3.3 Added file: http://bugs.python.org/file24829/msg_api_subclass_bug_test.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:15:44 2012 From: report at bugs.python.org (Jon Vaughan) Date: Tue, 13 Mar 2012 22:15:44 +0000 Subject: [issue13703] Hash collision security issue In-Reply-To: <1325619410.45.0.862265945379.issue13703@psf.upfronthosting.co.za> Message-ID: <1331676944.93.0.264285646176.issue13703@psf.upfronthosting.co.za> Jon Vaughan added the comment: Victor - yes that was it; a mixture of a 2.7.2 virtual env and 2.7.3. Apologies for any nuisance caused. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:18:58 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Mar 2012 22:18:58 +0000 Subject: [issue13703] Hash collision security issue In-Reply-To: <1325619410.45.0.862265945379.issue13703@psf.upfronthosting.co.za> Message-ID: <1331677138.3.0.200236268669.issue13703@psf.upfronthosting.co.za> STINNER Victor added the comment: Can we close this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:25:46 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 13 Mar 2012 22:25:46 +0000 Subject: [issue13703] Hash collision security issue In-Reply-To: <1325619410.45.0.862265945379.issue13703@psf.upfronthosting.co.za> Message-ID: <1331677546.49.0.332129726157.issue13703@psf.upfronthosting.co.za> Gregory P. Smith added the comment: I believe so. This is in all of the release candidates. The expat/xmlparse.c hash collision DoS issue is being handled on its own via http://bugs.python.org/issue14234. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:27:30 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 13 Mar 2012 22:27:30 +0000 Subject: [issue14288] Make iterators pickleable In-Reply-To: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> Message-ID: <1331677650.44.0.930151448316.issue14288@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Sure, I'll start a discussion there, but at least I've gotten the patch in. The patch is smaller than it looks, most of it is tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:32:46 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 13 Mar 2012 22:32:46 +0000 Subject: [issue8315] ./python -m unittest test.test_importlib doesn't work In-Reply-To: <1270481793.28.0.468676978723.issue8315@psf.upfronthosting.co.za> Message-ID: <1331677966.45.0.697703263532.issue8315@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:35:36 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 13 Mar 2012 22:35:36 +0000 Subject: [issue989712] Support using Tk without a mainloop Message-ID: <1331678136.42.0.869116977505.issue989712@psf.upfronthosting.co.za> Andrew Svetlov added the comment: I've uploaded gpolo's patch converted to python 3.3 Works good on Linux ---------- nosy: +asvetlov, loewis versions: +Python 3.3 -Python 3.2 Added file: http://bugs.python.org/file24830/issue989712.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:38:05 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 13 Mar 2012 22:38:05 +0000 Subject: [issue14288] Make iterators pickleable In-Reply-To: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> Message-ID: <1331678285.76.0.14592835114.issue14288@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The patch looks fine. If python-dev thinks that making-iterators-picklable is worth doing, I would support this going into Python 3.3 (no extra benefit will come from waiting). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:42:01 2012 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 13 Mar 2012 22:42:01 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331678521.29.0.509969716324.issue829370@psf.upfronthosting.co.za> Mark Dickinson added the comment: > Mark, the convincing use-cases apear already on this page. I meant that I'd be interested to see examples of real code (e.g., specific numeric algorithms, etc.) where signum would be useful, and where existing functionality doesn't really do the job neatly. In most examples I can think of, I'm either creating a sign only to multiply some quantity by it later, or I'm making some decision based on the sign. In the first case, math.copysign usually fits the needs very well; in the second, I only need a two-way choice anyway (until Python gets three-way if statements). For example, a case that *seems* like it would be a good candidate for a sign function at first glance is computing the roots of a quadratic polynomial a*x**2 + b*x + c in a numerically safe manner. There what you want to do is find the auxiliary quantity q = -(b + sign(b)*sqrt(b**2 - 4*a*c)) and compute the roots as q / (2*a) and (2*c) / q. [The point of doing it this way is to avoid loss of significant digits from a subtraction of nearly-equal quantities in the case where b is large compared to a and c.] But that's a perfect use-case for copysign: instead of first computing the sign of b and then multiplying by the sqrt, you'd just compute q = -(b + copysign(sqrt(b**2 - 4*a*c), b)) Moreover, in this case you don't want the sign function described in this issue anyway, since it gives wrong results when b == 0; you want a two-valued sign function that always gives -1 or 1, even for an argument of 0. So, do you have better examples than the one above? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 13 23:51:30 2012 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Tue, 13 Mar 2012 22:51:30 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331679090.12.0.000347232479872.issue14234@psf.upfronthosting.co.za> Arfrever Frehtes Taifersar Arahesis added the comment: Maybe it's related to: https://sourceforge.net/tracker/?func=detail&aid=3500861&group_id=10127&atid=110127 (But I think that --with-system-expat should be recommended.) ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 00:15:46 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 13 Mar 2012 23:15:46 +0000 Subject: [issue9216] FIPS support for hashlib In-Reply-To: <1278721335.16.0.522410247151.issue9216@psf.upfronthosting.co.za> Message-ID: <1331680546.48.0.906478507944.issue9216@psf.upfronthosting.co.za> Gregory P. Smith added the comment: quick summary of comments from pycon sprints discussion: this looks pretty good. i like the 0001 refactoring cleanup. a couple things to fix in error handling (better messages and some bogus handling in the test). dmalcolm has the notes on what to do. do it and commit away or ask for more review as you see fit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 00:20:39 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 13 Mar 2012 23:20:39 +0000 Subject: [issue14180] Factorize code to convert int/float to time_t, timeval or timespec In-Reply-To: <1330733422.24.0.352066771242.issue14180@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 5d6a5c5a4ebe by Victor Stinner in branch 'default': Issue #14180: datetime.date.fromtimestamp(), datetime.datetime.fromtimestamp() http://hg.python.org/cpython/rev/5d6a5c5a4ebe New changeset 706689b2d678 by Victor Stinner in branch 'default': Issue #14180: TestDateTime.test_microsecond_rounding() handles localtime() and http://hg.python.org/cpython/rev/706689b2d678 New changeset a0d101220f96 by Victor Stinner in branch 'default': Issue #14180: Fix the select module to handle correctly the Windows timeval http://hg.python.org/cpython/rev/a0d101220f96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 00:21:42 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 13 Mar 2012 23:21:42 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331680902.5.0.349858791596.issue14234@psf.upfronthosting.co.za> Gregory P. Smith added the comment: sweet, thanks for the reference. that really looks like the problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:10:54 2012 From: report at bugs.python.org (Dave Malcolm) Date: Wed, 14 Mar 2012 00:10:54 +0000 Subject: [issue13963] dev guide has no mention of mechanics of patch review In-Reply-To: <1328631878.8.0.85188160352.issue13963@psf.upfronthosting.co.za> Message-ID: <1331683854.17.0.154004775166.issue13963@psf.upfronthosting.co.za> Dave Malcolm added the comment: Some notes from discussion with MvL at PyCon sprint: The ideal is that: - for any patch attached to an issue: the patch is uploaded to a Rietveld instance colocated in the same db as Roundup (bugs.python.org) - if it works, than a "review" link is visible next to the patch, taking you to a patch review UI: unfortunately, it takes you to the most recent patch on the issue, rather than the patch you click on - unfortunately there are a few ways for the patch upload to fail, and if this happens, then currently there is no visible indication within Roundup. If this happens, then patch review will need to be done within Roundup itself (i.e. the comment form or via email) - how can it fail: the importer needs to determine what the baseline to which the patch is to be applied. It can figure this out for a "hg diff" (assuming that the baseline revision is known to hg.python.org/cpython), but not for git-style diffs (unless you do it on the current head of "default") - in theory the nosy list of a bug within Roundup is synchronized with that of the patch within Rietveld. Unfortunately there is currently at least one bug with this (e.g. dmalcolm isnt on the nosy of http://bugs.python.org/review/13703/show despite being on the nosy of http://bugs.python.org/issue13703): FIXME: do we have a metabug about this? See: http://psf.upfronthosting.co.za/roundup/meta/issue394 http://psf.upfronthosting.co.za/roundup/meta/issue439 Some code links: http://svn.python.org/projects/tracker/instances/python-dev/rietveld/ http://svn.python.org/projects/tracker/instances/python-dev/extensions/create_patch.py ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:20:29 2012 From: report at bugs.python.org (Dave Malcolm) Date: Wed, 14 Mar 2012 00:20:29 +0000 Subject: [issue13963] dev guide has no mention of mechanics of patch review In-Reply-To: <1328631878.8.0.85188160352.issue13963@psf.upfronthosting.co.za> Message-ID: <1331684429.86.0.699882823009.issue13963@psf.upfronthosting.co.za> Dave Malcolm added the comment: It would appear that having: [diff] git = on in ~/.hgrc breaks the rietveld integration, since "hg diff" then emits a diff that doesn't identify the hg revision number, and hence the importer can't determine the baseline. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:21:01 2012 From: report at bugs.python.org (Dave Malcolm) Date: Wed, 14 Mar 2012 00:21:01 +0000 Subject: [issue13963] dev guide has no mention of mechanics of patch review In-Reply-To: <1328631878.8.0.85188160352.issue13963@psf.upfronthosting.co.za> Message-ID: <1331684461.09.0.931185118648.issue13963@psf.upfronthosting.co.za> Changes by Dave Malcolm : ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:21:43 2012 From: report at bugs.python.org (Matthias Klose) Date: Wed, 14 Mar 2012 00:21:43 +0000 Subject: [issue3754] cross-compilation support for python build In-Reply-To: <1220305759.82.0.468834426074.issue3754@psf.upfronthosting.co.za> Message-ID: <1331684503.05.0.395853556294.issue3754@psf.upfronthosting.co.za> Matthias Klose added the comment: Roumen, do you have a newer patch which applies to the current trunk? ---------- nosy: +doko _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:27:06 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Mar 2012 00:27:06 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331684826.24.0.610349081103.issue14234@psf.upfronthosting.co.za> Gregory P. Smith added the comment: uploaded an updated patch (against 3.1) with the changes from r1.168 to r1.170 xmlparse.c from the expat project. it fixes the test_sax issue. there is one other thing that needs fixing (next patch update). The test for the hash seed being == 0 that falls back to using the expat provided trivial time() based seed undesirable. We want a hash seed of 0 to be "disabled" matching the old behavior. this might require adding a flag indicating if the hash seed has been initialized or not. I'm also going to look at the possibility of using the Python interpreter's prefix and suffix values in some way rather than just prefix to avoid a potential of exposing the seed. ---------- Added file: http://bugs.python.org/file24831/expat-hash-randomization-002.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:30:07 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Mar 2012 00:30:07 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331685007.24.0.586701570339.issue14234@psf.upfronthosting.co.za> Gregory P. Smith added the comment: A test case for this is also needed. one that sets the hash seed via the environment variable to a different value for two subprocesses that parse and re-emit an xml document to confirm that all of the xml attributes are present but emitted in a different order indicating that attribute hash randomization was in effect is needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:30:30 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Mar 2012 00:30:30 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331685030.19.0.481625620924.issue14234@psf.upfronthosting.co.za> Changes by Gregory P. Smith : ---------- assignee: -> gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:44:03 2012 From: report at bugs.python.org (Preston Holmes) Date: Wed, 14 Mar 2012 00:44:03 +0000 Subject: [issue14294] Requirements are not properly copied into metatdata of dist-info Message-ID: <1331685843.64.0.290498671343.issue14294@psf.upfronthosting.co.za> New submission from Preston Holmes : the egginfo_to_distinfo util method is not converting requirements properly from a requirements.txt file into the metadata file of the dist-info dir ---------- assignee: eric.araujo components: Distutils2 messages: 155696 nosy: Preston.Holmes, alexis, eric.araujo, tarek priority: normal severity: normal status: open title: Requirements are not properly copied into metatdata of dist-info type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:45:41 2012 From: report at bugs.python.org (Jeff McNeil) Date: Wed, 14 Mar 2012 00:45:41 +0000 Subject: [issue12365] URLopener should support context manager protocol In-Reply-To: <1308504365.98.0.668285563314.issue12365@psf.upfronthosting.co.za> Message-ID: <1331685941.5.0.671458031292.issue12365@psf.upfronthosting.co.za> Jeff McNeil added the comment: Yeah, updated with different wording and proper caps. I left the piece in regarding the use without the context manager as I think that's probably the more common use case still. ---------- Added file: http://bugs.python.org/file24832/urllib_request_doc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:49:07 2012 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Mar 2012 00:49:07 +0000 Subject: [issue9079] Make gettimeofday available in time module In-Reply-To: <1277427154.32.0.0996770896527.issue9079@psf.upfronthosting.co.za> Message-ID: <1331686147.58.0.0164619607167.issue9079@psf.upfronthosting.co.za> STINNER Victor added the comment: > The new patch, issue9079.diff exposes gettimeofday > as time.gettimeofday() returning (sec, usec) pair. A tuple is not the preferred type for a timestamp: Python uses float and is not going to use something different (the PEP 410 was just rejected). I don't see what we need a new function: there is always time.time(). I'm closing this issue because I consider it as done. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:50:29 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Wed, 14 Mar 2012 00:50:29 +0000 Subject: [issue989712] Support using Tk without a mainloop Message-ID: <1331686229.0.0.299059997649.issue989712@psf.upfronthosting.co.za> Martin v. L?wis added the comment: +1. asvetlov: please commit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:51:38 2012 From: report at bugs.python.org (Ali Ikinci) Date: Wed, 14 Mar 2012 00:51:38 +0000 Subject: [issue14291] Regression in Python3 of email handling of unicode strings in headers In-Reply-To: <1331668534.02.0.642658515735.issue14291@psf.upfronthosting.co.za> Message-ID: <1331686298.99.0.266076432601.issue14291@psf.upfronthosting.co.za> Ali Ikinci added the comment: Together with David we have worked on a fix and test for this. Thanks David. ---------- keywords: +patch Added file: http://bugs.python.org/file24833/Issue14291.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:53:15 2012 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Mar 2012 00:53:15 +0000 Subject: [issue14222] Using time.time() in Queue.get breaks when system time is changed In-Reply-To: <1331149120.51.0.79082225225.issue14222@psf.upfronthosting.co.za> Message-ID: <1331686395.81.0.925616573074.issue14222@psf.upfronthosting.co.za> STINNER Victor added the comment: queue_monotonic.patch: simple patch using time.monotonic(), with a fallback to time.time() if monotonic failed or is not available. ---------- keywords: +patch Added file: http://bugs.python.org/file24834/queue_monotonic.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:56:38 2012 From: report at bugs.python.org (py.user) Date: Wed, 14 Mar 2012 00:56:38 +0000 Subject: [issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it In-Reply-To: <1331530103.22.0.0779581075646.issue14260@psf.upfronthosting.co.za> Message-ID: <1331686598.15.0.120221551893.issue14260@psf.upfronthosting.co.za> py.user added the comment: I take someone's code make tests for its behavior all tests say "the code is working" I continue to write the code make tests for its behavior all tests say "the code is working" I install it somewhere and it crashes now it is depending on the cache, when this exception is raised ?ric Araujo wrote: >and I don?t think Python promises to not break when people do random editions when people do something wrong, python should raise an exception ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 01:56:53 2012 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Mar 2012 00:56:53 +0000 Subject: [issue14222] Using time.time() in Queue.get breaks when system time is changed In-Reply-To: <1331149120.51.0.79082225225.issue14222@psf.upfronthosting.co.za> Message-ID: <1331686613.06.0.378395939285.issue14222@psf.upfronthosting.co.za> STINNER Victor added the comment: threading_monotonic.patch: similar patch for the threading module. Drawback of these patchs: they now call time.monotonic() when the module is loaded (another useless syscall?). ---------- Added file: http://bugs.python.org/file24835/threading_monotonic.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 02:20:00 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 14 Mar 2012 01:20:00 +0000 Subject: [issue14288] Make iterators pickleable In-Reply-To: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> Message-ID: <1331688000.43.0.464636739686.issue14288@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Btw, is there some way I can make this patch easier to review? I haven't contributed much since the Hg switchover, can I make it so that people can do visual diff? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 02:20:38 2012 From: report at bugs.python.org (Michael Foord) Date: Wed, 14 Mar 2012 01:20:38 +0000 Subject: [issue14295] PEP 417: adding mock module Message-ID: <1331688038.8.0.131181977771.issue14295@psf.upfronthosting.co.za> New submission from Michael Foord : PEP 417: Including mock in the Standard Library http://www.python.org/dev/peps/pep-0417/ Tasks: * Add mock with tests * Cleanup mock code to remove Python 2 compatibility * Add documentation I'll close this issue when all the tasks are complete. ---------- assignee: michael.foord components: Library (Lib) messages: 155705 nosy: michael.foord priority: normal severity: normal status: open title: PEP 417: adding mock module versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 02:20:54 2012 From: report at bugs.python.org (Dan Boswell) Date: Wed, 14 Mar 2012 01:20:54 +0000 Subject: [issue8739] Update to smtpd.py to RFC 5321 In-Reply-To: <1274103249.44.0.284620021799.issue8739@psf.upfronthosting.co.za> Message-ID: <1331688054.78.0.0765352248711.issue8739@psf.upfronthosting.co.za> Changes by Dan Boswell : _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 02:23:01 2012 From: report at bugs.python.org (=?utf-8?q?Herv=C3=A9_Coatanhay?=) Date: Wed, 14 Mar 2012 01:23:01 +0000 Subject: [issue14296] Compilation error on CentOS 5.8 Message-ID: <1331688181.08.0.800421526529.issue14296@psf.upfronthosting.co.za> New submission from Herv? Coatanhay : Linux Version: 2.6.18-238.19.1.el5 / CentOS release 5.8 (Final) Since changeset 71704:89e92e684b37 , I have the following compilation error: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c: In function ?cpu_set_dealloc?: ./Modules/posixmodule.c:4769: attention : implicit declaration of function ?CPU_FREE? ./Modules/posixmodule.c: In function ?make_new_cpu_set?: ./Modules/posixmodule.c:4786: attention : implicit declaration of function ?CPU_ALLOC_SIZE? ./Modules/posixmodule.c:4787: attention : implicit declaration of function ?CPU_ALLOC? ./Modules/posixmodule.c:4787: attention : assignment makes pointer from integer without a cast ./Modules/posixmodule.c:4793: attention : implicit declaration of function ?CPU_ZERO_S? ./Modules/posixmodule.c: In function ?cpu_set_set?: ./Modules/posixmodule.c:4847: attention : implicit declaration of function ?CPU_SET_S? ./Modules/posixmodule.c: In function ?cpu_set_count?: ./Modules/posixmodule.c:4858: attention : implicit declaration of function ?CPU_COUNT_S? ./Modules/posixmodule.c: In function ?cpu_set_clear?: ./Modules/posixmodule.c:4871: attention : implicit declaration of function ?CPU_CLR_S? ./Modules/posixmodule.c: In function ?cpu_set_isset?: ./Modules/posixmodule.c:4885: attention : implicit declaration of function ?CPU_ISSET_S? ./Modules/posixmodule.c: In function ?cpu_set_richcompare?: ./Modules/posixmodule.c:4910: attention : implicit declaration of function ?CPU_EQUAL_S? ./Modules/posixmodule.c: In function ?do_cpu_set_and?: ./Modules/posixmodule.c:4946: attention : implicit declaration of function ?CPU_AND_S? ./Modules/posixmodule.c: In function ?do_cpu_set_or?: ./Modules/posixmodule.c:4947: attention : implicit declaration of function ?CPU_OR_S? ./Modules/posixmodule.c: In function ?do_cpu_set_xor?: ./Modules/posixmodule.c:4948: attention : implicit declaration of function ?CPU_XOR_S? ... gcc -pthread -Xlinker -export-dynamic -o python Modules/python.o libpython3.3m.a -lpthread -ldl -lutil -lm libpython3.3m.a(posixmodule.o): In function `cpu_set_zero': /home/proexp/cpython2/./Modules/posixmodule.c:4897: undefined reference to `CPU_ZERO_S' libpython3.3m.a(posixmodule.o): In function `cpu_set_count': /home/proexp/cpython2/./Modules/posixmodule.c:4858: undefined reference to `CPU_COUNT_S' libpython3.3m.a(posixmodule.o): In function `cpu_set_clear': /home/proexp/cpython2/./Modules/posixmodule.c:4871: undefined reference to `CPU_CLR_S' libpython3.3m.a(posixmodule.o): In function `make_new_cpu_set': /home/proexp/cpython2/./Modules/posixmodule.c:4786: undefined reference to `CPU_ALLOC_SIZE' /home/proexp/cpython2/./Modules/posixmodule.c:4787: undefined reference to `CPU_ALLOC' /home/proexp/cpython2/./Modules/posixmodule.c:4793: undefined reference to `CPU_ZERO_S' libpython3.3m.a(posixmodule.o): In function `do_cpu_set_or': /home/proexp/cpython2/./Modules/posixmodule.c:4947: undefined reference to `CPU_OR_S' libpython3.3m.a(posixmodule.o): In function `do_cpu_set_xor': /home/proexp/cpython2/./Modules/posixmodule.c:4948: undefined reference to `CPU_XOR_S' libpython3.3m.a(posixmodule.o): In function `do_cpu_set_and': /home/proexp/cpython2/./Modules/posixmodule.c:4946: undefined reference to `CPU_AND_S' libpython3.3m.a(posixmodule.o): In function `cpu_set_richcompare': /home/proexp/cpython2/./Modules/posixmodule.c:4910: undefined reference to `CPU_EQUAL_S' libpython3.3m.a(posixmodule.o): In function `cpu_set_dealloc': /home/proexp/cpython2/./Modules/posixmodule.c:4769: undefined reference to `CPU_FREE' libpython3.3m.a(posixmodule.o): In function `do_cpu_set_xor': /home/proexp/cpython2/./Modules/posixmodule.c:4948: undefined reference to `CPU_XOR_S' libpython3.3m.a(posixmodule.o): In function `do_cpu_set_and': /home/proexp/cpython2/./Modules/posixmodule.c:4946: undefined reference to `CPU_AND_S' libpython3.3m.a(posixmodule.o): In function `do_cpu_set_or': /home/proexp/cpython2/./Modules/posixmodule.c:4947: undefined reference to `CPU_OR_S' libpython3.3m.a(posixmodule.o): In function `cpu_set_set': /home/proexp/cpython2/./Modules/posixmodule.c:4847: undefined reference to `CPU_SET_S' libpython3.3m.a(posixmodule.o): In function `cpu_set_isset': /home/proexp/cpython2/./Modules/posixmodule.c:4885: undefined reference to `CPU_ISSET_S' ---------- components: Build files: sched.h messages: 155706 nosy: Alzakath priority: normal severity: normal status: open title: Compilation error on CentOS 5.8 versions: Python 3.3 Added file: http://bugs.python.org/file24836/sched.h _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 02:38:49 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 01:38:49 +0000 Subject: [issue989712] Support using Tk without a mainloop Message-ID: Roundup Robot added the comment: New changeset 535bb0bf1f49 by Andrew Svetlov in branch 'default': Issue #989712: Support using Tk without a mainloop. http://hg.python.org/cpython/rev/535bb0bf1f49 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 03:03:00 2012 From: report at bugs.python.org (Paul McMillan) Date: Wed, 14 Mar 2012 02:03:00 +0000 Subject: [issue14297] Custom string formatter doesn't work like builtin str.format Message-ID: <1331690580.32.0.967691211794.issue14297@psf.upfronthosting.co.za> New submission from Paul McMillan : In Python 2.7, I can use an empty format string to indicate automatically numbered positional arguments when formatting the builtin string object. http://docs.python.org/release/2.7/library/string.html#format-string-syntax If I subclass string.Formatter, this expected functionality doesn't work. http://docs.python.org/release/2.7/library/string.html#string-formatting Python 2.7.2+ (default, Oct 4 2011, 20:06:09) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from string import Formatter >>> class MyFormatter(Formatter): ... pass ... >>> fs_a = 'a{0}b{1}c' >>> fs_b = 'a{}b{}c' >>> fs_a.format(1, 2) 'a1b2c' >>> fs_b.format(1, 2) 'a1b2c' >>> fmt = MyFormatter() >>> fmt.format(fs_a, 1, 2) 'a1b2c' >>> fmt.format(fs_b, 1, 2) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/string.py", line 545, in format return self.vformat(format_string, args, kwargs) File "/usr/lib/python2.7/string.py", line 549, in vformat result = self._vformat(format_string, args, kwargs, used_args, 2) File "/usr/lib/python2.7/string.py", line 571, in _vformat obj, arg_used = self.get_field(field_name, args, kwargs) File "/usr/lib/python2.7/string.py", line 632, in get_field obj = self.get_value(first, args, kwargs) File "/usr/lib/python2.7/string.py", line 591, in get_value return kwargs[key] KeyError: '' ---------- messages: 155708 nosy: PaulMcMillan priority: normal severity: normal status: open title: Custom string formatter doesn't work like builtin str.format versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 03:08:07 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 14 Mar 2012 02:08:07 +0000 Subject: [issue14285] Traceback wrong on ImportError while executing a package In-Reply-To: <1331621436.28.0.000669565075438.issue14285@psf.upfronthosting.co.za> Message-ID: <1331690887.3.0.288805140722.issue14285@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +brett.cannon, eric.araujo, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 03:15:56 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 14 Mar 2012 02:15:56 +0000 Subject: [issue14294] Requirements are not properly copied into metatdata of dist-info In-Reply-To: <1331685843.64.0.290498671343.issue14294@psf.upfronthosting.co.za> Message-ID: <1331691356.41.0.222242364388.issue14294@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- dependencies: +add a {dist-info} category to distutils2 versions: +3rd party, Python 3.3 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 03:18:01 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 14 Mar 2012 02:18:01 +0000 Subject: [issue14297] Custom string formatter doesn't work like builtin str.format In-Reply-To: <1331690580.32.0.967691211794.issue14297@psf.upfronthosting.co.za> Message-ID: <1331691481.67.0.212849074474.issue14297@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- nosy: +eric.smith versions: +Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 03:29:46 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 02:29:46 +0000 Subject: [issue10050] urllib.request still has old 2.x urllib primitives In-Reply-To: <1286536471.26.0.454336144311.issue10050@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 53715804dc71 by Senthil Kumaran in branch 'default': Issue10050 - urlretrieve uses newer urlopen. reporthook of urlretrieve takes, block number, block read size, file_size http://hg.python.org/cpython/rev/53715804dc71 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 03:32:29 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 14 Mar 2012 02:32:29 +0000 Subject: [issue10050] urllib.request still has old 2.x urllib primitives In-Reply-To: <1286536471.26.0.454336144311.issue10050@psf.upfronthosting.co.za> Message-ID: <1331692349.96.0.692645242669.issue10050@psf.upfronthosting.co.za> Senthil Kumaran added the comment: One at the time - urlretrieve is re-written. Now should add deprecation warnings to things methods to be deprecated / removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 03:48:50 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 02:48:50 +0000 Subject: [issue12365] URLopener should support context manager protocol In-Reply-To: <1308504365.98.0.668285563314.issue12365@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 8625627969aa by Senthil Kumaran in branch '3.2': closes Issue12365 - Add an example explaining the context manager use case of urllib.urlopen http://hg.python.org/cpython/rev/8625627969aa New changeset 074e12441ed6 by Senthil Kumaran in branch 'default': default: closes Issue12365 - Add an example explaining the context manager use case of urllib.urlopen http://hg.python.org/cpython/rev/074e12441ed6 ---------- nosy: +python-dev resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 03:49:38 2012 From: report at bugs.python.org (Jeff McNeil) Date: Wed, 14 Mar 2012 02:49:38 +0000 Subject: [issue10050] urllib.request still has old 2.x urllib primitives In-Reply-To: <1286536471.26.0.454336144311.issue10050@psf.upfronthosting.co.za> Message-ID: <1331693378.09.0.418560462253.issue10050@psf.upfronthosting.co.za> Jeff McNeil added the comment: I'd be happy to do that (URLopener, to begin with), though I'm not familiar with the usual approach. Is it simply a matter of warning in __init__? ---------- nosy: +mcjeff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 03:50:06 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 14 Mar 2012 02:50:06 +0000 Subject: [issue12365] URLopener should support context manager protocol In-Reply-To: <1308504365.98.0.668285563314.issue12365@psf.upfronthosting.co.za> Message-ID: <1331693406.86.0.631309083452.issue12365@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Thanks for the patch, Jeff McNeil. I pushed the patches to 3.2 and 3.3 docs. Since it is a documentation change (an explaination rather), I did not update the NEWS. Thanks again! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 03:51:17 2012 From: report at bugs.python.org (Chris Rebert) Date: Wed, 14 Mar 2012 02:51:17 +0000 Subject: [issue14298] account for dict randomization in Design & History FAQ Message-ID: <1331693477.45.0.106920867641.issue14298@psf.upfronthosting.co.za> New submission from Chris Rebert : The randomization introduced by the fix for issue 13703 means that the example string hash values given in http://docs.python.org/dev/faq/design.html#how-are-dictionaries-implemented are liable to become more difficult to reproduce (in fact, the example already currently implicitly assumes a 32-bit build). Either the phrasing should be changed to emphasize that these are *possible* values the strings *might* hash to, or no concrete hash values should be given at all. ---------- assignee: docs at python components: Documentation messages: 155714 nosy: cvrebert, docs at python priority: normal severity: normal status: open title: account for dict randomization in Design & History FAQ versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 04:04:32 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 14 Mar 2012 03:04:32 +0000 Subject: [issue10050] urllib.request still has old 2.x urllib primitives In-Reply-To: <1331693378.09.0.418560462253.issue10050@psf.upfronthosting.co.za> Message-ID: <20120314030427.GB2822@mathmagic> Senthil Kumaran added the comment: Yes, it is simply a matter of adding warnings.warn in proper classes and methods. I have started on that, Jeff. No problem. I just wanted the changes to be two separate commits. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 04:21:02 2012 From: report at bugs.python.org (Nicholas Riley) Date: Wed, 14 Mar 2012 03:21:02 +0000 Subject: [issue14299] OS X installer build script: permissions not ensured Message-ID: <1331695262.49.0.711005270468.issue14299@psf.upfronthosting.co.za> New submission from Nicholas Riley : The OS X installer build script does not ensure that files had the correct permissions when being packaged; some files' permissions were affected by your umask when running the build script, and others by the permissions of the source tree. This patch sets the umask, so script-created files get correct permissions, wraps shutil.copy so it does the same thing, and adapts the existing os.walk-based permissions fixer to run over everything else. It also removes group writability for the Python framework, as this is more secure and consistent with how Apple installs Python in 10.7 and later. If you need to install a Python package without being root, either use virtualenv/pythonv, ~/Library or ~/.local. Ned Deily and I discussed this at the PyCon sprints and he will update the documentation to match. ---------- assignee: ronaldoussoren components: Macintosh files: perm.patch keywords: patch messages: 155716 nosy: nriley, ronaldoussoren priority: normal severity: normal status: open title: OS X installer build script: permissions not ensured type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file24837/perm.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 04:24:16 2012 From: report at bugs.python.org (Nicholas Riley) Date: Wed, 14 Mar 2012 03:24:16 +0000 Subject: [issue14299] OS X installer build script: permissions not ensured In-Reply-To: <1331695262.49.0.711005270468.issue14299@psf.upfronthosting.co.za> Message-ID: <1331695456.84.0.893489492229.issue14299@psf.upfronthosting.co.za> Changes by Nicholas Riley : ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 04:33:23 2012 From: report at bugs.python.org (Ned Deily) Date: Wed, 14 Mar 2012 03:33:23 +0000 Subject: [issue14299] OS X installer build script: permissions not ensured In-Reply-To: <1331695262.49.0.711005270468.issue14299@psf.upfronthosting.co.za> Message-ID: <1331696003.62.0.808256752023.issue14299@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- assignee: ronaldoussoren -> ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 04:33:36 2012 From: report at bugs.python.org (Ned Deily) Date: Wed, 14 Mar 2012 03:33:36 +0000 Subject: [issue14299] OS X installer build script: permissions not ensured In-Reply-To: <1331695262.49.0.711005270468.issue14299@psf.upfronthosting.co.za> Message-ID: <1331696016.49.0.115033829649.issue14299@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 04:40:56 2012 From: report at bugs.python.org (Jeff McNeil) Date: Wed, 14 Mar 2012 03:40:56 +0000 Subject: [issue14255] tempfile.gettempdir() didn't return the path with correct case. In-Reply-To: <1331514762.82.0.635964063955.issue14255@psf.upfronthosting.co.za> Message-ID: <1331696456.4.0.565005638487.issue14255@psf.upfronthosting.co.za> Jeff McNeil added the comment: The actual implementation calls os.path.normcase from tempfile._get_default_tempdir. In this scenario here, that resolves to the ntpath module & triggers a lowercase conversion. On the other hand, the posixpath module is simply an identity function. Now, it *is* possible to force a Windows file system to run in a case-sensitive configuration. Since ntpath.py forces lower case, this could actually cause breakage in that situation, however rare. In my opinion, changing the ntpath.normcase function to retain case probably yields more correct behavior. ---------- nosy: +mcjeff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 04:42:06 2012 From: report at bugs.python.org (Ben Wolfson) Date: Wed, 14 Mar 2012 03:42:06 +0000 Subject: [issue12014] str.format parses replacement field incorrectly In-Reply-To: <1304646359.82.0.599761597998.issue12014@psf.upfronthosting.co.za> Message-ID: <1331696526.66.0.270974720214.issue12014@psf.upfronthosting.co.za> Ben Wolfson added the comment: just curious if there are any developments here since the first 3.3 alpha has been released. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 05:21:39 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 14 Mar 2012 04:21:39 +0000 Subject: [issue989712] Support using Tk without a mainloop Message-ID: <1331698899.86.0.96756611736.issue989712@psf.upfronthosting.co.za> Andrew Svetlov added the comment: The issue is fixed. Thanks to Guilherme Polo. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 06:27:46 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Mar 2012 05:27:46 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331702866.16.0.910944962158.issue14234@psf.upfronthosting.co.za> Gregory P. Smith added the comment: The existing pyexpat API doesn't give me a way to test if hash randomization is actually working so I'm going ahead without a specific test case for this. Attributes are either reported to xmlparser.SameElementHandler in a dictionary (unordered) or are reported in a list in the order they appeared on the element depending on the xmlparser.ordered_attributes bool. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 06:33:46 2012 From: report at bugs.python.org (Michael Foord) Date: Wed, 14 Mar 2012 05:33:46 +0000 Subject: [issue4080] unittest: display time used by each test case In-Reply-To: <1223497696.14.0.913391715353.issue4080@psf.upfronthosting.co.za> Message-ID: <1331703226.6.0.494481603351.issue4080@psf.upfronthosting.co.za> Michael Foord added the comment: I'm working on a modified version of the patch that is switched on with a command line option --timer=0.1 (or similar). Only tests that take longer than the threshold have the time printed. --timer=0 is valid, but it still only works when unittest is running with with verbose. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 07:06:36 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Mar 2012 06:06:36 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331705196.42.0.0716779681896.issue14234@psf.upfronthosting.co.za> Gregory P. Smith added the comment: and given that you cannot expose if this is enabled or not by the order in which things come out of the library... no need to make this change its behavior based on the overall python hash randomization setting. nobody's tests will break. there is no way to expose the hash seed. the latest patch I uploaded is good. Misc/NEWS entry needed. I'll push it tomorrow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 07:11:52 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 14 Mar 2012 06:11:52 +0000 Subject: [issue4199] add shorthand global and nonlocal statements In-Reply-To: <1224887535.03.0.272495603252.issue4199@psf.upfronthosting.co.za> Message-ID: <1331705512.11.0.396947786722.issue4199@psf.upfronthosting.co.za> R. David Murray added the comment: We could also just decide we don't need it :) If we do (I haven't read the PEP) does a statement with an assignment make the variable global in that scope, or does it only affect the global variable for the duration of the assignment, and otherwise the variable remains local in the scope? (I don't know which to guess, and the ambiguity is disturbing. I like the current clarity even if it is more typing.) ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 07:18:54 2012 From: report at bugs.python.org (Larry Hastings) Date: Wed, 14 Mar 2012 06:18:54 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331705934.48.0.913710877754.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: Guido suggested I break the work up into small patches. So here's the first patch: adds st_?time_ns fields to os.stat() result. Includes doc changes and a reasonable smoke-test in the regrtest suite; suite passes all expected tests. FYI I wasn't sure what to call the currently-slightly-uncomfortably-named new function _PyTime_LongFromTime_t(). ---------- Added file: http://bugs.python.org/file24838/larry.st_mtime_ns.patch.1.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 07:33:51 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 14 Mar 2012 06:33:51 +0000 Subject: [issue10050] urllib.request still has old 2.x urllib primitives In-Reply-To: <1286536471.26.0.454336144311.issue10050@psf.upfronthosting.co.za> Message-ID: <1331706831.97.0.0679185702637.issue10050@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Here is patch which adds DeprecationWarning to URLOpener and (it's subclasses FancyURLopener) as well as some other Request methods. The idea would be, in the next release we remove this old URLOpener and it's subclasses and remove (or make _private) the Request methods. Added tests for DeprecationWarnings too. I am trying to see if more classes/methods from old urllib can be deprecated/removed. But this first patch is for no-doubt ones. If one have any review comments, please provide. Otherwise I shall check it in 3.3.a1. Thanks! ---------- Added file: http://bugs.python.org/file24839/issue10050-deprecation.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 07:50:23 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 06:50:23 +0000 Subject: [issue14298] account for dict randomization in Design & History FAQ In-Reply-To: <1331693477.45.0.106920867641.issue14298@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 305cf9be1cd3 by Georg Brandl in branch 'default': Closes #14298: update section about dict implementation. http://hg.python.org/cpython/rev/305cf9be1cd3 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 07:58:20 2012 From: report at bugs.python.org (Georg Brandl) Date: Wed, 14 Mar 2012 06:58:20 +0000 Subject: [issue14250] for string patterns regex.flags is never equal to 0 In-Reply-To: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> Message-ID: <1331708300.5.0.151583761233.issue14250@psf.upfronthosting.co.za> Georg Brandl added the comment: There is even more wrongness here: if you give flags inline in the pattern, they also show up in .flags (since they are global, at least in the current implementation). Suggested patch attached. ---------- keywords: +patch nosy: +georg.brandl Added file: http://bugs.python.org/file24840/regexflags.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 08:03:46 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 07:03:46 +0000 Subject: [issue14291] Regression in Python3 of email handling of unicode strings in headers In-Reply-To: <1331668534.02.0.642658515735.issue14291@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset fd4b4650856f by R David Murray in branch '3.2': #14291: if a header has non-ascii unicode, default to CTE using utf-8 http://hg.python.org/cpython/rev/fd4b4650856f New changeset f5dcb2d58893 by R David Murray in branch 'default': Merge #14291: if a header has non-ascii unicode, default to CTE using utf-8 http://hg.python.org/cpython/rev/f5dcb2d58893 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 08:04:59 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 14 Mar 2012 07:04:59 +0000 Subject: [issue14291] Regression in Python3 of email handling of unicode strings in headers In-Reply-To: <1331668534.02.0.642658515735.issue14291@psf.upfronthosting.co.za> Message-ID: <1331708699.32.0.216556778294.issue14291@psf.upfronthosting.co.za> R. David Murray added the comment: Fix committed. Thanks Ali. ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 08:07:45 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 07:07:45 +0000 Subject: [issue14283] match.pos describes that match object has methods search() and match() In-Reply-To: <1331615209.27.0.948367520003.issue14283@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 544ed2cfb097 by Georg Brandl in branch '3.2': Closes #14283: match() and search() are regex methods, not match methods. http://hg.python.org/cpython/rev/544ed2cfb097 New changeset 3ffa1b88e9f6 by Georg Brandl in branch 'default': #14283: merge with 3.2 http://hg.python.org/cpython/rev/3ffa1b88e9f6 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 08:17:41 2012 From: report at bugs.python.org (=?utf-8?q?Herv=C3=A9_Coatanhay?=) Date: Wed, 14 Mar 2012 07:17:41 +0000 Subject: [issue14296] Compilation error on CentOS 5.8 In-Reply-To: <1331688181.08.0.800421526529.issue14296@psf.upfronthosting.co.za> Message-ID: <1331709461.12.0.280960580078.issue14296@psf.upfronthosting.co.za> Herv? Coatanhay added the comment: I forgot to give glibc version: glibc-2.5-81 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 08:19:21 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 07:19:21 +0000 Subject: [issue14289] Prebuilt CHM file on Docs download page In-Reply-To: <1331667578.7.0.0463792055808.issue14289@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 2800530b00d3 by Georg Brandl in branch '3.2': Closes #14289: put a link to the CHM download page on the docs download page. http://hg.python.org/cpython/rev/2800530b00d3 New changeset b4d1e51d91f8 by Georg Brandl in branch 'default': #14289: merge with 3.2 http://hg.python.org/cpython/rev/b4d1e51d91f8 New changeset 3e62379008c2 by Georg Brandl in branch '2.7': Closes #14289: put a link to the CHM download page on the docs download page. http://hg.python.org/cpython/rev/3e62379008c2 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 08:22:58 2012 From: report at bugs.python.org (Georg Brandl) Date: Wed, 14 Mar 2012 07:22:58 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331709778.27.0.541289152766.issue829370@psf.upfronthosting.co.za> Georg Brandl added the comment: Can we add a comment to that effect to the math docs? ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 08:26:22 2012 From: report at bugs.python.org (Georg Brandl) Date: Wed, 14 Mar 2012 07:26:22 +0000 Subject: [issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it In-Reply-To: <1331530103.22.0.0779581075646.issue14260@psf.upfronthosting.co.za> Message-ID: <1331709982.3.0.736962176827.issue14260@psf.upfronthosting.co.za> Georg Brandl added the comment: Looks like a case for a read-only dict/dictproxy :) ---------- nosy: +georg.brandl, haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 08:27:41 2012 From: report at bugs.python.org (Georg Brandl) Date: Wed, 14 Mar 2012 07:27:41 +0000 Subject: [issue14288] Make iterators pickleable In-Reply-To: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> Message-ID: <1331710061.79.0.0316090685167.issue14288@psf.upfronthosting.co.za> Georg Brandl added the comment: The "review" link next to the the patch file entry should already work and provide a nice visual diff + commenting interface. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 08:31:54 2012 From: report at bugs.python.org (Georg Brandl) Date: Wed, 14 Mar 2012 07:31:54 +0000 Subject: [issue14255] tempfile.gettempdir() didn't return the path with correct case. In-Reply-To: <1331514762.82.0.635964063955.issue14255@psf.upfronthosting.co.za> Message-ID: <1331710314.49.0.225592531098.issue14255@psf.upfronthosting.co.za> Georg Brandl added the comment: There's not much sense in having normcase() if it never does anything :) But in this case, I don't really see why tempfile needs to use normcase(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 10:23:30 2012 From: report at bugs.python.org (Frank) Date: Wed, 14 Mar 2012 09:23:30 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331717010.79.0.822069664054.issue829370@psf.upfronthosting.co.za> Frank added the comment: Mark, https://en.wikipedia.org/wiki/Signum_function or elementary math books tell us that this function is called signum, sign or sgn. A library should adopt this standard for the same reason we don't want a ComputeTheSine or calcsin, which would be very confusing. As we learn from repeated discussions people want to use this signum function, no matter we can imagine this or not and no matter whether that functionality is hidden somewhere else. Since we are talking about not more than 5 lines of code, I don't see any reason not to have it. If there are some please let us know. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 10:31:17 2012 From: report at bugs.python.org (Michal Sladek) Date: Wed, 14 Mar 2012 09:31:17 +0000 Subject: [issue14062] UTF-8 Email Subject problem In-Reply-To: <1329725009.21.0.0898146100656.issue14062@psf.upfronthosting.co.za> Message-ID: <1331717477.72.0.926881672952.issue14062@psf.upfronthosting.co.za> Michal Sladek added the comment: Changing code to: encodedSubject = '=?utf-8?b?{0}?='.format(base64Subject) still works properly with smtp.seznam.cz server.... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 10:38:24 2012 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 14 Mar 2012 09:38:24 +0000 Subject: [issue14273] distutils2: logging handler not properly initialized In-Reply-To: <1331651776.57.0.871222238168.issue14273@psf.upfronthosting.co.za> Message-ID: <1331717902.56578.YahooMailNeo@web171320.mail.ir2.yahoo.com> Vinay Sajip added the comment: > > IIUC the logger should be set to DEBUG, otherwise even if e.g. pip wants to get > INFO messages it won?t see them.? Is that right? Well, you could set the level to INFO to get INFO and higher messages. DEBUG should only be set for messages of interest to developers/support staff/system admins, and which might confuse end users. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 10:48:17 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 14 Mar 2012 09:48:17 +0000 Subject: [issue14296] Compilation error on CentOS 5.8 In-Reply-To: <1331688181.08.0.800421526529.issue14296@psf.upfronthosting.co.za> Message-ID: <1331718497.77.0.112219075551.issue14296@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- assignee: -> benjamin.peterson nosy: +benjamin.peterson, dmalcolm, georg.brandl priority: normal -> critical stage: -> needs patch type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 11:04:13 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 14 Mar 2012 10:04:13 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331719453.26.0.498999981871.issue14127@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Posted a review on Rietveld. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 11:23:48 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 14 Mar 2012 10:23:48 +0000 Subject: [issue9216] FIPS support for hashlib In-Reply-To: <1278721335.16.0.522410247151.issue9216@psf.upfronthosting.co.za> Message-ID: <1331720628.21.0.910283648448.issue9216@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Patch 0002: - cached_info->error_msg doesn't seem deallocated anywhere? Patch 0003: - "usedforsecurity" is a poor name IMO; make it shorter and/or PEP8-ize it ("used_for_security") - the 2-element context array thing is obscure: why not distinct "ctx" and "ctx_non_fips" members? - "this could fail, e.g. low on memory, or encodings": doesn't it lack an error-handling path, then? Patch 0004: - openssl_can_enforce_fips(): instead of calling OpenSSL in a subprocess, perhaps it's possible to expose a public flag in the hashlib module (e.g. "hashlib.HAS_FIPS")? or is this info not fetchable programmatically? - openssl_can_enforce_fips() needs to check the subprocess return code, in case another error happened - run_command_with_fips_enforcement() should use the assert_python_ok() and assert_python_failure() functions from Lib/test/script_helper.py Overall: - please put back the unconditional tests for the "usedforsecurity" argument (even when FIPS can't be enforced) - the patches lack docs (Doc/library/hashlib.rst) - please commit all this as a single commit, not 4 different ones ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 11:31:18 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 14 Mar 2012 10:31:18 +0000 Subject: [issue11826] Leak in atexitmodule In-Reply-To: <1302504979.95.0.857272040465.issue11826@psf.upfronthosting.co.za> Message-ID: <1331721078.12.0.886538672955.issue11826@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Well, if it doesn't crash, it's probably ok ;) Perhaps check modstate->atexit_callbacks for non-NULL? Or do we trust free() to do the right thing? ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 12:19:16 2012 From: report at bugs.python.org (Stefan Krah) Date: Wed, 14 Mar 2012 11:19:16 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1331667255.96.0.0894681454838.issue7652@psf.upfronthosting.co.za> Message-ID: <20120314111914.GA20635@sleipnir.bytereef.org> Stefan Krah added the comment: Mark Dickinson wrote: > > FWIW, I think we would be better off if this patch were merged in soon. > > +1 OK, I'm counting three +1 for merging soon. Thanks everyone for the encouragement! I'll then proceed with the merge this weekend or shortly after, with one caveat: My *second* self-review of mpdecimal.c is currently at 17%, but I can as well continue with that if the whole thing is merged. I'll probably replace the caching of ln(10) (not thread-safe, protected by the GIL) with a real thread-safe version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 12:38:24 2012 From: report at bugs.python.org (Stefan Krah) Date: Wed, 14 Mar 2012 11:38:24 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1331420248.53.0.414893031186.issue7652@psf.upfronthosting.co.za> Message-ID: <20120314113822.GA20731@sleipnir.bytereef.org> Stefan Krah added the comment: Arfrever Frehtes Taifersar Arahesis wrote: > Please add --with-system-libmpdec (or --with-system-mpdecimal) option in > `configure`, similarly to --with-system-expat and --with-system-ffi options. I've added that to the list of issues. However, if there is any change in the behavior of decimal.py that also applies to the library, the libmpdec shipped with Python will be silently updated. I can probably release a matching external libmpdec with every major Python release, but I can't promise to track all minor releases. This would mean that for Python-3.3 the yet unreleased mpdecimal-2.4, hopefully with thread-safe mpd_pow(), mpd_ln() and mpd_log10() should be used. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 13:04:36 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 14 Mar 2012 12:04:36 +0000 Subject: [issue14255] tempfile.gettempdir() didn't return the path with correct case. In-Reply-To: <1331514762.82.0.635964063955.issue14255@psf.upfronthosting.co.za> Message-ID: <1331726676.73.0.457956461924.issue14255@psf.upfronthosting.co.za> Antoine Pitrou added the comment: +1 for fixing. ---------- nosy: +pitrou priority: normal -> low stage: test needed -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 13:05:34 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 14 Mar 2012 12:05:34 +0000 Subject: [issue14265] Fully qualified test name in failure output In-Reply-To: <1331582387.93.0.923571160232.issue14265@psf.upfronthosting.co.za> Message-ID: <1331726734.11.0.372119510607.issue14265@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Which failure message are we talking about? regrtest? unittest? ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 13:14:46 2012 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Mar 2012 12:14:46 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1331719453.26.0.498999981871.issue14127@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > FYI I wasn't sure what to call the currently-slightly-uncomfortably-named new function _PyTime_LongFromTime_t(). There is already a private _PyLong_FromTime_t() function in _testcapi.c: just move the function to pytime.c (but keep the _Py prefix). ---------- title: add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds -> add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 13:15:04 2012 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Mar 2012 12:15:04 +0000 Subject: [issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it In-Reply-To: <1331530103.22.0.0779581075646.issue14260@psf.upfronthosting.co.za> Message-ID: <1331727304.93.0.929435995648.issue14260@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 13:59:46 2012 From: report at bugs.python.org (sbt) Date: Wed, 14 Mar 2012 12:59:46 +0000 Subject: [issue14300] dup_socket() on Windows should use WSA_FLAG_OVERLAPPED Message-ID: <1331729986.5.0.388536898962.issue14300@psf.upfronthosting.co.za> New submission from sbt : According to Microsoft's documentation sockets created using socket() have the overlapped attribute, but sockets created with WSASocket() do not unless you pass the WSA_FLAG_OVERLAPPED flag. The documentation for WSADuplicateSocket() says If the source process uses the socket function to create the socket, the destination process must pass the WSA_FLAG_OVERLAPPED flag to its WSASocket function call. This means that dup_socket() in socketmodule.c should use return WSASocket(FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, &info, 0, WSA_FLAG_OVERLAPPED); instead of return WSASocket(FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, &info, 0, 0); (On Windows, the new multiprocessing.connection.wait() function depends on the overlapped attribute, although it is primarily intended for use with pipe connections not sockets.) Patch attached. ---------- files: socket_dup.patch keywords: patch messages: 155748 nosy: sbt priority: normal severity: normal status: open title: dup_socket() on Windows should use WSA_FLAG_OVERLAPPED versions: Python 3.3 Added file: http://bugs.python.org/file24841/socket_dup.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 14:05:54 2012 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Wed, 14 Mar 2012 13:05:54 +0000 Subject: [issue14300] dup_socket() on Windows should use WSA_FLAG_OVERLAPPED In-Reply-To: <1331729986.5.0.388536898962.issue14300@psf.upfronthosting.co.za> Message-ID: <1331730354.9.0.149383955911.issue14300@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Which problem are you trying to solve? Can this change be tested somehow? ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 14:23:48 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 14 Mar 2012 13:23:48 +0000 Subject: [issue14300] dup_socket() on Windows should use WSA_FLAG_OVERLAPPED In-Reply-To: <1331729986.5.0.388536898962.issue14300@psf.upfronthosting.co.za> Message-ID: <1331731428.95.0.784296362375.issue14300@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Are you sure this is desired? Nowhere can I think of a place in the stdlib where we use overlapped I/O on sockets. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 15:34:18 2012 From: report at bugs.python.org (Kees Bos) Date: Wed, 14 Mar 2012 14:34:18 +0000 Subject: [issue14301] xmlrpc client transport and threading problem Message-ID: <1331735658.17.0.761953257498.issue14301@psf.upfronthosting.co.za> New submission from Kees Bos : The transport (second parameter to ServerProxy) must be unique for every thread. This was not the case in pre-python2.7. It is caused by the reuse of the connection (stored in _connection). This could be handled by saving the thread id too. I don't know whether this is a coding error or a documentation omission. ---------- components: None messages: 155751 nosy: kees priority: normal severity: normal status: open title: xmlrpc client transport and threading problem type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 15:43:29 2012 From: report at bugs.python.org (sbt) Date: Wed, 14 Mar 2012 14:43:29 +0000 Subject: [issue14300] dup_socket() on Windows should use WSA_FLAG_OVERLAPPED In-Reply-To: <1331729986.5.0.388536898962.issue14300@psf.upfronthosting.co.za> Message-ID: <1331736209.77.0.611982373721.issue14300@psf.upfronthosting.co.za> sbt added the comment: pitrou wrote: > Are you sure this is desired? Nowhere can I think of a place in the > stdlib where we use overlapped I/O on sockets. multiprocessing.connection.wait() does overlapped zero length reads on sockets. It's documentation currently claims that it works with sockets. Also it would seem strange if some sockets (created with socket()) have the overlapped attribute, but some others (created with WSASocket()) don't. amaury.forgeotdarc wrote: > Which problem are you trying to solve? For one thing, the fact that socketmodule.c does not obey the word "must" in the quote from Microsoft's documentation. > Can this change be tested somehow? An additional test could be added to test_multiprocessing.TestWait. Slightly surprisingly, in the testing I have done so far, using wait() with a duplicated socket seems to work without the patch. However, I would be rather wary of just assuming that it works in all cases and on all versions of Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 16:00:59 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 14 Mar 2012 15:00:59 +0000 Subject: [issue14062] UTF-8 Email Subject problem In-Reply-To: <1329725009.21.0.0898146100656.issue14062@psf.upfronthosting.co.za> Message-ID: <1331737259.9.0.385956270094.issue14062@psf.upfronthosting.co.za> R. David Murray added the comment: I think the next thing to do would be to replace the call to send_message with code that calls BytesGenerator to write the message out to disk, and diff the output of the two versions (normal subject and hand-encoded subject). Maybe that will give us a clue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 16:04:16 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 14 Mar 2012 15:04:16 +0000 Subject: [issue14265] Fully qualified test name in failure output In-Reply-To: <1331582387.93.0.923571160232.issue14265@psf.upfronthosting.co.za> Message-ID: <1331737456.2.0.752670654845.issue14265@psf.upfronthosting.co.za> R. David Murray added the comment: I'm pretty sure Michael is talking about unittest. Doing the same for regrtest would be interesting but not as important. (When I run individual tests from the Python test suite I generally use -m unittest to do it.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 16:10:14 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 14 Mar 2012 15:10:14 +0000 Subject: [issue14296] Compilation error on CentOS 5.8 In-Reply-To: <1331688181.08.0.800421526529.issue14296@psf.upfronthosting.co.za> Message-ID: <1331737814.4.0.106471180804.issue14296@psf.upfronthosting.co.za> Benjamin Peterson added the comment: It looks like this CPU_ api wasn't completely added until glib 2.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 16:14:18 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 14 Mar 2012 15:14:18 +0000 Subject: [issue12978] Figure out extended attributes on BSDs In-Reply-To: <1331592666.21.0.069109435319.issue12978@psf.upfronthosting.co.za> Message-ID: Benjamin Peterson added the comment: 2012/3/12 Nicholas Riley : > > Nicholas Riley added the comment: > > I've spent a few hours looking at xattr and the Linux/OS X (10.4+) implementations. ?Bob Ippolito's xattr module implements the OS X xattr interface on Linux, Solaris (9+) and FreeBSD. ?Linux and OS X are pretty close; FreeBSD and Solaris are substantially different from either and the Solaris implementation is somewhat incomplete/broken. > > The OS X differences from Linux are: > > ? Instead of l* functions, the XATTR_NOFOLLOW option > > ? XATTR_NOSECURITY and XATTR_NODEFAULT are in the headers but essentially unavailable as the kernel code always returns EINVAL for them. > > ? XATTR_SHOWCOMPRESSION to expose the HFS compression stuff, which I can't imagine many people needing > > ? XATTR_MAXNAMELEN (but no equivalent to XATTR_SIZE_MAX). ?Linux has a corresponding XATTR_NAME_MAX, which we should probably expose too. > > ? XATTR_FINDERINFO_NAME and XATTR_RESOURCEFORK_NAME for some standard attribute names. ?I would imagine these are worth exposing. > > I don't see any problems supporting the currently exposed Linux API on OS X ?(I could probably find a usable value for XATTR_SIZE_MAX), but it's unclear if that is the right way to go forward. > > Suggestions? Thanks for looking into this. I think the best approach at the moment is try to wrap these differences under the LInux API. It seems the biggest one will just be adding XATTR_NOFOLLOW for the l* calls. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 16:16:08 2012 From: report at bugs.python.org (Nam Nguyen) Date: Wed, 14 Mar 2012 15:16:08 +0000 Subject: [issue14289] Prebuilt CHM file on Docs download page In-Reply-To: <1331667578.7.0.0463792055808.issue14289@psf.upfronthosting.co.za> Message-ID: <1331738168.34.0.0351206312296.issue14289@psf.upfronthosting.co.za> Nam Nguyen added the comment: I can't find any CHM for download. For example, this is everything there is to Python 3.2.2: http://www.python.org/ftp/python/3.2.2/ Yet there's no sight of CHM in it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 16:38:17 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 14 Mar 2012 15:38:17 +0000 Subject: [issue14270] Can't install a project in a specific directory In-Reply-To: <1331590705.94.0.0465168087698.issue14270@psf.upfronthosting.co.za> Message-ID: <1331739497.83.0.406750802227.issue14270@psf.upfronthosting.co.za> ?ric Araujo added the comment: Mathieu?s patch attached. Test upcoming. ---------- keywords: +patch Added file: http://bugs.python.org/file24842/distutils2.14270.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 16:44:39 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 14 Mar 2012 15:44:39 +0000 Subject: [issue14288] Make iterators pickleable In-Reply-To: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> Message-ID: <1331739879.76.0.721420345047.issue14288@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The dict iterators depend on the order of the dict being the same when unpickled on another python (the order will vary depending on dummy entries, insertion order, 32 vs 64 bit builds, salted hashes, etc). Sets have the same issue -- it doesn't seem possible to pickle a set iterator in a "semi-consumed state" without being able to reproduce the underlying unordered collection in *exactly* the same order and being able to point the resumed iterators to the correct part of memory. Any hacks to make this appear to work would like be hard to reproduce across different implementations of Python (i.e. Jython's dicts are based on Java's concurrent mappings). There isn't a provision for saving and restoring running generators. There isn't a provision for iterators created using iter(func, sentinel) where successive func calls change state. I don't see how str iterators remember where they left off. Note, the prior effort to make iterators copyable was a failure. It was difficult to do in the general case and the cases we did provide had zero uptake (i.e. they were never used). ISTM, that pickling iterators faces the same issues. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 17:09:31 2012 From: report at bugs.python.org (Mark Shannon) Date: Wed, 14 Mar 2012 16:09:31 +0000 Subject: [issue8743] set() operators don't work with collections.Set instances In-Reply-To: <1274122246.37.0.692277131409.issue8743@psf.upfronthosting.co.za> Message-ID: <1331741371.28.0.609949083919.issue8743@psf.upfronthosting.co.za> Mark Shannon added the comment: Review of set-with-Set.patch: Looks good overall. I agree that restricting operations to instances of Set rather than Iterable is correct. Implementing "__rsub__" in terms of - (subtraction) means that infinite recursion is a possibility. It also creates an unnecessary temporary. Could you just reverse the expression used in __sub__? Would you add tests for comparisons; Set() == set(), etc. There are probably tested implicitly in the rest of the test suite, but explicit tests would be good. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 17:17:10 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 14 Mar 2012 16:17:10 +0000 Subject: [issue14288] Make iterators pickleable In-Reply-To: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> Message-ID: <1331741830.72.0.705646427988.issue14288@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- Removed message: http://bugs.python.org/msg155759 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 17:17:47 2012 From: report at bugs.python.org (Matt Joiner) Date: Wed, 14 Mar 2012 16:17:47 +0000 Subject: [issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb' In-Reply-To: <1330513271.31.0.437438851478.issue14156@psf.upfronthosting.co.za> Message-ID: <1331741867.95.0.653830061821.issue14156@psf.upfronthosting.co.za> Matt Joiner added the comment: Roger that. I'll start on a patch for this in a month or two if all goes well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 17:26:22 2012 From: report at bugs.python.org (Matt Joiner) Date: Wed, 14 Mar 2012 16:26:22 +0000 Subject: [issue14222] Using time.time() in Queue.get breaks when system time is changed In-Reply-To: <1331149120.51.0.79082225225.issue14222@psf.upfronthosting.co.za> Message-ID: <1331742382.36.0.0493047158439.issue14222@psf.upfronthosting.co.za> Changes by Matt Joiner : ---------- nosy: +anacrolix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 17:29:35 2012 From: report at bugs.python.org (Brian Curtin) Date: Wed, 14 Mar 2012 16:29:35 +0000 Subject: [issue14302] Move python.exe to bin/ Message-ID: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> New submission from Brian Curtin : After talks at PyCon with several people, python.exe will live in C:\Python33\bin rather than C:\Python33 to come more in line with the Unix layout. This will also simplify another issue with the Path option for the 3.3 installer as well as packaging's target directory for top-level scripts (used to be Scripts/, will be bin/). ---------- assignee: brian.curtin components: Build, Installation, Windows messages: 155762 nosy: brian.curtin priority: high severity: normal stage: needs patch status: open title: Move python.exe to bin/ type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 17:40:18 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 16:40:18 +0000 Subject: [issue3835] tkinter goes into an infinite loop (pydoc.gui) In-Reply-To: <1221139272.34.0.29160759745.issue3835@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 7cbc48324938 by Andrew Svetlov in branch 'default': Revert the patch for issue 3835 because failed on Windows buildbot http://hg.python.org/cpython/rev/7cbc48324938 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 17:43:09 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 14 Mar 2012 16:43:09 +0000 Subject: [issue3835] tkinter goes into an infinite loop (pydoc.gui) In-Reply-To: <1221139272.34.0.29160759745.issue3835@psf.upfronthosting.co.za> Message-ID: <1331743389.97.0.51623633698.issue3835@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Recall to 'open' state ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 17:46:42 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 14 Mar 2012 16:46:42 +0000 Subject: [issue12684] profile does not dump stats on exception like cProfile does In-Reply-To: <1312335798.44.0.743453347572.issue12684@psf.upfronthosting.co.za> Message-ID: <1331743602.95.0.666986473537.issue12684@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- keywords: +needs review nosy: +georg.brandl stage: -> patch review versions: -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 17:50:17 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 14 Mar 2012 16:50:17 +0000 Subject: [issue3835] tkinter goes into an infinite loop (pydoc.gui) In-Reply-To: <1221139272.34.0.29160759745.issue3835@psf.upfronthosting.co.za> Message-ID: <1331743817.36.0.888030330827.issue3835@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Close as 'not a bug' because Guilherme's test to reproduce the bug from msg73304 works good at least for Linux. Windows version of Tcl/Tk compiled without threading support. So current behavior is correct and should not to be fixed. ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 17:51:38 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 16:51:38 +0000 Subject: [issue13839] -m pstats should combine all the profiles given as arguments In-Reply-To: <1327289897.02.0.607924329906.issue13839@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 3a5a0e7d38c5 by Antoine Pitrou in branch 'default': Issue #13839: When invoked on the command-line, the pstats module now accepts several filenames of profile stat files and merges them all. http://hg.python.org/cpython/rev/3a5a0e7d38c5 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 17:54:39 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 14 Mar 2012 16:54:39 +0000 Subject: [issue13839] -m pstats should combine all the profiles given as arguments In-Reply-To: <1327289897.02.0.607924329906.issue13839@psf.upfronthosting.co.za> Message-ID: <1331744079.74.0.680997906781.issue13839@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I've committed the patch. Eric, adding a test suite for pstats' command-line interface is a separate concern. ---------- nosy: +pitrou resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 17:58:18 2012 From: report at bugs.python.org (Shane Hansen) Date: Wed, 14 Mar 2012 16:58:18 +0000 Subject: [issue14303] Incorrect documentation for socket.py on linux Message-ID: <1331744298.15.0.025379356395.issue14303@psf.upfronthosting.co.za> New submission from Shane Hansen : The python docs state that for socket.makefile "The file object references a dup()ped version of the socket file descriptor, so the file object and socket object may be closed or garbage-collected independently." In fact for socket.py dup() is never called, and no additional files are opened. Instead an object is returned which uses the original socket and does buffering. For me, this is the desired behaviour, but just thought I'd mention the docs were off. ---------- assignee: docs at python components: Documentation, IO files: test.py messages: 155768 nosy: Shane.Hansen, docs at python, georg.brandl, pitrou priority: normal severity: normal status: open title: Incorrect documentation for socket.py on linux type: behavior versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file24843/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 18:01:35 2012 From: report at bugs.python.org (Jeff McNeil) Date: Wed, 14 Mar 2012 17:01:35 +0000 Subject: [issue14255] tempfile.gettempdir() didn't return the path with correct case. In-Reply-To: <1331514762.82.0.635964063955.issue14255@psf.upfronthosting.co.za> Message-ID: <1331744495.98.0.959667205408.issue14255@psf.upfronthosting.co.za> Jeff McNeil added the comment: The normcase call isn't exactly a no-op in ntpath.py as it also swaps / for \\. Removing the .lower() seems to simply make it a watered down version of normpath. There are a couple of options I guess. We could simply keep the altsep, or update _get_default_tempdir to use normpath? I'd be happy to do it once everyone agrees =) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 18:02:43 2012 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Wed, 14 Mar 2012 17:02:43 +0000 Subject: [issue14222] Using time.time() in Queue.get breaks when system time is changed In-Reply-To: <1331742382.43.0.2021956504.issue14222@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: Random thoughts: - as noted by Antoine, it probably affects a lot of code throughout the standard library - sem_timedwait() (used by lock.acquire() on POSIX) is affected (the implementation using a condition variable could use pthread_condattr_setclock(), see issue #12822) - there's a side effect to that change: on Linux, when the system is suspended, CLOCK_MONOTONIC stops: so on resume, you'd have to wait for the complete timeout to expire, whereas with time.time() you'll break out early That being said, it's probably a good idea. As for the patches, I don't really like the idea of having to use this idiom everywhere: try: from time import monotonic as _time _time() except (ImportError, OSError): from time import _time ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 18:10:36 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Wed, 14 Mar 2012 17:10:36 +0000 Subject: [issue14062] UTF-8 Email Subject problem In-Reply-To: <1329725009.21.0.0898146100656.issue14062@psf.upfronthosting.co.za> Message-ID: <1331745036.39.0.596785135587.issue14062@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I digged a little bit further. The data being sent is 'Content-Type: multipart/mixed; boundary="===============1981330074035035012=="\r\nMIME-Version: 1.0\r\nFrom: rzrobot at seznam.cz\r\nTo: msladek at volny.cz\r\nSubject: =?utf-8?b?xb5sdcWlb3XEjWvDvSBrxa/FiA==?=\n\r\n--===============1981330074035035012==\r\nContent-Type: text/plain; charset="utf-8"\r\nMIME-Version: 1.0\r\nContent-Transfer-Encoding: base64\r\n\r\nw7pwxJtsIMSPw6FiZWxza8OpIMOzZHk=\n\r\n--===============1981330074035035012==--' As you notice, there is a plain \n (without \r) after the subject (and all other places with base64), which might confuse seznam. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 18:16:08 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Wed, 14 Mar 2012 17:16:08 +0000 Subject: [issue14062] UTF-8 Email Subject problem In-Reply-To: <1329725009.21.0.0898146100656.issue14062@psf.upfronthosting.co.za> Message-ID: <1331745368.86.0.395207144281.issue14062@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I also attach a stand-alone version. To run this locally, run smtpdX.Y.py -dn localhost:2525 ---------- Added file: http://bugs.python.org/file24844/a.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 18:19:57 2012 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 14 Mar 2012 17:19:57 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331745597.48.0.245983541683.issue14127@psf.upfronthosting.co.za> Guido van Rossum added the comment: I added a review as well. Not sure if that sends email by itself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 18:21:38 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 14 Mar 2012 17:21:38 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1331745597.48.0.245983541683.issue14127@psf.upfronthosting.co.za> Message-ID: <1331745434.3471.3.camel@localhost.localdomain> Antoine Pitrou added the comment: > I added a review as well. Not sure if that sends email by itself. It's supposed to send e-mail, but sometimes not all recipients are spelt right... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 18:25:39 2012 From: report at bugs.python.org (sbt) Date: Wed, 14 Mar 2012 17:25:39 +0000 Subject: [issue14288] Make iterators pickleable In-Reply-To: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> Message-ID: <1331745939.41.0.540754980727.issue14288@psf.upfronthosting.co.za> sbt added the comment: I think PyAPI_FUNC(PyObject *) _PyIter_GetIter(const char *iter); has a confusing name for a convenience function which retrieves an attribute from the builtin module by name. Not sure what would be better. Maybe _PyIter_GetBuiltin(). ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 18:31:00 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 14 Mar 2012 17:31:00 +0000 Subject: [issue14288] Make iterators pickleable In-Reply-To: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> Message-ID: <1331746260.55.0.553424315579.issue14288@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: another trick has been suggested. For hidden iterator objects, such as stringiter, to actually put them in the "types" module. in there, we could do something like: #types.py stringiter = iter('').__class__ and we would then change the name of the iterator in c to be "types.stringiter". How does that sound? It _does_ make it necessary for the types module to be there to help with pickling. The _proper_ fix would be for e.g. stringiter to live in builtins, next to 'str' that it is iterating over. Any thoughts? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 18:33:41 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 14 Mar 2012 17:33:41 +0000 Subject: [issue13554] Tkinter doesn't use higher resolution app icon In-Reply-To: <1323308666.66.0.322569696678.issue13554@psf.upfronthosting.co.za> Message-ID: <1331746421.03.0.296292080119.issue13554@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 19:00:12 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 14 Mar 2012 18:00:12 +0000 Subject: [issue14062] UTF-8 Email Subject problem In-Reply-To: <1329725009.21.0.0898146100656.issue14062@psf.upfronthosting.co.za> Message-ID: <1331748012.64.0.643398134778.issue14062@psf.upfronthosting.co.za> R. David Murray added the comment: OK, got it. When I created BytesParser I turned the 'NL' constant into a class attribute, but in the line that handles Header objects in BytesParser I failed to change NL to self._NL. So when send_message calls flatten with linesep='\r\n', in that one place it was using \n instead of the correct linesep. I've got a patch which I will commit shortly. ---------- assignee: -> r.david.murray components: +Library (Lib) -None stage: -> commit review type: -> behavior versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 19:18:24 2012 From: report at bugs.python.org (Jim Jewett) Date: Wed, 14 Mar 2012 18:18:24 +0000 Subject: [issue12684] profile does not dump stats on exception like cProfile does In-Reply-To: <1312335798.44.0.743453347572.issue12684@psf.upfronthosting.co.za> Message-ID: <1331749104.59.0.478562281471.issue12684@psf.upfronthosting.co.za> Jim Jewett added the comment: If I read that patch right, it ignores (and does not even reraise) SystemExit (unchanged), but other Exceptions currently block the dump (and your patch causes them to still dump). (1) Why is SystemExit ignored? (2) There should be tests to show that there was a dump after, say, a MyError. (3) You can use a single try ... except ... finally statement instead of two try statements. ---------- nosy: +Jim.Jewett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 19:24:46 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 18:24:46 +0000 Subject: [issue14062] UTF-8 Email Subject problem In-Reply-To: <1329725009.21.0.0898146100656.issue14062@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset d0bf40ff20ef by R David Murray in branch '3.2': #14062: fix BytesParser handling of linesep for Header objects http://hg.python.org/cpython/rev/d0bf40ff20ef New changeset 7617f3071320 by R David Murray in branch 'default': #14062: fix BytesParser handling of Header objects http://hg.python.org/cpython/rev/7617f3071320 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 19:27:04 2012 From: report at bugs.python.org (=?utf-8?q?Guilherme_Gon=C3=A7alves?=) Date: Wed, 14 Mar 2012 18:27:04 +0000 Subject: [issue12294] multiprocessing.Pool: Need a way to find out if work are finished. In-Reply-To: <1307627992.49.0.467043384727.issue12294@psf.upfronthosting.co.za> Message-ID: <1331749624.61.0.963143128964.issue12294@psf.upfronthosting.co.za> Guilherme Gon?alves added the comment: I uploaded a patch that adds an is_alive() method to multiprocessing.Pool, along with the associated test and documentation updates. Please let me know if there are any issues, I'll be glad to rework the patch. ---------- keywords: +patch nosy: +guilherme-pg Added file: http://bugs.python.org/file24845/12294.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 19:28:07 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 14 Mar 2012 18:28:07 +0000 Subject: [issue14062] UTF-8 Email Subject problem In-Reply-To: <1329725009.21.0.0898146100656.issue14062@psf.upfronthosting.co.za> Message-ID: <1331749687.21.0.946514553185.issue14062@psf.upfronthosting.co.za> R. David Murray added the comment: Thanks for the bug report. I thought we had tests for processing Header objects when serializing a message using BytesParser, but clearly we didn't. And thanks Tatiana and Martin for issue review and testing. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 20:06:55 2012 From: report at bugs.python.org (Jeff McNeil) Date: Wed, 14 Mar 2012 19:06:55 +0000 Subject: [issue10050] urllib.request still has old 2.x urllib primitives In-Reply-To: <1286536471.26.0.454336144311.issue10050@psf.upfronthosting.co.za> Message-ID: <1331752015.53.0.1014414896.issue10050@psf.upfronthosting.co.za> Jeff McNeil added the comment: I don't see why we'd need to make these _private -- they're just accessors/mutators for the most part. I'd be happy to help clean this up if you need it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 20:32:51 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 19:32:51 +0000 Subject: [issue12818] email.utils.formataddr incorrectly quotes parens inside quoted strings In-Reply-To: <1314020743.63.0.326215230826.issue12818@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset ec191c51a15f by R David Murray in branch 'default': #12818: remove escaping of () in quoted strings in formataddr http://hg.python.org/cpython/rev/ec191c51a15f ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 20:34:12 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 14 Mar 2012 19:34:12 +0000 Subject: [issue12818] email.utils.formataddr incorrectly quotes parens inside quoted strings In-Reply-To: <1314020743.63.0.326215230826.issue12818@psf.upfronthosting.co.za> Message-ID: <1331753652.7.0.999833006942.issue12818@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 20:37:07 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 14 Mar 2012 19:37:07 +0000 Subject: [issue14288] Make iterators pickleable In-Reply-To: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> Message-ID: <1331753827.45.0.313639245246.issue14288@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 20:47:59 2012 From: report at bugs.python.org (Larry Hastings) Date: Wed, 14 Mar 2012 19:47:59 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331754479.28.0.591889856999.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: I was notified by email of both Antoine's and Guido's reviews. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 21:13:14 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Mar 2012 20:13:14 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331755994.33.0.116880719407.issue14234@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Replacing the generate_hash_secret_salt function with one containing assert(0) shows that it still gets called so there are apparently still ways that initialize parsers that do not call XML_SetHashSalt using the Python hash prefix. ./python Lib/test/test_xml_etree_c.pypython: /XXX/cpython/3.1/Modules/expat/xmlparse.c:687: generate_hash_secret_salt: Assertion `0' failed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 21:13:55 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 14 Mar 2012 20:13:55 +0000 Subject: [issue8739] Update to smtpd.py to RFC 5321 In-Reply-To: <1274103249.44.0.284620021799.issue8739@psf.upfronthosting.co.za> Message-ID: <1331756035.01.0.797864658863.issue8739@psf.upfronthosting.co.za> R. David Murray added the comment: By the way, Alberto, if you haven't already submitted a contributor agreement, could you do so please? We have one from Dan from the sprints. Michele, you aren't marked in the tracker as having submitted an agreement but you've been active long enough I would think you would have. Have you and it just isn't reflected in the tracker? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 21:37:01 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 14 Mar 2012 20:37:01 +0000 Subject: [issue10050] urllib.request still has old 2.x urllib primitives In-Reply-To: <1331752015.53.0.1014414896.issue10050@psf.upfronthosting.co.za> Message-ID: <20120314203655.GA1924@mathmagic> Senthil Kumaran added the comment: My concern was with the method get_full_url. I have seen it being useful in more than one place and it's not just the accessor. Others are just the accessors and those can be safely removed. When get_full_url gives the correct url, taking into consideration the url fragment, I think that should stay. Other's can be cleaned up. Note that in 3.3, we should just be deprecating and as soon as 3.3 is out, we can remove these. Thanks, Senthil ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 21:44:05 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 20:44:05 +0000 Subject: [issue10050] urllib.request still has old 2.x urllib primitives In-Reply-To: <1286536471.26.0.454336144311.issue10050@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset eab274c7d456 by Senthil Kumaran in branch 'default': deprecated the old urllib primitives in 3.3 urllib package - issue 10050 http://hg.python.org/cpython/rev/eab274c7d456 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 21:46:19 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 20:46:19 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset c06b94c5c609 by Andrew Svetlov in branch 'default': Issue #14200: Idle shell crash on printing non-BMP unicode character. http://hg.python.org/cpython/rev/c06b94c5c609 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 21:52:29 2012 From: report at bugs.python.org (Brett Cannon) Date: Wed, 14 Mar 2012 20:52:29 +0000 Subject: [issue13959] Re-implement parts of imp in pure Python In-Reply-To: <1328575890.24.0.0737633689073.issue13959@psf.upfronthosting.co.za> Message-ID: <1331758349.77.0.653769491575.issue13959@psf.upfronthosting.co.za> Brett Cannon added the comment: Attached is a start for re-implementing imp. Still need code for cache_from_source, source_from_cache, find_module, load_module, reload, load_compiled, load_source, and load_package. ---------- keywords: +patch Added file: http://bugs.python.org/file24846/imp.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 21:55:36 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Mar 2012 20:55:36 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331758536.53.0.888329444721.issue14234@psf.upfronthosting.co.za> Gregory P. Smith added the comment: false alarm, thats just what happens when PYTHONHASHSEED=0 (I won't be committing the assert, I was just testing behavior). For what its worth, the xmlparse.c generate_hash_seed() function is pretty poor as far as picking a random number goes as it is time based and it is often easy for an attacker to figure out the time on a process they're injecting data into and thus construct a targeted attack. It is still better than nothing but it could be better. I'd leave improving that up to the upstream expat project. When PYTHONHASHSEED is enabled, pyexpat will never use that function. It does mean we use a constant seed for the life of the process when it is enabled, and revert to the expat behavior of using the expat parser creation time based seed otherwise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:00:46 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 21:00:46 +0000 Subject: [issue10050] urllib.request still has old 2.x urllib primitives In-Reply-To: <1286536471.26.0.454336144311.issue10050@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 30f13d7fecd0 by Senthil Kumaran in branch 'default': Fix the buildbot breakdown - issue 10050 http://hg.python.org/cpython/rev/30f13d7fecd0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:01:10 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 14 Mar 2012 21:01:10 +0000 Subject: [issue14304] Implement utf-8-bmp codec Message-ID: <1331758870.76.0.606902244655.issue14304@psf.upfronthosting.co.za> New submission from Andrew Svetlov : Tkinter (and IDLE specially) can use only UCS-2 characters. In PyShell IDLE tries to escape non-ascii. To better result we should to escape only non-BMP chars leaving BMP characters untouched. ---------- assignee: asvetlov messages: 155793 nosy: asvetlov priority: normal severity: normal status: open title: Implement utf-8-bmp codec versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:01:18 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 14 Mar 2012 21:01:18 +0000 Subject: [issue14304] Implement utf-8-bmp codec In-Reply-To: <1331758870.76.0.606902244655.issue14304@psf.upfronthosting.co.za> Message-ID: <1331758878.87.0.450391239514.issue14304@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- components: +Tkinter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:02:50 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 14 Mar 2012 21:02:50 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331758970.47.0.129793258674.issue14200@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Patch escapes avery non-ascii char while better to escape only non-BMP. Will be done after #14304 ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:03:01 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 14 Mar 2012 21:03:01 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331758981.56.0.73342319816.issue14200@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:06:47 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 14 Mar 2012 21:06:47 +0000 Subject: [issue14222] Using time.time() in Queue.get breaks when system time is changed In-Reply-To: <1331149120.51.0.79082225225.issue14222@psf.upfronthosting.co.za> Message-ID: <1331759207.46.0.580682124779.issue14222@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:14:52 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Wed, 14 Mar 2012 21:14:52 +0000 Subject: [issue14139] test_ftplib: segfault In-Reply-To: <1330341244.46.0.956938686476.issue14139@psf.upfronthosting.co.za> Message-ID: <1331759692.22.0.367303363304.issue14139@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:17:00 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Wed, 14 Mar 2012 21:17:00 +0000 Subject: [issue13248] deprecated in 3.2, should be removed in 3.3 In-Reply-To: <1319392186.66.0.823106983991.issue13248@psf.upfronthosting.co.za> Message-ID: <1331759820.69.0.945951097074.issue13248@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:17:15 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 14 Mar 2012 21:17:15 +0000 Subject: [issue14305] fix typos Message-ID: <1331759835.12.0.380682525613.issue14305@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- hgrepos: 116 nosy: tshepang priority: normal severity: normal status: open title: fix typos _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:18:21 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 14 Mar 2012 21:18:21 +0000 Subject: [issue14305] fix typos Message-ID: <1331759901.95.0.860903524385.issue14305@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- keywords: +patch Added file: http://bugs.python.org/file24847/08b3d0bf0a61.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:19:32 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 14 Mar 2012 21:19:32 +0000 Subject: [issue13963] dev guide has no mention of mechanics of patch review In-Reply-To: <1328631878.8.0.85188160352.issue13963@psf.upfronthosting.co.za> Message-ID: <1331759972.08.0.7069969498.issue13963@psf.upfronthosting.co.za> Senthil Kumaran added the comment: It should be noted that diff in git supported format is recommended in the devguide - http://docs.python.org/devguide/committing.html#minimal-configuration If it breaks the rietveld integration, then we should not be advising it. ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:24:38 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Wed, 14 Mar 2012 21:24:38 +0000 Subject: [issue7978] SocketServer doesn't handle syscall interruption In-Reply-To: <1266779695.23.0.617672066685.issue7978@psf.upfronthosting.co.za> Message-ID: <1331760278.84.0.625897222016.issue7978@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:35:03 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 14 Mar 2012 21:35:03 +0000 Subject: [issue14305] fix typos Message-ID: <1331760903.4.0.390329802244.issue14305@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:36:06 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Wed, 14 Mar 2012 21:36:06 +0000 Subject: [issue8536] Support new features of ZLIB 1.2.4 In-Reply-To: <1272302591.08.0.11918516326.issue8536@psf.upfronthosting.co.za> Message-ID: <1331760966.72.0.279725246939.issue8536@psf.upfronthosting.co.za> Nadeem Vawda added the comment: Jes?s, did you have any particular idea about exactly where these new features would be useful? Or was your idea that someone needs to read through the code and check whether the features can be used at all? Also, it should be noted that the scope of this issue has grown somewhat since it was created - zlib 1.2.6 was released recently, with more new features. And it seems that the zlib folks sometimes add new features in point releases (e.g. 1.2.5.1) as well... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:39:03 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 14 Mar 2012 21:39:03 +0000 Subject: [issue13248] deprecated in 3.2, should be removed in 3.3 In-Reply-To: <1319392186.66.0.823106983991.issue13248@psf.upfronthosting.co.za> Message-ID: <1331761143.67.0.234946587001.issue13248@psf.upfronthosting.co.za> Raymond Hettinger added the comment: In unittest, DictContainsSubset() should be removed from 3.3. It was defective by design (wrong argument order). I concur with Ezio that the other unittest methods should remain intact. I'm not sure whether assertSameElements() should stay or go (when Google's code search was still up, it showed zero uptake for that test method, so it may be better to remove it now). The Decimal module's Context._clamp should also be removed from 3.3. It was a private API from the outset and won't be mirrored in the C version. It looks like Mark has already done this one. I also agree Antoine that most of the other changes shouldn't be made in 3.3 except for the three he listed: max_buffer_size, get_prefix/set_prefix, and the argparse deprecations. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:41:19 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 14 Mar 2012 21:41:19 +0000 Subject: [issue14306] try/except block is both efficient and expensive? Message-ID: <1331761279.09.0.327606618026.issue14306@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : In Doc/faq/design.rst, we got this text: "A try/except block is extremely efficient. Actually catching an exception is expensive." The 2 sentences appear contradictory. ---------- assignee: docs at python components: Documentation messages: 155798 nosy: docs at python, tshepang priority: normal severity: normal status: open title: try/except block is both efficient and expensive? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:42:41 2012 From: report at bugs.python.org (Ned Deily) Date: Wed, 14 Mar 2012 21:42:41 +0000 Subject: [issue13153] IDLE crashes when pasting non-BMP unicode char on UCS-16 build In-Reply-To: <1318363292.9.0.682519731008.issue13153@psf.upfronthosting.co.za> Message-ID: <1331761361.49.0.725565850693.issue13153@psf.upfronthosting.co.za> Ned Deily added the comment: Reassigning to Andrew to investigate solution similar to the one used in Issue14200. ---------- assignee: ned.deily -> astrand nosy: +astrand title: IDLE crash with unicode bigger than 0xFFFF -> IDLE crashes when pasting non-BMP unicode char on UCS-16 build versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:42:56 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 21:42:56 +0000 Subject: [issue14305] fix typos Message-ID: New submission from Roundup Robot : New changeset 0092ab03fdd5 by Georg Brandl in branch '3.2': Closes #14305: fix typo. http://hg.python.org/cpython/rev/0092ab03fdd5 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:44:00 2012 From: report at bugs.python.org (Ned Deily) Date: Wed, 14 Mar 2012 21:44:00 +0000 Subject: [issue13153] IDLE crashes when pasting non-BMP unicode char on UCS-16 build In-Reply-To: <1318363292.9.0.682519731008.issue13153@psf.upfronthosting.co.za> Message-ID: <1331761440.48.0.118723320841.issue13153@psf.upfronthosting.co.za> Ned Deily added the comment: (Oops, wrong assignment!) ---------- assignee: astrand -> asvetlov nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:44:21 2012 From: report at bugs.python.org (Ezio Melotti) Date: Wed, 14 Mar 2012 21:44:21 +0000 Subject: [issue14306] try/except block is both efficient and expensive? In-Reply-To: <1331761279.09.0.327606618026.issue14306@psf.upfronthosting.co.za> Message-ID: <1331761461.79.0.456177129312.issue14306@psf.upfronthosting.co.za> Ezio Melotti added the comment: What it's trying to say is that in case the operation in the "try" block succeeds there's almost no overhead, so it's very efficient. On the other hand, raising and then catching the error is expensive. ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:44:37 2012 From: report at bugs.python.org (Ned Deily) Date: Wed, 14 Mar 2012 21:44:37 +0000 Subject: [issue13153] IDLE crashes when pasting non-BMP unicode char on UCS-16 build In-Reply-To: <1318363292.9.0.682519731008.issue13153@psf.upfronthosting.co.za> Message-ID: <1331761477.16.0.791391065907.issue13153@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- nosy: -astrand _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:45:13 2012 From: report at bugs.python.org (Georg Brandl) Date: Wed, 14 Mar 2012 21:45:13 +0000 Subject: [issue14306] try/except block is both efficient and expensive? In-Reply-To: <1331761279.09.0.327606618026.issue14306@psf.upfronthosting.co.za> Message-ID: <1331761513.22.0.672582930389.issue14306@psf.upfronthosting.co.za> Georg Brandl added the comment: It could be reworded, yes. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:48:11 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 14 Mar 2012 21:48:11 +0000 Subject: [issue12342] characters with ord above 65535 fail to display in IDLE In-Reply-To: <1308171600.34.0.388895530939.issue12342@psf.upfronthosting.co.za> Message-ID: <1331761691.89.0.261839977119.issue12342@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Fixed in #14200 ---------- assignee: -> asvetlov resolution: fixed -> duplicate stage: commit review -> committed/rejected status: open -> closed superseder: -> Idle shell crash on printing non-BMP unicode character versions: -Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:53:11 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 14 Mar 2012 21:53:11 +0000 Subject: [issue11437] IDLE crash on startup with typo in config-keys.cfg In-Reply-To: <1299543243.52.0.970222997696.issue11437@psf.upfronthosting.co.za> Message-ID: <1331761991.66.0.473536554611.issue11437@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- assignee: -> asvetlov nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:54:54 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 14 Mar 2012 21:54:54 +0000 Subject: [issue12558] Locale-dependent exception for float width argument to Tkinter widget constructor In-Reply-To: <1310655906.95.0.630445767575.issue12558@psf.upfronthosting.co.za> Message-ID: <1331762094.07.0.435618211709.issue12558@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- assignee: -> asvetlov nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 22:56:37 2012 From: report at bugs.python.org (Roger Serwy) Date: Wed, 14 Mar 2012 21:56:37 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331762197.92.0.687644931113.issue14200@psf.upfronthosting.co.za> Roger Serwy added the comment: Andrew, please reopen this issue. Your committed patch does not work if IDLE is not using the subprocess. >>> got_ahsa = "\N{GOTHIC LETTER AHSA}" >>> got_ahsa Traceback (most recent call last): File "", line 1, in got_ahsa File "idlelib/PyShell.py", line 1255, in write return self.shell.write(s, self.tags) File "idlelib/PyShell.py", line 1233, in write 'Non-BMP character not supported in Tk') UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 1-1: Non-BMP character not supported in Tk However, it does work when IDLE uses a subprocess. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 23:04:35 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 14 Mar 2012 22:04:35 +0000 Subject: [issue14217] text output pretends to be code In-Reply-To: <1331108351.7.0.269278733631.issue14217@psf.upfronthosting.co.za> Message-ID: <1331762675.23.0.65265673107.issue14217@psf.upfronthosting.co.za> Senthil Kumaran added the comment: ?ric - not really. nonlocal is from python3.x onwards only. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 23:08:48 2012 From: report at bugs.python.org (Roger Serwy) Date: Wed, 14 Mar 2012 22:08:48 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331762928.21.0.184620586828.issue14200@psf.upfronthosting.co.za> Roger Serwy added the comment: Attached is a patch to undo Andrew's and fixes the issue in a simple manner. The tcl_unicode_range.patch from Issue12342 has already been applied, so catching ValueError within IDLE is all that is now needed. ---------- Added file: http://bugs.python.org/file24848/issue14200.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 23:10:09 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 22:10:09 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 7b5bc1719477 by Gregory P. Smith in branch '3.1': Fixes issue #14234: CVE-2012-0876: Randomize hashes of xml attributes http://hg.python.org/cpython/rev/7b5bc1719477 New changeset d6c197edd99b by Gregory P. Smith in branch '3.2': Fixes Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes http://hg.python.org/cpython/rev/d6c197edd99b New changeset a8b164ab98bf by Gregory P. Smith in branch 'default': Fixes Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes http://hg.python.org/cpython/rev/a8b164ab98bf ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 23:10:48 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 14 Mar 2012 22:10:48 +0000 Subject: [issue14305] fix typos In-Reply-To: Message-ID: <1331763048.31.0.689015888725.issue14305@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- hgrepos: -116 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 23:15:49 2012 From: report at bugs.python.org (Roger Serwy) Date: Wed, 14 Mar 2012 22:15:49 +0000 Subject: [issue12342] characters with ord above 65535 fail to display in IDLE In-Reply-To: <1308171600.34.0.388895530939.issue12342@psf.upfronthosting.co.za> Message-ID: <1331763349.27.0.771329993027.issue12342@psf.upfronthosting.co.za> Roger Serwy added the comment: Rather than raising a ValueError, would UnicodeEncodeError be more appropriate? I admit that this suggestion may be bike shedding. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 23:21:20 2012 From: report at bugs.python.org (Roger Serwy) Date: Wed, 14 Mar 2012 22:21:20 +0000 Subject: [issue13153] IDLE crashes when pasting non-BMP unicode char on UCS-16 build In-Reply-To: <1318363292.9.0.682519731008.issue13153@psf.upfronthosting.co.za> Message-ID: <1331763680.0.0.759471674739.issue13153@psf.upfronthosting.co.za> Roger Serwy added the comment: Issue13582 deals with the IDLE error feedback. ---------- nosy: +serwy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 23:28:28 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 22:28:28 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset b54f5849013c by Gregory P. Smith in branch '2.7': Fixes Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes http://hg.python.org/cpython/rev/b54f5849013c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 23:31:33 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Mar 2012 22:31:33 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331764293.38.0.152639726225.issue14234@psf.upfronthosting.co.za> Gregory P. Smith added the comment: the fix is in the 3.1, 3.2, 3.3 and 2.7 trees. It still need applying to the 2.6 branch (it applies cleanly other than Misc/NEWS); I'll let Barry do that one. New rc2 release candidates should be made. Otherwise I think we're ready for the releases. I'm keeping this open until 2.6 is fixed. ---------- assignee: gregory.p.smith -> barry versions: -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 23:37:00 2012 From: report at bugs.python.org (Roger Serwy) Date: Wed, 14 Mar 2012 22:37:00 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331764620.51.0.0717391560086.issue14200@psf.upfronthosting.co.za> Roger Serwy added the comment: Attached is a better implementation of the patch. The Percolator which ultimately handles writing to the Text widget should intercept the ValueError due to non-BMP characters. The issue14200_rev1.patch fixes this issue and Issue13153. ---------- status: closed -> open Added file: http://bugs.python.org/file24849/issue14200_rev1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 23:37:27 2012 From: report at bugs.python.org (Roger Serwy) Date: Wed, 14 Mar 2012 22:37:27 +0000 Subject: [issue13153] IDLE crashes when pasting non-BMP unicode char on UCS-16 build In-Reply-To: <1318363292.9.0.682519731008.issue13153@psf.upfronthosting.co.za> Message-ID: <1331764647.62.0.903996153188.issue13153@psf.upfronthosting.co.za> Roger Serwy added the comment: Issue14200 has a patch to fix this problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 23:38:55 2012 From: report at bugs.python.org (Roger Serwy) Date: Wed, 14 Mar 2012 22:38:55 +0000 Subject: [issue14304] Implement utf-8-bmp codec In-Reply-To: <1331758870.76.0.606902244655.issue14304@psf.upfronthosting.co.za> Message-ID: <1331764735.49.0.992916120117.issue14304@psf.upfronthosting.co.za> Changes by Roger Serwy : ---------- nosy: +serwy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 14 23:41:27 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 22:41:27 +0000 Subject: [issue13248] deprecated in 3.2, should be removed in 3.3 In-Reply-To: <1319392186.66.0.823106983991.issue13248@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset b30171bbc571 by Benjamin Peterson in branch 'default': remove get_prefix and set_prefix (#13248) http://hg.python.org/cpython/rev/b30171bbc571 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 00:22:58 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 14 Mar 2012 23:22:58 +0000 Subject: [issue14307] Make subclassing SocketServer simpler for non-blocking frameworks Message-ID: <1331767378.71.0.470789063251.issue14307@psf.upfronthosting.co.za> New submission from Kristj?n Valur J?nsson : SocketServer employs select.select to achieve timeout behaviour on accepting new requests. Unfortunately, the way this is implemented makes it tricky to bypass this behaviour for users that want to achieve timeout in a different manner. This defect presents two patches. One shows how we delegate the timeout to a new function, _get_request_timeout(), that can be overridden by subclasses. The second shows a concrete version of this function, one that uses the socket's own timeout property rather than select, to get the same behaviour. ---------- files: 75646.patch keywords: patch messages: 155816 nosy: krisvale priority: normal severity: normal status: open title: Make subclassing SocketServer simpler for non-blocking frameworks type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file24850/75646.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 00:24:14 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 14 Mar 2012 23:24:14 +0000 Subject: [issue14307] Make subclassing SocketServer simpler for non-blocking frameworks In-Reply-To: <1331767378.71.0.470789063251.issue14307@psf.upfronthosting.co.za> Message-ID: <1331767454.94.0.00634093623794.issue14307@psf.upfronthosting.co.za> Changes by Kristj?n Valur J?nsson : Added file: http://bugs.python.org/file24851/75647.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 00:39:19 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 14 Mar 2012 23:39:19 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331768359.35.0.311925004331.issue14200@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Roger, you are missing the difference between calling print() and evaluating expression in python interactive mode. While later should be unicode escaped the former should to raise error ? we need to follow the same way as console python interactive session does. For the rest I like your simplification. And definitelly IDLE should to work both in subprocess and embedded modes ? thank you for that point. I'll make the final (I hope) patch a bit later. ---------- assignee: -> asvetlov resolution: fixed -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 00:48:20 2012 From: report at bugs.python.org (Dustin Kirkland) Date: Wed, 14 Mar 2012 23:48:20 +0000 Subject: [issue14308] Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'", ) in ignored Message-ID: <1331768900.76.0.717773710833.issue14308@psf.upfronthosting.co.za> New submission from Dustin Kirkland : My Apache2 logs are filled with the following error kicked out by my python wsgi script: [Wed Mar 14 18:16:38 2012] [error] Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in ignored I was able to silence these with a simple conditional in /usr/lib/python2.7/threading.pyc: - del self._Thread__block + if hasattr(self, '_Thread__block'): + del self._Thread__block Full patch attached. ---------- files: thread.py.patch keywords: patch messages: 155818 nosy: Dustin.Kirkland priority: normal severity: normal status: open title: Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in ignored type: crash versions: Python 2.7 Added file: http://bugs.python.org/file24852/thread.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 00:49:52 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 14 Mar 2012 23:49:52 +0000 Subject: [issue14307] Make subclassing SocketServer simpler for non-blocking frameworks In-Reply-To: <1331767378.71.0.470789063251.issue14307@psf.upfronthosting.co.za> Message-ID: <1331768992.78.0.785167010375.issue14307@psf.upfronthosting.co.za> Changes by Kristj?n Valur J?nsson : Removed file: http://bugs.python.org/file24851/75647.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 00:50:22 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 14 Mar 2012 23:50:22 +0000 Subject: [issue14307] Make subclassing SocketServer simpler for non-blocking frameworks In-Reply-To: <1331767378.71.0.470789063251.issue14307@psf.upfronthosting.co.za> Message-ID: <1331769022.07.0.674996486916.issue14307@psf.upfronthosting.co.za> Changes by Kristj?n Valur J?nsson : Added file: http://bugs.python.org/file24853/75647.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 00:53:19 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 14 Mar 2012 23:53:19 +0000 Subject: [issue14308] '_DummyThread' object has no attribute '_Thread__block' In-Reply-To: <1331768900.76.0.717773710833.issue14308@psf.upfronthosting.co.za> Message-ID: <1331769199.36.0.258377755268.issue14308@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- stage: -> test needed title: Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in ignored -> '_DummyThread' object has no attribute '_Thread__block' type: crash -> behavior versions: +Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 00:58:50 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 14 Mar 2012 23:58:50 +0000 Subject: [issue10278] add time.wallclock() method In-Reply-To: <1288624210.23.0.0497533122542.issue10278@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset c11946846474 by Victor Stinner in branch 'default': Issue #10278: Drop time.monotonic() function, rename time.wallclock() to time.steady() http://hg.python.org/cpython/rev/c11946846474 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 01:09:33 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 15 Mar 2012 00:09:33 +0000 Subject: [issue14295] PEP 417: adding mock module In-Reply-To: <1331688038.8.0.131181977771.issue14295@psf.upfronthosting.co.za> Message-ID: <1331770173.03.0.00314279486183.issue14295@psf.upfronthosting.co.za> ?ric Araujo added the comment: I?ve seen some things to clean up in the code, like the fact that callable is back in 3.2+, or (I hate to point this) the ugly-according-to-PEP-8 klass instead of cls; I may read the code more carefully later if it helps. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 01:12:12 2012 From: report at bugs.python.org (Michael Foord) Date: Thu, 15 Mar 2012 00:12:12 +0000 Subject: [issue14295] PEP 417: adding mock module In-Reply-To: <1331688038.8.0.131181977771.issue14295@psf.upfronthosting.co.za> Message-ID: <1331770332.36.0.622344812499.issue14295@psf.upfronthosting.co.za> Michael Foord added the comment: Feel free to suggest changes on this issue. _callable can probably go now I agree. cls is only suggested by PEP 8 for classmethods I believe, and off the top of my head I don't think mock has any of those. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 01:14:12 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 15 Mar 2012 00:14:12 +0000 Subject: [issue13963] dev guide has no mention of mechanics of patch review In-Reply-To: <1328631878.8.0.85188160352.issue13963@psf.upfronthosting.co.za> Message-ID: <1331770452.98.0.602898071265.issue13963@psf.upfronthosting.co.za> ?ric Araujo added the comment: This is highly debatable. All Mercurial guides that I?ve seen recommend setting git=on because of its many advantages. On the other side there is only one inconvenient. I?m strongly opposed to removing that info from the devguide because one tool can?t cope with it. See also http://psf.upfronthosting.co.za/roundup/meta/issue415 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 01:14:47 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 15 Mar 2012 00:14:47 +0000 Subject: [issue14217] text output pretends to be code In-Reply-To: <1331108351.7.0.269278733631.issue14217@psf.upfronthosting.co.za> Message-ID: <1331770487.52.0.687281809032.issue14217@psf.upfronthosting.co.za> ?ric Araujo added the comment: I thought nonlocal had been backported to 2.7 but you?re right, it was not. ---------- stage: patch review -> committed/rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 01:16:11 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 15 Mar 2012 00:16:11 +0000 Subject: [issue14295] PEP 417: adding mock module In-Reply-To: <1331688038.8.0.131181977771.issue14295@psf.upfronthosting.co.za> Message-ID: <1331770571.78.0.787443793698.issue14295@psf.upfronthosting.co.za> ?ric Araujo added the comment: ?If your public attribute name collides with a reserved keyword, append a single trailing underscore to your attribute name. This is preferable to an abbreviation or corrupted spelling. (However, notwithstanding this rule, 'cls' is the preferred spelling for any variable or argument which is known to be a class, especially the first argument to a class method.)? ---------- _______________________________________ Python tracker _______________________________________ From senthil at uthcode.com Thu Mar 15 01:16:52 2012 From: senthil at uthcode.com (Senthil Kumaran) Date: Wed, 14 Mar 2012 17:16:52 -0700 Subject: [issue13963] dev guide has no mention of mechanics of patch review In-Reply-To: <1331770452.98.0.602898071265.issue13963@psf.upfronthosting.co.za> References: <1328631878.8.0.85188160352.issue13963@psf.upfronthosting.co.za> <1331770452.98.0.602898071265.issue13963@psf.upfronthosting.co.za> Message-ID: <20120315001652.GB5494@mathmagic> Yeah, the other option is to fix the tracker-reitveld integration. (Which I assumed was harder because diff did not give hg info required for it) From report at bugs.python.org Thu Mar 15 01:16:57 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 15 Mar 2012 00:16:57 +0000 Subject: [issue13963] dev guide has no mention of mechanics of patch review In-Reply-To: <1331770452.98.0.602898071265.issue13963@psf.upfronthosting.co.za> Message-ID: <20120315001652.GB5494@mathmagic> Senthil Kumaran added the comment: Yeah, the other option is to fix the tracker-reitveld integration. (Which I assumed was harder because diff did not give hg info required for it) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 01:17:27 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 00:17:27 +0000 Subject: [issue10278] add time.wallclock() method In-Reply-To: <1288624210.23.0.0497533122542.issue10278@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 27441e0d6a75 by Victor Stinner in branch 'default': Issue #10278: Add an optional strict argument to time.steady(), False by default http://hg.python.org/cpython/rev/27441e0d6a75 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 01:19:19 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 00:19:19 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 9c8d066013ea by Barry Warsaw in branch '2.6': - Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes in the hash http://hg.python.org/cpython/rev/9c8d066013ea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 01:22:05 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 00:22:05 +0000 Subject: [issue14222] Using time.time() in Queue.get breaks when system time is changed In-Reply-To: <1331149120.51.0.79082225225.issue14222@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset d97ae725814c by Victor Stinner in branch 'default': Issue #14222: Use the new time.steady() function instead of time.time() for http://hg.python.org/cpython/rev/d97ae725814c ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 01:32:44 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 15 Mar 2012 00:32:44 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331771564.29.0.286134432512.issue14234@psf.upfronthosting.co.za> Gregory P. Smith added the comment: One issue has been identified when compiling with --system-expat. if the system expat library does not have the hash salt support, compilation breaks. fixing now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 01:37:29 2012 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 15 Mar 2012 00:37:29 +0000 Subject: [issue13963] dev guide has no mention of mechanics of patch review In-Reply-To: <1328631878.8.0.85188160352.issue13963@psf.upfronthosting.co.za> Message-ID: <1331771849.69.0.373186334573.issue13963@psf.upfronthosting.co.za> Ezio Melotti added the comment: Most of the patches are against 3.2 or 2.7, so applying them to "default" might fail. If we specify the correct branch, rietveld should be able to apply them cleanly to the head of the branch even without knowing the exact revision (so even with git-style diff). This might still fail if the files affected by the patch changed in the meanwhile, but that shouldn't happen very often. If this is true, we could simply add a way to specify the branch (either a dropdown in the roundup UI or an X.Y in the filename). This might also be used to avoid conflicts when the same patch is submitted for different branches. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 01:52:02 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Mar 2012 00:52:02 +0000 Subject: [issue14309] Deprecate time.clock() Message-ID: <1331772722.48.0.0484604711161.issue14309@psf.upfronthosting.co.za> New submission from STINNER Victor : Python 3.3 has 3 functions to get time: - time.clock() - time.steady() - time.time() Antoine Pitrou suggested to deprecated time.clock() in msg120149 (issue #10278). "The problem is time.clock(), since it does two wildly different things depending on the OS. I would suggest to deprecate time.clock() at the same time as we add time.wallclock(). For the Unix-specific definition of time.clock(), there is already os.times() (which gives even richer information)." (time.wallclock was the old name of time.steady) ---------- components: Library (Lib) messages: 155831 nosy: haypo, pitrou priority: normal severity: normal status: open title: Deprecate time.clock() versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 02:03:03 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 15 Mar 2012 01:03:03 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331773383.81.0.225069485039.issue14234@psf.upfronthosting.co.za> Gregory P. Smith added the comment: configure --with-system-expat was introduced in 2.7 and 3.2 so 2.6 and 3.1 are good to go for release candidates. patch tests are running now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 02:07:28 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 15 Mar 2012 01:07:28 +0000 Subject: [issue14222] Using time.time() in Queue.get breaks when system time is changed In-Reply-To: <1331149120.51.0.79082225225.issue14222@psf.upfronthosting.co.za> Message-ID: <1331773648.5.0.840882595.issue14222@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Yo, I had marked this as something I was going to review once the python-dev discussion to complete. FWIW, I'm the maintainer of the Queue module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 02:11:56 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 01:11:56 +0000 Subject: [issue11261] urlopen breaks when data parameter is used. In-Reply-To: <1298239651.85.0.222287222979.issue11261@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset fddbe9a59d26 by Senthil Kumaran in branch '3.2': Fix the wrong urllib exampls which use str for POST data. Closes Issue11261 http://hg.python.org/cpython/rev/fddbe9a59d26 New changeset 0345dc184e9a by Senthil Kumaran in branch 'default': cpython:Fix the wrong urllib exampls which use str for POST data. Closes Issue11261 http://hg.python.org/cpython/rev/0345dc184e9a ---------- nosy: +python-dev resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 02:15:39 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 01:15:39 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset b2d4a6a9463e by Gregory P. Smith in branch '3.2': Fixes Issue 14234: fix for the previous commit, keep compilation when http://hg.python.org/cpython/rev/b2d4a6a9463e New changeset db27b7353400 by Gregory P. Smith in branch 'default': Fixes Issue 14234: fix for the previous commit, keep compilation when http://hg.python.org/cpython/rev/db27b7353400 New changeset cb72aa8a8008 by Gregory P. Smith in branch '2.7': Fixes Issue 14234: fix for the previous commit, keep compilation when http://hg.python.org/cpython/rev/cb72aa8a8008 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 02:17:30 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 01:17:30 +0000 Subject: [issue13248] deprecated in 3.2, should be removed in 3.3 In-Reply-To: <1319392186.66.0.823106983991.issue13248@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 0ddb78341290 by Raymond Hettinger in branch 'default': Issue #13248: Removed docs for two deprecated unittest features. To be conservative, the code is left in for one more release. http://hg.python.org/cpython/rev/0ddb78341290 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 02:22:36 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Mar 2012 01:22:36 +0000 Subject: [issue12822] NewGIL should use CLOCK_MONOTONIC if possible. In-Reply-To: <1314085416.99.0.752578807259.issue12822@psf.upfronthosting.co.za> Message-ID: <1331774556.27.0.200860028553.issue12822@psf.upfronthosting.co.za> STINNER Victor added the comment: See also #14222. Python 3.3 has a new time.steady() function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 02:23:43 2012 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 15 Mar 2012 01:23:43 +0000 Subject: [issue13248] deprecated in 3.2, should be removed in 3.3 In-Reply-To: <1319392186.66.0.823106983991.issue13248@psf.upfronthosting.co.za> Message-ID: <1331774623.78.0.463954388015.issue13248@psf.upfronthosting.co.za> Ezio Melotti added the comment: Raymond, I think it's better to leave the documentation and use "deprecated-removed" to signal clearly that those functions are deprecated and when they will be removed (even if this means 3.4). IME removing documentation creates more confusion because people that find those functions in some codebase will have an hard time figuring out what they are, where do they come from, if they are deprecated or not and when they will be removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 02:27:40 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 15 Mar 2012 01:27:40 +0000 Subject: [issue13248] deprecated in 3.2, should be removed in 3.3 In-Reply-To: <1319392186.66.0.823106983991.issue13248@psf.upfronthosting.co.za> Message-ID: <1331774860.27.0.298194874127.issue13248@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Ezio, I'm was thinking of marking the code and its docstring as removed/unused, but if you want the code removed altogether, that would be fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 02:28:28 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 15 Mar 2012 01:28:28 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331774908.01.0.461400384863.issue14234@psf.upfronthosting.co.za> Gregory P. Smith added the comment: okay. it is time to cut the rc2 release candidates with these changes. ---------- assignee: barry -> gregory.p.smith resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 02:33:07 2012 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 15 Mar 2012 01:33:07 +0000 Subject: [issue13248] deprecated in 3.2, should be removed in 3.3 In-Reply-To: <1319392186.66.0.823106983991.issue13248@psf.upfronthosting.co.za> Message-ID: <1331775187.4.0.0928032537266.issue13248@psf.upfronthosting.co.za> Ezio Melotti added the comment: I don't mind if they are removed in 3.3 or 3.4, as long as they are documented in all the versions where they are present. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 02:38:07 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 15 Mar 2012 01:38:07 +0000 Subject: [issue14310] Socket duplication for windows Message-ID: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> New submission from Kristj?n Valur J?nsson : winsock natively supports the duplciation of sockets for use on different processes. This patch proposes to add that functionality: socket.duplicate(target_pid) gets a bytes representation of the duplicate socket, usable for the target process. socket.socket(x,y,z,data) creates the socket object from the bytes representation. The patch contains a test using multiprocessing that works. Note that multiprocessing already contains its own code to achieve this, and that code can possibly be simplified with this patch. Note also the new function "duplicate." Perhaps "dup(target_pid) would be better? But it would have different semantics. Also notice how we overload the "fromfd" parameter in socket.socket() to recreate a socket from a bytes representation. Maybe this is not ideal? Looking for thoughs here. ---------- components: Interpreter Core files: duplicate.patch keywords: patch messages: 155842 nosy: krisvale priority: normal severity: normal status: open title: Socket duplication for windows type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file24854/duplicate.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 03:24:52 2012 From: report at bugs.python.org (Sean Wang) Date: Thu, 15 Mar 2012 02:24:52 +0000 Subject: [issue14311] ConfigParser does not parse utf-8 files with BOM bytes Message-ID: <1331778292.28.0.574531846286.issue14311@psf.upfronthosting.co.za> New submission from Sean Wang : ConfigParser failed to parse a utf-8 file with BOM bytes('\xef\xbb\xbf'), it would raise ConfigParser.MissingSectionHeaderError. I think that other files with BOM would have the same problem; because the argument "SECTCRE" does not consider the BOM conditions. Now the workaround is like below: cp=ConfigParser.ConfigParser() cfgfile=os.path.join(curpath,'config.cfg') cp.readfp(codecs.open(cfgfile, 'r','utf-8-sig')) ---------- components: Library (Lib) messages: 155843 nosy: Sean.Wang priority: normal severity: normal status: open title: ConfigParser does not parse utf-8 files with BOM bytes type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 03:25:21 2012 From: report at bugs.python.org (Roger Serwy) Date: Thu, 15 Mar 2012 02:25:21 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331778321.79.0.331624089649.issue14200@psf.upfronthosting.co.za> Roger Serwy added the comment: Andrew, I do admit that I have a lot to learn about Unicode support in Python, for instance with its error-handling and its corner cases. On Windows Vista, I do see that print() behaves differently than evaluating the expression. An exception is raised for: print('\N{GOTHIC LETTER AHSA}') On Linux, I see the character print as ? in xterm and as a '?' when evaluated. In gnome-terminal (Ubuntu Mono font) it prints as a box containing the code point in hex. No exception is raised. I do see your point. The patch I provided always substitutes the unsupported character with its full expansion. Returning to a point earlier raised by Martin, using REPLACEMENT CHARACTER instead would be better. It would make the behavior of IDLE more consistent with xterm and gnome-terminal, although it would cause IDLE to hide errors if the program ran from a Windows console instead of IDLE. Given that Windows and Linux (Ubuntu) behave differently, I'd rather let IDLE mimic the behavior of a Linux console than a Windows console. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 04:08:43 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 15 Mar 2012 03:08:43 +0000 Subject: [issue14163] tkinter: problems with hello doc example In-Reply-To: <1330560048.21.0.5556738264.issue14163@psf.upfronthosting.co.za> Message-ID: <1331780923.37.0.309121485704.issue14163@psf.upfronthosting.co.za> Andrew Svetlov added the comment: What the status of 'hello demo'? If there are no objections I can update the docs. ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 04:17:03 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 15 Mar 2012 03:17:03 +0000 Subject: [issue9216] FIPS support for hashlib In-Reply-To: <1278721335.16.0.522410247151.issue9216@psf.upfronthosting.co.za> Message-ID: <1331781423.55.0.150621570414.issue9216@psf.upfronthosting.co.za> Gregory P. Smith added the comment: My summary of our discussion was pretty terse. :) dmalcolm has more detailed TODO list notes that include things like the error cases and .rst documentation. As for how to commit it, i'd make 0001 its own commit as it is a useful refactoring otherwise unrelated to this change. I'll leave it entirely up to dmalcolm how many commits he wants 0002 onward to be. No need to be picky. usedforsecurity vs used_for_security, agreed, used_for_security is better. dmalcolm was going to make an enum to index the two element array, that'd give meaningful names instead of 0 or 1. simply using two named variables would also work but it would require the loop in 0003 to be expanded or turned into a small static method for the body (not a bad idea) instead. i'm fine with either. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 04:28:38 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 03:28:38 +0000 Subject: [issue14296] Compilation error on CentOS 5.8 In-Reply-To: <1331688181.08.0.800421526529.issue14296@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 760347b11ef8 by Benjamin Peterson in branch 'default': try to fix compilation on glibc's with cpu sets (#14296) http://hg.python.org/cpython/rev/760347b11ef8 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 04:28:47 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 15 Mar 2012 03:28:47 +0000 Subject: [issue14296] Compilation error on CentOS 5.8 In-Reply-To: <1331688181.08.0.800421526529.issue14296@psf.upfronthosting.co.za> Message-ID: <1331782127.49.0.342277142645.issue14296@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Can you try on the default branch now? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 04:30:32 2012 From: report at bugs.python.org (Roger Serwy) Date: Thu, 15 Mar 2012 03:30:32 +0000 Subject: [issue14163] tkinter: problems with hello doc example In-Reply-To: <1330560048.21.0.5556738264.issue14163@psf.upfronthosting.co.za> Message-ID: <1331782232.76.0.938082790558.issue14163@psf.upfronthosting.co.za> Roger Serwy added the comment: The current tk_hello.py file works under Ubuntu 11.04 with the latest python build from the repository. It looks good to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 04:42:03 2012 From: report at bugs.python.org (Brian Jones) Date: Thu, 15 Mar 2012 03:42:03 +0000 Subject: [issue14278] email.utils.localtime throws exception if time.daylight is False In-Reply-To: <1331597641.5.0.510268852561.issue14278@psf.upfronthosting.co.za> Message-ID: <1331782923.67.0.782366486245.issue14278@psf.upfronthosting.co.za> Changes by Brian Jones : ---------- nosy: +Brian.Jones _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 04:49:49 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 15 Mar 2012 03:49:49 +0000 Subject: [issue8739] Update to smtpd.py to RFC 5321 In-Reply-To: <1274103249.44.0.284620021799.issue8739@psf.upfronthosting.co.za> Message-ID: <1331783389.67.0.206406242095.issue8739@psf.upfronthosting.co.za> R. David Murray added the comment: OK, I've gone through Dan's update (thanks very much for the tests!). I'm uploading a revised patch. The major differences are: I've refactored the parsing. Now it is a three step process: peel off the extra keyword (FROM:, TO:) if there is one, then pull off the address, then parse the remainder as parameters, doing a best-effort parse (that is, ignore tokens that don't parse as parameters rather than failing the entire parse if one is bad). This fixed a bug where a space between the : and the address would break command parsing. When the RFC5322 parser from email6 lands, it will almost be a drop in replacement for _parseaddr. (Oh, yeah, I took the opportunity to eliminate the last __ methods. There's no reason for those parsing methods to be __ methods.) I say almost because it will allow us to correctly implement the difference in the syntax of the address for VRFY verses MAIL and RCPT by using two different functions from that parser. I've removed the 8BITMIME support. It was not implemented correctly per its RFC, and the server as it exists does not, in fact, support receiving binary data (it decodes what it receives using the utf-8 codec...which means it will raise a decode error on binary data). It would be possible to add 8BITMIME support, but since it is non trivial we'll leave that to another issue. I reworked the extended command length support to facilitate adding additional extension support. What I did may not be the most useful refactoring, though. I considered just making the limit "large enough", but decided to keep the current behavior since it allows smtpd to be used to test clients handling smtp servers that enforce the limits. Given that, a nice future feature would be to make the max command length limit settable as well. I renamed max_message_size back to data_size_limit in order to maintain backward compatibility. I updated the general help output to reflect the HELO/EHLO state. I don't know what typical servers do for that (since HELP can be issued before them), but I think I've seen it work that way on other servers. I've added a few more tests. Unless someone wants to add tests for the smtpd command line, I think this patch is done. Reviews welcome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 04:50:16 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 15 Mar 2012 03:50:16 +0000 Subject: [issue8739] Update to smtpd.py to RFC 5321 In-Reply-To: <1274103249.44.0.284620021799.issue8739@psf.upfronthosting.co.za> Message-ID: <1331783416.94.0.59988984836.issue8739@psf.upfronthosting.co.za> Changes by R. David Murray : Added file: http://bugs.python.org/file24855/issue8739.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 05:07:56 2012 From: report at bugs.python.org (Berker Peksag) Date: Thu, 15 Mar 2012 04:07:56 +0000 Subject: [issue14312] Convert PEP 7 to reStructuredText for readability purposes Message-ID: <1331784475.88.0.114777219074.issue14312@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- assignee: docs at python components: Documentation files: pep-0007_v1.diff keywords: patch nosy: berker.peksag, docs at python priority: normal severity: normal status: open title: Convert PEP 7 to reStructuredText for readability purposes type: enhancement Added file: http://bugs.python.org/file24856/pep-0007_v1.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 05:20:02 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 15 Mar 2012 04:20:02 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331785202.67.0.651112660726.issue14200@psf.upfronthosting.co.za> Andrew Svetlov added the comment: I consulted with Martin at PyCon sprint and he suggested sulution which I'm following ? to split `print` and REPL (read-eval-print loop). Output passed to print() function encoded with sys.stdout.encoding UTF has been invented to support any character. Linux usually setted up to use utf-8 encoding by default (see LANG environment variable). There are no encoding issues with that. xterm (old enough terminal) which you use cannot print non-BMP characters and replaces it with question marks. Modern gnome-terminal prints that symbols very well. Let's return to non-UTF terminal encodings. If character cannot be encoded Python throws UnicodeEncodeError. There's example: andrew at tiktaalik ~/p/cpython> bash -c "LANG=C; ./python" Python 3.3.0a1+ (qbase qtip tip tk:c3ce8a8e6c9c+, Mar 14 2012, 15:54:55) [GCC 4.6.1] on linux Type "help", "copyright", "credits" or "license" for more information. >>> '\U00010340' '\U00010340' >>> print('\U00010340') Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character '\U00010340' in position 0: ordinal not in range(128) >>> As you can see I have switched LANG to C (alias for ASCII) locale. Eval printed with unicode escaping but `print` call raises error. This happens because python's REPL calls sys.displayhook. You can look at http://docs.python.org/dev/library/sys.html#sys.displayhook details. That code escapes unicode if terminal doesn't support it. The same for Windows, OS X and any other platform. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 05:24:29 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 15 Mar 2012 04:24:29 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1331785469.67.0.279521689786.issue2377@psf.upfronthosting.co.za> Benjamin Peterson added the comment: I'm guessing the most important part to review is the binding of importlib into being the main import implementation? (It's been in the tree a while, so I assume the kinks of the actual import implementation have been mostly ironed out.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 05:26:15 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 15 Mar 2012 04:26:15 +0000 Subject: [issue14133] improved PEP 409 implementation In-Reply-To: <1330269562.83.0.382343969435.issue14133@psf.upfronthosting.co.za> Message-ID: <1331785575.06.0.792673163265.issue14133@psf.upfronthosting.co.za> Benjamin Peterson added the comment: I'm wondering if allowing printing __context__ and __cause__ is the best idea. Both could have chains and if they do it will be very non-obvious which one came from which. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 05:35:35 2012 From: report at bugs.python.org (Sergey Dorofeev) Date: Thu, 15 Mar 2012 04:35:35 +0000 Subject: [issue14313] zipfile does not unpack files from archive (files extracted have zero length) Message-ID: <1331786135.76.0.307574406169.issue14313@psf.upfronthosting.co.za> New submission from Sergey Dorofeev : unzip does extract files but zipfile no works fine with python2.7 but fails with python 3.2.2 tested on solaris 11 express and windows xp >>> import zipfile >>> zipfile.ZipFile("test.zip") >>> z=_ >>> z.namelist > >>> z.namelist() ['19A7B5A4.PKT'] >>> z.read('19A7B5A4.PKT') b'' ---------- components: Library (Lib) files: test.zip messages: 155854 nosy: fidoman priority: normal severity: normal status: open title: zipfile does not unpack files from archive (files extracted have zero length) type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file24857/test.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 05:41:37 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 04:41:37 +0000 Subject: [issue14163] tkinter: problems with hello doc example In-Reply-To: <1330560048.21.0.5556738264.issue14163@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset d8ba959a547b by Andrew Svetlov in branch 'default': Closes issue #14163 - tkinter: problems with hello doc example http://hg.python.org/cpython/rev/d8ba959a547b ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 05:43:23 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 15 Mar 2012 04:43:23 +0000 Subject: [issue14163] tkinter: problems with hello doc example In-Reply-To: <1330560048.21.0.5556738264.issue14163@psf.upfronthosting.co.za> Message-ID: <1331786603.85.0.0814202991723.issue14163@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Pushed into master. Thanks. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 05:46:44 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 15 Mar 2012 04:46:44 +0000 Subject: [issue13153] IDLE crashes when pasting non-BMP unicode char on UCS-16 build In-Reply-To: <1318363292.9.0.682519731008.issue13153@psf.upfronthosting.co.za> Message-ID: <1331786804.64.0.710679261702.issue13153@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Not sure. Let me to investigate the problem deeper. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 05:59:35 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 15 Mar 2012 04:59:35 +0000 Subject: [issue14314] logging smtp handler (and test) timeout issue Message-ID: <1331787575.82.0.497209791656.issue14314@psf.upfronthosting.co.za> New submission from R. David Murray : I'm working on a patch that updates smtpd, and when I ran the full test suite I got a hang in test_logging. This means there's a bug in my update, but there is also a bug in the logging test. But see below for another issue I noticed while investigating this, that is the real focus of this report. This traceback occurs before the test hang: test_basic (test.test_logging.SMTPHandlerTest) ... error: uncaptured python exception, closing channel (:TestSMTPChannel inst) Traceback (most recent call last): File "/home/rdmurray/python/p33/Lib/logging/handlers.py", line 935, in emit smtp.sendmail(self.fromaddr, self.toaddrs, msg) File "/home/rdmurray/python/p33/Lib/smtplib.py", line 741, in sendmail self.ehlo_or_helo_if_needed() File "/home/rdmurray/python/p33/Lib/smtplib.py", line 550, in ehlo_or_helo_if_needed if not (200 <= self.ehlo()[0] <= 299): File "/home/rdmurray/python/p33/Lib/smtplib.py", line 417, in ehlo (code, msg) = self.getreply() File "/home/rdmurray/python/p33/Lib/smtplib.py", line 372, in getreply raise SMTPServerDisconnected("Connection unexpectedly closed") smtplib.SMTPServerDisconnected: Connection unexpectedly closed Logged from file , line 0 I think the event.wait() in the test should have a timeout; setting it to, say, 5 lets the tests complete (with a failure) in this situation. Now the real issue: Looking at the smtp handler code, I notice that unlike the socket handler it doesn't provide any way to set the timeout. This means it could potentially hang forever trying to log an event, which while not related to the above issue is something that I think should be fixed. I've marked this as behavior, since the SMTP connection should probably get a reasonable default timeout even in bug fix releases, but in 3.3 you'll probably want to make it settable and perhaps shorten the default relative to what you use for the maint releases. ---------- components: Library (Lib) keywords: easy messages: 155858 nosy: r.david.murray, vinay.sajip priority: normal severity: normal stage: needs patch status: open title: logging smtp handler (and test) timeout issue type: behavior versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 06:37:09 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 15 Mar 2012 05:37:09 +0000 Subject: [issue8963] test_urllibnet failure In-Reply-To: <1276196839.19.0.231590602267.issue8963@psf.upfronthosting.co.za> Message-ID: <1331789829.99.0.862641176768.issue8963@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Closing this based on - msg155387. The upstream bug is "unfortunately" closed as OLD. We can reopen if this stumble upon this again. ---------- resolution: -> invalid stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 06:43:08 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 15 Mar 2012 05:43:08 +0000 Subject: [issue11959] smtpd cannot be used without affecting global state In-Reply-To: <1304111550.3.0.684224980767.issue11959@psf.upfronthosting.co.za> Message-ID: <1331790188.29.0.489523638708.issue11959@psf.upfronthosting.co.za> R. David Murray added the comment: The test failure in #14314 isn't a bug in my code, it is due to the fact that you copied the __init__ method of SMTPChannel in your logging tests, and the __init__ is changed by my patch. Clearly it would be good to resolve this issue one way or another. I notice that your logging test code doesn't override create_socket. Is that no longer needed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 06:44:57 2012 From: report at bugs.python.org (Eric Snow) Date: Thu, 15 Mar 2012 05:44:57 +0000 Subject: [issue4199] add shorthand global and nonlocal statements In-Reply-To: <1224887535.03.0.272495603252.issue4199@psf.upfronthosting.co.za> Message-ID: <1331790297.13.0.267286457647.issue4199@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 06:45:45 2012 From: report at bugs.python.org (=?utf-8?b?5YuH5YiaIOe9lw==?=) Date: Thu, 15 Mar 2012 05:45:45 +0000 Subject: [issue14255] tempfile.gettempdir() didn't return the path with correct case. In-Reply-To: <1331514762.82.0.635964063955.issue14255@psf.upfronthosting.co.za> Message-ID: <1331790345.42.0.791210004137.issue14255@psf.upfronthosting.co.za> ?? ? added the comment: +1 _get_default_tempdir to use normpath ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 06:47:01 2012 From: report at bugs.python.org (Dylan Sarber) Date: Thu, 15 Mar 2012 05:47:01 +0000 Subject: [issue12758] time.time() returns local time instead of UTC In-Reply-To: <1313481124.28.0.0943950907585.issue12758@psf.upfronthosting.co.za> Message-ID: <1331790421.08.0.528527006623.issue12758@psf.upfronthosting.co.za> Dylan Sarber added the comment: I patched this one up quickly. One has been changed using belopolsky's recommendation, which already reads well. ---------- keywords: +patch nosy: +dwsarber Added file: http://bugs.python.org/file24858/time_doc_fix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 06:49:32 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 15 Mar 2012 05:49:32 +0000 Subject: [issue8739] Update to smtpd.py to RFC 5321 In-Reply-To: <1274103249.44.0.284620021799.issue8739@psf.upfronthosting.co.za> Message-ID: <1331790572.83.0.113644722587.issue8739@psf.upfronthosting.co.za> R. David Murray added the comment: Note that this patch causes test_logging to fail/hang. I've opened issue 14314 that mentions the hang (the issue is really about the lack of a timeout in logging's smtp handler) and updated issue 11959 about the issues involved in test_logging using smtpd the way it does. I'm making fixing that issue a dependency for this one. ---------- dependencies: +smtpd cannot be used without affecting global state _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 07:09:34 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 15 Mar 2012 06:09:34 +0000 Subject: [issue14278] email.utils.localtime throws exception if time.daylight is False In-Reply-To: <1331597641.5.0.510268852561.issue14278@psf.upfronthosting.co.za> Message-ID: <1331791774.6.0.283451178252.issue14278@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- assignee: -> r.david.murray resolution: -> fixed stage: -> committed/rejected type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 07:11:54 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 15 Mar 2012 06:11:54 +0000 Subject: [issue14278] email.utils.localtime throws exception if time.daylight is False In-Reply-To: <1331597641.5.0.510268852561.issue14278@psf.upfronthosting.co.za> Message-ID: <1331791914.33.0.69861793241.issue14278@psf.upfronthosting.co.za> R. David Murray added the comment: Fixed in the email6 feature branch. Thanks Brian. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 07:35:26 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 15 Mar 2012 06:35:26 +0000 Subject: [issue4199] add shorthand global and nonlocal statements In-Reply-To: <1224887535.03.0.272495603252.issue4199@psf.upfronthosting.co.za> Message-ID: <1331793326.95.0.997282417229.issue4199@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 on the feature as described in the PEP. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 07:37:48 2012 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Thu, 15 Mar 2012 06:37:48 +0000 Subject: [issue14309] Deprecate time.clock() In-Reply-To: <1331772722.48.0.0484604711161.issue14309@psf.upfronthosting.co.za> Message-ID: <4F618E38.7020108@egenix.com> Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > New submission from STINNER Victor : > > Python 3.3 has 3 functions to get time: > > - time.clock() > - time.steady() > - time.time() > > Antoine Pitrou suggested to deprecated time.clock() in msg120149 (issue #10278). > > "The problem is time.clock(), since it does two wildly different things > depending on the OS. I would suggest to deprecate time.clock() at the same time as we add time.wallclock(). For the Unix-specific definition of time.clock(), there is already os.times() (which gives even richer information)." > > (time.wallclock was the old name of time.steady) Strong -1 on this idea. time.clock() has been in use for ages in many many scripts. We don't want to carelessly break all those. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 08:10:58 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 07:10:58 +0000 Subject: [issue12758] time.time() returns local time instead of UTC In-Reply-To: <1313481124.28.0.0943950907585.issue12758@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 1559a82a3529 by R David Murray in branch '2.7': #12758: removing confusing mention of UTC from time.time description http://hg.python.org/cpython/rev/1559a82a3529 New changeset 5615d6b91b53 by R David Murray in branch '3.2': #12758: removing confusing mention of UTC from time.time description http://hg.python.org/cpython/rev/5615d6b91b53 New changeset f18767bb66ba by R David Murray in branch 'default': Merge #12758: removing confusing mention of UTC from time.time description http://hg.python.org/cpython/rev/f18767bb66ba ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 08:11:34 2012 From: report at bugs.python.org (Larry Hastings) Date: Thu, 15 Mar 2012 07:11:34 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331795494.13.0.251393453631.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: My revised patch, incorporating changes suggested by Antoine and Guido. ---------- Added file: http://bugs.python.org/file24859/larry.st_mtime_ns.patch.2.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 08:12:08 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 15 Mar 2012 07:12:08 +0000 Subject: [issue12758] time.time() returns local time instead of UTC In-Reply-To: <1313481124.28.0.0943950907585.issue12758@psf.upfronthosting.co.za> Message-ID: <1331795528.69.0.176281316554.issue12758@psf.upfronthosting.co.za> R. David Murray added the comment: Thanks, Dylan. ---------- nosy: +r.david.murray resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 08:19:24 2012 From: report at bugs.python.org (Georg Brandl) Date: Thu, 15 Mar 2012 07:19:24 +0000 Subject: [issue14312] Convert PEP 7 to reStructuredText for readability purposes Message-ID: <1331795964.87.0.67514867127.issue14312@psf.upfronthosting.co.za> New submission from Georg Brandl : Yes, who not. Applied in 5d6ae5e01df6. ---------- nosy: +georg.brandl resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 08:20:30 2012 From: report at bugs.python.org (Georg Brandl) Date: Thu, 15 Mar 2012 07:20:30 +0000 Subject: [issue14312] Convert PEP 7 to reStructuredText for readability purposes In-Reply-To: <1331795964.87.0.67514867127.issue14312@psf.upfronthosting.co.za> Message-ID: <1331796030.18.0.654773119686.issue14312@psf.upfronthosting.co.za> Georg Brandl added the comment: Yes, why not. Applied in c1fd4a5af1c5. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 08:20:35 2012 From: report at bugs.python.org (Georg Brandl) Date: Thu, 15 Mar 2012 07:20:35 +0000 Subject: [issue14312] Convert PEP 7 to reStructuredText for readability purposes In-Reply-To: <1331796030.18.0.654773119686.issue14312@psf.upfronthosting.co.za> Message-ID: <1331796035.54.0.882872000195.issue14312@psf.upfronthosting.co.za> Changes by Georg Brandl : ---------- Removed message: http://bugs.python.org/msg155870 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 09:57:54 2012 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Thu, 15 Mar 2012 08:57:54 +0000 Subject: [issue14313] zipfile does not unpack files from archive (files extracted have zero length) In-Reply-To: <1331786135.76.0.307574406169.issue14313@psf.upfronthosting.co.za> Message-ID: <1331801874.6.0.485961447442.issue14313@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: This ZIP file uses a compression method unsupported by Python: >>> z.getinfo('19A7B5A4.PKT').compress_type 6 which corresponds to "Imploded". Only "Stored" and "Deflated" are supported. Note that previous versions don't work either: they just happen to return the compressed data. ---------- nosy: +amaury.forgeotdarc stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 10:31:30 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Mar 2012 09:31:30 +0000 Subject: [issue14309] Deprecate time.clock() In-Reply-To: <4F618E38.7020108@egenix.com> Message-ID: STINNER Victor added the comment: > time.clock() has been in use for ages in many many scripts. > We don't want to carelessly break all those. I don't want to remove the function, just mark it as deprecated to avoid confusion. It will only be removed from the next major Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 10:34:31 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Thu, 15 Mar 2012 09:34:31 +0000 Subject: [issue14307] Make subclassing SocketServer simpler for non-blocking frameworks In-Reply-To: <1331767378.71.0.470789063251.issue14307@psf.upfronthosting.co.za> Message-ID: <1331804071.66.0.105001704784.issue14307@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 10:36:23 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Thu, 15 Mar 2012 09:36:23 +0000 Subject: [issue14309] Deprecate time.clock() In-Reply-To: <1331772722.48.0.0484604711161.issue14309@psf.upfronthosting.co.za> Message-ID: <1331804183.3.0.702116319419.issue14309@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 10:39:49 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Thu, 15 Mar 2012 09:39:49 +0000 Subject: [issue14295] PEP 417: adding mock module In-Reply-To: <1331688038.8.0.131181977771.issue14295@psf.upfronthosting.co.za> Message-ID: <1331804389.13.0.788274714075.issue14295@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 10:43:00 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Thu, 15 Mar 2012 09:43:00 +0000 Subject: [issue14310] Socket duplication for windows In-Reply-To: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> Message-ID: <1331804580.41.0.515182929184.issue14310@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 12:15:46 2012 From: report at bugs.python.org (pleed) Date: Thu, 15 Mar 2012 11:15:46 +0000 Subject: [issue14315] zipfile.ZipFile() unable to open zip File Message-ID: <1331810146.14.0.995585507713.issue14315@psf.upfronthosting.co.za> New submission from pleed : zipfile.ZipFile("bla.apk") crashes, but should not since other tools work perfectly with this file. Python 2.7.2+ (default, Oct 4 2011, 20:06:09) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import zipfile >>> zipfile.ZipFile("bla.apk") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/zipfile.py", line 710, in __init__ self._GetContents() File "/usr/lib/python2.7/zipfile.py", line 744, in _GetContents self._RealGetContents() File "/usr/lib/python2.7/zipfile.py", line 803, in _RealGetContents x._decodeExtra() File "/usr/lib/python2.7/zipfile.py", line 369, in _decodeExtra tp, ln = unpack(' _______________________________________ From report at bugs.python.org Thu Mar 15 12:21:54 2012 From: report at bugs.python.org (Jeff McNeil) Date: Thu, 15 Mar 2012 11:21:54 +0000 Subject: [issue14255] tempfile.gettempdir() didn't return the path with correct case. In-Reply-To: <1331514762.82.0.635964063955.issue14255@psf.upfronthosting.co.za> Message-ID: <1331810514.56.0.191049487669.issue14255@psf.upfronthosting.co.za> Jeff McNeil added the comment: Here's a tiny patch that just changes normcase->normpath. This fixes the casing issue at the 'gettempdir' level, though it doesn't address the 'normcase' function itself. Note that *both* macpath.py and ntpath.py use .lower, which obviously won't fly on case-sensitive mounts. If someone more experienced than I has a suggestion on how to handle that -- or whether its worthwhile to even touch -- I'll gladly implement. ---------- keywords: +patch Added file: http://bugs.python.org/file24861/tempfile_normpath.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 12:30:31 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 15 Mar 2012 11:30:31 +0000 Subject: [issue14308] '_DummyThread' object has no attribute '_Thread__block' In-Reply-To: <1331768900.76.0.717773710833.issue14308@psf.upfronthosting.co.za> Message-ID: <1331811031.31.0.582787855245.issue14308@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 12:37:54 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 15 Mar 2012 11:37:54 +0000 Subject: [issue14307] Make subclassing SocketServer simpler for non-blocking frameworks In-Reply-To: <1331767378.71.0.470789063251.issue14307@psf.upfronthosting.co.za> Message-ID: <1331811474.46.0.423879068274.issue14307@psf.upfronthosting.co.za> Antoine Pitrou added the comment: As discussed on python-dev, I'm against this change. Furthermore, removing the explicit select() call also removes the opportunity to use a wake-up fd instead of the current polling mechanism. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 13:02:17 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 12:02:17 +0000 Subject: [issue14314] logging smtp handler (and test) timeout issue In-Reply-To: <1331787575.82.0.497209791656.issue14314@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 4b3f81720809 by Vinay Sajip in branch 'default': Fixes #14314: Improved SMTP timeout handling. http://hg.python.org/cpython/rev/4b3f81720809 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 13:05:23 2012 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 15 Mar 2012 12:05:23 +0000 Subject: [issue14314] logging smtp handler (and test) timeout issue In-Reply-To: <1331787575.82.0.497209791656.issue14314@psf.upfronthosting.co.za> Message-ID: <1331813123.25.0.0814136880179.issue14314@psf.upfronthosting.co.za> Vinay Sajip added the comment: I've added changes to the test code and a timeout to SMTPHandler (docs still to be updated), and I'll let it run on the buildbots for a bit before looking at timeouts for 3.2/2.7. Marking as pending to remind me. ---------- assignee: -> vinay.sajip resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 13:05:47 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 12:05:47 +0000 Subject: [issue1641] asyncore delayed calls feature In-Reply-To: <1197908693.3.0.330108725692.issue1641@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 59f0e6de54b3 by Giampaolo Rodola' in branch 'default': (sched) when run() is invoked with blocking=False return the deadline of the next scheduled call in the scheduler; this use case was suggested in http://bugs.python.org/issue1641#msg149453 http://hg.python.org/cpython/rev/59f0e6de54b3 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 13:09:45 2012 From: report at bugs.python.org (sbt) Date: Thu, 15 Mar 2012 12:09:45 +0000 Subject: [issue14310] Socket duplication for windows In-Reply-To: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> Message-ID: <1331813385.22.0.0936265458968.issue14310@psf.upfronthosting.co.za> sbt added the comment: It appears that the 4th argument of the socket constructor is undocumented, so presumably one is expected to use fromfd() instead. Maybe you could have a frominfo(info) function (to match fromfd(fd,...)) and a dupinfo(pid) method. (It appears that multiprocessing uses DuplicateHandle() instead of WSADuplicateSocket() for duplicating socket handles on Windows. That should be fixed.) ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 13:14:54 2012 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 15 Mar 2012 12:14:54 +0000 Subject: [issue11959] smtpd cannot be used without affecting global state In-Reply-To: <1304111550.3.0.684224980767.issue11959@psf.upfronthosting.co.za> Message-ID: <1331813694.31.0.989706241188.issue11959@psf.upfronthosting.co.za> Vinay Sajip added the comment: > I notice that your logging test code doesn't override create_socket. Is that no longer needed? I removed that code from test_logging, but the code in the BitBucket repo shows how I'd like smtpd to be changed. I would of course prefer to avoid copying stuff from SMTPChannel, as the docstring for TestSMTPChannel indicates. If you could take a look at the suggested changes in https://bitbucket.org/vinay.sajip/cpython-smtpd/compare/default..mirror/cpython and let me have your comments, that'd be great. The code in that repo does redefine create_socket. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 13:45:02 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 15 Mar 2012 12:45:02 +0000 Subject: [issue14308] '_DummyThread' object has no attribute '_Thread__block' In-Reply-To: <1331768900.76.0.717773710833.issue14308@psf.upfronthosting.co.za> Message-ID: <1331815502.28.0.871873435039.issue14308@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I don't understand how that can happen, since _Thread__block is initialized in Thread.__init__, which is called by _DummyThread.__init__. Did you somehow monkeypatch the threading module? ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 13:56:27 2012 From: report at bugs.python.org (Stefan Krah) Date: Thu, 15 Mar 2012 12:56:27 +0000 Subject: [issue11826] Leak in atexitmodule In-Reply-To: <1331721078.12.0.886538672955.issue11826@psf.upfronthosting.co.za> Message-ID: <20120315125625.GA17512@sleipnir.bytereef.org> Stefan Krah added the comment: Antoine Pitrou wrote: > Well, if it doesn't crash, it's probably ok ;) > Perhaps check modstate->atexit_callbacks for non-NULL? > Or do we trust free() to do the right thing? I was initially surprised by this, but the docs state that it's safe: http://docs.python.org/dev/c-api/memory.html?highlight=pymem_free#PyMem_Free The I searched a bit and it appears that free() crashing on NULL is a pre-ANSI thing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 14:45:33 2012 From: report at bugs.python.org (Laurent Mazuel) Date: Thu, 15 Mar 2012 13:45:33 +0000 Subject: [issue11085] expose _abcoll as collections.abc In-Reply-To: <1296503066.28.0.738947830383.issue11085@psf.upfronthosting.co.za> Message-ID: <1331819133.74.0.0175505708377.issue11085@psf.upfronthosting.co.za> Changes by Laurent Mazuel : ---------- nosy: +Laurent.Mazuel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 15:06:39 2012 From: report at bugs.python.org (Dustin Kirkland) Date: Thu, 15 Mar 2012 14:06:39 +0000 Subject: [issue14308] '_DummyThread' object has no attribute '_Thread__block' In-Reply-To: <1331768900.76.0.717773710833.issue14308@psf.upfronthosting.co.za> Message-ID: <1331820399.61.0.231584752338.issue14308@psf.upfronthosting.co.za> Dustin Kirkland added the comment: /usr/lib/python2.7/threading.pyc is stock from my distribution, Ubuntu 12.04 LTS, which has python-2.7.3~rc1-1ubuntu2. I did manually apply the patch I've attached here to /usr/lib/python2.7/threading.py, and it *seemed* to silence those errors. However, on checking my logs again this morning, I have a few hundred more of the same error, so that was not effective. First time contributor here...what would be the proper way to test this? Thanks for your patience. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 15:17:17 2012 From: report at bugs.python.org (Frank) Date: Thu, 15 Mar 2012 14:17:17 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331821037.05.0.414735022148.issue829370@psf.upfronthosting.co.za> Frank added the comment: Here an example where the signum function provides an elegant way to calculate the Julian date: def julian_date(YY,MM,DD,HR,Min,Sec,UTcor): return 367*YY - (7*(YY+((MM+9)/12))/4) + (275*MM/9)+ DD + 1721013.5 + UTcor/24 - 0.5*sign((100*YY)+MM-190002.5) + 0.5 + HR/24.0 + Min/(60.0*24.0) + Sec/(3600.0*24.0) http://aa.usno.navy.mil/faq/docs/JD_Formula.php http://www.krioma.net/blog/2011/09/python_julian_date.php By the way Julian date should be part of the time or datetime module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 15:18:59 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 15 Mar 2012 14:18:59 +0000 Subject: [issue14308] '_DummyThread' object has no attribute '_Thread__block' In-Reply-To: <1331768900.76.0.717773710833.issue14308@psf.upfronthosting.co.za> Message-ID: <1331821139.85.0.987613848074.issue14308@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > However, on checking my logs again this morning, I have a few hundred > more of the same error, so that was not effective. Did you restart your server? In your patch, you could use the traceback module (e.g. http://docs.python.org/dev/library/traceback.html#traceback.print_stack ) to figure out in which situation the error occurs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 15:25:10 2012 From: report at bugs.python.org (sbt) Date: Thu, 15 Mar 2012 14:25:10 +0000 Subject: [issue14308] '_DummyThread' object has no attribute '_Thread__block' In-Reply-To: <1331768900.76.0.717773710833.issue14308@psf.upfronthosting.co.za> Message-ID: <1331821510.72.0.328083421451.issue14308@psf.upfronthosting.co.za> sbt added the comment: _DummyThread.__init__() explicitly deletes self._Thread__block: def __init__(self): Thread.__init__(self, name=_newname("Dummy-%d")) # Thread.__block consumes an OS-level locking primitive, which # can never be used by a _DummyThread. Since a _DummyThread # instance is immortal, that's bad, so release this resource. del self._Thread__block ^^^^^^^^^^^^^^^^^^^^^^^ ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 15:25:19 2012 From: report at bugs.python.org (Berker Peksag) Date: Thu, 15 Mar 2012 14:25:19 +0000 Subject: [issue14316] Broken link in grammar.html Message-ID: <1331821519.86.0.740460407781.issue14316@psf.upfronthosting.co.za> New submission from Berker Peksag : In the rationale section: http://docs.python.org/devguide/grammar.html#rationale This link is not working: http://docs.python.org/devguide/HowtoChangePython%27sGrammar ---------- components: Devguide messages: 155888 nosy: berker.peksag, ezio.melotti priority: normal severity: normal status: open title: Broken link in grammar.html _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 15:29:01 2012 From: report at bugs.python.org (sbt) Date: Thu, 15 Mar 2012 14:29:01 +0000 Subject: [issue14308] '_DummyThread' object has no attribute '_Thread__block' In-Reply-To: <1331768900.76.0.717773710833.issue14308@psf.upfronthosting.co.za> Message-ID: <1331821741.52.0.823370108661.issue14308@psf.upfronthosting.co.za> sbt added the comment: Ignore my last message... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 15:31:15 2012 From: report at bugs.python.org (Berker Peksag) Date: Thu, 15 Mar 2012 14:31:15 +0000 Subject: [issue14316] Broken link in grammar.rst In-Reply-To: <1331821519.86.0.740460407781.issue14316@psf.upfronthosting.co.za> Message-ID: <1331821875.71.0.59322872644.issue14316@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- title: Broken link in grammar.html -> Broken link in grammar.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 15:31:29 2012 From: report at bugs.python.org (Merlijn van Deen) Date: Thu, 15 Mar 2012 14:31:29 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331821889.35.0.664450354553.issue829370@psf.upfronthosting.co.za> Merlijn van Deen added the comment: I'm not quite sure why that formula would be "elegant" in the first place, and I most certainly don't understand why 0.5*sign((100*YY)+MM-190002.5) + 0.5 is more elegant than ((100*YY)+MM > 190002.5) or (((YY = 1900) and (MM > 2.5)) or (YY > 1900)) or rather: implementing leap years correctly in the first place, so the formula also works outside of the 1800-2099 range. And, in general, I don't understand the problem. Everyone who does scientific computing has numpy *anyway*, so there is no gain for them. As a last note, the C math.h also doesn't have a sign() function, and only a copysign() function: http://en.wikipedia.org/wiki/C_mathematical_functions ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 16:01:32 2012 From: report at bugs.python.org (Merlijn van Deen) Date: Thu, 15 Mar 2012 15:01:32 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331823692.61.0.813388614306.issue829370@psf.upfronthosting.co.za> Merlijn van Deen added the comment: Although there is one use case which I now realise due to your post: easier 1-on-1 implementation of existing algorithms. Another possible reason to implement it is that it's not that hard to implement the sign() function wrongly, if it also has to work with nans. This implementation: def signum(x): return (x > 0) - (x < 0) returns 0 for nan, which is wrong (it should return nan). Another naive implementation def signum(x): return math.copysign(1, x) also fails for nan, and gives a result for +/- 0 that could be right or wrong, depending on context. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 16:05:53 2012 From: report at bugs.python.org (=?utf-8?b?5YuH5YiaIOe9lw==?=) Date: Thu, 15 Mar 2012 15:05:53 +0000 Subject: [issue14255] tempfile.gettempdir() didn't return the path with correct case. In-Reply-To: <1331514762.82.0.635964063955.issue14255@psf.upfronthosting.co.za> Message-ID: <1331823953.44.0.134776651697.issue14255@psf.upfronthosting.co.za> ?? ? added the comment: It's possible to getting actual file name under Windows. http://stackoverflow.com/questions/74451/getting-actual-file-name-with-proper-casing-on-windows ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 16:15:26 2012 From: report at bugs.python.org (Pierre Lecointre) Date: Thu, 15 Mar 2012 15:15:26 +0000 Subject: [issue14317] index.simple module licking in distutils2 Message-ID: <1331824525.48.0.828054000089.issue14317@psf.upfronthosting.co.za> New submission from Pierre Lecointre : Got an error, in debian squeeze (python 2.6) and Ubuntu 11.10 (python 2.7) : plec at cezoffsrv04:~$ python Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from distutils2.index.simple import Crawler Traceback (most recent call last): File "", line 1, in ImportError: No module named index.simple >>> ---------- assignee: eric.araujo components: Distutils2 messages: 155893 nosy: Pierre.Lecointre, alexis, eric.araujo, tarek priority: normal severity: normal status: open title: index.simple module licking in distutils2 type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 16:15:55 2012 From: report at bugs.python.org (Pierre Lecointre) Date: Thu, 15 Mar 2012 15:15:55 +0000 Subject: [issue14317] index.simple module lacking in distutils2 In-Reply-To: <1331824525.48.0.828054000089.issue14317@psf.upfronthosting.co.za> Message-ID: <1331824555.96.0.992972229616.issue14317@psf.upfronthosting.co.za> Changes by Pierre Lecointre : ---------- title: index.simple module licking in distutils2 -> index.simple module lacking in distutils2 versions: +Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 16:31:06 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 15 Mar 2012 15:31:06 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb In-Reply-To: <1331241110.78.0.993419519739.issue14230@psf.upfronthosting.co.za> Message-ID: <1331825466.75.0.344979336603.issue14230@psf.upfronthosting.co.za> Benjamin Peterson added the comment: I would appreciate the patch could be regenerated against the latest default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 16:32:10 2012 From: report at bugs.python.org (Brett Cannon) Date: Thu, 15 Mar 2012 15:32:10 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1331825530.93.0.910974307161.issue2377@psf.upfronthosting.co.za> Brett Cannon added the comment: Yes, that's the important bit. Thomas has given it a once over at this point so you should be able to see his review comments as well to prevent duplicate work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 16:38:21 2012 From: report at bugs.python.org (Jim Jewett) Date: Thu, 15 Mar 2012 15:38:21 +0000 Subject: [issue14318] clarify http://docs.python.org/dev/library/time.html#time.steady Message-ID: <1331825901.59.0.838853491009.issue14318@psf.upfronthosting.co.za> Changes by Jim Jewett : ---------- assignee: docs at python components: Documentation nosy: Jim.Jewett, docs at python priority: normal severity: normal status: open title: clarify http://docs.python.org/dev/library/time.html#time.steady type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 16:45:11 2012 From: report at bugs.python.org (Frank Breitling) Date: Thu, 15 Mar 2012 15:45:11 +0000 Subject: [issue829370] math.signum(int) In-Reply-To: <1331821889.35.0.664450354553.issue829370@psf.upfronthosting.co.za> Message-ID: <4F620E85.3000501@gmx.de> Frank Breitling added the comment: Because its short. Because the former is a proper mathematical expression, while the latter is python jargon with limited use elsewhere. Exactly, why is there no correct implementation of Julian date in python time or datetime? For most practical purposes I can understand why most people would consider the above formula most useful and most elegant. Then what's the math module good for? So what? Is this the law of Moses? Or should we fall back to Assebmly? Python is supposed to be a high-level language not a stone age tool. However, I am glad you found at least another reason convincing to have this function. Cheers! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 16:56:28 2012 From: report at bugs.python.org (Frank Breitling) Date: Thu, 15 Mar 2012 15:56:28 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331826988.44.0.15905225144.issue829370@psf.upfronthosting.co.za> Frank Breitling added the comment: Unfortunately my reply to the list lost all quotes, so I try to answer again through the web interface: --- > I'm not quite sure why that formula would be "elegant" in the first place, Because its short. > and I most certainly don't understand why 0.5*sign((100*YY)+MM-190002.5) + 0.5 is more elegant ... Because the former is a proper mathematical expression, while the latter is python jargon with limited use elsewhere. > or rather: implementing leap years correctly in the first place, so the formula also works outside of the 1800-2099 range. Exactly, why is there no correct implementation of Julian date in python time or datetime? For most practical purposes I can understand why most people would consider the above formula most useful and most elegant. > And, in general, I don't understand the problem. Everyone who does scientific computing has numpy *anyway*, so there is no gain for them. Then what's the math module good for? > As a last note, the C math.h also doesn't have a sign() function, and only a copysign() function: http://en.wikipedia.org/wiki/C_mathematical_functions So what? Is this the law of Moses? Or should we fall back to Assebmly? Python is supposed to be a high-level language not a stone age tool. However, I am glad you found at least another reason convincing to have this function. Cheers! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:06:26 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Thu, 15 Mar 2012 16:06:26 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1331778321.79.0.331624089649.issue14200@psf.upfronthosting.co.za> Message-ID: <4F621381.9050700@v.loewis.de> Martin v. L?wis added the comment: > On Windows Vista, I do see that print() behaves differently than > evaluating the expression. An exception is raised for: > print('\N{GOTHIC LETTER AHSA}') As is for most other characters not supported in your OEM code page, e.g. (likely) '\N{GREEK SMALL LETTER ALPHA}' > On Linux, I see the character print as ? in xterm and as a '?' when > evaluated. In gnome-terminal (Ubuntu Mono font) it prints as a box > containing the code point in hex. No exception is raised. That's because your terminal output encoding is UTF-8. If you change your locale to C, or any other locale that doesn't cover full Unicode (e.g. de_DE.ISO-8859-1, if supported on your Linux installation), you get the same behavior on Linux as you do on Windows. > Given that Windows and Linux (Ubuntu) behave differently That's not a given, see above. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:08:43 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Thu, 15 Mar 2012 16:08:43 +0000 Subject: [issue14317] index.simple module lacking in distutils2 In-Reply-To: <1331824525.48.0.828054000089.issue14317@psf.upfronthosting.co.za> Message-ID: <1331827723.59.0.865750946209.issue14317@psf.upfronthosting.co.za> Alexis Metaireau added the comment: The APIs of distutils2 have changed. the "index" module is now named "pypi". So, doing something like:: >>> from distutils2.pypi.simple import Crawler should work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:09:34 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Thu, 15 Mar 2012 16:09:34 +0000 Subject: [issue14317] index.simple module lacking in distutils2 In-Reply-To: <1331824525.48.0.828054000089.issue14317@psf.upfronthosting.co.za> Message-ID: <1331827774.01.0.595927961146.issue14317@psf.upfronthosting.co.za> Changes by Alexis Metaireau : ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:18:13 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Thu, 15 Mar 2012 16:18:13 +0000 Subject: [issue11880] add a {dist-info} category to distutils2 In-Reply-To: <1303231865.42.0.936595329467.issue11880@psf.upfronthosting.co.za> Message-ID: <1331828293.03.0.459012989123.issue11880@psf.upfronthosting.co.za> Alexis Metaireau added the comment: Hey, is there any news on this bug? Berker? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:20:50 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Thu, 15 Mar 2012 16:20:50 +0000 Subject: [issue14294] Requirements are not properly copied into metatdata of dist-info In-Reply-To: <1331685843.64.0.290498671343.issue14294@psf.upfronthosting.co.za> Message-ID: <1331828450.62.0.514659592235.issue14294@psf.upfronthosting.co.za> Alexis Metaireau added the comment: Thanks for reporting this Preston, Could you be a bit more precise on this one? What is the input you are giving (in the dist-info) and what is not being done? (what's the expected output and what's what you have as a result of running util.egginfo_to_distinfo) ?ric, I'm not sure #11880 is a dependency of this one, could you expand on this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:22:22 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Thu, 15 Mar 2012 16:22:22 +0000 Subject: [issue5302] Allow package_data specs/globs to match directories In-Reply-To: <1331676451.15.0.447349043593.issue5302@psf.upfronthosting.co.za> Message-ID: <4F62173C.2050906@notmyidea.org> Alexis Metaireau added the comment: Agreed on this one. That would avoid to have a new syntax for this case, which seems to be very common. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:26:57 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Thu, 15 Mar 2012 16:26:57 +0000 Subject: [issue14319] cleanup index switching mechanism on packaging.pypi Message-ID: <1331828817.11.0.332015599072.issue14319@psf.upfronthosting.co.za> New submission from Alexis Metaireau : I need to do some general cleanup on packaging/d2, and especially on this bit. Currently, the implementation is way too complicated for what it does. ---------- assignee: alexis components: Distutils2 messages: 155903 nosy: alexis, tarek priority: normal severity: normal status: open title: cleanup index switching mechanism on packaging.pypi type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:28:42 2012 From: report at bugs.python.org (Matt Joiner) Date: Thu, 15 Mar 2012 16:28:42 +0000 Subject: [issue12684] profile does not dump stats on exception like cProfile does In-Reply-To: <1312335798.44.0.743453347572.issue12684@psf.upfronthosting.co.za> Message-ID: <1331828922.73.0.7300600917.issue12684@psf.upfronthosting.co.za> Matt Joiner added the comment: Jim the code was lifted verbatim from Lib/cProfile.py, line 47. That code in cProfile.py has not changed since 2006 when it was committed by Armin Rigo. I can modernize it if it's a requirement to get it committed, but I'm also okay with my conservative patch as is. ---------- nosy: +arigo, mwh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:29:13 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Thu, 15 Mar 2012 16:29:13 +0000 Subject: [issue14279] packaging.pypi should support flat directories of distributions In-Reply-To: <1331598588.13.0.0229993351988.issue14279@psf.upfronthosting.co.za> Message-ID: <1331828953.47.0.890383059113.issue14279@psf.upfronthosting.co.za> Alexis Metaireau added the comment: It is supposed to work already, but I'm not sure this is tested or complete. I'll have a closer look on this. +1 on the general idea. ---------- assignee: eric.araujo -> alexis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:33:14 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Thu, 15 Mar 2012 16:33:14 +0000 Subject: [issue14280] packaging.pypi should not require checksums In-Reply-To: <1331599235.17.0.307385355427.issue14280@psf.upfronthosting.co.za> Message-ID: <1331829194.07.0.482928929701.issue14280@psf.upfronthosting.co.za> Alexis Metaireau added the comment: If no MD5 checksum is present on the crawled simple index, then we don't have to check them. This means we introduce a potential security hole here (md5 checksums were added for a reason). What could be done is to explicitely don't check them if asked so. For instance using a --no-checksum flag when running pysetup, or passing a no_checksum argument when using the crawler. Would that work for you? ?ric, this is a different issue than the one you pointed out in the sence that one is for local files and the other is for remote indexes. (Of course, local files, will not need checksums as well). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:41:08 2012 From: report at bugs.python.org (Jim Jewett) Date: Thu, 15 Mar 2012 16:41:08 +0000 Subject: [issue14318] clarify "may not" in time.steady docs Message-ID: <1331829668.71.0.947018206764.issue14318@psf.upfronthosting.co.za> New submission from Jim Jewett : http://docs.python.org/dev/library/time.html#time.steady Current: """Return the current time as a floating point number expressed in seconds. This clock advances at a steady rate relative to real time and it may not be adjusted. The reference point of the returned value is undefined so only the difference of consecutive calls is valid. If available, a monotonic clock is used. By default, if strict is False, the function falls back to another clock if the monotonic clock failed or is not available. If strict is True, raise an OSError on error or NotImplementedError if no monotonic clock is available.""" Does "may not" mean that the user isn't allowed to adjust it, or that they system won't always have adjusted it? Assuming that this really means it won't jump around for daylight savings time or manual time resets, it could be reworded as: """Return elapsed seconds as a floating point number. The start time is undefined, so only differences between calls are meaningful. steady() is the best clock for profiling response time, as opposed to CPU usage. This function prefers to rely upon a high-precision counter that is not affected by resetting the system time. If no such monotonic clock is available, steady() will substitute another clock, but steady(strict=true) will raise either NotImplementedError or OSError. """ ---------- title: clarify http://docs.python.org/dev/library/time.html#time.steady -> clarify "may not" in time.steady docs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:42:26 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Thu, 15 Mar 2012 16:42:26 +0000 Subject: [issue14275] pysetup create doesn't handle install requirements In-Reply-To: <1331593918.19.0.128575459883.issue14275@psf.upfronthosting.co.za> Message-ID: <1331829746.25.0.743901463961.issue14275@psf.upfronthosting.co.za> Changes by Alexis Metaireau : ---------- dependencies: +Requirements are not properly copied into metatdata of dist-info _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:42:40 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 16:42:40 +0000 Subject: [issue3871] cross and native build of python for mingw32 with packaging In-Reply-To: <1221433699.47.0.0165458312451.issue3871@psf.upfronthosting.co.za> Message-ID: <1331829760.46.0.700413321716.issue3871@psf.upfronthosting.co.za> Changes by Matthias Klose : ---------- components: +Cross-Build -Build, Distutils2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:43:49 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Thu, 15 Mar 2012 16:43:49 +0000 Subject: [issue14275] pysetup create doesn't handle install requirements In-Reply-To: <1331593918.19.0.128575459883.issue14275@psf.upfronthosting.co.za> Message-ID: <1331829829.31.0.688754176182.issue14275@psf.upfronthosting.co.za> Changes by Alexis Metaireau : ---------- dependencies: -Requirements are not properly copied into metatdata of dist-info _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:45:59 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Thu, 15 Mar 2012 16:45:59 +0000 Subject: [issue14275] pysetup create doesn't handle install requirements In-Reply-To: <1331593918.19.0.128575459883.issue14275@psf.upfronthosting.co.za> Message-ID: <1331829959.32.0.78467547202.issue14275@psf.upfronthosting.co.za> Alexis Metaireau added the comment: Thanks for reporting this, Jan-Jaap, I've marked this issue as easy, it's mostly a matter of looking at the passed parameter and outputing the list in the generated file, respecting the PEP 345 format (http://www.python.org/dev/peps/pep-0345/#requires-dist-multiple-use) Do you want to work on this one? ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:55:46 2012 From: report at bugs.python.org (Matt Joiner) Date: Thu, 15 Mar 2012 16:55:46 +0000 Subject: [issue14320] set.add can return boolean indicate newly added item Message-ID: <1331830545.62.0.37534358264.issue14320@psf.upfronthosting.co.za> New submission from Matt Joiner : set.add can return True to indicate a newly added item to the set, or False if the item was already present. The C function PySet_Add returns -1 on error, and 0 on success currently. This is extended to return 1 if the item is newly added, and 0 if it was already present. Precedents exist for PySet_Contains and PySet_Discard with the same semantics. There are only 3 calls that need to be patched in the entire core, these are included in the patch. The Python function set.add currently returns None. This is extended to return True if if the item is new to the set, and False otherwise. No object overhead is introduced as set.add is already currently executing Py_RETURN_NONE. Benchmarks indicate that set.add if the item isn't already present (returning True in the patched instance) reduces time by 5-9%. set.add if the item already exists increases time by 1-3%. I'm happy to put these down to effects of touching True and False instead of None on return from set.add. Patch and primitive performance test attached. ---------- components: Interpreter Core files: set-add-return-bool.patch keywords: patch messages: 155909 nosy: anacrolix, eric.araujo, gvanrossum, petri.lehtinen priority: normal severity: normal status: open title: set.add can return boolean indicate newly added item type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24862/set-add-return-bool.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 17:56:24 2012 From: report at bugs.python.org (Matt Joiner) Date: Thu, 15 Mar 2012 16:56:24 +0000 Subject: [issue14320] set.add can return boolean indicate newly added item In-Reply-To: <1331830545.62.0.37534358264.issue14320@psf.upfronthosting.co.za> Message-ID: <1331830584.25.0.480067219404.issue14320@psf.upfronthosting.co.za> Changes by Matt Joiner : Added file: http://bugs.python.org/file24863/bench_set_add.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:04:24 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 15 Mar 2012 17:04:24 +0000 Subject: [issue14320] set.add can return boolean indicate newly added item In-Reply-To: <1331830545.62.0.37534358264.issue14320@psf.upfronthosting.co.za> Message-ID: <1331831064.95.0.866597942317.issue14320@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:07:24 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 17:07:24 +0000 Subject: [issue14321] Do not run pgen during the build if files are up to date Message-ID: <1331831244.15.0.8026915878.issue14321@psf.upfronthosting.co.za> New submission from Matthias Klose : For a cross build, make tries to run pgen built for the host machine, not the build machine. However it is not necessary to run pgen at all if all the files are up to date. This change implements it. The release script (if something like this exists) should make sure that the time stamps are correct, and then pgen isn't even built for a native build. reviewed by MvL ---------- assignee: doko components: Build files: pgen.diff keywords: patch messages: 155910 nosy: doko priority: normal severity: normal status: open title: Do not run pgen during the build if files are up to date versions: Python 3.3 Added file: http://bugs.python.org/file24864/pgen.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:08:49 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 17:08:49 +0000 Subject: [issue14321] Do not run pgen during the build if files are up to date In-Reply-To: <1331831244.15.0.8026915878.issue14321@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 52597f888e7a by Matthias Klose in branch 'default': - Issue #14321: Do not run pgen during the build if files are up to date. http://hg.python.org/cpython/rev/52597f888e7a ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:08:54 2012 From: report at bugs.python.org (Matt Joiner) Date: Thu, 15 Mar 2012 17:08:54 +0000 Subject: [issue13872] socket.detach doesn't mark socket._closed In-Reply-To: <1327582652.34.0.856044764189.issue13872@psf.upfronthosting.co.za> Message-ID: <1331831334.59.0.215068720749.issue13872@psf.upfronthosting.co.za> Matt Joiner added the comment: Yes it should. A cursory glance shows that __repr__ returns incorrect if _closed is not marked, and an unnecessary mop-up call to socket.close is avoided. ---------- nosy: +giampaolo.rodola, haypo, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:10:03 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 17:10:03 +0000 Subject: [issue14321] Do not run pgen during the build if files are up to date In-Reply-To: <1331831244.15.0.8026915878.issue14321@psf.upfronthosting.co.za> Message-ID: <1331831403.84.0.641772730455.issue14321@psf.upfronthosting.co.za> Changes by Matthias Klose : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:13:29 2012 From: report at bugs.python.org (Brian Landers) Date: Thu, 15 Mar 2012 17:13:29 +0000 Subject: [issue14322] More test coverage for hmac.py Message-ID: <1331831609.33.0.520236800519.issue14322@psf.upfronthosting.co.za> New submission from Brian Landers : Adding some tests to non-default code paths in hmac.py to get to 100% coverage. ---------- components: Tests files: test_hmac.patch keywords: patch messages: 155913 nosy: packetslave priority: normal severity: normal status: open title: More test coverage for hmac.py type: enhancement versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24865/test_hmac.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:16:53 2012 From: report at bugs.python.org (Matt Joiner) Date: Thu, 15 Mar 2012 17:16:53 +0000 Subject: [issue13694] asynchronous connect in asyncore.dispatcher does not set addr In-Reply-To: <1325470516.27.0.519900720027.issue13694@psf.upfronthosting.co.za> Message-ID: <1331831813.3.0.494404649766.issue13694@psf.upfronthosting.co.za> Matt Joiner added the comment: I should mention that this failure to set addr is unusual seeing as most socket instances are wrapping AF_INET* domain sockets, and aren't likely to connect without blocking. This is quite likely a reason nobody has observed it until now. It *is* desirable to save addr at this point, as mentioned in previous comments. Additionally addr is public API insofar as asyncore.sockets are concerned. ---------- nosy: +akuchling _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:19:37 2012 From: report at bugs.python.org (Brian Landers) Date: Thu, 15 Mar 2012 17:19:37 +0000 Subject: [issue14323] Normalize math precision in RGB/YIQ conversion Message-ID: <1331831977.5.0.174772346075.issue14323@psf.upfronthosting.co.za> New submission from Brian Landers : There doesn't seem to be a standard definition for the constants to use when doing the matrix calculations to convert RGB to YIQ or vise versa. Also, the current colorsys library uses two digits of precision for RGB-YIQ but six digits for YIQ-RGB. The attached patch standardizes both functions to use the same constants as Matlab, using the same 3 digits of precision. This makes a roundtrip of RGB->YIQ->RGB return the original values (for 3 digits of precision). Also added tests, which brings colorsys.py to 100% coverage. ---------- components: Library (Lib) files: colorlib.patch keywords: patch messages: 155915 nosy: packetslave priority: normal severity: normal status: open title: Normalize math precision in RGB/YIQ conversion type: enhancement versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24866/colorlib.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:19:47 2012 From: report at bugs.python.org (Brian Landers) Date: Thu, 15 Mar 2012 17:19:47 +0000 Subject: [issue14323] Normalize math precision in RGB/YIQ conversion In-Reply-To: <1331831977.5.0.174772346075.issue14323@psf.upfronthosting.co.za> Message-ID: <1331831987.34.0.464402444061.issue14323@psf.upfronthosting.co.za> Changes by Brian Landers : Added file: http://bugs.python.org/file24867/acks.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:20:34 2012 From: report at bugs.python.org (Preston Holmes) Date: Thu, 15 Mar 2012 17:20:34 +0000 Subject: [issue14294] Requirements are not properly copied into metatdata of dist-info In-Reply-To: <1331685843.64.0.290498671343.issue14294@psf.upfronthosting.co.za> Message-ID: <1331832034.84.0.375840502702.issue14294@psf.upfronthosting.co.za> Preston Holmes added the comment: fixed in http://hg.python.org/distutils2/rev/f453054a7d8b I worked on this fix with Tarek at the pycon sprints - still a bit unfamiliar with this tracker and how to best cross ref revs with ticket numbers This ticket can't be closed until the question of the dependency is resolved. ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:23:09 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 17:23:09 +0000 Subject: [issue14324] Do not rely on AC_RUN_IFELSE tests in the configury Message-ID: <1331832189.68.0.401858624599.issue14324@psf.upfronthosting.co.za> New submission from Matthias Klose : AC_RUN_IFELSE tests can't be used in cross builds, and have to fall back to some default in the case of a cross build. This is a meta issue to collect changes for the conversion of such tests. ---------- assignee: doko components: Cross-Build keywords: patch messages: 155918 nosy: doko priority: normal severity: normal status: open title: Do not rely on AC_RUN_IFELSE tests in the configury versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 18:53:22 2012 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 15 Mar 2012 17:53:22 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331834002.25.0.356049500332.issue14127@psf.upfronthosting.co.za> Guido van Rossum added the comment: Somehow patch #2 doesn't show up in Rietveld. :-( Anyway, I'll leave completion of the review to Antoine, who's more competent in this area. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:01:18 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 18:01:18 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 04ff6e206b98 by Gregory P. Smith in branch '2.7': Fixes Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes http://hg.python.org/cpython/rev/04ff6e206b98 New changeset ada6bfbeceb8 by Gregory P. Smith in branch '2.7': Fixes Issue 14234: fix for the previous commit, keep compilation when http://hg.python.org/cpython/rev/ada6bfbeceb8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:01:18 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 18:01:18 +0000 Subject: [issue14114] 2.7.3rc1 chm gives JS error In-Reply-To: <1330114530.4.0.50026951866.issue14114@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 11a11e5cac0f by Ezio Melotti in branch '2.7': #14114: don't include copybutton.js in the htmlhelp output. http://hg.python.org/cpython/rev/11a11e5cac0f New changeset 36ec90b6b5e5 by Ezio Melotti in branch '2.7': #14114: don't include copybutton.js in the htmlhelp output. http://hg.python.org/cpython/rev/36ec90b6b5e5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:05:00 2012 From: report at bugs.python.org (Roger Serwy) Date: Thu, 15 Mar 2012 18:05:00 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331834700.07.0.51475588029.issue14200@psf.upfronthosting.co.za> Roger Serwy added the comment: I stand corrected. Thank you for the information. The behavior of the console depends on its locale. IDLE has no facility for changing the locale of the PyShell window. Should this option be included somewhere? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:11:31 2012 From: report at bugs.python.org (Matt Joiner) Date: Thu, 15 Mar 2012 18:11:31 +0000 Subject: [issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb' In-Reply-To: <1330513271.31.0.437438851478.issue14156@psf.upfronthosting.co.za> Message-ID: <1331835091.06.0.428712791734.issue14156@psf.upfronthosting.co.za> Matt Joiner added the comment: Steven, patch attached. I lost steam in the unittests with all the meta, suffice it that the names match the file descriptors of the stream sources. i.e. FileType('rb') would give a file with name=0, and so forth. My chosen method also allows other mode flags as well as custom bufsizes. ---------- keywords: +patch Added file: http://bugs.python.org/file24868/argparse-filetype-stdio-modes.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:16:24 2012 From: report at bugs.python.org (Jim Fulton) Date: Thu, 15 Mar 2012 18:16:24 +0000 Subject: [issue14279] packaging.pypi should support flat directories of distributions In-Reply-To: <1331598588.13.0.0229993351988.issue14279@psf.upfronthosting.co.za> Message-ID: <1331835384.61.0.514762258091.issue14279@psf.upfronthosting.co.za> Jim Fulton added the comment: Note that "ala a directory of files" wasn't meant to imply local files. It could be a directory of files served via a HTTP (or sftp) server. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:17:54 2012 From: report at bugs.python.org (Jim Fulton) Date: Thu, 15 Mar 2012 18:17:54 +0000 Subject: [issue14280] packaging.pypi should not require checksums In-Reply-To: <1331599235.17.0.307385355427.issue14280@psf.upfronthosting.co.za> Message-ID: <1331835474.37.0.0825832510527.issue14280@psf.upfronthosting.co.za> Jim Fulton added the comment: I just clarified that 14279 doesn't imply local files. I'd be fine with a warning about lack of checksums for downloads. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:22:40 2012 From: report at bugs.python.org (Jean-Paul Calderone) Date: Thu, 15 Mar 2012 18:22:40 +0000 Subject: [issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist Message-ID: <1331835760.38.0.280902502881.issue14325@psf.upfronthosting.co.za> New submission from Jean-Paul Calderone : Allocating a Python list and a bunch of Capsules for each PyArg_ParseTuple call is expensive and unnecessarily complicated. The freelist never escapes getargs.c (if it ever did, it would be a bug). The same job can be accomplished with a normal C array. ---------- assignee: exarkun messages: 155926 nosy: exarkun priority: normal severity: normal status: open title: Stop using the garbage collector to manage the lifetime of the getargs.c freelist type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:23:24 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 15 Mar 2012 18:23:24 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331835804.2.0.960318009177.issue14200@psf.upfronthosting.co.za> Andrew Svetlov added the comment: I think that doesn't make sense. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:29:22 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 18:29:22 +0000 Subject: [issue14324] Do not rely on AC_RUN_IFELSE tests in the configury In-Reply-To: <1331832189.68.0.401858624599.issue14324@psf.upfronthosting.co.za> Message-ID: <1331836162.97.0.904189806218.issue14324@psf.upfronthosting.co.za> Matthias Klose added the comment: when using gcc, use a compilation test for the cross build check for long long format. ---------- Added file: http://bugs.python.org/file24869/long-long-format.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:32:23 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 15 Mar 2012 18:32:23 +0000 Subject: [issue14320] set.add can return boolean indicate newly added item In-Reply-To: <1331830545.62.0.37534358264.issue14320@psf.upfronthosting.co.za> Message-ID: <1331836343.17.0.937952463673.issue14320@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The part of the patch for PySet_Add() is a reasonable improvement to the C API if it doesn't conflict with Martin's stable ABI effort. The question of whether to change the Python API requires much more thought and I'll do some research and evaluate it more thoroughly over the next few weeks. Here are some of the considerations: * The set API currently has a near zero learning curve. We want to keep it that way. I'm teaching classes over the next few weeks and will try out the proposal on my students. * For collections that are commonplace in other languages, I look to their experience and design for inspiration. I'll look at was done in Smalltalk, Java, and ObjectiveC (with dynamic languages being a better model than statically compiled languages). In particular, I look to SETL when evaluating the utility of proposed changes to the set API (a little like looking to Matlab when thinking about designing a matrix API). * I'm concerned about the intuitiveness of the polarity of the proposed method and will try it out on other programmers to see whether "if s.add(e): ..." gets interpreted as "true if e is already added" or "true if the adding a new item". The sense of set.add() is the opposite of set.__contains__, so we should be careful about making a API change with an ambiguous or error-prone interpretation. * As written, the proposal seems to be about efficiency rather than clarity. I'll run my own timings to see if they make any difference in typical applications of set.add(). In addition, I'll consult the Jython folks to see if it makes a difference in their world (I suspect it won't -- they use native Java objects and the Java JIT handily optimizes away the traditional calling pattern). Also, I'll consult the PyPy folks to see whether they can provide the optimization automatically rather than via an API change. * The suggested API also needs to be viewed in the context of what other Python APIs do. For the most part, the language has an aversion to combining tests and assignments. For example, Python doesn't do "while (buf = f.read(bufsize)): ..." eventhough that is traditionally supported in statically compiled languages. There is a precedent with dict.setdefault(); however, that is often regarded as one of the least beautiful parts of the API in Python's basic collection objects. * I also want to look back a previous discussions on this topic. The set API had a slow and careful evolution starting with a PEP, being exposed as a pure python module, and being coded in C as a builtin type. The API was built by Alex Martelli, Guido, Tim Peters, Greg Wilson and myself with substantial input from the community. None of the designers sought to include this functionality and it wasn't because it hadn't occurred to the them or that they were unaware of typical use cases. In addition, having set.add() return a boolean was discussed and rejected on python-dev (I've forgotten whether it was last year or the year before). Some care should be taken before dismissing the judgment of the designers who've previously spent time thinking this out. * Lastly, we need to look at code examples to see whether they read better or whether clarity is being lost in the name of efficiency. We should look at both sophisticated examples (i.e. sets are part of multistep logic) and minimal examples (i.e. where the set logic is dominant). Here is a before-and-after for the minimal case: def dedup_before(iterable): '''Order preserving elimination of duplicates''' seen = set() for i in iterable: if i not in seen: seen.add(i) yield i def dedup_after(iterable): '''Order preserving elimination of duplicates''' seen = Set() for i in iterable: if seen.add(i): yield i As you can see, there is more to API design than just spotting an opportunity to fold two steps into one. ---------- priority: normal -> low type: enhancement -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:37:56 2012 From: report at bugs.python.org (Roger Serwy) Date: Thu, 15 Mar 2012 18:37:56 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331836676.6.0.659710404064.issue14200@psf.upfronthosting.co.za> Roger Serwy added the comment: The Tkinter Text widget is the output for the IDLE shell and it has the limitation imposed by Tcl/Tk of not handling non-BMP unicode characters. Is the following reasonable: The IDLE shell console has a locale of "non-BMP utf8"? If so, would it be reasonable to add a menu item to switch locales for the shell? This amounts to adding some extra code to OutputWindow's write() to raise encoding errors if the string contains unsupported characters, and possibly replacing characters to work around Tcl/Tk's non-BMP limitation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:38:17 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Thu, 15 Mar 2012 18:38:17 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1331834700.07.0.51475588029.issue14200@psf.upfronthosting.co.za> Message-ID: <4F623718.8000501@v.loewis.de> Martin v. L?wis added the comment: > The behavior of the console depends on its locale. IDLE has no > facility for changing the locale of the PyShell window. Should this > option be included somewhere? It may be remotely desirable to be able to set the terminal encoding in IDLE for debuggging purposes. But it's unrelated to the issue at hand. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:42:41 2012 From: report at bugs.python.org (Mark Shannon) Date: Thu, 15 Mar 2012 18:42:41 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb In-Reply-To: <1331241110.78.0.993419519739.issue14230@psf.upfronthosting.co.za> Message-ID: <1331836961.76.0.910056267301.issue14230@psf.upfronthosting.co.za> Mark Shannon added the comment: Updated Patch ---------- Added file: http://bugs.python.org/file24870/yieldfrom.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:43:28 2012 From: report at bugs.python.org (Mark Shannon) Date: Thu, 15 Mar 2012 18:43:28 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb In-Reply-To: <1331241110.78.0.993419519739.issue14230@psf.upfronthosting.co.za> Message-ID: <1331837008.02.0.304196255958.issue14230@psf.upfronthosting.co.za> Changes by Mark Shannon : Removed file: http://bugs.python.org/file24759/yieldfrom.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:50:29 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Thu, 15 Mar 2012 18:50:29 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1331836676.6.0.659710404064.issue14200@psf.upfronthosting.co.za> Message-ID: <4F6239F3.4020403@v.loewis.de> Martin v. L?wis added the comment: > Is the following reasonable: The IDLE shell console has a locale of > "non-BMP utf8"? [BMP utf8] That's indeed the approach that Andrew and I were discussing. Unfortunately, there is no codec for it yet. We were discussing to add a "utf8bom" encoding to Python. This is a medium-sized project, though (and again out of scope for this issue). > If so, would it be reasonable to add a menu item to switch locales > for the shell? This amounts to adding some extra code to > OutputWindow's write() to raise encoding errors if the string > contains unsupported characters, and possibly replacing characters to > work around Tcl/Tk's non-BMP limitation. Please open a separate issue for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:50:46 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 18:50:46 +0000 Subject: [issue14324] Do not rely on AC_RUN_IFELSE tests in the configury In-Reply-To: <1331832189.68.0.401858624599.issue14324@psf.upfronthosting.co.za> Message-ID: <1331837446.46.0.0791336229404.issue14324@psf.upfronthosting.co.za> Matthias Klose added the comment: when configured --with(out)-computed-gotos for a cross, use this value instead of defaulting to no. ---------- Added file: http://bugs.python.org/file24871/computed-gotos.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:52:01 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 18:52:01 +0000 Subject: [issue14324] Do not rely on AC_RUN_IFELSE tests in the configury In-Reply-To: <1331832189.68.0.401858624599.issue14324@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset fbbf9c187662 by Matthias Klose in branch 'default': - Issue #14324: Fix configure tests for cross builds. http://hg.python.org/cpython/rev/fbbf9c187662 New changeset 29ee48f843ec by Matthias Klose in branch 'default': - Issue #14324: Fix configure tests for cross builds. http://hg.python.org/cpython/rev/29ee48f843ec ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 19:54:46 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 15 Mar 2012 18:54:46 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb In-Reply-To: <1331241110.78.0.993419519739.issue14230@psf.upfronthosting.co.za> Message-ID: <1331837686.48.0.233662029619.issue14230@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Mercurial complains when trying to apply the patch: applying yieldfrom.patch patching file Lib/test/test_pep380.py Hunk #2 succeeded at 921 with fuzz 2 (offset 72 lines). abort: bad hunk #1 @@ -20,7 +20,6 @@ (7 7 7 6) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:07:01 2012 From: report at bugs.python.org (Mark Shannon) Date: Thu, 15 Mar 2012 19:07:01 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb In-Reply-To: <1331241110.78.0.993419519739.issue14230@psf.upfronthosting.co.za> Message-ID: <1331838421.96.0.460605632412.issue14230@psf.upfronthosting.co.za> Mark Shannon added the comment: Could you try this new patch (with white space changes included)? ---------- Added file: http://bugs.python.org/file24872/yieldfrom.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:10:03 2012 From: report at bugs.python.org (Jean-Paul Calderone) Date: Thu, 15 Mar 2012 19:10:03 +0000 Subject: [issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist In-Reply-To: <1331835760.38.0.280902502881.issue14325@psf.upfronthosting.co.za> Message-ID: <1331838603.92.0.859166438781.issue14325@psf.upfronthosting.co.za> Changes by Jean-Paul Calderone : ---------- keywords: +patch Added file: http://bugs.python.org/file24873/getargs.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:12:22 2012 From: report at bugs.python.org (Larry Hastings) Date: Thu, 15 Mar 2012 19:12:22 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331838742.83.0.892221769812.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: Attached is a second patch that adds keyword-only argument support to PyArg_ParseTupleAndKeywords. This was developed in isolation. The magic character is '$'; I would have used '*', but we already use '*' in the format string as a modifier to 'U' and 's' etc. If someone has a better idea for the format I'd be interested. Martin suggested using '|' a second time but I am unsure. (Re: no reitveld link: my repo must have drifted too far and the patch didn't align cleanly. I've freshened and am rerunning the regression test; once that runs clean I'll upload a fresh patch.) ---------- Added file: http://bugs.python.org/file24874/larry.parsekwonly.diff.1.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:15:21 2012 From: report at bugs.python.org (Roger Serwy) Date: Thu, 15 Mar 2012 19:15:21 +0000 Subject: [issue14326] IDLE - allow shell to support different locales Message-ID: <1331838921.21.0.772661396628.issue14326@psf.upfronthosting.co.za> New submission from Roger Serwy : Per Martin's request, this issue has been separated from Issue14200. The IDLE shell presently has an effective locale of "BMP UTF8" due to a limitation in Tkinter, described in Issue12342. IDLE should support different output codecs, like "ascii" and "utf8". In order to work around Tkinter's limitations, unsupported characters would be replaced (this is related to #14304). This amounts to adding some extra code to OutputWindow's write() to raise encoding errors if the string contains unsupported characters. ---------- components: IDLE messages: 155939 nosy: serwy priority: normal severity: normal status: open title: IDLE - allow shell to support different locales type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:15:38 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 15 Mar 2012 19:15:38 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1331838742.83.0.892221769812.issue14127@psf.upfronthosting.co.za> Message-ID: <1331838672.3410.0.camel@localhost.localdomain> Antoine Pitrou added the comment: > Attached is a second patch that adds keyword-only argument support to > PyArg_ParseTupleAndKeywords. This was developed in isolation. Please post that on a dedicated issue :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:19:30 2012 From: report at bugs.python.org (Larry Hastings) Date: Thu, 15 Mar 2012 19:19:30 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331839170.43.0.798387225655.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: Do you insist? It's a small patch, and I need it as a precondition to posting the... *third* patch in this series, which adds the ns= parameter to utime and its brothers. (Most of the patch is test and doc; it really only adds about twenty lines of C.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:20:28 2012 From: report at bugs.python.org (Larry Hastings) Date: Thu, 15 Mar 2012 19:20:28 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331839228.01.0.753400531681.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: A fresh patch for adding st_mtime_ns etc to os.stat output. This is the same as last night's patch but with fresh line numbers. (Generated against 44eba26951f6.) ---------- Added file: http://bugs.python.org/file24875/larry.st_mtime_ns.patch.3.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:23:24 2012 From: report at bugs.python.org (Roger Serwy) Date: Thu, 15 Mar 2012 19:23:24 +0000 Subject: [issue14200] Idle shell crash on printing non-BMP unicode character In-Reply-To: <1330951176.7.0.566345829726.issue14200@psf.upfronthosting.co.za> Message-ID: <1331839404.64.0.454432043301.issue14200@psf.upfronthosting.co.za> Roger Serwy added the comment: Martin, you are right. I created a separate issue #14326. Let me know what I can do to help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:26:41 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 15 Mar 2012 19:26:41 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1331839170.43.0.798387225655.issue14127@psf.upfronthosting.co.za> Message-ID: <1331839335.3410.1.camel@localhost.localdomain> Antoine Pitrou added the comment: > Do you insist? It's a small patch, and I need it as a precondition to > posting the... Yes, I do. It might a small patch, but it changes a core API and should be discussed on its own. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:36:37 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 19:36:37 +0000 Subject: [issue14324] Do not rely on AC_RUN_IFELSE tests in the configury In-Reply-To: <1331832189.68.0.401858624599.issue14324@psf.upfronthosting.co.za> Message-ID: <1331840197.27.0.637666687317.issue14324@psf.upfronthosting.co.za> Matthias Klose added the comment: when configured with --(en|dis)able-ipv6 for cross builds, don't fail the configury due to the missing buggy-getaddrinfo check. ---------- Added file: http://bugs.python.org/file24876/buggy-getaddrinfo.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:38:21 2012 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 15 Mar 2012 19:38:21 +0000 Subject: [issue14326] IDLE - allow shell to support different locales In-Reply-To: <1331838921.21.0.772661396628.issue14326@psf.upfronthosting.co.za> Message-ID: <1331840301.24.0.311644857105.issue14326@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:40:07 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 15 Mar 2012 19:40:07 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331840407.89.0.0567550034307.issue14127@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Posted a last review on Rietveld. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:42:35 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 19:42:35 +0000 Subject: [issue14324] Do not rely on AC_RUN_IFELSE tests in the configury In-Reply-To: <1331832189.68.0.401858624599.issue14324@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 58cd710d9dff by Matthias Klose in branch 'default': - Issue #14324: Fix configure tests for cross builds. http://hg.python.org/cpython/rev/58cd710d9dff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 20:48:33 2012 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 15 Mar 2012 19:48:33 +0000 Subject: [issue829370] math.signum(int) Message-ID: <1331840913.24.0.405517694503.issue829370@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- nosy: -mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 21:02:15 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 15 Mar 2012 20:02:15 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331841735.05.0.771160674253.issue14127@psf.upfronthosting.co.za> Changes by Gregory P. Smith : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 21:05:28 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 15 Mar 2012 20:05:28 +0000 Subject: [issue14320] set.add can return boolean indicate newly added item In-Reply-To: <1331830545.62.0.37534358264.issue14320@psf.upfronthosting.co.za> Message-ID: <1331841928.94.0.642956058392.issue14320@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Here's the results of the research so far: Guido gave it a -1: http://mail.python.org/pipermail/python-ideas/2012-March/014510.html Smalltalk does not return a boolean: http://www.gnu.org/software/smalltalk/manual-base/gst-base.html#Set http://www.gnu.org/software/smalltalk/manual-base/gst-base.html#HashedCollection add: newObject Add newObject to the set, if and only if the set doesn't already contain an occurrence of it. Don't fail if a duplicate is found. Answer anObject Java does return a boolean for Interface Set>: http://docs.oracle.com/javase/6/docs/api/ boolean add(E e) Adds the specified element to this set if it is not already present (optional operation) The SETL programming language does not return a boolean for the "set plus one element operation". Instead, it returns the new set. http://setl.org/setl/doc/setl-lib.html#with Real-world examples of code using set.add in a way that benefits from the boolean result do not look promising. They match the pattern in the minimal example shown in the previous post, "if e in previously_seen.add(e): ..." This is problematic because it can easily be read as "take this branch if e has been previously seen". I consulted with the PyPy developers and found that PyPy is already eliminating double lookups in common cases (it recognizes that the two lookups refer to the same entry and constant folds them). It cannot do this in the general case because of a potential semantic change (i.e. __eq__ can change the set during the initial lookup). Looking at Jython, it appears that both sets and dicts are based on Java's concurrent mapping object which doesn't support a boolean result directly but allows the JIT to optimize away the double lookup depending on the JIT and on whether the keys are of all the same type. One other note, in general the Python language makes no guarantees about atomicity (different implementations are free to make different implementation choices). For example, people relying on dict.setdefault() to be atomic were making an incorrect assumption (until recently). Our standing recommendation is to use locks unless your willing to rely on an implementation detail. In the case of set.add(), the race condition is harmless since set.add() is idempotent. I've shown sample code to some other developers and they had mixed guesses about the polarity of s.add(e), whether it would return True or False if the e was already in the set. A mixed result is not good and implies that the proposal is error prone. Also, when shown the dedup() code example, the devs didn't feel that the additional conciseness was worth it (one said, "it just looks funny and causes me to do a double-take, but the original code could be read effortlessly"). My timings on the dedup() code showed a <2% speedup on an iterable of strings with 80% duplicates and no improvement on an iterable of strings with 5% duplicates. The improvement was mostly erased if a "seen_add = seen.add" bound method was used inside the loop. This indicates that the double lookup is cheap compared to the cost of the dotted lookup in "seen.add(e)". That being said, objects with a custom __hash__ would benefit from calling __hash__ only once. Given that the results above were uniformly negative (except for the Java library), I'll skip trying this out on my students and am rejecting the suggested change to the pure Python API. We appreciate your suggestion but it isn't appropriate for inclusion in the language. Some of those concerns may also apply to the suggested change to the C API ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 21:06:43 2012 From: report at bugs.python.org (Jeff McNeil) Date: Thu, 15 Mar 2012 20:06:43 +0000 Subject: [issue14255] tempfile.gettempdir() didn't return the path with correct case. In-Reply-To: <1331514762.82.0.635964063955.issue14255@psf.upfronthosting.co.za> Message-ID: <1331842003.33.0.668259473635.issue14255@psf.upfronthosting.co.za> Jeff McNeil added the comment: It doesn't seem to me that the right approach on either platform is to simply downcase. Maybe just deprecate the call altogether as its not doing anything normpath isn't if the .lower call is removed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 21:14:33 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 20:14:33 +0000 Subject: [issue14327] replace use of uname in the configury with macros set by AC_CANONICAL_HOST Message-ID: <1331842473.11.0.734789766158.issue14327@psf.upfronthosting.co.za> New submission from Matthias Klose : the configury uses uname, which fails for cross builds. this issue tracks patches tor replace the uname calls with the use of macros set by AC_CANONICAL_HOST (host*, build*) ---------- assignee: doko components: Cross-Build keywords: needs review messages: 155950 nosy: doko priority: normal severity: normal status: open title: replace use of uname in the configury with macros set by AC_CANONICAL_HOST _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 21:15:13 2012 From: report at bugs.python.org (Jim Jewett) Date: Thu, 15 Mar 2012 20:15:13 +0000 Subject: [issue9290] IDLE and Command line present different behavior for sys.stdin In-Reply-To: <1279417895.54.0.811089047738.issue9290@psf.upfronthosting.co.za> Message-ID: <1331842513.5.0.236882688594.issue9290@psf.upfronthosting.co.za> Jim Jewett added the comment: msvcrt.getwch has a similar failure, returning (2**16)-1. Because of this, getpass.win_getpass (used as getpass.getpass on windows) echoes the password when using Idle (even without a subprocess), but does not echo passwords when from a command-line python. ---------- nosy: +Jim.Jewett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 21:18:37 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 20:18:37 +0000 Subject: [issue14327] replace use of uname in the configury with macros set by AC_CANONICAL_HOST In-Reply-To: <1331842473.11.0.734789766158.issue14327@psf.upfronthosting.co.za> Message-ID: <1331842717.3.0.411497614845.issue14327@psf.upfronthosting.co.za> Matthias Klose added the comment: call AC_CANONICAL_HOST and check in config.{guess,sub}, taken from git://git.savannah.gnu.org/config.git --- a/configure.ac Thu Mar 15 20:42:23 2012 +0100 +++ b/configure.ac Thu Mar 15 21:17:32 2012 +0100 @@ -33,6 +33,8 @@ AC_CONFIG_SRCDIR([Include/object.h]) AC_CONFIG_HEADER(pyconfig.h) +AC_CANONICAL_HOST + dnl Ensure that if prefix is specified, it does not end in a slash. If dnl it does, we get path names containing '//' which is both ugly and dnl can cause trouble. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 21:19:01 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 15 Mar 2012 20:19:01 +0000 Subject: [issue14311] ConfigParser does not parse utf-8 files with BOM bytes In-Reply-To: <1331778292.28.0.574531846286.issue14311@psf.upfronthosting.co.za> Message-ID: <1331842741.66.0.485990955562.issue14311@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +lukasz.langa stage: -> needs patch versions: +Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 21:28:48 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 20:28:48 +0000 Subject: [issue11199] urllib hangs when closing connection In-Reply-To: <1297515605.42.0.925312292331.issue11199@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 6ce4868861ba by Senthil Kumaran in branch '2.7': Fix the urllib closing issue which hangs on particular ftp urls/ftp servers. closes issue11199 http://hg.python.org/cpython/rev/6ce4868861ba New changeset 891184abbf6e by Senthil Kumaran in branch '3.2': closes Issue #11199: Fix the with urllib which hangs on particular ftp urls. http://hg.python.org/cpython/rev/891184abbf6e New changeset 9e7374779e19 by Senthil Kumaran in branch 'default': port from 3.2 - Fix the urllib closing issue which hangs on particular ftp urls/ftp servers. closes issue11199 http://hg.python.org/cpython/rev/9e7374779e19 ---------- nosy: +python-dev resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 21:30:38 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 20:30:38 +0000 Subject: [issue14327] replace use of uname in the configury with macros set by AC_CANONICAL_HOST In-Reply-To: <1331842473.11.0.734789766158.issue14327@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 04aa26c572ba by Matthias Klose in branch 'default': - Issue #14327: Call AC_CANONICAL_HOST in configure.ac and check in http://hg.python.org/cpython/rev/04aa26c572ba ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 21:38:29 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 20:38:29 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb In-Reply-To: <1331241110.78.0.993419519739.issue14230@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 72556ff86828 by Benjamin Peterson in branch 'default': perform yield from delegation by repeating YIELD_FROM opcode (closes #14230) http://hg.python.org/cpython/rev/72556ff86828 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 21:50:28 2012 From: report at bugs.python.org (Jim Jewett) Date: Thu, 15 Mar 2012 20:50:28 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331844628.28.0.456246716545.issue14234@psf.upfronthosting.co.za> Jim Jewett added the comment: Looking at http://sourceforge.net/projects/expat/files/expat/2.1.0/, so long as XML_ATTR_INFO isn't defined at compile time, the changes are all considered bugfixes, and the XML_SetHashSalt is the only other changed API. Is a potential Denial of Service really worse than a crash, such as these fixed bugs: http://sourceforge.net/tracker/?func=detail&aid=2894085&group_id=10127&atid=110127 http://sourceforge.net/tracker/?func=detail&aid=1990430&group_id=10127&atid=110127 ---------- nosy: +Jim.Jewett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 22:17:01 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 21:17:01 +0000 Subject: [issue14327] replace use of uname in the configury with macros set by AC_CANONICAL_HOST In-Reply-To: <1331842473.11.0.734789766158.issue14327@psf.upfronthosting.co.za> Message-ID: <1331846221.43.0.29727035801.issue14327@psf.upfronthosting.co.za> Matthias Klose added the comment: the following patch still keeps the uname calls for native builds, but sets the ac_sys_* macros depending on $host for cross builds. For now the cross configure fails for everything except linux and cygwin targets. ---------- keywords: +patch Added file: http://bugs.python.org/file24877/no-uname-for-cross.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 22:19:38 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 15 Mar 2012 21:19:38 +0000 Subject: [issue14327] replace use of uname in the configury with macros set by AC_CANONICAL_HOST In-Reply-To: <1331842473.11.0.734789766158.issue14327@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset d0cce5a2c0cf by Matthias Klose in branch 'default': - Issue #14327: Call AC_CANONICAL_HOST in configure.ac and check in http://hg.python.org/cpython/rev/d0cce5a2c0cf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 22:36:33 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Thu, 15 Mar 2012 21:36:33 +0000 Subject: [issue14280] packaging.pypi should not require checksums In-Reply-To: <1331835474.37.0.0825832510527.issue14280@psf.upfronthosting.co.za> Message-ID: <4F6260DF.5090503@notmyidea.org> Alexis Metaireau added the comment: Right, I'll go for this then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 22:37:58 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Thu, 15 Mar 2012 21:37:58 +0000 Subject: [issue14279] packaging.pypi should support flat directories of distributions In-Reply-To: <1331835384.61.0.514762258091.issue14279@psf.upfronthosting.co.za> Message-ID: <4F626134.2090307@notmyidea.org> Alexis Metaireau added the comment: Oh, thanks for clarifying this. I'll have a look at what the blockers are on this. I'm wondering if "local files" can be considered a simple index or not. If not, we can add another PyPI reader, which works with local files. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 22:49:19 2012 From: report at bugs.python.org (Larry Hastings) Date: Thu, 15 Mar 2012 21:49:19 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords Message-ID: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> New submission from Larry Hastings : This has been split off from #14127 at Antoine's request. The attached patch adds support for keyword-only arguments to the PyArg_ParseTupleAndKeywords() family of functions. Includes doc and test. I used '$' to indicate "all parameters after this are keyword-only"; since they must also be optional it must follow a '|'. (I would have used '*' but we already use that for 'U*' 's* etc.) The patch already received one review from Greg P. Smith on the previous issue; the patch I'm attaching here is the second revision incorporating his suggestions. ---------- assignee: larry components: Interpreter Core files: larry.parsekwonly.diff.2.txt keywords: patch messages: 155961 nosy: gregory.p.smith, larry, pitrou priority: normal severity: normal stage: patch review status: open title: Add keyword-only parameter support to PyArg_ParseTupleAndKeywords type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24878/larry.parsekwonly.diff.2.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 22:50:48 2012 From: report at bugs.python.org (Larry Hastings) Date: Thu, 15 Mar 2012 21:50:48 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331848248.41.0.266846481428.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: I've created a separate issue for adding keyword-only parameter support to PyArg_ParseTupleAndKeywords, #14328. I've also posted a new patch to that issue incorporating Greg's suggestions. Please file all further comments regarding this topic on that issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 22:53:09 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 15 Mar 2012 21:53:09 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1331848389.38.0.404022833368.issue2377@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Okay; I added review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 22:54:58 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 15 Mar 2012 21:54:58 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1331848498.48.0.717293903532.issue14328@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Why do you force them to be optional? ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 22:59:03 2012 From: report at bugs.python.org (Larry Hastings) Date: Thu, 15 Mar 2012 21:59:03 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1331848743.02.0.126593840744.issue14328@psf.upfronthosting.co.za> Larry Hastings added the comment: It frankly never occurred to me that you'd want mandatory keyword-only arguments. Implementing them as optional-only was easy; I'm not sure but making them possibly mandatory (or both!) might complicate matters. Is there a use case for 'em? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:01:37 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 15 Mar 2012 22:01:37 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848743.02.0.126593840744.issue14328@psf.upfronthosting.co.za> Message-ID: Benjamin Peterson added the comment: 2012/3/15 Larry Hastings : > > Larry Hastings added the comment: > > It frankly never occurred to me that you'd want mandatory keyword-only arguments. ?Implementing them as optional-only was easy; I'm not sure but making them possibly mandatory (or both!) might complicate matters. > > Is there a use case for 'em? No idea, but at some point we might want them and it parallels the Python interface. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:02:49 2012 From: report at bugs.python.org (Nikki DelRosso) Date: Thu, 15 Mar 2012 22:02:49 +0000 Subject: [issue1519638] Unmatched Group issue - workaround Message-ID: <1331848969.61.0.13393632844.issue1519638@psf.upfronthosting.co.za> Nikki DelRosso added the comment: I'm having the same issue as the original author of this issue was. The workaround does not apply to the situation where the captured text is on one side of an "or" grouping, rather than just being optional. I'm trying to remove groups of text in parentheses that come at the end of a string, but if the content in a pair of parentheses is a number, I want to retain it. My regular expression looks like so: These work: >>> re.sub(r'(?:\((?:(\d+)|.*?)\)\s*)+$','\\1','avatar (2009)') 'avatar 2009' >>> re.sub(r'(?:\((?:(\d+)|.*?)\)\s*)+$','\\1','avatar (2009) (special edition)') 'avatar 2009' This doesn't: >>> re.sub(r'(?:\((?:(\d+)|.*?)\)\s*)+$','\\1','avatar (special Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.6/re.py", line 151, in sub return _compile(pattern, 0).sub(repl, string, count) File "/usr/lib/python2.6/re.py", line 278, in filter return sre_parse.expand_template(template, match) File "/usr/lib/python2.6/sre_parse.py", line 793, in expand_template raise error, "unmatched group" sre_constants.error: unmatched groupedition)') Is there some way I can apply this workaround to this situation? ---------- nosy: +Nikker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:02:58 2012 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Thu, 15 Mar 2012 22:02:58 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1331848978.48.0.149900634726.issue14328@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:04:00 2012 From: report at bugs.python.org (Larry Hastings) Date: Thu, 15 Mar 2012 22:04:00 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1331849040.43.0.508719575728.issue14328@psf.upfronthosting.co.za> Larry Hastings added the comment: How about we leave it for now, and if we need it later we can fix the implementation. Adding that feature won't break existing calls--we'll just permit $ to occur before/without | in the format string. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:04:13 2012 From: report at bugs.python.org (Nikki DelRosso) Date: Thu, 15 Mar 2012 22:04:13 +0000 Subject: [issue1519638] Unmatched Group issue - workaround Message-ID: <1331849053.48.0.602415809094.issue1519638@psf.upfronthosting.co.za> Nikki DelRosso added the comment: Sorry, the non-working command should look as follows: re.sub(r'(?:\((?:(\d+)|.*?)\)\s*)+$','\\1','avatar (special edition)') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:10:06 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 22:10:06 +0000 Subject: [issue1006238] cross compile patch Message-ID: <1331849406.82.0.765732813384.issue1006238@psf.upfronthosting.co.za> Matthias Klose added the comment: closing this issue. please continue in issue 3754. ---------- components: +Cross-Build -Build nosy: +doko resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:13:44 2012 From: report at bugs.python.org (Matthias Klose) Date: Thu, 15 Mar 2012 22:13:44 +0000 Subject: [issue3754] cross-compilation support for python build In-Reply-To: <1220305759.82.0.468834426074.issue3754@psf.upfronthosting.co.za> Message-ID: <1331849624.63.0.474189677533.issue3754@psf.upfronthosting.co.za> Matthias Klose added the comment: some of these changes are now available in trunk, tested with a x86_64-linux-gnu to arm-linux-gnueabihf cross build. using issue 14324 for configure tests which need fixes, and issue 14327 for the use of uname in the configure script. please feel free to open separate issues for the changes in the distutils package and the packaging package. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:16:42 2012 From: report at bugs.python.org (Florian Mladitsch) Date: Thu, 15 Mar 2012 22:16:42 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: <1331849802.47.0.422722248706.issue14202@psf.upfronthosting.co.za> Changes by Florian Mladitsch : Added file: http://bugs.python.org/file24879/xml.dom.pulldom.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:18:40 2012 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Thu, 15 Mar 2012 22:18:40 +0000 Subject: [issue14324] Do not rely on AC_RUN_IFELSE tests in the configury In-Reply-To: <1331832189.68.0.401858624599.issue14324@psf.upfronthosting.co.za> Message-ID: <1331849920.9.0.355875142066.issue14324@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:20:23 2012 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Thu, 15 Mar 2012 22:20:23 +0000 Subject: [issue14327] replace use of uname in the configury with macros set by AC_CANONICAL_HOST In-Reply-To: <1331842473.11.0.734789766158.issue14327@psf.upfronthosting.co.za> Message-ID: <1331850023.99.0.268875493897.issue14327@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:33:03 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 15 Mar 2012 22:33:03 +0000 Subject: [issue3754] cross-compilation support for python build In-Reply-To: <1220305759.82.0.468834426074.issue3754@psf.upfronthosting.co.za> Message-ID: <1331850783.21.0.978445980768.issue3754@psf.upfronthosting.co.za> ?ric Araujo added the comment: Not for distutils (feature-frozen, see previous messages) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:41:58 2012 From: report at bugs.python.org (Mike Frysinger) Date: Thu, 15 Mar 2012 22:41:58 +0000 Subject: [issue3754] cross-compilation support for python build In-Reply-To: <1220305759.82.0.468834426074.issue3754@psf.upfronthosting.co.za> Message-ID: <1331851318.97.0.183899141408.issue3754@psf.upfronthosting.co.za> Changes by Mike Frysinger : ---------- nosy: +vapier _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:49:14 2012 From: report at bugs.python.org (Serge Droz) Date: Thu, 15 Mar 2012 22:49:14 +0000 Subject: [issue14329] proxy_bypass_macosx_sysconf does not handle singel ip addresses correctly Message-ID: <1331851754.34.0.615850283155.issue14329@psf.upfronthosting.co.za> New submission from Serge Droz : On MacOS in urllib the function proxy_bypass_macosx_sysconf does not handle proxy settings which are just IP addresses correctly: If there is any IP address, always true is reported. Reason: the mask is calculated wrong. The attached patch fixes this. NB This is also an issue in other python versions ---------- assignee: ronaldoussoren components: Macintosh files: urllib_macos.diff keywords: patch messages: 155973 nosy: Serge.Droz, ronaldoussoren priority: normal severity: normal status: open title: proxy_bypass_macosx_sysconf does not handle singel ip addresses correctly versions: Python 2.6 Added file: http://bugs.python.org/file24880/urllib_macos.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:50:27 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 15 Mar 2012 22:50:27 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: <1331851827.42.0.3965247984.issue14202@psf.upfronthosting.co.za> ?ric Araujo added the comment: Could you provide a diff? (instructions in the devguide) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 15 23:58:48 2012 From: report at bugs.python.org (Florian Mladitsch) Date: Thu, 15 Mar 2012 22:58:48 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: <1331852328.27.0.120746431016.issue14202@psf.upfronthosting.co.za> Florian Mladitsch added the comment: It is a diff-file, or am I missing something? I generated the file with 'hg diff > xml.dom.pulldom.rst' Probably should have given it a '*.patch' file-ending =/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 01:14:10 2012 From: report at bugs.python.org (Matthias Klose) Date: Fri, 16 Mar 2012 00:14:10 +0000 Subject: [issue14330] do not use the host python for cross builds Message-ID: <1331856850.28.0.590122825265.issue14330@psf.upfronthosting.co.za> New submission from Matthias Klose : for various tasks, the just built python for the host is used. this patch searches for a suitable python for the build machine and uses it for the build. ---------- assignee: doko components: Cross-Build files: no-host-python-for-build.diff keywords: needs review, patch messages: 155976 nosy: doko priority: normal severity: normal status: open title: do not use the host python for cross builds versions: Python 3.3 Added file: http://bugs.python.org/file24881/no-host-python-for-build.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 01:17:36 2012 From: report at bugs.python.org (Matthias Klose) Date: Fri, 16 Mar 2012 00:17:36 +0000 Subject: [issue3754] cross-compilation support for python build In-Reply-To: <1220305759.82.0.468834426074.issue3754@psf.upfronthosting.co.za> Message-ID: <1331857056.23.0.871012197564.issue3754@psf.upfronthosting.co.za> Matthias Klose added the comment: issue 14330 handles not using the host python for the build ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 01:28:27 2012 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Fri, 16 Mar 2012 00:28:27 +0000 Subject: [issue14330] do not use the host python for cross builds In-Reply-To: <1331856850.28.0.590122825265.issue14330@psf.upfronthosting.co.za> Message-ID: <1331857707.47.0.236673548791.issue14330@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 01:33:04 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 16 Mar 2012 00:33:04 +0000 Subject: [issue11105] Compiling evil ast crashes interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1331857984.55.0.759612679406.issue11105@psf.upfronthosting.co.za> Gregory P. Smith added the comment: i haven't confirmed if it is this exact bug but I believe a coworker just ran into something similar. he wrote code to use the ast to remove docstrings from code before passing it to compile() (as that saves a noticable amount of memory). in the case the ast for code like: def foo(): """this is a docstring.""" Removing the docstring and passing such a thing to compile triggers a problem. A workaround was to add a pass in such cases: if (node.body and isinstance(node.body[0], ast.Expr) and isinstance(node.body[0].value, ast.Str)): docstring = node.body.pop(0) if len(node.body) == 0: # An empty body will sometimes provoke a segfault when you call # compile on the code object. node.body.append(ast.Pass(lineno=docstring.lineno, col_offset=docstring.col_offset)) regardless, it'd be better if compile() *never* crashed on strange input. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 01:36:39 2012 From: report at bugs.python.org (Larry Hastings) Date: Fri, 16 Mar 2012 00:36:39 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1331858199.53.0.191762664989.issue14328@psf.upfronthosting.co.za> Larry Hastings added the comment: BTW, I have the os.utime patch nearly ready for review; it works, it just needs doc and test. But it's dependent on this patch--and it'd be smoother if #14127 were finished too. So I'll hold off on posting the new patch until the fates of these two are decided. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 01:37:13 2012 From: report at bugs.python.org (Matthias Klose) Date: Fri, 16 Mar 2012 00:37:13 +0000 Subject: [issue3754] cross-compilation support for python build In-Reply-To: <1220305759.82.0.468834426074.issue3754@psf.upfronthosting.co.za> Message-ID: <1331858233.04.0.11072899605.issue3754@psf.upfronthosting.co.za> Matthias Klose added the comment: I'm now able to build the interpreter (and run it in qemu on the same machine), but building the extension modules fails. the build is configured as: CC="arm-linux-gnueabihf-gcc" \ CXX="arm-linux-gnueabihf-g++" \ CFLAGS="-g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security" \ LDFLAGS="-Wl,-Bsymbolic-functions -Wl,-z,relro" \ ../cross/configure \ --prefix=/usr \ --enable-ipv6 \ --with-computed-gotos \ --enable-loadable-sqlite-extensions \ --with-dbmliborder=bdb:gdbm \ --with-system-expat \ --with-system-ffi \ --with-fpectl \ --host=arm-linux-gnueabihf \ --build=x86_64-linux-gnu building 'cmath' extension arm-linux-gnueabihf-gcc -fPIC -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -I. -I/usr/include/arm-linux-gnueabihf -I/usr/local/include -I/usr/include/python3.3m -c cmathmodule.c -o build/temp.linux-x86_64-3.3/cmathmodule.o arm-linux-gnueabihf-gcc: error: cmathmodule.c: No such file or directory arm-linux-gnueabihf-gcc: fatal error: no input files compilation terminated. the source files are not found (srcdir != builddir), the patch from rpetrov talks about: +# revert patch from issue 7880 : +# - the test case (from issue 7880) works for me +# - realpath break cross compilation +# => so lets use abspath again ;) +# NOTE "Issue #6612: Fix site and sysconfig to catch os.getcwd() error, +# eg. if the current directory was deleted." replase all occurrence of +# realpath with _safe_realpath. Instead to update _safe_realpath to use +# abspath the cross-compilation revert all! but I'm running out of time, and won't work on this for the next two weeks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 01:42:29 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 16 Mar 2012 00:42:29 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN Message-ID: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> New submission from Gregory P. Smith : Python/import.c in 2.7 and 3.2 consume a lot of stack space when importing modules. In stack constrained environments (think: 64k stack) this can cause a crash when you have a large chain of imports. The bulk of this likely comes from places where a char buf[MAXPATHLEN+1] or similar is declared on the stack in the call chain. MAXPATHLEN is commonly defined to be in the 256..1024 range depending on the OS. Changing the code to not put the large buffer on the stack but to malloc and free it instead is a pretty straightforward re-factor. import is being significantly reworked in 3.3 so I won't consider this issue there until after that settles as it may no longer apply. ---------- assignee: gregory.p.smith messages: 155981 nosy: brett.cannon, gregory.p.smith, ncoghlan, twouters priority: normal severity: normal status: open title: Python/import.c uses a lot of stack space due to MAXPATHLEN versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 01:59:59 2012 From: report at bugs.python.org (Matthew Barnett) Date: Fri, 16 Mar 2012 00:59:59 +0000 Subject: [issue1519638] Unmatched Group issue - workaround Message-ID: <1331859599.58.0.92028912424.issue1519638@psf.upfronthosting.co.za> Matthew Barnett added the comment: The replacement can be a callable, so you could do this: re.sub(r'(?:\((?:(\d+)|.*?)\)\s*)+$', lambda m: m.group(1) or '', 'avatar (special edition)') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 02:05:26 2012 From: report at bugs.python.org (Eric Snow) Date: Fri, 16 Mar 2012 01:05:26 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1331859926.01.0.309904588482.issue14328@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 02:07:50 2012 From: report at bugs.python.org (Eric Snow) Date: Fri, 16 Mar 2012 01:07:50 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN In-Reply-To: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> Message-ID: <1331860070.9.0.544701697442.issue14331@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 02:08:10 2012 From: report at bugs.python.org (Nikki DelRosso) Date: Fri, 16 Mar 2012 01:08:10 +0000 Subject: [issue1519638] Unmatched Group issue - workaround Message-ID: <1331860090.95.0.0971481976339.issue1519638@psf.upfronthosting.co.za> Nikki DelRosso added the comment: Perfect; thank you! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 02:15:53 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 01:15:53 +0000 Subject: [issue11082] ValueError: Content-Length should be specified In-Reply-To: <1296501492.73.0.362770141375.issue11082@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 057cf78ed576 by Senthil Kumaran in branch '3.2': Explain the use of charset parameter with Content-Type header. Issue11082 http://hg.python.org/cpython/rev/057cf78ed576 New changeset 90e35b91756d by Senthil Kumaran in branch 'default': Explain the use of charset parameter with Content-Type header: issue11082 http://hg.python.org/cpython/rev/90e35b91756d ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 02:18:27 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 16 Mar 2012 01:18:27 +0000 Subject: [issue11082] ValueError: Content-Length should be specified In-Reply-To: <1296501492.73.0.362770141375.issue11082@psf.upfronthosting.co.za> Message-ID: <1331860707.01.0.542308377645.issue11082@psf.upfronthosting.co.za> Senthil Kumaran added the comment: I have rewritten some parts of the documentation, explaining the use of charset parameter with Content-Type header. Used the suggestions from the previous patch's review comments too. I see that other parts of the documentation can be improved further, I shall do that separately. I am closing this issue. Thanks! ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 02:20:35 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 16 Mar 2012 01:20:35 +0000 Subject: [issue11105] Compiling evil ast crashes interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1331860835.55.0.400503405871.issue11105@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Have him try on 3.3. This should be less of an issue there where there is an AST validator. It doesn't fix this bug, but it does fix most accidental AST construction bugs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 02:21:32 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 16 Mar 2012 01:21:32 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1331860892.24.0.443292987983.issue14328@psf.upfronthosting.co.za> Benjamin Peterson added the comment: I want #14325 to go in first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 02:43:57 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 16 Mar 2012 01:43:57 +0000 Subject: [issue14326] IDLE - allow shell to support different locales In-Reply-To: <1331838921.21.0.772661396628.issue14326@psf.upfronthosting.co.za> Message-ID: <1331862237.82.0.700940976836.issue14326@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 03:30:24 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 02:30:24 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: <1331865024.54.0.10755784619.issue14202@psf.upfronthosting.co.za> ?ric Araujo added the comment: Ah, right, I just assumed that your .rst file was the full file (like in your first upload), but it is indeed a diff. Our tools don?t care about the file extension, but they sometimes are useful conventions for humans :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 03:36:32 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 02:36:32 +0000 Subject: [issue14321] Do not run pgen during the build if files are up to date In-Reply-To: <1331831244.15.0.8026915878.issue14321@psf.upfronthosting.co.za> Message-ID: <1331865392.27.0.465690531035.issue14321@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- resolution: -> fixed stage: -> committed/rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 04:03:54 2012 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 16 Mar 2012 03:03:54 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN In-Reply-To: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> Message-ID: <1331867034.17.0.53354235619.issue14331@psf.upfronthosting.co.za> Changes by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 04:24:55 2012 From: report at bugs.python.org (Eric Snow) Date: Fri, 16 Mar 2012 03:24:55 +0000 Subject: [issue11105] Compiling evil ast crashes interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1331868295.68.0.515744269405.issue11105@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 04:41:38 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 16 Mar 2012 03:41:38 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: <1331869298.8.0.296244978304.issue14202@psf.upfronthosting.co.za> Eli Bendersky added the comment: Looks good, pending fixing of ?ric's comments. Florian, could you do that? We can then proceed to commit (to 3.3) and consider backports. ---------- stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 04:55:16 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 03:55:16 +0000 Subject: [issue14246] Accelerated ETree XMLParser cannot handle io.StringIO In-Reply-To: <1331377442.17.0.542633134085.issue14246@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 7bdf5c96fdc0 by Eli Bendersky in branch 'default': Closes Issue #14246: _elementtree parser will now handle io.StringIO http://hg.python.org/cpython/rev/7bdf5c96fdc0 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 04:56:06 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 16 Mar 2012 03:56:06 +0000 Subject: [issue14246] Accelerated ETree XMLParser cannot handle io.StringIO In-Reply-To: <1331377442.17.0.542633134085.issue14246@psf.upfronthosting.co.za> Message-ID: <1331870166.28.0.942698747717.issue14246@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 05:03:20 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 16 Mar 2012 04:03:20 +0000 Subject: [issue14065] Element should support cyclic GC In-Reply-To: <1329755208.03.0.143933032526.issue14065@psf.upfronthosting.co.za> Message-ID: <1331870600.53.0.20974382915.issue14065@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- assignee: -> eli.bendersky versions: -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 05:54:05 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 16 Mar 2012 04:54:05 +0000 Subject: [issue14065] Element should support cyclic GC In-Reply-To: <1329755208.03.0.143933032526.issue14065@psf.upfronthosting.co.za> Message-ID: <1331873645.87.0.233141754761.issue14065@psf.upfronthosting.co.za> Eli Bendersky added the comment: Martin, why do you think it's important for Element to support this? After all, this is XML, not an arbitrary tree. As such, the children of Element can only be other elements, and attribute values should be strings. Anything else will result in errors when attempting to write that Element into a real XML file. Semantically it doesn't make sense for the value of an attribute to be a list or any other container, for that matter. In your sample code, if you attempt to dump or write L[0] before deleting it, you'll get an error. Adding GC handling complicates the code (even if not by too much), and this complication should be justified. Can you see a valid use case where GC handling would be required? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 06:52:05 2012 From: report at bugs.python.org (Weronika Patena) Date: Fri, 16 Mar 2012 05:52:05 +0000 Subject: [issue14332] difflib.ndiff appears to ignore linejunk argument Message-ID: <1331877125.66.0.103153393744.issue14332@psf.upfronthosting.co.za> New submission from Weronika Patena : According to difflib.ndiff help, the optional linejunk argument is "A function that should accept a single string argument, and return true iff the string is junk." Presumably the point is to ignore the junk lines in the comparison. But the function doesn't appear to actually do this - in fact I haven't been able to make the linejunk argument change the output in any way. Expected difflib.ndiff behavior with no linejunk argument given: >>> test_lines_1 = ['# something\n', 'real data\n'] >>> test_lines_2 = ['# something else\n', 'real data\n'] >>> print ''.join(difflib.ndiff(test_lines_1,test_lines_2)) - # something + # something else ? +++++ real data Now I'm providing a linejunk function to ignore all lines starting with '#', but the output is still the same: >>> print ''.join(difflib.ndiff(test_lines_1, test_lines_2, linejunk=lambda line: line.startswith('#'))) - # something + # something else ? +++++ real data In fact if I make linejunk always return True (or False), nothing changes either: >>> print ''.join(difflib.ndiff(test_lines_1, test_lines_2, linejunk=lambda line: True)) - # something + # something else ? +++++ real data It certainly looks like an error, although it's possible that I'm just misunderstanding how this should work. I'm using Python 2.6.5, on Ubuntu Linux 10.04. ---------- components: Library (Lib) messages: 155992 nosy: patena, tim_one priority: normal severity: normal status: open title: difflib.ndiff appears to ignore linejunk argument type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 07:08:50 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 16 Mar 2012 06:08:50 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN In-Reply-To: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> Message-ID: <1331878130.83.0.956377541084.issue14331@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Here's a patch for python 2.7. test cases pass but it could use review to see if I missed any free()s. ---------- keywords: +patch Added file: http://bugs.python.org/file24882/malloc-import-pathbufs-py27.001.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 07:17:48 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Fri, 16 Mar 2012 06:17:48 +0000 Subject: [issue2486] Recode (parts of) decimal module in C In-Reply-To: <1206480975.35.0.923616350386.issue2486@psf.upfronthosting.co.za> Message-ID: <1331878668.22.0.933838919079.issue2486@psf.upfronthosting.co.za> Ramchandra Apte added the comment: If issue7652 finishes. There's no point in fixing this bug. ---------- nosy: +ramchandra.apte _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 07:21:50 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 06:21:50 +0000 Subject: [issue14207] ElementTree.ParseError - needs documentation and consistent C&Py implementations In-Reply-To: <1331010333.9.0.736082311251.issue14207@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset b76fa310e73d by Eli Bendersky in branch 'default': Issue #14207: the ParseError exception raised by _elementtree was made http://hg.python.org/cpython/rev/b76fa310e73d ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 07:22:19 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 16 Mar 2012 06:22:19 +0000 Subject: [issue14207] ElementTree.ParseError - needs documentation and consistent C&Py implementations In-Reply-To: <1331010333.9.0.736082311251.issue14207@psf.upfronthosting.co.za> Message-ID: <1331878939.82.0.463923192098.issue14207@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 07:23:34 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 16 Mar 2012 06:23:34 +0000 Subject: [issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO In-Reply-To: <1290324717.4.0.0270982528857.issue10484@psf.upfronthosting.co.za> Message-ID: <1331879014.24.0.74105480906.issue10484@psf.upfronthosting.co.za> Senthil Kumaran added the comment: To note in the tracker, the original 2.6 code was changed in Issue 2254 and the relevant changeset is c6c4398293bd I find, Glenn's suggestion a possibly okay solution for PATH_INFO problem, keeping in tact the security issue the the previous change dealt with. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 07:28:01 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 16 Mar 2012 06:28:01 +0000 Subject: [issue14009] Clearer documentation for cElementTree In-Reply-To: <1329233203.38.0.944311933185.issue14009@psf.upfronthosting.co.za> Message-ID: <1331879281.68.0.679823030443.issue14009@psf.upfronthosting.co.za> Eli Bendersky added the comment: ?ric, what stops us from closing this issue? Given Ezio and Fred's feedback, I don't object to indexing cET in 3.3 - I guess it can't hurt. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 07:34:42 2012 From: report at bugs.python.org (Larry Hastings) Date: Fri, 16 Mar 2012 06:34:42 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1331879682.98.0.469289384307.issue14328@psf.upfronthosting.co.za> Larry Hastings added the comment: Attached is r3 of my patch incorporated Benjamin's suggestions. > I want #14325 to go in first. Why do you care? If I get signoff before 14325 does please explain to me why I should wait. They don't touch the same lines; should be a clean merge no matter who goes first. ---------- Added file: http://bugs.python.org/file24883/larry.parsekwonly.diff.3.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 07:44:21 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 06:44:21 +0000 Subject: [issue9257] cElementTree iterparse requires events as bytes; ElementTree uses strings In-Reply-To: <1279078067.06.0.575324977312.issue9257@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 84e4d76bd146 by Eli Bendersky in branch '3.2': Issue #9257: clarify the events iterparse accepts http://hg.python.org/cpython/rev/84e4d76bd146 New changeset 00c7142ee54a by Eli Bendersky in branch 'default': Issue #9257: clarify the events iterparse accepts http://hg.python.org/cpython/rev/00c7142ee54a ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 07:44:40 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 16 Mar 2012 06:44:40 +0000 Subject: [issue9257] cElementTree iterparse requires events as bytes; ElementTree uses strings In-Reply-To: <1279078067.06.0.575324977312.issue9257@psf.upfronthosting.co.za> Message-ID: <1331880280.68.0.523831412998.issue9257@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 07:46:35 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 16 Mar 2012 06:46:35 +0000 Subject: [issue12908] Update dev-in-a-box for new coverage steps In-Reply-To: <1315284663.33.0.542797190768.issue12908@psf.upfronthosting.co.za> Message-ID: <1331880395.9.0.507385345781.issue12908@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- nosy: -eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 08:01:05 2012 From: report at bugs.python.org (Larry Hastings) Date: Fri, 16 Mar 2012 07:01:05 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1331881265.8.0.712749659934.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: Updated patch incorporating only one of Antoine's latest suggestions. Please see my reply on Reitveld for r3 as to why I skipped two of your three suggestions. ---------- Added file: http://bugs.python.org/file24884/larry.st_mtime_ns.patch.4.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 08:01:23 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 16 Mar 2012 07:01:23 +0000 Subject: [issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO In-Reply-To: <1290324717.4.0.0270982528857.issue10484@psf.upfronthosting.co.za> Message-ID: <1331881283.18.0.240182827287.issue10484@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Actually no. I revert back my previous statement. Meddling with splitpath breaks all the tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 08:19:29 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 07:19:29 +0000 Subject: [issue13709] Capitalization mistakes in the documentation for ctypes In-Reply-To: <1325645203.91.0.562347938508.issue13709@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset d2460ff173ff by Eli Bendersky in branch 'default': Issue #13709: some fixes to the ctypes documentation. In addition to fixing http://hg.python.org/cpython/rev/d2460ff173ff ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 08:20:04 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 16 Mar 2012 07:20:04 +0000 Subject: [issue13709] Capitalization mistakes in the documentation for ctypes In-Reply-To: <1325645203.91.0.562347938508.issue13709@psf.upfronthosting.co.za> Message-ID: <1331882404.15.0.934839211337.issue13709@psf.upfronthosting.co.za> Eli Bendersky added the comment: Fixed in 3.3 I don't think this is important enough to spend time on backporting. ---------- resolution: -> fixed stage: needs patch -> commit review status: open -> closed versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 08:28:22 2012 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 16 Mar 2012 07:28:22 +0000 Subject: [issue2486] Recode (parts of) decimal module in C In-Reply-To: <1206480975.35.0.923616350386.issue2486@psf.upfronthosting.co.za> Message-ID: <1331882902.27.0.288514194453.issue2486@psf.upfronthosting.co.za> Mark Dickinson added the comment: No, this should be closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 08:28:27 2012 From: report at bugs.python.org (Matt Joiner) Date: Fri, 16 Mar 2012 07:28:27 +0000 Subject: [issue14320] set.add can return boolean indicate newly added item In-Reply-To: <1331830545.62.0.37534358264.issue14320@psf.upfronthosting.co.za> Message-ID: <1331882907.63.0.435621932455.issue14320@psf.upfronthosting.co.za> Matt Joiner added the comment: Is there still some value to at least exposing this in the C API, per the precedents I mentioned? The patch also contains some adjustment to the set_add_entry/set_add_key abstraction dance, and some future proofing of PySet_Add return values that have merit on their own. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 08:45:45 2012 From: report at bugs.python.org (Matt Joiner) Date: Fri, 16 Mar 2012 07:45:45 +0000 Subject: [issue14333] queue unittest errors Message-ID: <1331883945.34.0.322652565121.issue14333@psf.upfronthosting.co.za> New submission from Matt Joiner : $ python3.3 -m unittest test.test_queue Generates errors in the unit test code of the form AttributeError: 'BaseQueueTest' object has no attribute 'type2test' ---------- components: Tests messages: 156006 nosy: anacrolix, benjamin.peterson, rhettinger priority: normal severity: normal status: open title: queue unittest errors type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 08:51:40 2012 From: report at bugs.python.org (Glenn Linderman) Date: Fri, 16 Mar 2012 07:51:40 +0000 Subject: [issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO In-Reply-To: <1290324717.4.0.0270982528857.issue10484@psf.upfronthosting.co.za> Message-ID: <1331884300.7.0.957675818233.issue10484@psf.upfronthosting.co.za> Glenn Linderman added the comment: I'm not sure what tests break or why, I suppose it is the ones for the security patch. I'm not sure which code you are referring to... the code in msg122259 I tested only cursorily, the (different) code in issue 13893 is what I'm running today, and so has been tested more heavily, but I haven't run the regression tests (haven't figured out how). The latter code fixes the _url_collapse_path_split function, instead of working around it, which the code in msg122259 tries to do. I would be highly interested if it fails any tests, and why, and would be glad to help analyze and fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 09:09:48 2012 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 16 Mar 2012 08:09:48 +0000 Subject: [issue2486] Recode (parts of) decimal module in C In-Reply-To: <1206480975.35.0.923616350386.issue2486@psf.upfronthosting.co.za> Message-ID: <1331885388.03.0.918337307193.issue2486@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 09:10:33 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Fri, 16 Mar 2012 08:10:33 +0000 Subject: [issue8739] Update to smtpd.py to RFC 5321 In-Reply-To: <1274103249.44.0.284620021799.issue8739@psf.upfronthosting.co.za> Message-ID: <1331885433.7.0.957319883023.issue8739@psf.upfronthosting.co.za> Michele Orr? added the comment: David: yes, I did. About two weeks ago. Probably I'll take a look to those issues :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 09:13:24 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Fri, 16 Mar 2012 08:13:24 +0000 Subject: [issue8739] Update to smtpd.py to RFC 5321 In-Reply-To: <1274103249.44.0.284620021799.issue8739@psf.upfronthosting.co.za> Message-ID: <1331885604.25.0.570900725782.issue8739@psf.upfronthosting.co.za> Michele Orr? added the comment: David, can you tag this issue as dependency for issue14261 ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 09:15:35 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 08:15:35 +0000 Subject: [issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO In-Reply-To: <1290324717.4.0.0270982528857.issue10484@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset bab9f29c93fd by Senthil Kumaran in branch '2.7': 2.7 - Issue #10484: Fix the CGIHTTPServer's PATH_INFO handling problem http://hg.python.org/cpython/rev/bab9f29c93fd New changeset 88c86869ce92 by Senthil Kumaran in branch '3.2': closes issue10484 - Fix the http.server's cgi PATH_INFO handling problem http://hg.python.org/cpython/rev/88c86869ce92 New changeset 13c44ad094b4 by Senthil Kumaran in branch 'default': closes issue10484 - Fix the http.server's cgi PATH_INFO handling problem http://hg.python.org/cpython/rev/13c44ad094b4 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 09:18:20 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 16 Mar 2012 08:18:20 +0000 Subject: [issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO In-Reply-To: <1290324717.4.0.0270982528857.issue10484@psf.upfronthosting.co.za> Message-ID: <1331885900.19.0.209900506409.issue10484@psf.upfronthosting.co.za> Senthil Kumaran added the comment: I treated this as a regression from 2.6. A cgi url with /cgi-bin/hello.py/hello/world would have PATH_INFO as '/hello/world' I saw some apache specs saying that it should be 'hello/world', but I relied on python2.6's behavior with had initial '/'. Glenn, I referred to Lib/test/test_httpservers.py. Thanks for raising this and other issues (and patches)! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 09:21:32 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 16 Mar 2012 08:21:32 +0000 Subject: [issue10485] http.server fails when query string contains addition '?' characters In-Reply-To: <1290325094.43.0.114667735532.issue10485@psf.upfronthosting.co.za> Message-ID: <1331886092.82.0.625364260637.issue10485@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- assignee: -> orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 09:21:52 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 16 Mar 2012 08:21:52 +0000 Subject: [issue10487] http.server doesn't process Status header from CGI scripts In-Reply-To: <1290325843.93.0.000870454658653.issue10487@psf.upfronthosting.co.za> Message-ID: <1331886112.54.0.962533848597.issue10487@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- assignee: -> orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 09:22:59 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 16 Mar 2012 08:22:59 +0000 Subject: [issue10487] http.server doesn't process Status header from CGI scripts In-Reply-To: <1290325843.93.0.000870454658653.issue10487@psf.upfronthosting.co.za> Message-ID: <1331886179.07.0.838512242901.issue10487@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- superseder: -> Make CGIHTTPServer capable of redirects (and status other than 200) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 09:25:16 2012 From: report at bugs.python.org (Glenn Linderman) Date: Fri, 16 Mar 2012 08:25:16 +0000 Subject: [issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO In-Reply-To: <1290324717.4.0.0270982528857.issue10484@psf.upfronthosting.co.za> Message-ID: <1331886316.2.0.673950165934.issue10484@psf.upfronthosting.co.za> Glenn Linderman added the comment: In reviewing my code in this area, I also see that in addition to fixing _url_collapse_path_split, I override the location that uses it, which is the is_cgi function. Here is my code for the override, which actually creates a proper PATH_INFO string: def is_cgi(self): """Test whether self.path corresponds to a CGI script. Returns True and updates the cgi_info attribute to the tuple (dir, rest) if self.path requires running a CGI script. Returns False otherwise. If any exception is raised, the caller should assume that self.path was rejected as invalid and act accordingly. The default implementation tests whether the normalized url path begins with one of the strings in self.cgi_directories (and the next character is a '/' or the end of the string). """ splitpath = server._url_collapse_path_split(self.path) # more processing required due to possible PATHINFO parts # not clear above function really does what is needed here, # nor just how general it is! splitpath = '/'.join( splitpath ).split('/', 2 ) head = '/' + splitpath[ 1 ] tail = splitpath[ 2 ] if head in self.cgi_directories: self.cgi_info = head, tail return True return False I have no idea what applications might depend on the improper handling of PATH_INFO that the current code is performing, so that is why I applied my fix for that in my overridden code, rather than in the server.py source file. It may be that the actual fix for this issue is in the overridden code above (but the fix to _url_collapse_path_split also seemed necessary, there was a corner case that it did incorrectly, but after 16 months, I couldn't tell you what that corner case was, any more. Yes, the biggest issue here was the regression from 2.6, the security fix seemed to break the PATH_INFO feature. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 09:31:29 2012 From: report at bugs.python.org (Glenn Linderman) Date: Fri, 16 Mar 2012 08:31:29 +0000 Subject: [issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO In-Reply-To: <1290324717.4.0.0270982528857.issue10484@psf.upfronthosting.co.za> Message-ID: <1331886689.11.0.474276472344.issue10484@psf.upfronthosting.co.za> Glenn Linderman added the comment: Senthil, the patch you submitted breaks the encapsulation of cgi_directories -- this should be changeable per particular application via subclassing or assignment, but you've built those directories into the code. Perhaps you should take a look at my code for is_cgi (which I was trying to post while you were posting the patches, sorry I was slow). Perhaps there should be one more test, which actually changes the cgi_directories, and tests a few more things, to prove that the code does not hard code those directories (it shouldn't). ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 09:43:23 2012 From: report at bugs.python.org (Glenn Linderman) Date: Fri, 16 Mar 2012 08:43:23 +0000 Subject: [issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO In-Reply-To: <1290324717.4.0.0270982528857.issue10484@psf.upfronthosting.co.za> Message-ID: <1331887403.57.0.678972154074.issue10484@psf.upfronthosting.co.za> Glenn Linderman added the comment: Another issue with the patch, is that it doesn't do .. and . collapsing on the PATH_INFO part of the path. It is possible for a path like /cgi-bin/script.py/../../plain-file.html to be passed to the server. I guess the question is if it should serve plain-file.html or if it should pass "../../plain-file.html" to script.py as its PATH_INFO. I would think the former would be appropriate. I would have to do research to determine if some standard states otherwise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 09:56:56 2012 From: report at bugs.python.org (Glenn Linderman) Date: Fri, 16 Mar 2012 08:56:56 +0000 Subject: [issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO In-Reply-To: <1290324717.4.0.0270982528857.issue10484@psf.upfronthosting.co.za> Message-ID: <1331888216.15.0.391790592276.issue10484@psf.upfronthosting.co.za> Glenn Linderman added the comment: I just tested what Apache does with such a path as /cgi-bin/script.py/../../plain-file.html, and it serves the plain-file.html. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 11:02:23 2012 From: report at bugs.python.org (Florian Mladitsch) Date: Fri, 16 Mar 2012 10:02:23 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: <1331892143.35.0.505169641072.issue14202@psf.upfronthosting.co.za> Changes by Florian Mladitsch : ---------- keywords: +patch Added file: http://bugs.python.org/file24885/xml.dom.pulldom.rst.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 13:24:28 2012 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 16 Mar 2012 12:24:28 +0000 Subject: [issue14133] improved PEP 409 implementation In-Reply-To: <1330269562.83.0.382343969435.issue14133@psf.upfronthosting.co.za> Message-ID: <1331900668.46.0.923989354795.issue14133@psf.upfronthosting.co.za> Nick Coghlan added the comment: With the decision on whether or not to suppress the context moved out to a separate flag, I think we need to allow it. Requiring that the flag be False *and* that the context also be None gets us back to asking the question of why the flag doesn't work when the context is set to a different value. That question was part of the genesis of the Ellipsis-as-sentinel approach in the original 409 implementation. I wouldn't stress too much about the formatting though. Perhaps note in the suppress context docs that the output can get *very* noisy if you turn it off when both cause and context are set, so while it does display all the exception information, the default output isn't going to be very easy to read. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 13:33:41 2012 From: report at bugs.python.org (Stefan Krah) Date: Fri, 16 Mar 2012 12:33:41 +0000 Subject: [issue14334] Invalid free in _PyUnicode_Ready() Message-ID: <1331901221.34.0.872170817389.issue14334@psf.upfronthosting.co.za> New submission from Stefan Krah : Hi -- I'm getting a segfault running the attached crasher.py script. Valgrind traces it down to an Invalid free() / delete / delete[] in _PyUnicode_Ready(). Reproduce: ========== Rev: 870c0ef7e8a2 Build: ./configure --without-pymalloc CFLAGS="-O0 -g" && make $ ./python crasher.py Segmentation fault $ valgrind --db-attach=yes --suppressions=./Misc/valgrind-python.supp ./python crasher.py ==3476== Memcheck, a memory error detector ==3476== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==3476== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==3476== Command: ./python crasher.py ==3476== ==3476== Invalid free() / delete / delete[] ==3476== at 0x4C2748D: free (vg_replace_malloc.c:366) ==3476== by 0x44763C: _PyUnicode_Ready (unicodeobject.c:1405) ==3476== by 0x44ACF8: PyUnicode_FromFormatV (unicodeobject.c:2500) ==3476== by 0x4A1CF4: PyErr_Format (errors.c:621) ==3476== by 0x42F8FE: type_getattro (typeobject.c:2551) ==3476== by 0x43493A: wrap_binaryfunc (typeobject.c:4317) ==3476== by 0x550008: wrapper_call (descrobject.c:1067) ==3476== by 0x532C93: PyObject_Call (abstract.c:2150) ==3476== by 0x49012B: PyEval_CallObjectWithKeywords (ceval.c:3920) ==3476== by 0x54F136: wrapperdescr_call (descrobject.c:309) ==3476== by 0x532C93: PyObject_Call (abstract.c:2150) ==3476== by 0x491A1E: ext_do_call (ceval.c:4355) ==3476== Address 0x4 is not stack'd, malloc'd or (recently) free'd ==3476== ---------- components: Interpreter Core files: crasher.py messages: 156017 nosy: haypo, loewis, skrah priority: high severity: normal stage: needs patch status: open title: Invalid free in _PyUnicode_Ready() type: crash versions: Python 3.3 Added file: http://bugs.python.org/file24886/crasher.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 13:42:03 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 12:42:03 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 172630a3e6d8 by Eli Bendersky in branch '3.2': Issue #14202: Greatly enhance the documentation of xml.dom.pulldom. http://hg.python.org/cpython/rev/172630a3e6d8 New changeset 5d118a154ba3 by Eli Bendersky in branch 'default': Issue #14202: Greatly enhance the documentation of xml.dom.pulldom. http://hg.python.org/cpython/rev/5d118a154ba3 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 13:44:38 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 16 Mar 2012 12:44:38 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: <1331901878.25.0.277152059525.issue14202@psf.upfronthosting.co.za> Eli Bendersky added the comment: I committed the patch after some minor modifications, to 3.2 and 3.3 Florian, thanks for the contribution! ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed versions: +Python 3.2 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 13:52:00 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 12:52:00 +0000 Subject: [issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist In-Reply-To: <1331835760.38.0.280902502881.issue14325@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 9fc456ac20cf by Jean-Paul Calderone in branch 'default': Issue #14325: Stop using python lists, capsules, and the garbage collector to deal with PyArg_Parse* cleanup. http://hg.python.org/cpython/rev/9fc456ac20cf ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 13:53:54 2012 From: report at bugs.python.org (Jean-Paul Calderone) Date: Fri, 16 Mar 2012 12:53:54 +0000 Subject: [issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist In-Reply-To: <1331835760.38.0.280902502881.issue14325@psf.upfronthosting.co.za> Message-ID: <1331902434.39.0.696565846095.issue14325@psf.upfronthosting.co.za> Changes by Jean-Paul Calderone : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 13:57:18 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 16 Mar 2012 12:57:18 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1331902638.02.0.267716492542.issue11379@psf.upfronthosting.co.za> Eli Bendersky added the comment: ?ric, what else would you like to do here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 14:05:30 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 16 Mar 2012 13:05:30 +0000 Subject: [issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist In-Reply-To: <1331835760.38.0.280902502881.issue14325@psf.upfronthosting.co.za> Message-ID: <1331903130.46.0.702232294175.issue14325@psf.upfronthosting.co.za> Eli Bendersky added the comment: This is cool! Any benchmark / speedup data? ---------- nosy: +eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 14:07:51 2012 From: report at bugs.python.org (Stefan Krah) Date: Fri, 16 Mar 2012 13:07:51 +0000 Subject: [issue14334] Invalid free in _PyUnicode_Ready() In-Reply-To: <1331901221.34.0.872170817389.issue14334@psf.upfronthosting.co.za> Message-ID: <1331903271.15.0.374872887926.issue14334@psf.upfronthosting.co.za> Stefan Krah added the comment: 3.2 also crashes. 2.7 runs fine. So it's certainly not related to the new Unicode API. ---------- versions: +Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 14:07:58 2012 From: report at bugs.python.org (Jean-Paul Calderone) Date: Fri, 16 Mar 2012 13:07:58 +0000 Subject: [issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist In-Reply-To: <1331835760.38.0.280902502881.issue14325@psf.upfronthosting.co.za> Message-ID: <1331903278.42.0.284087508977.issue14325@psf.upfronthosting.co.za> Jean-Paul Calderone added the comment: If it's a bit faster, that'd be a nice win, but I didn't benchmark. I'm primarily interested in correctness in the PyPy case (PyPy re-uses this code), and I think CPython benefits from the slightly simplified code as well. If you do any benchmarks, I'd love to hear the results, though. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 14:45:36 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 16 Mar 2012 13:45:36 +0000 Subject: [issue14128] _elementtree should expose types and factory functions consistently with ElementTree In-Reply-To: <1330248620.3.0.71621144947.issue14128@psf.upfronthosting.co.za> Message-ID: <1331905536.28.0.0363142060184.issue14128@psf.upfronthosting.co.za> Eli Bendersky added the comment: The TreeBuilder constructor in _elemettree doesn't accept arguments, contrary to the documentation. Added a (currently marked as failing) test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 14:49:06 2012 From: report at bugs.python.org (Stefan Krah) Date: Fri, 16 Mar 2012 13:49:06 +0000 Subject: [issue14334] Crash: getattr(type, '__getattribute__')(type, type) In-Reply-To: <1331901221.34.0.872170817389.issue14334@psf.upfronthosting.co.za> Message-ID: <1331905746.85.0.542881546552.issue14334@psf.upfronthosting.co.za> Stefan Krah added the comment: I've traced it down to this line: >>> getattr(type, '__getattribute__')(type, type) Segmentation fault Setting to 'normal', since there are apparently more of these. ---------- priority: high -> normal title: Invalid free in _PyUnicode_Ready() -> Crash: getattr(type, '__getattribute__')(type, type) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 14:49:07 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 13:49:07 +0000 Subject: [issue11379] Remove "lightweight" from minidom description In-Reply-To: <1299093908.17.0.828802315354.issue11379@psf.upfronthosting.co.za> Message-ID: <1331905747.72.0.93080867506.issue11379@psf.upfronthosting.co.za> ?ric Araujo added the comment: I?ll soon have a revised version of my patch to address your feedback. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 14:53:32 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 16 Mar 2012 13:53:32 +0000 Subject: [issue14320] set.add can return boolean indicate newly added item In-Reply-To: <1331830545.62.0.37534358264.issue14320@psf.upfronthosting.co.za> Message-ID: <1331906012.52.0.904343217559.issue14320@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:04:48 2012 From: report at bugs.python.org (sbt) Date: Fri, 16 Mar 2012 14:04:48 +0000 Subject: [issue14335] Reimplement multiprocessing's ForkingPickler using dispatch_table Message-ID: <1331906688.53.0.0988257452578.issue14335@psf.upfronthosting.co.za> New submission from sbt : The attached patch reimplements ForkingPickler using the new dispatch_table attribute. This allows ForkingPickler to subclass Pickler (implemented in C) instead of _Pickler (implemented in Python). ---------- components: Library (Lib) files: mp_forking_pickler.patch keywords: patch messages: 156028 nosy: sbt priority: normal severity: normal status: open title: Reimplement multiprocessing's ForkingPickler using dispatch_table type: performance versions: Python 3.3 Added file: http://bugs.python.org/file24887/mp_forking_pickler.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:04:56 2012 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 16 Mar 2012 14:04:56 +0000 Subject: [issue14334] Crash: getattr(type, '__getattribute__')(type, type) In-Reply-To: <1331901221.34.0.872170817389.issue14334@psf.upfronthosting.co.za> Message-ID: <1331906696.52.0.42793109382.issue14334@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: One-line crasher: type.__getattribute__(type, type) Python 2.7 does not crash reliably, but is not exempt from the bug: type.__getattribute__(type, 1.1j) ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:05:18 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 14:05:18 +0000 Subject: [issue14009] Clearer documentation for cElementTree In-Reply-To: <1329233203.38.0.944311933185.issue14009@psf.upfronthosting.co.za> Message-ID: <1331906718.66.0.783576761558.issue14009@psf.upfronthosting.co.za> ?ric Araujo added the comment: I will commit the patch, keeping the indexing in 3.3 as agreed. I just moved to a new city, so today is paperwork day but in the evening or tomorrow I?ll do Python work :) ---------- versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:13:57 2012 From: report at bugs.python.org (Matt Joiner) Date: Fri, 16 Mar 2012 14:13:57 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb In-Reply-To: <1331241110.78.0.993419519739.issue14230@psf.upfronthosting.co.za> Message-ID: <1331907237.26.0.222217459396.issue14230@psf.upfronthosting.co.za> Matt Joiner added the comment: This changeset has broken something. All I get is a confusing backtrace ending with: File "/home/matt/src/python-torrent/torrent/bencode.py", line 15, in encode yield from encode(k) AttributeError: 'list_iterator' object has no attribute 'send' Backing out the changeset, and there is no problem. Let me know if there's some way to provide more information. ---------- nosy: +anacrolix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:15:15 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 16 Mar 2012 14:15:15 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb In-Reply-To: <1331907237.26.0.222217459396.issue14230@psf.upfronthosting.co.za> Message-ID: Benjamin Peterson added the comment: 2012/3/16 Matt Joiner : > > Matt Joiner added the comment: > > This changeset has broken something. All I get is a confusing backtrace ending with: > > ?File "/home/matt/src/python-torrent/torrent/bencode.py", line 15, in encode > ? ?yield from encode(k) > AttributeError: 'list_iterator' object has no attribute 'send' > > Backing out the changeset, and there is no problem. Let me know if there's some way to provide more information. Try removing all the pycs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:15:58 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 16 Mar 2012 14:15:58 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb In-Reply-To: Message-ID: Benjamin Peterson added the comment: Nevermind, I think I see the problem. 2012/3/16 Benjamin Peterson : > > Benjamin Peterson added the comment: > > 2012/3/16 Matt Joiner : >> >> Matt Joiner added the comment: >> >> This changeset has broken something. All I get is a confusing backtrace ending with: >> >> ?File "/home/matt/src/python-torrent/torrent/bencode.py", line 15, in encode >> ? ?yield from encode(k) >> AttributeError: 'list_iterator' object has no attribute 'send' >> >> Backing out the changeset, and there is no problem. Let me know if there's some way to provide more information. > > Try removing all the pycs. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:22:32 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 16 Mar 2012 14:22:32 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb In-Reply-To: <1331241110.78.0.993419519739.issue14230@psf.upfronthosting.co.za> Message-ID: <1331907752.17.0.479362624073.issue14230@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Can you possibly create a small example that fails? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:22:56 2012 From: report at bugs.python.org (sbt) Date: Fri, 16 Mar 2012 14:22:56 +0000 Subject: [issue12338] multiprocessing.util._eintr_retry doen't recalculate timeouts In-Reply-To: <1308144268.86.0.218604754177.issue12338@psf.upfronthosting.co.za> Message-ID: <1331907776.3.0.822330531285.issue12338@psf.upfronthosting.co.za> sbt added the comment: _eintr_retry is currently unused. The attached patch removes it. If it is retained then we should at least add a warning that it does not recalculate timeouts. ---------- keywords: +patch Added file: http://bugs.python.org/file24888/mp_remove_eintr_retry.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:31:46 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 14:31:46 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: <1331908306.56.0.580669043727.issue14202@psf.upfronthosting.co.za> ?ric Araujo added the comment: Thanks to you both, the new docs are greatly better! Eli, why not backporting to 2.7 too? It has the same rules and should get the same attention as 3.2. BTW, when you nest class/method directives, you needn?t repeat the class name in the method directives: .. class:: DOVEventStream(stream, etc) .. method:: getEvent(blah) A few nits you may want to avoid in future patches: - The constants in the methods doc don?t use data markup - s/ie./i.e./ - I?d say ?Unicode string?, not ?unicode string? (referring to the concept/standard, not the old class) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:37:01 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 14:37:01 +0000 Subject: [issue14334] Crash: getattr(type, '__getattribute__')(type, type) In-Reply-To: <1331901221.34.0.872170817389.issue14334@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset b7bad204b34f by Benjamin Peterson in branch '3.2': check to make sure the attribute is a string (#14334) http://hg.python.org/cpython/rev/b7bad204b34f New changeset e44591015cf0 by Benjamin Peterson in branch 'default': merge 3.2 (#14334) http://hg.python.org/cpython/rev/e44591015cf0 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:37:09 2012 From: report at bugs.python.org (Mark Shannon) Date: Fri, 16 Mar 2012 14:37:09 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb In-Reply-To: <1331241110.78.0.993419519739.issue14230@psf.upfronthosting.co.za> Message-ID: <1331908629.04.0.320292004277.issue14230@psf.upfronthosting.co.za> Mark Shannon added the comment: The magic number has not been updated Patch attached. ---------- Added file: http://bugs.python.org/file24889/magic.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:38:16 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 14:38:16 +0000 Subject: [issue14316] Broken link in grammar.rst In-Reply-To: <1331821519.86.0.740460407781.issue14316@psf.upfronthosting.co.za> Message-ID: <1331908696.52.0.365318973496.issue14316@psf.upfronthosting.co.za> ?ric Araujo added the comment: Thanks for the catch! A little detective work finds that grammar.rst started as a copy of PEP 306, where the link?s target is http://www.python.org/sf/676521 a.k.a. http://bugs.python.org/issue676521 I can fix this later if nobody does it before me. ---------- nosy: +brett.cannon, eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:39:30 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 14:39:30 +0000 Subject: [issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb In-Reply-To: <1331241110.78.0.993419519739.issue14230@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset c0a6569fdad6 by Benjamin Peterson in branch 'default': in 72556ff86828, I should have updated the magic as well as the comment (#14230) http://hg.python.org/cpython/rev/c0a6569fdad6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:39:53 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 14:39:53 +0000 Subject: [issue14319] cleanup index switching mechanism on packaging.pypi In-Reply-To: <1331828817.11.0.332015599072.issue14319@psf.upfronthosting.co.za> Message-ID: <1331908793.41.0.467976430663.issue14319@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo versions: +3rd party, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:40:39 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 14:40:39 +0000 Subject: [issue14318] clarify "may not" in time.steady docs In-Reply-To: <1331829668.71.0.947018206764.issue14318@psf.upfronthosting.co.za> Message-ID: <1331908839.86.0.164607316505.issue14318@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:41:49 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 14:41:49 +0000 Subject: [issue14275] pysetup create doesn't handle install requirements In-Reply-To: <1331593918.19.0.128575459883.issue14275@psf.upfronthosting.co.za> Message-ID: <1331908909.64.0.500229333501.issue14275@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- stage: -> needs patch versions: +3rd party -Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:44:05 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 14:44:05 +0000 Subject: [issue14322] More test coverage for hmac In-Reply-To: <1331831609.33.0.520236800519.issue14322@psf.upfronthosting.co.za> Message-ID: <1331909045.08.0.680108246255.issue14322@psf.upfronthosting.co.za> ?ric Araujo added the comment: Thanks for the patch. Could you rewrite it using self.assert* methods instead of asserts? I?m not an hmac expert, so you may have to wait a bit for another core developer to see and commit the patch. ---------- nosy: +eric.araujo title: More test coverage for hmac.py -> More test coverage for hmac _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:46:21 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 14:46:21 +0000 Subject: [issue14311] ConfigParser does not parse utf-8 files with BOM bytes In-Reply-To: <1331778292.28.0.574531846286.issue14311@psf.upfronthosting.co.za> Message-ID: <1331909181.82.0.336579833191.issue14311@psf.upfronthosting.co.za> ?ric Araujo added the comment: Could you paste the exact code that fails? In 3.2+ there is a read_something method that takes an encoding argument, so that should work for example. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:46:33 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 14:46:33 +0000 Subject: [issue14334] Crash: getattr(type, '__getattribute__')(type, type) In-Reply-To: <1331901221.34.0.872170817389.issue14334@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset d1cf6008a565 by Benjamin Peterson in branch '2.7': check to make sure the attribute is a string (#14334) http://hg.python.org/cpython/rev/d1cf6008a565 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:47:49 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 14:47:49 +0000 Subject: [issue14330] do not use the host python for cross builds In-Reply-To: <1331856850.28.0.590122825265.issue14330@psf.upfronthosting.co.za> Message-ID: <1331909269.09.0.903177218062.issue14330@psf.upfronthosting.co.za> ?ric Araujo added the comment: + case $$MAKEFLAGS in *s*) quiet=-s; esac; \ Should be quiet=-q. make -s ? setup.py -q ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:49:31 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 16 Mar 2012 14:49:31 +0000 Subject: [issue14334] Crash: getattr(type, '__getattribute__')(type, type) In-Reply-To: <1331901221.34.0.872170817389.issue14334@psf.upfronthosting.co.za> Message-ID: <1331909371.58.0.977257720846.issue14334@psf.upfronthosting.co.za> Benjamin Peterson added the comment: It doesn't crash for me anymore. ---------- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:50:13 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 14:50:13 +0000 Subject: [issue14332] difflib.ndiff appears to ignore linejunk argument In-Reply-To: <1331877125.66.0.103153393744.issue14332@psf.upfronthosting.co.za> Message-ID: <1331909413.87.0.614875840753.issue14332@psf.upfronthosting.co.za> ?ric Araujo added the comment: Unfortunately Python 2.6 only gets fixes for security bugs now, not regular bugs. Can you reproduce the problem with 2.7 or 3.2? ---------- nosy: +eric.araujo, terry.reedy versions: -Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:52:18 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 14:52:18 +0000 Subject: [issue14317] index.simple module lacking in distutils2 In-Reply-To: <1331824525.48.0.828054000089.issue14317@psf.upfronthosting.co.za> Message-ID: <1331909538.04.0.355250807427.issue14317@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- resolution: wont fix -> out of date stage: -> committed/rejected versions: +3rd party -Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:52:48 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 14:52:48 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 1a740ea4f2a1 by Eli Bendersky in branch '3.2': Issue #14202: some additional doc fixes http://hg.python.org/cpython/rev/1a740ea4f2a1 New changeset b2e27f21760e by Eli Bendersky in branch 'default': Issue #14202: some additional doc fixes http://hg.python.org/cpython/rev/b2e27f21760e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 15:57:34 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 16 Mar 2012 14:57:34 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: <1331909854.86.0.476305017813.issue14202@psf.upfronthosting.co.za> Eli Bendersky added the comment: ?ric, thanks for the comments - all fixed. As for 2.7, it's just laziness really. Committing to both 3.2 and 3.3 is trivial since it's a simple merge. For 2.7 it's more complicated since it's an unrelated branch, and the code samples have to be fixed as well (the current ones use Python 3.x syntax). So I wouldn't object for someone to backport it to 2.7, but I don't deem it very important. If it was a bug fix, I would bother, but for documentation... not really :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 16:00:37 2012 From: report at bugs.python.org (Brett Cannon) Date: Fri, 16 Mar 2012 15:00:37 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1331910037.82.0.164153142795.issue2377@psf.upfronthosting.co.za> Brett Cannon added the comment: Thanks to everyone for the reviews. I'm moving house tomorrow and I suspect Andrea wants me to take a little Python break so I might not get to the reviews before a2, but I will definitely get to them an merged by a3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 16:08:18 2012 From: report at bugs.python.org (=?utf-8?q?Herv=C3=A9_Coatanhay?=) Date: Fri, 16 Mar 2012 15:08:18 +0000 Subject: [issue14296] Compilation error on CentOS 5.8 In-Reply-To: <1331688181.08.0.800421526529.issue14296@psf.upfronthosting.co.za> Message-ID: <1331910498.75.0.631788308615.issue14296@psf.upfronthosting.co.za> Herv? Coatanhay added the comment: I still have the exact same error Maybe change should be: #if !defined(CPU_ALLOC) && defined(HAVE_SCHED_SETAFFINITY) #undef HAVE_SCHED_SETAFFINITY #endif it seems CPU_ALLOC first appeared in glibc 2.7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 16:09:08 2012 From: report at bugs.python.org (Pierre Lecointre) Date: Fri, 16 Mar 2012 15:09:08 +0000 Subject: [issue14317] index.simple module lacking in distutils2 In-Reply-To: <1331827723.59.0.865750946209.issue14317@psf.upfronthosting.co.za> Message-ID: Pierre Lecointre added the comment: Un grand merci pour cette r?ponse ! La substitution index par pypi a fonctionn?. Bon week-end 2012/3/15 Alexis Metaireau > > Alexis Metaireau added the comment: > > The APIs of distutils2 have changed. the "index" module is now named > "pypi". > > So, doing something like:: > > >>> from distutils2.pypi.simple import Crawler > > should work. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 16:09:13 2012 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 16 Mar 2012 15:09:13 +0000 Subject: [issue14334] Crash: getattr(type, '__getattribute__')(type, type) In-Reply-To: <1331901221.34.0.872170817389.issue14334@psf.upfronthosting.co.za> Message-ID: <1331910553.31.0.635735364521.issue14334@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: well, on 2.6 and 2.7 the following has weird output and crashes: def test(obj): try: type(obj).__getattribute__(obj, (1,)) except AttributeError as e: print(e) class C: pass test(str) test(C) test(C()) ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 16:13:13 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 16 Mar 2012 15:13:13 +0000 Subject: [issue14296] Compilation error on CentOS 5.8 In-Reply-To: <1331910498.75.0.631788308615.issue14296@psf.upfronthosting.co.za> Message-ID: Benjamin Peterson added the comment: 2012/3/16 Herv? Coatanhay : > > Herv? Coatanhay added the comment: > > I still have the exact same error > > Maybe change should be: > > #if !defined(CPU_ALLOC) && defined(HAVE_SCHED_SETAFFINITY) > #undef HAVE_SCHED_SETAFFINITY > #endif Right you are. Try now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 16:13:41 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 15:13:41 +0000 Subject: [issue14296] Compilation error on CentOS 5.8 In-Reply-To: <1331688181.08.0.800421526529.issue14296@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 17980cb07625 by Benjamin Peterson in branch 'default': fix condition (#14296) http://hg.python.org/cpython/rev/17980cb07625 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 16:22:25 2012 From: report at bugs.python.org (R. David Murray) Date: Fri, 16 Mar 2012 15:22:25 +0000 Subject: [issue14261] Cleanup in smtpd module In-Reply-To: <1331553850.91.0.315576733805.issue14261@psf.upfronthosting.co.za> Message-ID: <1331911345.21.0.547207677605.issue14261@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- dependencies: +Update to smtpd.py to RFC 5321 stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 16:35:29 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 15:35:29 +0000 Subject: [issue14202] The docs of xml.dom.pulldom are almost nonexistent In-Reply-To: <1330964719.2.0.249901769319.issue14202@psf.upfronthosting.co.za> Message-ID: <1331912129.4.0.082455495118.issue14202@psf.upfronthosting.co.za> ?ric Araujo added the comment: I understand :) I?ll do it. I value doc as much as code, it?s also delivered faster to the users, and there are a lot of Python 2 users out there, so porting doc fixes to 2.7 is really worth it. ---------- assignee: docs at python -> eric.araujo status: closed -> open versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 16:58:58 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 15:58:58 +0000 Subject: [issue14334] Crash: getattr(type, '__getattribute__')(type, type) In-Reply-To: <1331901221.34.0.872170817389.issue14334@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 3d4d52e47431 by Benjamin Peterson in branch '2.7': check for string attribute names in old-style classes (closes #14334) http://hg.python.org/cpython/rev/3d4d52e47431 ---------- stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 17:50:47 2012 From: report at bugs.python.org (Jakub Wilk) Date: Fri, 16 Mar 2012 16:50:47 +0000 Subject: [issue13512] ~/.pypirc created insecurely In-Reply-To: <1322695403.24.0.389183798564.issue13512@psf.upfronthosting.co.za> Message-ID: <1331916647.08.0.472665082358.issue13512@psf.upfronthosting.co.za> Changes by Jakub Wilk : ---------- nosy: +jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 17:55:22 2012 From: report at bugs.python.org (Stefan Krah) Date: Fri, 16 Mar 2012 16:55:22 +0000 Subject: [issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist In-Reply-To: <1331835760.38.0.280902502881.issue14325@psf.upfronthosting.co.za> Message-ID: <1331916922.17.0.570713819513.issue14325@psf.upfronthosting.co.za> Stefan Krah added the comment: I'm getting a leak since this revision: ./configure --without-pymalloc CFLAGS="-O0 -g" && make valgrind --db-attach=yes --suppressions=./Misc/valgrind-python.supp --leak-check=full ./python leak.py ==32303== 16 bytes in 1 blocks are definitely lost in loss record 3 of 2,489 ==32303== at 0x4C27878: malloc (vg_replace_malloc.c:236) ==32303== by 0x41DDB0: PyMem_Malloc (object.c:1841) ==32303== by 0x4A72BF: vgetargskeywords (getargs.c:1432) ==32303== by 0x4A6E1C: PyArg_ParseTupleAndKeywords (getargs.c:1301) ==32303== by 0x55D1C8: float_new (floatobject.c:1557) ==32303== by 0x42B643: type_call (typeobject.c:708) ==32303== by 0x532A9F: PyObject_Call (abstract.c:2150) ==32303== by 0x491483: do_call (ceval.c:4260) ==32303== by 0x490A33: call_function (ceval.c:4063) ==32303== by 0x48BD49: PyEval_EvalFrameEx (ceval.c:2662) ==32303== by 0x48EA11: PyEval_EvalCodeEx (ceval.c:3414) ==32303== by 0x482FC6: PyEval_EvalCode (ceval.c:771) ---------- nosy: +skrah status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 17:56:42 2012 From: report at bugs.python.org (Stefan Krah) Date: Fri, 16 Mar 2012 16:56:42 +0000 Subject: [issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist In-Reply-To: <1331835760.38.0.280902502881.issue14325@psf.upfronthosting.co.za> Message-ID: <1331917002.22.0.732510585232.issue14325@psf.upfronthosting.co.za> Stefan Krah added the comment: Here's leak.py. ---------- Added file: http://bugs.python.org/file24890/leak.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 18:15:56 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 17:15:56 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1331918156.87.0.903875035617.issue12568@psf.upfronthosting.co.za> ?ric Araujo added the comment: eo ---------- nosy: +benjamin.peterson, eric.araujo, lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 18:16:13 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 17:16:13 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1331918173.23.0.275776948831.issue12568@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- Removed message: http://bugs.python.org/msg156059 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 18:32:26 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 16 Mar 2012 17:32:26 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1331919146.02.0.329699534094.issue14328@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Shouldn't using vgetargs1 with '$' in the format string just be an error? vgetargs1 doesn't know anything about keyword arguments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 19:01:25 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Mar 2012 18:01:25 +0000 Subject: [issue14332] Better explain "junk" concept in difflib doc In-Reply-To: <1331877125.66.0.103153393744.issue14332@psf.upfronthosting.co.za> Message-ID: <1331920885.34.0.290502995381.issue14332@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I reproduced the observed behavior in 3.3.0a. However, I am rather sure it is not a bug. In any case, linejunk is not ignored. Passing 'lambda x: 1/0' causes ZeroDivisionError, proving that it gets called. The body of ndiff(linejunk,charjunk,a,b) is return Differ(linejunk, charjunk).compare(a, b) Differ only uses the linejunk parameter here cruncher = SequenceMatcher(self.linejunk, a, b) SequenceMatcher uses the first parameter, isjunk, in the internal .__chain_b method to segregate (not remove) items expected to be common in order to speed up the .find_longest_match method. Read the docstring for that method (and possibly the code) to see how it affects matching. The main intent of the *junk parameters is to speed up matching to find differences, not to mask differences. It does, however, affect output of the .*ratio methods. The doc string for ndiff says "The default is None, and is recommended; as of Python 2.3, an adaptive notion of "noise" lines is used that does a good job on its own." That is a good idea. That said, I think the doc (and docstrings) should explain the notion of "junk" elements and what 'ignoring' them means. In particular, I think a couple of sentences should be added after "The idea is to find the longest contiguous matching subsequence that contains no ?junk? elements (the Ratcliff and Obershelp algorithm doesn?t address junk)." The quotes around "junk" indicate that it is being used with a non-standard, module specific meaning. What is it? And what does 'ignore' (used several times later in the doc) mean? Tim, I think we may need your help here since 'junk' is your label for your concept and I am not sure I understand well enough to articulate it. (For one thing, given that the "common" heuristic was apparently meant to replace at least the linejunk version version of junk, I do not understand why .get_longest_match treats 'junk' and 'common' items differently, other than that the two concepts are apparently not the same.) ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python, eli.bendersky stage: -> needs patch title: difflib.ndiff appears to ignore linejunk argument -> Better explain "junk" concept in difflib doc versions: +Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 19:05:31 2012 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 16 Mar 2012 18:05:31 +0000 Subject: [issue14309] Deprecate time.clock() In-Reply-To: Message-ID: <4F6380E9.7060905@egenix.com> Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > >> time.clock() has been in use for ages in many many scripts. >> We don't want to carelessly break all those. > > I don't want to remove the function, just mark it as deprecated to > avoid confusion. It will only be removed from the next major Python. Why ? There's no other single function providing the same functionality, so it's not even a candidate for deprecation. Similar functionality is available via several different functions, but that's true for a lot functions in th stdlib. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 19:09:57 2012 From: report at bugs.python.org (Glenn Linderman) Date: Fri, 16 Mar 2012 18:09:57 +0000 Subject: [issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO In-Reply-To: <1290324717.4.0.0270982528857.issue10484@psf.upfronthosting.co.za> Message-ID: <1331921397.28.0.613331169442.issue10484@psf.upfronthosting.co.za> Glenn Linderman added the comment: Senthil, from you patch, I discovered where the test_httpservers.py lives, and added '/cgi-bin/file1.py/../../a': ('/', 'a'), to a local copy, and it worked fine against whatever version of the server and tests it was running against... but that was in test_url_collapse_path_split ... I haven't figured out the full environment of the testing, or even if it launches an HTTP SERVER or only unittests particular functions within it, but it seems that that particular test is just testing the one function. I'm not clear on where the tests actually test the activities of is_cgi or the creation of PATH_INFO, if that occurs. What time I've spent working with Python can be characterized as 99% application, 0.999% Python source to figure out how things work (or fail), .001% test environment (just now). So I'm pretty ignorant of the test environment, although I've spent 30+ years programming, only about 4 has been in Python, and that not full time. It is not clear to me, though, that the test you added: '/cgi-bin/file1.py/PATH-INFO': ('/cgi-bin', 'file1.py/PATH-INFO'), should be the expected results of _url_collapse_path_split... I would expect '/cgi-bin/file1.py/a/b/c/../../d': ('/cgi-bin/file1.py/a', 'd'), but I don't think it would, with your present patch. It looks like it would return ('/cgi-bin', 'file1.py/a/b/c/../../d') which reintroduces the security problem: the '..' stuff has not been processed. I haven't applied your patch to actually run it, this is just from inspection, and I may have missed something. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 19:13:52 2012 From: report at bugs.python.org (Glenn Linderman) Date: Fri, 16 Mar 2012 18:13:52 +0000 Subject: [issue14313] zipfile does not unpack files from archive (files extracted have zero length) In-Reply-To: <1331786135.76.0.307574406169.issue14313@psf.upfronthosting.co.za> Message-ID: <1331921632.23.0.539592274171.issue14313@psf.upfronthosting.co.za> Glenn Linderman added the comment: While Amaury's comment is no doubt true, shouldn't z.read raise an exception if it encounters an unsupported compression type? ---------- nosy: +v+python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 19:15:01 2012 From: report at bugs.python.org (Weronika Patena) Date: Fri, 16 Mar 2012 18:15:01 +0000 Subject: [issue14332] Better explain "junk" concept in difflib doc In-Reply-To: <1331877125.66.0.103153393744.issue14332@psf.upfronthosting.co.za> Message-ID: <1331921701.06.0.454694922219.issue14332@psf.upfronthosting.co.za> Weronika Patena added the comment: Ah, I see. True, the ndiff docstring doesn't actually explain what junk IS - I was just engaging in wishful thinking and assuming it did the thing I wanted. A better explanation would help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 19:26:10 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 18:26:10 +0000 Subject: [issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist In-Reply-To: <1331835760.38.0.280902502881.issue14325@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset d08f0f3ab23e by Benjamin Peterson in branch 'default': plug memory leak (closes #14325) http://hg.python.org/cpython/rev/d08f0f3ab23e ---------- stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 19:57:38 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Mar 2012 18:57:38 +0000 Subject: [issue14245] float rounding examples in FAQ are outdated In-Reply-To: <1331372112.92.0.532785259032.issue14245@psf.upfronthosting.co.za> Message-ID: <1331924258.05.0.952408711229.issue14245@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The last version in the message above looks good to me. Ready to markup and apply? ---------- keywords: +patch nosy: +terry.reedy stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 20:03:39 2012 From: report at bugs.python.org (sbt) Date: Fri, 16 Mar 2012 19:03:39 +0000 Subject: [issue14336] Difference between pickle implementations for function objects Message-ID: <1331924619.34.0.890923032137.issue14336@psf.upfronthosting.co.za> New submission from sbt : When pickling a function object, if it cannot be saved as a global the C implementation falls back to using copyreg/__reduce__/__reduce_ex__. The comment for the changeset which added this fallback claims that it is for compatibility with the Python implementation. See http://hg.python.org/cpython/rev/c6753db9c6af However, the current python implementations do not have any such fallback. This affects both 2.x and 3.x. For example Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import pickle, cPickle, copy_reg >>> def f(): ... pass ... >>> _f = f >>> del f >>> copy_reg.pickle(type(_f), lambda obj: (str, ("FALLBACK",))) >>> cPickle.dumps(_f) "c__builtin__\nstr\np1\n(S'FALLBACK'\np2\ntp3\nRp4\n." >>> pickle.dumps(_f) Traceback (most recent call last): File "", line 1, in File "c:\Python27\lib\pickle.py", line 1374, in dumps Pickler(file, protocol).dump(obj) File "c:\Python27\lib\pickle.py", line 224, in dump self.save(obj) File "c:\Python27\lib\pickle.py", line 286, in save f(self, obj) # Call unbound method with explicit self File "c:\Python27\lib\pickle.py", line 748, in save_global (obj, module, name)) pickle.PicklingError: Can't pickle : it's not found as __main__.f I don't know what should be done. I would be tempted to always fall back to copyreg/__reduce__/__reduce_ex__ when save_global fails (not just for function objects) but that might make error messages less helpful. ---------- components: Library (Lib) messages: 156069 nosy: sbt priority: normal severity: normal status: open title: Difference between pickle implementations for function objects type: behavior versions: Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 20:03:57 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Mar 2012 19:03:57 +0000 Subject: [issue14250] for string patterns regex.flags is never equal to 0 In-Reply-To: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> Message-ID: <1331924637.32.0.876942946311.issue14250@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 20:21:16 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Mar 2012 19:21:16 +0000 Subject: [issue14297] Custom string formatter doesn't work like builtin str.format In-Reply-To: <1331690580.32.0.967691211794.issue14297@psf.upfronthosting.co.za> Message-ID: <1331925676.31.0.116563267553.issue14297@psf.upfronthosting.co.za> Terry J. Reedy added the comment: We know that string.Formatter does not properly duplicate str.format. #13598 is specifically about use of {}. Search "string Formatter" for other related issues. ---------- nosy: +terry.reedy resolution: -> duplicate status: open -> closed superseder: -> string.Formatter doesn't support empty curly braces "{}" _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 20:32:04 2012 From: report at bugs.python.org (Stefan Krah) Date: Fri, 16 Mar 2012 19:32:04 +0000 Subject: [issue14337] test_builtin: refleaks Message-ID: <1331926323.93.0.0839449921053.issue14337@psf.upfronthosting.co.za> New submission from Stefan Krah : I don't see immediately why, but since 3877bf2e323 test_builtin and a couple of other tests leak in refcounting mode: hg up 8a5742b7a14d make distclean && ./configure --with-pydebug && make ./python -m test -uall -R :: test_builtin [1/1] test_builtin beginning 9 repetitions 123456789 ......... 1 test OK. [154630 refs] hg up 3877bf2e323 make distclean && ./configure --with-pydebug && make ./python -m test -uall -R :: test_builtin [1/1] test_builtin beginning 9 repetitions 123456789 ......... test_builtin leaked [880, 880, 880, 880] references, sum=3520 1 test failed: test_builtin [163380 refs] ---------- components: Tests messages: 156071 nosy: benjamin.peterson, skrah priority: normal severity: normal status: open title: test_builtin: refleaks type: resource usage versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 20:37:21 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 16 Mar 2012 19:37:21 +0000 Subject: [issue14337] test_builtin: refleaks In-Reply-To: <1331926323.93.0.0839449921053.issue14337@psf.upfronthosting.co.za> Message-ID: <1331926641.41.0.577892966763.issue14337@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Yes, see 9e7f6ddc0d76 for the fix. ---------- resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 20:38:19 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 16 Mar 2012 19:38:19 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN In-Reply-To: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> Message-ID: <1331926699.92.0.733217547029.issue14331@psf.upfronthosting.co.za> Gregory P. Smith added the comment: It looks like MAXPATHLEN is 4096 on our systems. The offending code that caused a stack overflow segfault shows over 100 Python/import.c function calls in its backtrace. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 20:56:10 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Mar 2012 19:56:10 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1331927770.04.0.811920013282.issue14269@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 21:08:33 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Mar 2012 20:08:33 +0000 Subject: [issue14306] try/except block is both efficient and expensive? In-Reply-To: <1331761279.09.0.327606618026.issue14306@psf.upfronthosting.co.za> Message-ID: <1331928513.38.0.276806379325.issue14306@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I think it would be sufficient to add ' if no exceptions are raised' to the first sentence. The example that follows in the entry clarifies the implications of "cheap to try, expensive to catch". ---------- keywords: +patch nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 21:17:56 2012 From: report at bugs.python.org (R. David Murray) Date: Fri, 16 Mar 2012 20:17:56 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1331929076.93.0.414447734881.issue14269@psf.upfronthosting.co.za> R. David Murray added the comment: Thanks for the patch. I think this is fine. An alternate approach would be to introduce the concept of a state (like imaplib has), have a list of which commands are allowed in which state, and implement the check in the command processing function, but that may not be worth it at smtpd's current level of complexity. One change I'd like to see in the patch (and test): postfix in this case responds: 503 Error: send HELO/EHLO first And I think that is more useful than the text 'Bad sequence of commands'. ---------- nosy: +r.david.murray stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 21:19:34 2012 From: report at bugs.python.org (R. David Murray) Date: Fri, 16 Mar 2012 20:19:34 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1331929174.99.0.932224354071.issue14269@psf.upfronthosting.co.za> R. David Murray added the comment: Oh, by the way the mention of EHLO in that message depends on issue 8739 going in. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 21:19:45 2012 From: report at bugs.python.org (Stefan Krah) Date: Fri, 16 Mar 2012 20:19:45 +0000 Subject: [issue14337] Recent refleaks In-Reply-To: <1331926323.93.0.0839449921053.issue14337@psf.upfronthosting.co.za> Message-ID: <1331929185.71.0.801923700856.issue14337@psf.upfronthosting.co.za> Stefan Krah added the comment: Ah, thanks for the pointer. 9e7f6ddc0d76 is clean, but default still leaks. Next attempt: OK: d2460ff173ff Leak: 3b2856d8614b test_dict leaked [12, 12] references, sum=24 test_builtin leaked [24, 24] references, sum=48 test_unittest leaked [970, 970] references, sum=1940 test_doctest leaked [351, 351] references, sum=702 test_doctest2 leaked [50, 50] references, sum=100 ---------- resolution: out of date -> status: closed -> open title: test_builtin: refleaks -> Recent refleaks _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 21:23:32 2012 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Mar 2012 20:23:32 +0000 Subject: [issue14311] ConfigParser does not parse utf-8 files with BOM bytes In-Reply-To: <1331778292.28.0.574531846286.issue14311@psf.upfronthosting.co.za> Message-ID: <1331929412.91.0.399384507946.issue14311@psf.upfronthosting.co.za> ?ukasz Langa added the comment: What you considered a workaround is actually what you should be using faced with BOM bytes. This is a broader issue in Python, not necessarily connected with ConfigParser or any other library. Also, this has been already reported here: http://bugs.python.org/issue7519 For the UTF-8 BOM context please see: http://bugs.python.org/issue7651 To solve the actual problem we should really do something about that last issue. If you have any further questions, please ask. If not, I will close this issue. ---------- assignee: -> lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 21:25:01 2012 From: report at bugs.python.org (beeNuts) Date: Fri, 16 Mar 2012 20:25:01 +0000 Subject: [issue14338] urllib2 HowTo for overriding post/3xx behavior. Message-ID: <1331929501.86.0.889924099512.issue14338@psf.upfronthosting.co.za> New submission from beeNuts : Issue #14144, with the title "urllib2 HTTPRedirectHandler not forwarding POST data in redirect" was recently closed with these comments: "This could be cookbook recipe style example, if it's utility value is high. I am closing this issue as I feel that the requirement may not be addressed by a change. If there is patch for HowTo, we can tackle that in another issue. Thank you for contribution." The decision that documents on this issue were preferable to a patch seems like a fair compromise, especially considering that the RFC is decidedly ambiguous.I was wondering if the HowTo would be forthcoming? It seems to me that the value/utility would certainly be high. I'd submit it myself but I'm so new to Python that I don't trust my ability to do it correctly. It's something I would find highly useful, though. ---------- assignee: docs at python components: Documentation messages: 156080 nosy: beerNuts, docs at python priority: normal severity: normal status: open title: urllib2 HowTo for overriding post/3xx behavior. versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 21:25:17 2012 From: report at bugs.python.org (beeNuts) Date: Fri, 16 Mar 2012 20:25:17 +0000 Subject: [issue14338] urllib2 HowTo for overriding post/3xx behavior. In-Reply-To: <1331929501.86.0.889924099512.issue14338@psf.upfronthosting.co.za> Message-ID: <1331929518.0.0.757978427519.issue14338@psf.upfronthosting.co.za> Changes by beeNuts : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 21:37:24 2012 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 16 Mar 2012 20:37:24 +0000 Subject: [issue14245] float rounding examples in FAQ are outdated In-Reply-To: <1331372112.92.0.532785259032.issue14245@psf.upfronthosting.co.za> Message-ID: <1331930244.2.0.236102179825.issue14245@psf.upfronthosting.co.za> Mark Dickinson added the comment: Fine by me. Language nitpick: "approximation to" sounds a bit better to my ears than "approximation of" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 21:46:23 2012 From: report at bugs.python.org (Brett Cannon) Date: Fri, 16 Mar 2012 20:46:23 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN In-Reply-To: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> Message-ID: <1331930783.15.0.936363242252.issue14331@psf.upfronthosting.co.za> Brett Cannon added the comment: Cursory glance has the patch LGTM. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 21:48:26 2012 From: report at bugs.python.org (Jason Killen) Date: Fri, 16 Mar 2012 20:48:26 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1331930906.79.0.710133344419.issue14269@psf.upfronthosting.co.za> Jason Killen added the comment: On using a different approach: I weighed an approach like that and decided to go with what I thought was the clean/simple/easy approach. If there were more commands that smptd.py accepted I would have probably gone with more like what you mentioned. Change in error text: That's fine with me. I don't really care what it says. I'll make the change and generate a new patch but won't be able to get it done until Monday. Given that the inclusion of EHLO in the error text depends on another patch should I include EHLO, and maybe have to remove it later, or leave it out now and maybe have to put it in later? 2 patches, maybe, and we can pick when the time comes? So when patches like this get applied? If that's covered in an FAQ someplace please point me to it, I'm interested in some of the details. I poked around a bit but couldn't find what I was looking for. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 21:56:45 2012 From: report at bugs.python.org (R. David Murray) Date: Fri, 16 Mar 2012 20:56:45 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1331931405.89.0.977902405974.issue14269@psf.upfronthosting.co.za> R. David Murray added the comment: When do patches get applied? The general answer is "when someone gets around to it" :) In this particular case the issue 8739 patch is waiting on the resolution of its dependency (logging uses smtpd in its tests, and the 8739 patch breaks the logging test). The fix for that issue is a bit ugly, so I haven't decided if I'm ready to apply that or not yet. For now, just leave the EHLO out. We can then apply this patch, and update the 8739 patch to include the addition of the EHLO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 22:09:31 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Mar 2012 21:09:31 +0000 Subject: [issue14339] Optimizing bin, oct and hex Message-ID: <1331932171.45.0.56771909125.issue14339@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : This patch slightly optimize conversion int to string with base 2, 8 or 16 by calculating exactly number of digits and avoiding unnecessary memory allocation. The code is similar to used for decimal conversion. Without patch: $ ./python -m timeit -s 'x=1' 'bin(x)' 1000000 loops, best of 3: 0.295 usec per loop $ ./python -m timeit -s 'x=1' 'oct(x)' 1000000 loops, best of 3: 0.327 usec per loop $ ./python -m timeit -s 'x=1' 'hex(x)' 1000000 loops, best of 3: 0.298 usec per loop $ ./python -m timeit -s 'x=9**999' 'bin(x)' 100000 loops, best of 3: 11.9 usec per loop $ ./python -m timeit -s 'x=9**999' 'oct(x)' 100000 loops, best of 3: 4.55 usec per loop $ ./python -m timeit -s 'x=9**999' 'hex(x)' 100000 loops, best of 3: 3.99 usec per loop With patch: $ ./python -m timeit -s 'x=1' 'bin(x)' 1000000 loops, best of 3: 0.213 usec per loop $ ./python -m timeit -s 'x=1' 'oct(x)' 1000000 loops, best of 3: 0.228 usec per loop $ ./python -m timeit -s 'x=1' 'hex(x)' 1000000 loops, best of 3: 0.215 usec per loop $ ./python -m timeit -s 'x=9**999' 'bin(x)' 100000 loops, best of 3: 9.76 usec per loop $ ./python -m timeit -s 'x=9**999' 'oct(x)' 100000 loops, best of 3: 3.58 usec per loop $ ./python -m timeit -s 'x=9**999' 'hex(x)' 100000 loops, best of 3: 3.3 usec per loop ---------- components: Library (Lib) files: long_to_binary_base.patch keywords: patch messages: 156085 nosy: storchaka priority: normal severity: normal status: open title: Optimizing bin, oct and hex type: performance versions: Python 3.3 Added file: http://bugs.python.org/file24891/long_to_binary_base.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 22:21:55 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 16 Mar 2012 21:21:55 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: <1331932915.29.0.218585839642.issue14234@psf.upfronthosting.co.za> Gregory P. Smith added the comment: I'm opening another issue to track updating the embedded copy of expat within Python. FWIW, Python 2.7 & 3.2 and later support a --with-system-expat option which is what I'd *hope* that any OS distro is building their Python with rather than using the older out of date embedded copy of expat (which appears to be derived from expat 2.0.0). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 22:28:26 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 16 Mar 2012 21:28:26 +0000 Subject: [issue14340] Update embedded copy of expat - fix security & crash issues Message-ID: <1331933306.8.0.658837557797.issue14340@psf.upfronthosting.co.za> New submission from Gregory P. Smith : As pointed out in #14234, our embedded copy of expat used by pyexpat for xml parsing in Modules/expat/ is out of date. There have been many fixes to expat that we have not applied including a few potential crash and security fixes. We should upgrade it wholesale to the latest version for 3.3. Someone should also audit expat changes to see if there are security fixes for expat that should be backported to 2.6/2.7/3.1/3.2 as platforms without a system expat such as Windows (and 2.6 and 3.1) will contain those problems. I am marking this a release blocker for 3.3 to ensure expat is updated before then. I would *not* hold up the existing round of release candidates for this, the next security+bugfix updates can contain these changes. ---------- components: Extension Modules messages: 156087 nosy: Arfrever, Jim.Jewett, amaury.forgeotdarc, barry, benjamin.peterson, dmalcolm, georg.brandl, gregory.p.smith, pitrou priority: release blocker severity: normal status: open title: Update embedded copy of expat - fix security & crash issues type: security versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 22:47:17 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 16 Mar 2012 21:47:17 +0000 Subject: [issue12338] multiprocessing.util._eintr_retry doen't recalculate timeouts In-Reply-To: <1308144268.86.0.218604754177.issue12338@psf.upfronthosting.co.za> Message-ID: <1331934437.7.0.163932295069.issue12338@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > _eintr_retry is currently unused. AFAICT it's still used in forking.py. ---------- versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 22:53:50 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Mar 2012 21:53:50 +0000 Subject: [issue14315] zipfile.ZipFile() unable to open zip File In-Reply-To: <1331810146.14.0.995585507713.issue14315@psf.upfronthosting.co.za> Message-ID: <1331934830.19.0.842805081947.issue14315@psf.upfronthosting.co.za> Terry J. Reedy added the comment: .apk is primarily used for Android Package files https://en.wikipedia.org/wiki/APK_%28file_format%29 which are zipped JAR-based archives. By changing .apk to .zip, I can open the file in Win7 explorer, which has zip built in. A 'crash' is a segfault or equvalent. A traceback is a graceful shutdown and not a crash. I reproduced the traceback on 3.3.0a1. It appears to say that there are not enough bytes. import struct struct.unpack(' behavior versions: +Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 23:02:08 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Mar 2012 22:02:08 +0000 Subject: [issue14323] Normalize math precision in RGB/YIQ conversion In-Reply-To: <1331831977.5.0.174772346075.issue14323@psf.upfronthosting.co.za> Message-ID: <1331935328.53.0.880801986321.issue14323@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The idea seems reasonable. Do you have a link or reference to a Matlab doc with the coefficients? Enhancements only go in new versions. ---------- nosy: +terry.reedy versions: -Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 23:28:42 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 16 Mar 2012 22:28:42 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN In-Reply-To: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> Message-ID: <1331936922.58.0.197847302467.issue14331@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Updated per review (style changes). ---------- Added file: http://bugs.python.org/file24892/malloc-import-pathbufs-py27.002.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 23:35:24 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 16 Mar 2012 22:35:24 +0000 Subject: [issue14340] Update embedded copy of expat - fix security & crash issues In-Reply-To: <1331933306.8.0.658837557797.issue14340@psf.upfronthosting.co.za> Message-ID: <1331937324.3.0.322767587997.issue14340@psf.upfronthosting.co.za> Benjamin Peterson added the comment: What would be awesome is if we could just kill embedded versions of libraries like expat. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 23:37:27 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 16 Mar 2012 22:37:27 +0000 Subject: [issue14340] Update embedded copy of expat - fix security & crash issues In-Reply-To: <1331933306.8.0.658837557797.issue14340@psf.upfronthosting.co.za> Message-ID: <1331937447.51.0.321014240557.issue14340@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Indeed! How do we do that on windows and osx where these may not exist outside of Python? We already require a set of external dependency libraries on windows, could we just add expat to the list? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 23:37:58 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 16 Mar 2012 22:37:58 +0000 Subject: [issue14340] Update embedded copy of expat - fix security & crash issues In-Reply-To: <1331937324.3.0.322767587997.issue14340@psf.upfronthosting.co.za> Message-ID: <1331937207.3977.3.camel@localhost.localdomain> Antoine Pitrou added the comment: > What would be awesome is if we could just kill embedded versions of libraries like expat. It practically wouldn't change much, since we still bundle them as part of Windows binaries. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 23:42:35 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 16 Mar 2012 22:42:35 +0000 Subject: [issue14340] Update embedded copy of expat - fix security & crash issues In-Reply-To: <1331933306.8.0.658837557797.issue14340@psf.upfronthosting.co.za> Message-ID: <1331937755.28.0.399441551766.issue14340@psf.upfronthosting.co.za> Gregory P. Smith added the comment: It is much less effort for us to simply take a new version of an external library and recompile rather than consider it part of our code that shouldn't change within a release and manually deal with patching it and cherry picking patches onto it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 16 23:47:47 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 16 Mar 2012 22:47:47 +0000 Subject: [issue13903] New shared-keys dictionary implementation In-Reply-To: <1327847206.97.0.499643364955.issue13903@psf.upfronthosting.co.za> Message-ID: <1331938067.18.0.803112976105.issue13903@psf.upfronthosting.co.za> Antoine Pitrou added the comment: The latest patch has a significant (negative) effect on some benchmarks: ### silent_logging ### Min: 0.057927 -> 0.068228: 1.18x slower Avg: 0.058218 -> 0.068660: 1.18x slower Significant (t=-36.06) ### mako ### Min: 0.118240 -> 0.140451: 1.19x slower Avg: 0.120145 -> 0.142422: 1.19x slower Significant (t=-61.66) These regressions should be fixed before going any further, IMO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:06:02 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 23:06:02 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1331939162.19.0.612544046286.issue14302@psf.upfronthosting.co.za> ?ric Araujo added the comment: IIUC this is about two changes: - Moving python.exe to the scripts subdirectory instead of the top-level install dir - Renaming that subdir from Scripts to bin The first change will reduce the number of dirs to add to PATH from two to one, which sounds nice; the second is more controversial, as shown by the current python-dev discussion. I am also not sure of the risks if we make an exception to the distutils freeze. ---------- nosy: +eric.araujo, loewis, mhammond, tim.golden _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:09:50 2012 From: report at bugs.python.org (Brian Landers) Date: Fri, 16 Mar 2012 23:09:50 +0000 Subject: [issue14323] Normalize math precision in RGB/YIQ conversion In-Reply-To: <1331831977.5.0.174772346075.issue14323@psf.upfronthosting.co.za> Message-ID: <1331939390.21.0.422081850388.issue14323@psf.upfronthosting.co.za> Brian Landers added the comment: Matlab docs are here: - http://www.mathworks.com/help/toolbox/images/ref/rgb2ntsc.html - http://www.mathworks.com/help/toolbox/images/ref/ntsc2rgb.html Should these be referenced in the source itself? re new versions: sure, I'll create a separate patch for adding the tests to the maintenance releases so there's coverage there, too. Should that have a new bug as well? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:11:09 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 16 Mar 2012 23:11:09 +0000 Subject: [issue2377] Replace __import__ w/ importlib.__import__ In-Reply-To: <1205808012.99.0.46136974085.issue2377@psf.upfronthosting.co.za> Message-ID: <1331939469.32.0.11437517709.issue2377@psf.upfronthosting.co.za> Antoine Pitrou added the comment: There are also reference leaks: $ ./python -m test -R 3:2 test_bz2 [1/1] test_bz2 beginning 5 repetitions 12345 ..... test_bz2 leaked [-1, -1] references, sum=-2 $ ./python -m test -R 3:2 test_hashlib [1/1] test_hashlib beginning 5 repetitions 12345 ..... test_hashlib leaked [-1, -1] references, sum=-2 1 test failed: test_hashlib $ ./python -m test -R 3:2 test_capi [1/1] test_capi beginning 5 repetitions 12345 ..... test_capi leaked [78, 78] references, sum=156 1 test failed: test_capi ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:13:29 2012 From: report at bugs.python.org (Thomas Wouters) Date: Fri, 16 Mar 2012 23:13:29 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN In-Reply-To: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> Message-ID: <1331939609.29.0.981292401423.issue14331@psf.upfronthosting.co.za> Thomas Wouters added the comment: For the record, as I said in the review of 002.diff: LGTM. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:16:32 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 23:16:32 +0000 Subject: [issue14335] Reimplement multiprocessing's ForkingPickler using dispatch_table In-Reply-To: <1331906688.53.0.0988257452578.issue14335@psf.upfronthosting.co.za> Message-ID: <1331939792.08.0.883723120738.issue14335@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +alexandre.vassalotti, jnoller, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:18:24 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 23:18:24 +0000 Subject: [issue14313] zipfile does not unpack files from archive (files extracted have zero length) In-Reply-To: <1331786135.76.0.307574406169.issue14313@psf.upfronthosting.co.za> Message-ID: <1331939904.88.0.418755193976.issue14313@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +alanmcintyre, eric.araujo stage: needs patch -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:20:22 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 23:20:22 +0000 Subject: [issue14313] zipfile should raise an exception for unsupported compression methods In-Reply-To: <1331786135.76.0.307574406169.issue14313@psf.upfronthosting.co.za> Message-ID: <1331940022.87.0.14149116585.issue14313@psf.upfronthosting.co.za> ?ric Araujo added the comment: The requested change is arguably a new feature, but it seems to me that the current behavior is not acceptable and should be changed. ---------- title: zipfile does not unpack files from archive (files extracted have zero length) -> zipfile should raise an exception for unsupported compression methods versions: +Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:20:51 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 23:20:51 +0000 Subject: [issue14336] Difference between pickle implementations for function objects In-Reply-To: <1331924619.34.0.890923032137.issue14336@psf.upfronthosting.co.za> Message-ID: <1331940051.19.0.343477168066.issue14336@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +alexandre.vassalotti, pitrou versions: +Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:22:22 2012 From: report at bugs.python.org (Brian Curtin) Date: Fri, 16 Mar 2012 23:22:22 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1331940142.75.0.0946351107774.issue14302@psf.upfronthosting.co.za> Brian Curtin added the comment: If that thread ever comes to a conclusion, can someone summarize it here? Also, is there a reason distutils even matters here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:22:46 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 23:22:46 +0000 Subject: [issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect In-Reply-To: <1330382649.62.0.524230876085.issue14144@psf.upfronthosting.co.za> Message-ID: <1331940166.12.0.330149625784.issue14144@psf.upfronthosting.co.za> ?ric Araujo added the comment: Continued in #14338. ---------- resolution: invalid -> works for me stage: patch review -> committed/rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:23:00 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 16 Mar 2012 23:23:00 +0000 Subject: [issue14337] Recent refleaks In-Reply-To: <1331926323.93.0.0839449921053.issue14337@psf.upfronthosting.co.za> Message-ID: <1331940180.97.0.353591336998.issue14337@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Okay, hopefuly fixed now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:28:45 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 16 Mar 2012 23:28:45 +0000 Subject: [issue14335] Reimplement multiprocessing's ForkingPickler using dispatch_table In-Reply-To: <1331906688.53.0.0988257452578.issue14335@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset b2a8310de718 by Antoine Pitrou in branch 'default': Issue #14335: multiprocessing's custom Pickler subclass now inherits from the C-accelerated implementation. http://hg.python.org/cpython/rev/b2a8310de718 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:29:42 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 16 Mar 2012 23:29:42 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN In-Reply-To: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> Message-ID: <1331940582.51.0.483463748303.issue14331@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Updated to use PyErr_NoMemory(). Thanks Antoine! I'm now working on this for 3.2 as well before I commit. ---------- Added file: http://bugs.python.org/file24893/malloc-import-pathbufs-py27.003.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:31:07 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 16 Mar 2012 23:31:07 +0000 Subject: [issue14335] Reimplement multiprocessing's ForkingPickler using dispatch_table In-Reply-To: <1331906688.53.0.0988257452578.issue14335@psf.upfronthosting.co.za> Message-ID: <1331940667.55.0.264170110138.issue14335@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Thanks for this! Committed now. ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:33:08 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 16 Mar 2012 23:33:08 +0000 Subject: [issue14339] Optimizing bin, oct and hex In-Reply-To: <1331932171.45.0.56771909125.issue14339@psf.upfronthosting.co.za> Message-ID: <1331940788.4.0.859197529327.issue14339@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- components: +Interpreter Core -Library (Lib) nosy: +mark.dickinson, skrah stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:33:27 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 23:33:27 +0000 Subject: [issue14338] Document how to forward POST data on redirects In-Reply-To: <1331929501.86.0.889924099512.issue14338@psf.upfronthosting.co.za> Message-ID: <1331940807.3.0.227791892393.issue14338@psf.upfronthosting.co.za> ?ric Araujo added the comment: The idea is to add a short example in Doc/howto/urllib2.rst. Senthil explained how to do things on #14144 (?obtain the redirected URL and then POST to [it]?), and the example should be introduced by a clear warning about security/misbehavior risks (this is why I?m not adding the ?easy? keyword to this report). If you would like to propose a patch, you can find instructions on how to get and edit the source for the docs in the devguide. You can also write to the beginner-friendly core-mentorship mailing list (link in the devguide or on mail.python.org) to request help or guidance. ---------- nosy: +crustymonkey, eric.araujo, orsenthil stage: -> needs patch title: urllib2 HowTo for overriding post/3xx behavior. -> Document how to forward POST data on redirects versions: +Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:35:27 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 23:35:27 +0000 Subject: [issue14315] zipfile.ZipFile() unable to open zip File In-Reply-To: <1331810146.14.0.995585507713.issue14315@psf.upfronthosting.co.za> Message-ID: <1331940927.99.0.458232138918.issue14315@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 00:40:45 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Mar 2012 23:40:45 +0000 Subject: [issue13512] ~/.pypirc created insecurely In-Reply-To: <1322695403.24.0.389183798564.issue13512@psf.upfronthosting.co.za> Message-ID: <1331941245.02.0.072751478809.issue13512@psf.upfronthosting.co.za> ?ric Araujo added the comment: Barry, Benjamin: I?d like to fix this but am not sure if it should apply to 2.6 and 3.1 too. It does not look like a major flaw (see for example the assessment on the Red Hat bug page). ---------- components: +Distutils2 keywords: +easy nosy: +alexis, benjamin.peterson versions: +3rd party _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 01:13:52 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 17 Mar 2012 00:13:52 +0000 Subject: [issue14315] zipfile.ZipFile() unable to open zip File In-Reply-To: <1331810146.14.0.995585507713.issue14315@psf.upfronthosting.co.za> Message-ID: <1331943232.36.0.111076963788.issue14315@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is print from *other* _decodeExtra call. Add print('start') at start of _decodeExtra and you will see it. start b'\xfe\xca\x00\x00' 51966 0 b'' start start b'\x00' ---------- nosy: +storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 01:26:09 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 17 Mar 2012 00:26:09 +0000 Subject: [issue14341] sporadic (?) test_urllib2 failures Message-ID: <1331943969.2.0.17966534502.issue14341@psf.upfronthosting.co.za> New submission from Antoine Pitrou : ====================================================================== FAIL: test_method_deprecations (test.test_urllib2.OpenerDirectorTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/test/test_urllib2.py", line 628, in test_method_deprecations req.get_host() File "/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/contextlib.py", line 54, in __exit__ next(self.gen) File "/home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/test/support.py", line 776, in _filterwarnings missing[0]) AssertionError: filter ('', DeprecationWarning) did not catch any warning ---------- assignee: orsenthil components: Library (Lib), Tests messages: 156111 nosy: orsenthil, pitrou priority: normal severity: normal stage: needs patch status: open title: sporadic (?) test_urllib2 failures type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 01:48:28 2012 From: report at bugs.python.org (py.user) Date: Sat, 17 Mar 2012 00:48:28 +0000 Subject: [issue14342] In re's examples the example with recursion doesn't work Message-ID: <1331945308.4.0.250244486328.issue14342@psf.upfronthosting.co.za> New submission from py.user : http://docs.python.org/py3k/library/re.html#avoiding-recursion >>> import sys >>> sys.getrecursionlimit() 1000 >>> import re >>> s = 'Begin ' + 1000*'a very long string ' + 'end' >>> re.match('Begin (\w| )*? end', s).end() 19009 >>> ---------- assignee: docs at python components: Documentation, Regular Expressions messages: 156112 nosy: docs at python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: In re's examples the example with recursion doesn't work versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 01:48:30 2012 From: report at bugs.python.org (Mark Hammond) Date: Sat, 17 Mar 2012 00:48:30 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1331945310.99.0.012058527535.issue14302@psf.upfronthosting.co.za> Mark Hammond added the comment: To clarify the second comment from Eric: it is actually the first of the proposals that I consider controversial - moving where python.exe lives (regardless of to where) will break 3rd party tools. If a decision was made to move it anyway, then renaming "Scripts" to "bin" and installing it there makes sense IMO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 01:50:34 2012 From: report at bugs.python.org (py.user) Date: Sat, 17 Mar 2012 00:50:34 +0000 Subject: [issue14343] In re's examples the example with re.split() overlaps builtin input() Message-ID: <1331945434.37.0.313316190883.issue14343@psf.upfronthosting.co.za> New submission from py.user : http://docs.python.org/py3k/library/re.html#making-a-phonebook input -> text ---------- assignee: docs at python components: Documentation, Regular Expressions messages: 156114 nosy: docs at python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: In re's examples the example with re.split() overlaps builtin input() type: enhancement versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 01:55:34 2012 From: report at bugs.python.org (Brian Curtin) Date: Sat, 17 Mar 2012 00:55:34 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1331945734.47.0.380338658056.issue14302@psf.upfronthosting.co.za> Brian Curtin added the comment: It'll break tools who just look for "C:\\Python%d%d\python.exe" % (x, y) or some variation, but that's not a very dependable solution. If you're using the registry to find actual install locations, I think you'll be alright. What other solutions for finding python.exe would break by moving the location? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 02:03:37 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 17 Mar 2012 01:03:37 +0000 Subject: [issue14337] Recent refleaks In-Reply-To: <1331926323.93.0.0839449921053.issue14337@psf.upfronthosting.co.za> Message-ID: <1331946217.74.0.939895801484.issue14337@psf.upfronthosting.co.za> Benjamin Peterson added the comment: I think I've nailed them all now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 02:06:41 2012 From: report at bugs.python.org (Mark Hammond) Date: Sat, 17 Mar 2012 01:06:41 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1331946401.32.0.556241489127.issue14302@psf.upfronthosting.co.za> Mark Hammond added the comment: Tools that use the registry will typically look up the InstallPath key and look for python.exe there. They will not look in sub-directories (except some may look in PCBuild and PCBuild/amd64). It is exactly those tools I'm concerned about. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 02:12:45 2012 From: report at bugs.python.org (Brian Curtin) Date: Sat, 17 Mar 2012 01:12:45 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1331946765.41.0.00122296344614.issue14302@psf.upfronthosting.co.za> Brian Curtin added the comment: A suggested solution to that was to add BinaryPath to give them the proper path. We could potentially expose BinaryPath in older installers, just pointing at the same value as InstallPath. It's an installer-only change and very low (no?) risk, just preparing users as they move forward. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 02:17:44 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 17 Mar 2012 01:17:44 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN In-Reply-To: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> Message-ID: <1331947064.47.0.596596919626.issue14331@psf.upfronthosting.co.za> Gregory P. Smith added the comment: attaching the equivalent patch against python 3.2. that could also use a pair of eyeballs for review. it should show up as 'patch 4' in the rietveld reviews. ---------- Added file: http://bugs.python.org/file24894/malloc-import-pathbufs-py32.003.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 02:40:24 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 01:40:24 +0000 Subject: [issue12788] test_email fails with -R In-Reply-To: <1313802442.52.0.218487753455.issue12788@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 474338602bd8 by R David Murray in branch 'default': #12788: fix error in test_policy when run under refleak detection http://hg.python.org/cpython/rev/474338602bd8 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 02:40:59 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 01:40:59 +0000 Subject: [issue12788] test_email fails with -R In-Reply-To: <1313802442.52.0.218487753455.issue12788@psf.upfronthosting.co.za> Message-ID: <1331948459.11.0.29239413238.issue12788@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 03:05:24 2012 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 17 Mar 2012 02:05:24 +0000 Subject: [issue14339] Optimizing bin, oct and hex In-Reply-To: <1331932171.45.0.56771909125.issue14339@psf.upfronthosting.co.za> Message-ID: <1331949924.56.0.945296089849.issue14339@psf.upfronthosting.co.za> Changes by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 03:06:25 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 02:06:25 +0000 Subject: [issue11780] email.encoders are broken In-Reply-To: <1302087898.67.0.0241600221025.issue11780@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 1be426a555ca by R David Murray in branch '3.2': #11780: document that email.encoders throw TypeError on multipart messages. http://hg.python.org/cpython/rev/1be426a555ca New changeset 060eda590fa0 by R David Murray in branch 'default': Merge #11780: document that email.encoders throw TypeError on multipart messages. http://hg.python.org/cpython/rev/060eda590fa0 New changeset c894e2ea9ff7 by R David Murray in branch '2.7': #11780: document that email.encoders throw TypeError on multipart messages. http://hg.python.org/cpython/rev/c894e2ea9ff7 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 03:08:05 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 02:08:05 +0000 Subject: [issue11780] email.encoders are broken In-Reply-To: <1302087898.67.0.0241600221025.issue11780@psf.upfronthosting.co.za> Message-ID: <1331950085.11.0.512258390122.issue11780@psf.upfronthosting.co.za> R. David Murray added the comment: Nope, those errors are correct. The encodings functions do not apply to Multipart messages. I've updated the docs to reflect that. ---------- components: +Documentation -Library (Lib) resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> behavior versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 03:08:25 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 17 Mar 2012 02:08:25 +0000 Subject: [issue11780] email.encoders are broken In-Reply-To: <1302087898.67.0.0241600221025.issue11780@psf.upfronthosting.co.za> Message-ID: <1331950105.32.0.387795533607.issue11780@psf.upfronthosting.co.za> ?ric Araujo added the comment: I think it?s best to always say that exceptions are raised, and keep ?throw? for the generator method. It?s consistent and avoids confusion. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 03:11:43 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 02:11:43 +0000 Subject: [issue11780] email.encoders are broken In-Reply-To: <1302087898.67.0.0241600221025.issue11780@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 195b67c26ce7 by R David Murray in branch '3.2': #11780: s/throw/raise/ http://hg.python.org/cpython/rev/195b67c26ce7 New changeset 63c46a8547fb by R David Murray in branch 'default': Merge #11780: s/throw/raise/ http://hg.python.org/cpython/rev/63c46a8547fb New changeset 55993cd25564 by R David Murray in branch '2.7': #11780: s/throw/raise/ http://hg.python.org/cpython/rev/55993cd25564 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 03:11:51 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 02:11:51 +0000 Subject: [issue11780] email.encoders are broken In-Reply-To: <1302087898.67.0.0241600221025.issue11780@psf.upfronthosting.co.za> Message-ID: <1331950311.56.0.211083776649.issue11780@psf.upfronthosting.co.za> R. David Murray added the comment: Thanks, fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 03:41:19 2012 From: report at bugs.python.org (Matthew Barnett) Date: Sat, 17 Mar 2012 02:41:19 +0000 Subject: [issue14342] In re's examples the example with recursion doesn't work In-Reply-To: <1331945308.4.0.250244486328.issue14342@psf.upfronthosting.co.za> Message-ID: <1331952079.98.0.715898103596.issue14342@psf.upfronthosting.co.za> Matthew Barnett added the comment: As far as I can tell, back in 2003, changes were made to replace the recursive scheme which used stack allocation with a non-recursive scheme which used heap allocation in order to the improve the behaviour. To me it looks like an oversight and that the example should have been removed at the time, but unfortunately was retained and just updated in subsequent releases to refer to the Python version ("python3.2" in this case). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 03:44:52 2012 From: report at bugs.python.org (Matthew Barnett) Date: Sat, 17 Mar 2012 02:44:52 +0000 Subject: [issue14343] In re's examples the example with re.split() shadows builtin input() In-Reply-To: <1331945434.37.0.313316190883.issue14343@psf.upfronthosting.co.za> Message-ID: <1331952292.68.0.28810275453.issue14343@psf.upfronthosting.co.za> Changes by Matthew Barnett : ---------- title: In re's examples the example with re.split() overlaps builtin input() -> In re's examples the example with re.split() shadows builtin input() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 03:46:42 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 02:46:42 +0000 Subject: [issue11686] Update of some email/ __all__ lists In-Reply-To: <1301159741.4.0.853509960092.issue11686@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 63a6d35fcac8 by R David Murray in branch '3.2': #11686: add missing entries to email __all__ lists. http://hg.python.org/cpython/rev/63a6d35fcac8 New changeset 561fc3b4cc2a by R David Murray in branch 'default': Merge #11686: add missing entries to email __all__ lists. http://hg.python.org/cpython/rev/561fc3b4cc2a ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 03:51:14 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 02:51:14 +0000 Subject: [issue11686] Update of some email/ __all__ lists In-Reply-To: <1301159741.4.0.853509960092.issue11686@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 32d3ecacdabf by R David Murray in branch '3.2': #11686: news entry. http://hg.python.org/cpython/rev/32d3ecacdabf New changeset 26c8c43dd774 by R David Murray in branch 'default': Merge #11686: news entry. http://hg.python.org/cpython/rev/26c8c43dd774 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 03:51:56 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 02:51:56 +0000 Subject: [issue11686] Update of some email/ __all__ lists In-Reply-To: <1301159741.4.0.853509960092.issue11686@psf.upfronthosting.co.za> Message-ID: <1331952716.36.0.552832482122.issue11686@psf.upfronthosting.co.za> R. David Murray added the comment: Thanks for the patch, Steffen. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 03:54:58 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 17 Mar 2012 02:54:58 +0000 Subject: [issue14344] repr of email policies is wrong Message-ID: <1331952898.09.0.346715938946.issue14344@psf.upfronthosting.co.za> New submission from ?ric Araujo : >>> import email.policy as p >>> p.default Policy() >>> p.HTTP Policy(["linesep='\\r\\n'", 'max_line_length=None']) I think you wanted Policy(linesep='\r\n', max_line_length=None); the problem comes from __repr__ where a format field is replaced by a list, which should have been something ', '.join(args) instead. I can commit this minor thing if you want, I just wanted to check if I was right first. ---------- components: Library (Lib) messages: 156130 nosy: eric.araujo, r.david.murray priority: low severity: normal status: open title: repr of email policies is wrong type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 05:01:32 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 17 Mar 2012 04:01:32 +0000 Subject: [issue14323] Normalize math precision in RGB/YIQ conversion In-Reply-To: <1331831977.5.0.174772346075.issue14323@psf.upfronthosting.co.za> Message-ID: <1331956892.69.0.650872708464.issue14323@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Yes, put reference in source. I checked that you copied correctly. I think there is some controversy, which I do not understand, about adding tests to maintenance releases without a bug fix. I will ask, so do not do it yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 05:04:26 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 17 Mar 2012 04:04:26 +0000 Subject: [issue14323] Normalize math precision in RGB/YIQ conversion In-Reply-To: <1331831977.5.0.174772346075.issue14323@psf.upfronthosting.co.za> Message-ID: <1331957066.69.0.984854856344.issue14323@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Mark, I know you have worked on numerical algorithms. 1. Do you agree that this is a reasonable change? 2. Should new tests go in maintenance release? ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 05:16:19 2012 From: report at bugs.python.org (Brian Landers) Date: Sat, 17 Mar 2012 04:16:19 +0000 Subject: [issue14323] Normalize math precision in RGB/YIQ conversion In-Reply-To: <1331831977.5.0.174772346075.issue14323@psf.upfronthosting.co.za> Message-ID: <1331957779.87.0.84890751245.issue14323@psf.upfronthosting.co.za> Brian Landers added the comment: Updated to add Matlab refs, also added a roundtrip RGB-YIQ-RGB test to match the other conversions. ---------- Added file: http://bugs.python.org/file24895/colorlib.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 05:17:39 2012 From: report at bugs.python.org (Brian Landers) Date: Sat, 17 Mar 2012 04:17:39 +0000 Subject: [issue14322] More test coverage for hmac In-Reply-To: <1331831609.33.0.520236800519.issue14322@psf.upfronthosting.co.za> Message-ID: <1331957859.29.0.557646001222.issue14322@psf.upfronthosting.co.za> Brian Landers added the comment: Updated to use the correct assert* methods. ---------- Added file: http://bugs.python.org/file24896/test_hmac.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 05:18:35 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 17 Mar 2012 04:18:35 +0000 Subject: [issue14315] zipfile.ZipFile() unable to open zip File In-Reply-To: <1331810146.14.0.995585507713.issue14315@psf.upfronthosting.co.za> Message-ID: <1331957915.74.0.187106404616.issue14315@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Thanks. There must be multiple extra fields allowed. This output suggests that a) zipfile mis-parses the extra field in some peculiar case (which I doubt) or b) the file either gives a bad field length or third extra field is mal-formed and that other tools catch the error and ignore the bad extra field whereas zipfile does not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 05:39:18 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 17 Mar 2012 04:39:18 +0000 Subject: [issue14250] for string patterns regex.flags is never equal to 0 In-Reply-To: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> Message-ID: <1331959158.78.0.0849972299123.issue14250@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- nosy: -eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 05:42:46 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 17 Mar 2012 04:42:46 +0000 Subject: [issue13782] xml.etree.ElementTree: Element.append doesn't type-check its argument In-Reply-To: <1326502453.32.0.206779556991.issue13782@psf.upfronthosting.co.za> Message-ID: <1331959366.7.0.48193961172.issue13782@psf.upfronthosting.co.za> Eli Bendersky added the comment: Link to related python-dev discussion: http://mail.python.org/pipermail/python-dev/2012-March/117715.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 06:06:18 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 05:06:18 +0000 Subject: [issue1683368] object.__init__ shouldn't allow args/kwds Message-ID: Roundup Robot added the comment: New changeset 25b71858cb14 by Benjamin Peterson in branch 'default': make extra arguments to object.__init__/__new__ to errors in most cases (finishes #1683368) http://hg.python.org/cpython/rev/25b71858cb14 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 06:09:51 2012 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 17 Mar 2012 05:09:51 +0000 Subject: [issue1683368] object.__init__ shouldn't allow args/kwds Message-ID: <1331960991.45.0.0104214649548.issue1683368@psf.upfronthosting.co.za> Guido van Rossum added the comment: Please don't add python-dev at python.org to the nosy list. ---------- nosy: -python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 06:11:55 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 17 Mar 2012 05:11:55 +0000 Subject: [issue1683368] object.__init__ shouldn't allow args/kwds Message-ID: <1331961115.6.0.361405475321.issue1683368@psf.upfronthosting.co.za> Benjamin Peterson added the comment: python-dev is just the name of the robot which notes records changesets. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 06:43:02 2012 From: report at bugs.python.org (anatoly techtonik) Date: Sat, 17 Mar 2012 05:43:02 +0000 Subject: [issue14345] Document socket.SOL_SOCKET Message-ID: <1331962982.1.0.381278454339.issue14345@psf.upfronthosting.co.za> New submission from anatoly techtonik : socket.get/setsockopt() docs can be improved by providing description for SOL_SOCKET constant, and link to source code for other level constants and socket level options. ---------- assignee: docs at python components: Documentation messages: 156140 nosy: docs at python, techtonik priority: normal severity: normal status: open title: Document socket.SOL_SOCKET _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 07:12:31 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 17 Mar 2012 06:12:31 +0000 Subject: [issue13782] xml.etree.ElementTree: Element.append doesn't type-check its argument In-Reply-To: <1326502453.32.0.206779556991.issue13782@psf.upfronthosting.co.za> Message-ID: <1331964751.06.0.569251636524.issue13782@psf.upfronthosting.co.za> Eli Bendersky added the comment: Attaching a patch that sets the record straight in 3.3 - the 3 methods will raise TypeError, in both C and Python implementations. Also adds a test that verifies this, and updating the documentation. Note that in the C implementation extend wasn't actually type-checking its argument as well, so I added it for consistency. I don't believe this will be a performance problem. On the contrary, there are some type checking calls inside the implementation that can probably be removed now that we make sure only subclasses of Element get in as children. I'll look into this later. ---------- keywords: +patch Added file: http://bugs.python.org/file24897/issue13782.1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 07:13:40 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 17 Mar 2012 06:13:40 +0000 Subject: [issue13782] xml.etree.ElementTree: Element.append doesn't type-check its argument In-Reply-To: <1326502453.32.0.206779556991.issue13782@psf.upfronthosting.co.za> Message-ID: <1331964820.39.0.851327619969.issue13782@psf.upfronthosting.co.za> Changes by Eli Bendersky : Removed file: http://bugs.python.org/file24897/issue13782.1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 07:13:52 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 17 Mar 2012 06:13:52 +0000 Subject: [issue13782] xml.etree.ElementTree: Element.append doesn't type-check its argument In-Reply-To: <1326502453.32.0.206779556991.issue13782@psf.upfronthosting.co.za> Message-ID: <1331964832.06.0.701655044603.issue13782@psf.upfronthosting.co.za> Changes by Eli Bendersky : Added file: http://bugs.python.org/file24898/issue13782.1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 08:31:41 2012 From: report at bugs.python.org (Kirubakaran Athmanathan) Date: Sat, 17 Mar 2012 07:31:41 +0000 Subject: [issue6566] json.dumps converts None to "null" (not null) In-Reply-To: <1248469678.72.0.793111928959.issue6566@psf.upfronthosting.co.za> Message-ID: <1331969501.12.0.288909855083.issue6566@psf.upfronthosting.co.za> Kirubakaran Athmanathan added the comment: Here is the patch that fixes for 2.7 ---------- keywords: +patch nosy: +kirubakaran Added file: http://bugs.python.org/file24899/6566.2.7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 08:32:32 2012 From: report at bugs.python.org (Kirubakaran Athmanathan) Date: Sat, 17 Mar 2012 07:32:32 +0000 Subject: [issue6566] json.dumps converts None to "null" (not null) In-Reply-To: <1248469678.72.0.793111928959.issue6566@psf.upfronthosting.co.za> Message-ID: <1331969552.05.0.0789485177528.issue6566@psf.upfronthosting.co.za> Kirubakaran Athmanathan added the comment: Here is the patch that fixes for 3.3 ---------- Added file: http://bugs.python.org/file24900/6566.3.3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 08:41:27 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 07:41:27 +0000 Subject: [issue6566] json.dumps converts None to "null" (not null) In-Reply-To: <1248469678.72.0.793111928959.issue6566@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 7c818b4cd98a by Senthil Kumaran in branch '2.7': explain json.dumps for non-string keys in dicts. closes issue6566. Patch contributed Kirubakaran Athmanathan http://hg.python.org/cpython/rev/7c818b4cd98a New changeset 613919591a05 by Senthil Kumaran in branch '3.2': 3.2 explain json.dumps for non-string keys in dicts. closes issue6566. Patch contributed Kirubakaran Athmanathan http://hg.python.org/cpython/rev/613919591a05 New changeset 0554183066b5 by Senthil Kumaran in branch 'default': merge from 3.2 - issue6566 http://hg.python.org/cpython/rev/0554183066b5 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 08:59:47 2012 From: report at bugs.python.org (Larry Hastings) Date: Sat, 17 Mar 2012 07:59:47 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1331971187.66.0.752224472412.issue14328@psf.upfronthosting.co.za> Larry Hastings added the comment: > Shouldn't using vgetargs1 with '$' in the format string just be > an error? vgetargs1 doesn't know anything about keyword arguments. Thank you for catching that! Serves me right for search-and-destroy style development--I'm not that familiar with getargs.c. Fixed, which is to say I removed that gunk, in attached patch #4 against current trunk. ---------- Added file: http://bugs.python.org/file24901/larry.parsekwonly.diff.4.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 10:51:27 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Sat, 17 Mar 2012 09:51:27 +0000 Subject: [issue13210] Support Visual Studio 2010 In-Reply-To: <1318942521.44.0.961979099616.issue13210@psf.upfronthosting.co.za> Message-ID: <1331977887.15.0.429016455392.issue13210@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: I'd like to subscribe to this newsletter. IMHO, it is important that people are able to compile python with VS2010 with minimum fuss. Not everyone has access to older compilers and forward compatibility shouldn't be that hard. There are to problems currently, as far as I can tell: 1) errnomodule.c needs to be changed to make sure WSAERROR and ERROR are the same. A patch to this effect exists already. 2) the .vcproj files don't upgrade correctly. The new ones have an extra "TargetName" property, optionally settable but defaults to ProjectName. This causes linker errors because of python's peculiar _d extension for debug. There is no easy fix for this so a solution would be, unfortunately, to maintain a separate PCBuild10 directory. What is there keeping this from moving forwards? ---------- nosy: +krisvale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 10:52:44 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 17 Mar 2012 09:52:44 +0000 Subject: [issue14315] zipfile.ZipFile() unable to open zip File In-Reply-To: <1331810146.14.0.995585507713.issue14315@psf.upfronthosting.co.za> Message-ID: <1331977964.19.0.00806622750912.issue14315@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is padding. Other implimentations just ignore it and Python must. ---------- keywords: +patch Added file: http://bugs.python.org/file24902/fix_zipfile_extra.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 10:59:04 2012 From: report at bugs.python.org (Dionysios Kalofonos) Date: Sat, 17 Mar 2012 09:59:04 +0000 Subject: [issue14346] Typos in Mac/README Message-ID: <1331978344.42.0.979821037918.issue14346@psf.upfronthosting.co.za> New submission from Dionysios Kalofonos : Mac/README had a few typos (see attached file for details). ---------- files: typos.patch keywords: patch messages: 156148 nosy: dk priority: normal severity: normal status: open title: Typos in Mac/README versions: Python 2.7 Added file: http://bugs.python.org/file24903/typos.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 11:03:24 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 17 Mar 2012 10:03:24 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1331978604.2.0.991156758038.issue14302@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I'm still in favor of the change, accepting any breakage that will result from it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 11:13:43 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 17 Mar 2012 10:13:43 +0000 Subject: [issue13210] Support Visual Studio 2010 In-Reply-To: <1331977887.15.0.429016455392.issue13210@psf.upfronthosting.co.za> Message-ID: <4F6463D5.6030402@v.loewis.de> Martin v. L?wis added the comment: > IMHO, it is important that people are able to compile python with > VS2010 with minimum fuss. Not everyone has access to older compilers > and forward compatibility shouldn't be that hard. Not sure what you mean by "forward compatibility". You cannot build extension modules with a different version of MSVC than you built Python with; that's inherent in the way the MS CRT works. This means that Python 2.7 and 3.2 will continue to use VS 2008 until their end-of-life, and extensions module authors will continue to need VS 2008. Getting the old compilers isn't that hard, either - the express edition of VS 2008 is still available for download. So whatever "forward compatibiltiy" is in this context - I think it is extremely hard. > What is there keeping this from moving forwards? Brian Curtin has volunteered to work on this. Maybe he can comment on the status; there is little point in people duplicating efforts (except perhaps for publishing hg clones that add project files for the older branches, for people who want that). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 11:25:30 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 17 Mar 2012 10:25:30 +0000 Subject: [issue14065] Element should support cyclic GC In-Reply-To: <1329755208.03.0.143933032526.issue14065@psf.upfronthosting.co.za> Message-ID: <1331979930.64.0.709786418744.issue14065@psf.upfronthosting.co.za> Martin v. L?wis added the comment: As a matter of principle, garbage collection in Python should *always* work, for all types, except for the one documented exception (cycles involving __del__). Failure of a type to properly garbage collect should be considered as serious as an interpreter crash; I hence propose this issue as release blocker. In addition, failure to support tp_traverse means that gc.get_referents doesn't work for the type, which is an inconvenience even in regular (non-cyclic) usage. ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 11:44:13 2012 From: report at bugs.python.org (Stefan Krah) Date: Sat, 17 Mar 2012 10:44:13 +0000 Subject: [issue14337] Recent refleaks In-Reply-To: <1331926323.93.0.0839449921053.issue14337@psf.upfronthosting.co.za> Message-ID: <1331981053.8.0.225998527681.issue14337@psf.upfronthosting.co.za> Stefan Krah added the comment: Nice. 0554183066b5 is completely clean except for a leak in test_curses. I think that one may be due to the fact that I'm running the tests in an ssh terminal. ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 12:00:08 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sat, 17 Mar 2012 11:00:08 +0000 Subject: [issue14276] installing latest version of a project In-Reply-To: <1331594570.15.0.87827411475.issue14276@psf.upfronthosting.co.za> Message-ID: <1331982008.92.0.0622202054924.issue14276@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 12:11:53 2012 From: report at bugs.python.org (=?utf-8?q?Francisco_Mart=C3=ADn_Brugu=C3=A9?=) Date: Sat, 17 Mar 2012 11:11:53 +0000 Subject: [issue13579] string.Formatter doesn't understand the !a conversion specifier In-Reply-To: <1323587450.48.0.625379374057.issue13579@psf.upfronthosting.co.za> Message-ID: <1331982713.75.0.285927391633.issue13579@psf.upfronthosting.co.za> Francisco Mart?n Brugu? added the comment: > However, I have not actually applied and run test_string.py. I've applied the issue13579_47288880cc9e.patch to the changeset 0554183066b5 and applies without errors for me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 13:12:25 2012 From: report at bugs.python.org (Dionysios Kalofonos) Date: Sat, 17 Mar 2012 12:12:25 +0000 Subject: [issue14347] Misc/README Message-ID: <1331986345.75.0.966769562204.issue14347@psf.upfronthosting.co.za> New submission from Dionysios Kalofonos : Misc/README does not enumerate all the files in the Misc directory (see the attached file for more information). ---------- components: None files: files.patch keywords: patch messages: 156154 nosy: dk priority: normal severity: normal status: open title: Misc/README versions: Python 3.3 Added file: http://bugs.python.org/file24904/files.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 14:16:28 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 13:16:28 +0000 Subject: [issue10516] Add list.clear() and list.copy() In-Reply-To: <1290555468.47.0.0329661397161.issue10516@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 958a98bf924e by Eli Bendersky in branch 'default': updated whatsnew/3.3.rst with the new methods added to list and bytearray (issue 10516) http://hg.python.org/cpython/rev/958a98bf924e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 14:20:03 2012 From: report at bugs.python.org (Dionysios Kalofonos) Date: Sat, 17 Mar 2012 13:20:03 +0000 Subject: [issue14348] Whitespace - Lib/base64.py Message-ID: <1331990403.5.0.414904918457.issue14348@psf.upfronthosting.co.za> New submission from Dionysios Kalofonos : Whitespace changes as of PEP8. ---------- components: Library (Lib) files: base64.patch keywords: patch messages: 156156 nosy: dk priority: normal severity: normal status: open title: Whitespace - Lib/base64.py versions: Python 3.3 Added file: http://bugs.python.org/file24905/base64.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 14:23:36 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Sat, 17 Mar 2012 13:23:36 +0000 Subject: [issue12619] Automatically regenerate platform-specific modules In-Reply-To: <1311414212.95.0.467545301683.issue12619@psf.upfronthosting.co.za> Message-ID: <1331990616.12.0.0930692655135.issue12619@psf.upfronthosting.co.za> Ramchandra Apte added the comment: +1 for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 14:28:19 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 13:28:19 +0000 Subject: [issue13579] string.Formatter doesn't understand the !a conversion specifier In-Reply-To: <1323587450.48.0.625379374057.issue13579@psf.upfronthosting.co.za> Message-ID: <1331990899.64.0.638658486943.issue13579@psf.upfronthosting.co.za> R. David Murray added the comment: To answer your question about wrapping, it is best not to introduce noise into the patch. The person who commits it can rewrap (although even then it is nice to do the rewrapping in a separate changeset). ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 15:03:47 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 14:03:47 +0000 Subject: [issue14344] repr of email policies is wrong In-Reply-To: <1331952898.09.0.346715938946.issue14344@psf.upfronthosting.co.za> Message-ID: <1331993027.71.0.562748688208.issue14344@psf.upfronthosting.co.za> R. David Murray added the comment: That doesn't produce an evalable repr, though. The repr should actually be Policy(linesep='\\r\\n', max_line_length=None) I'm not immediately seeing how to get that to happen. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 15:26:23 2012 From: report at bugs.python.org (Zbyszek Szmek) Date: Sat, 17 Mar 2012 14:26:23 +0000 Subject: [issue14245] float rounding examples in FAQ are outdated In-Reply-To: <1331930244.2.0.236102179825.issue14245@psf.upfronthosting.co.za> Message-ID: <4F649F08.6090603@in.waw.pl> Zbyszek Szmek added the comment: Both appear to be commonly used. Both sound OK to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 16:08:06 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 17 Mar 2012 15:08:06 +0000 Subject: [issue14349] The documentation of 'dis' doesn't describe MAKE_FUNCTION correctly Message-ID: <1331996886.47.0.46755295506.issue14349@psf.upfronthosting.co.za> New submission from Eli Bendersky : The documentation of the MAKE_FUNCTION opcode in 'dis' says: "Pushes a new function object on the stack. TOS is the code associated with the function. " Which doesn't appear to be true. In Python/ceval.c: [...] TARGET_WITH_IMPL(MAKE_CLOSURE, _make_function) TARGET(MAKE_FUNCTION) _make_function: { int posdefaults = oparg & 0xff; int kwdefaults = (oparg>>8) & 0xff; int num_annotations = (oparg >> 16) & 0x7fff; w = POP(); /* qualname */ v = POP(); /* code object */ x = PyFunction_NewWithQualName(v, f->f_globals, w); [...] ---------- assignee: docs at python components: Documentation messages: 156161 nosy: docs at python, eli.bendersky, ncoghlan priority: normal severity: normal stage: needs patch status: open title: The documentation of 'dis' doesn't describe MAKE_FUNCTION correctly type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 16:54:09 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 17 Mar 2012 15:54:09 +0000 Subject: [issue14344] repr of email policies is wrong In-Reply-To: <1331952898.09.0.346715938946.issue14344@psf.upfronthosting.co.za> Message-ID: <1331999649.16.0.86257584064.issue14344@psf.upfronthosting.co.za> ?ric Araujo added the comment: I don?t understand why the repr should use \\r instead of \r. It seems to work: >>> from email.policy import Policy, HTTP, strict >>> strict Policy(raise_on_defect=True) >>> eval(repr(strict)) Policy(raise_on_defect=True) >>> HTTP Policy(linesep='\r\n', max_line_length=None) >>> eval(repr(HTTP)) Policy(linesep='\r\n', max_line_length=None) >>> HTTP.__dict__ {'max_line_length': None, 'linesep': '\r\n'} >>> eval(repr(HTTP)).__dict__ {'max_line_length': None, 'linesep': '\r\n'} ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 16:56:23 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 17 Mar 2012 15:56:23 +0000 Subject: [issue6566] json.dumps converts None to "null" (not null) In-Reply-To: <1248469678.72.0.793111928959.issue6566@psf.upfronthosting.co.za> Message-ID: <1331999783.39.0.358208846706.issue6566@psf.upfronthosting.co.za> ?ric Araujo added the comment: Shouldn?t the 2.7 docs talk about str and unicode, or maybe basestring, instead of just str? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 16:58:17 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 15:58:17 +0000 Subject: [issue14306] try/except block is both efficient and expensive? In-Reply-To: <1331761279.09.0.327606618026.issue14306@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 9a7dcfbcf726 by Georg Brandl in branch '3.2': Closes #14306: clarify expensiveness of try-except and update code snippet http://hg.python.org/cpython/rev/9a7dcfbcf726 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 16:58:55 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 15:58:55 +0000 Subject: [issue14306] try/except block is both efficient and expensive? In-Reply-To: <1331761279.09.0.327606618026.issue14306@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 7a93f6ee2ebc by Georg Brandl in branch '2.7': Closes #14306: clarify expensiveness of try-except and update code snippet http://hg.python.org/cpython/rev/7a93f6ee2ebc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 16:59:37 2012 From: report at bugs.python.org (Georg Brandl) Date: Sat, 17 Mar 2012 15:59:37 +0000 Subject: [issue14349] The documentation of 'dis' doesn't describe MAKE_FUNCTION correctly In-Reply-To: <1331996886.47.0.46755295506.issue14349@psf.upfronthosting.co.za> Message-ID: <1331999977.85.0.47810181963.issue14349@psf.upfronthosting.co.za> Changes by Georg Brandl : ---------- assignee: docs at python -> pitrou nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 17:07:00 2012 From: report at bugs.python.org (Merlijn van Deen) Date: Sat, 17 Mar 2012 16:07:00 +0000 Subject: [issue6784] byte/unicode pickle incompatibilities between python2 and python3 In-Reply-To: <1251287773.44.0.222300610244.issue6784@psf.upfronthosting.co.za> Message-ID: <1332000420.67.0.492725276757.issue6784@psf.upfronthosting.co.za> Merlijn van Deen added the comment: Based on the discussion on python-dev [1], this is an updated implementation that uses encoding='bytes' to signal str->bytes behaviour. http://mail.python.org/pipermail/python-dev/2012-March/117536.html ---------- Added file: http://bugs.python.org/file24906/pickle_bytes_code.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 17:07:48 2012 From: report at bugs.python.org (Merlijn van Deen) Date: Sat, 17 Mar 2012 16:07:48 +0000 Subject: [issue6784] byte/unicode pickle incompatibilities between python2 and python3 In-Reply-To: <1251287773.44.0.222300610244.issue6784@psf.upfronthosting.co.za> Message-ID: <1332000468.27.0.445125154431.issue6784@psf.upfronthosting.co.za> Merlijn van Deen added the comment: ...and the tests to go with that. ---------- Added file: http://bugs.python.org/file24907/pickle_bytes_tests.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 17:26:41 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 16:26:41 +0000 Subject: [issue14342] In re's examples the example with recursion doesn't work In-Reply-To: <1331945308.4.0.250244486328.issue14342@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 8172d7dce0ed by Georg Brandl in branch '3.2': Closes #14342: remove out-of-date section about avoiding recursion errors. http://hg.python.org/cpython/rev/8172d7dce0ed ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 17:26:40 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 16:26:40 +0000 Subject: [issue14343] In re's examples the example with re.split() shadows builtin input() In-Reply-To: <1331945434.37.0.313316190883.issue14343@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 6cf5f963e0c4 by Georg Brandl in branch '3.2': Closes #14343: avoid shadowing builtin input() in example code. http://hg.python.org/cpython/rev/6cf5f963e0c4 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 17:27:48 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 16:27:48 +0000 Subject: [issue14343] In re's examples the example with re.split() shadows builtin input() In-Reply-To: <1331945434.37.0.313316190883.issue14343@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 483319c711d4 by Georg Brandl in branch '2.7': Closes #14343: avoid shadowing builtin input() in example code. http://hg.python.org/cpython/rev/483319c711d4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 17:27:48 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 16:27:48 +0000 Subject: [issue14342] In re's examples the example with recursion doesn't work In-Reply-To: <1331945308.4.0.250244486328.issue14342@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 276f79e4b215 by Georg Brandl in branch '2.7': Closes #14342: remove out-of-date section about avoiding recursion errors. http://hg.python.org/cpython/rev/276f79e4b215 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 17:29:45 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 16:29:45 +0000 Subject: [issue14250] for string patterns regex.flags is never equal to 0 In-Reply-To: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset b3b3a4a7d7b2 by Georg Brandl in branch '3.2': Closes #14250: regex.flags has not only explicit flags but also implicit flags and those from the pattern http://hg.python.org/cpython/rev/b3b3a4a7d7b2 ---------- nosy: +python-dev resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 17:31:32 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 16:31:32 +0000 Subject: [issue14250] for string patterns regex.flags is never equal to 0 In-Reply-To: <1331426792.04.0.0924775979082.issue14250@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset ac00531a63aa by Georg Brandl in branch '2.7': Closes #14250: regex.flags has not only explicit flags but also those from the pattern http://hg.python.org/cpython/rev/ac00531a63aa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 17:33:28 2012 From: report at bugs.python.org (Kirubakaran Athmanathan) Date: Sat, 17 Mar 2012 16:33:28 +0000 Subject: [issue6566] json.dumps converts None to "null" (not null) In-Reply-To: <1331999783.39.0.358208846706.issue6566@psf.upfronthosting.co.za> Message-ID: Kirubakaran Athmanathan added the comment: The note added "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." is true for unicode keys too. '{"foo": "bar"}' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 17:34:49 2012 From: report at bugs.python.org (Kirubakaran Athmanathan) Date: Sat, 17 Mar 2012 16:34:49 +0000 Subject: [issue6566] json.dumps converts None to "null" (not null) In-Reply-To: Message-ID: Kirubakaran Athmanathan added the comment: json.dumps({u'foo':'bar'}) '{"foo": "bar"}' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 17:37:47 2012 From: report at bugs.python.org (Merlijn van Deen) Date: Sat, 17 Mar 2012 16:37:47 +0000 Subject: [issue6566] json.dumps converts None to "null" (not null) In-Reply-To: <1248469678.72.0.793111928959.issue6566@psf.upfronthosting.co.za> Message-ID: <1332002267.03.0.121209230963.issue6566@psf.upfronthosting.co.za> Merlijn van Deen added the comment: JSON does not have the distinction between bytes and unicode; py2 strings are coerced into unicode. I think it would be better to speak about 'JSON string' or 'JSON string element' if it's JSON and about 'unicode' (2.7) or 'str' (3.x) when speaking about the data that has been decoded again. >>> json.loads(json.dumps("boo")) u'boo' >>> json.loads(json.dumps({"a": "b"})) {u'a': u'b'} (the keys will always be unicode in 2.7) ---------- nosy: +valhallasw _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 17:53:53 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Sat, 17 Mar 2012 16:53:53 +0000 Subject: [issue11959] smtpd cannot be used without affecting global state In-Reply-To: <1304111550.3.0.684224980767.issue11959@psf.upfronthosting.co.za> Message-ID: <1332003233.1.0.648802162901.issue11959@psf.upfronthosting.co.za> Changes by Michele Orr? : ---------- nosy: +maker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 18:10:11 2012 From: report at bugs.python.org (Barry A. Warsaw) Date: Sat, 17 Mar 2012 17:10:11 +0000 Subject: [issue13512] ~/.pypirc created insecurely In-Reply-To: <1322695403.24.0.389183798564.issue13512@psf.upfronthosting.co.za> Message-ID: <1332004211.17.0.672498329784.issue13512@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: I don't think it's worth fixing in Python 2.6, at least not in 2.6.8 which is ready for rc2 today. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 18:13:57 2012 From: report at bugs.python.org (Brian Curtin) Date: Sat, 17 Mar 2012 17:13:57 +0000 Subject: [issue13210] Support Visual Studio 2010 In-Reply-To: <1318942521.44.0.961979099616.issue13210@psf.upfronthosting.co.za> Message-ID: <1332004437.06.0.645563985785.issue13210@psf.upfronthosting.co.za> Brian Curtin added the comment: Nothing's keeping it from moving forward at this point. Progress stagnated the last few months because I was busy doing organizational and PR work for PyCon. Now that the conference has passed, this and installer changes are on the top of my list. I will follow up with the current state of the port within the next few days (I should have time tomorrow evening). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 18:25:18 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Sat, 17 Mar 2012 17:25:18 +0000 Subject: [issue14333] queue unittest errors In-Reply-To: <1331883945.34.0.322652565121.issue14333@psf.upfronthosting.co.za> Message-ID: <1332005118.44.0.720018908842.issue14333@psf.upfronthosting.co.za> Changes by Michele Orr? : ---------- nosy: +maker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 18:31:27 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 17:31:27 +0000 Subject: [issue14346] Typos in Mac/README In-Reply-To: <1331978344.42.0.979821037918.issue14346@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 3decf67e1a28 by Ned Deily in branch '2.7': Issue #14346: Fix some typos in the Mac/README file. http://hg.python.org/cpython/rev/3decf67e1a28 New changeset 7464c8cf7466 by Ned Deily in branch '3.2': Issue #14346: Fix some typos in the Mac/README file. http://hg.python.org/cpython/rev/7464c8cf7466 New changeset 4b222467acf4 by Ned Deily in branch 'default': Issue #14346: merge http://hg.python.org/cpython/rev/4b222467acf4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 18:33:09 2012 From: report at bugs.python.org (Ned Deily) Date: Sat, 17 Mar 2012 17:33:09 +0000 Subject: [issue14346] Typos in Mac/README In-Reply-To: <1331978344.42.0.979821037918.issue14346@psf.upfronthosting.co.za> Message-ID: <1332005589.15.0.541697741971.issue14346@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for the suggestions! ---------- assignee: -> ned.deily components: +Documentation nosy: +ned.deily resolution: -> fixed stage: -> committed/rejected status: open -> closed versions: +Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 18:33:51 2012 From: report at bugs.python.org (Larry Hastings) Date: Sat, 17 Mar 2012 17:33:51 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1332005631.55.0.197882221497.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: Incorporated Greg's (hopefully) parting shot. Also put the "as an integer" back for the docs. Finally, munged the note about float seconds vs integer nanoseconds a bit; I think it's an improvement. Can I get the go ahead now, pretty please? ---------- assignee: -> larry stage: -> patch review Added file: http://bugs.python.org/file24908/larry.st_mtime_ns.patch.6.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 18:42:44 2012 From: report at bugs.python.org (=?utf-8?q?Francisco_Mart=C3=ADn_Brugu=C3=A9?=) Date: Sat, 17 Mar 2012 17:42:44 +0000 Subject: [issue13579] string.Formatter doesn't understand the !a conversion specifier In-Reply-To: <1323587450.48.0.625379374057.issue13579@psf.upfronthosting.co.za> Message-ID: <1332006164.83.0.691484065804.issue13579@psf.upfronthosting.co.za> Francisco Mart?n Brugu? added the comment: Ok, I've updated the patch. The NEWS entry could be: Issue #13579: string.Formatter now understands the !a conversion specifier. (not in the patch because AFAIN it makes the merge easier) Let me know if that's in the line you want. Thank you! ---------- Added file: http://bugs.python.org/file24909/issue13579_0554183066b5.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 18:51:26 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Sat, 17 Mar 2012 17:51:26 +0000 Subject: [issue14333] queue unittest errors In-Reply-To: <1331883945.34.0.322652565121.issue14333@psf.upfronthosting.co.za> Message-ID: <1332006686.36.0.767976061235.issue14333@psf.upfronthosting.co.za> Michele Orr? added the comment: This bug is becouse of Lib/unittest/loader.py:107 . So a quick fix would be to inherit from unittest.TestCase only in the exposed classes; but probably using a class decorator is the best solution. ---------- keywords: +patch Added file: http://bugs.python.org/file24910/issue14333_decorators.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 18:51:42 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Sat, 17 Mar 2012 17:51:42 +0000 Subject: [issue14333] queue unittest errors In-Reply-To: <1331883945.34.0.322652565121.issue14333@psf.upfronthosting.co.za> Message-ID: <1332006702.93.0.405677022848.issue14333@psf.upfronthosting.co.za> Changes by Michele Orr? : Added file: http://bugs.python.org/file24911/issue14333.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 18:53:01 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 17:53:01 +0000 Subject: [issue14347] Misc/README In-Reply-To: <1331986345.75.0.966769562204.issue14347@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 65a0a6fab127 by Ned Deily in branch 'default': Issue #14347: Update Misc/README list of files. http://hg.python.org/cpython/rev/65a0a6fab127 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 18:54:42 2012 From: report at bugs.python.org (Ned Deily) Date: Sat, 17 Mar 2012 17:54:42 +0000 Subject: [issue14347] Update Misc/README In-Reply-To: <1331986345.75.0.966769562204.issue14347@psf.upfronthosting.co.za> Message-ID: <1332006882.73.0.522127568014.issue14347@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for the suggestion! ---------- nosy: +ned.deily resolution: -> fixed stage: -> committed/rejected status: open -> closed title: Misc/README -> Update Misc/README _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 18:56:57 2012 From: report at bugs.python.org (Larry Hastings) Date: Sat, 17 Mar 2012 17:56:57 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1332007017.78.0.540984721904.issue14328@psf.upfronthosting.co.za> Larry Hastings added the comment: Incorporated the latest round of suggestions from Benjamin's most recent--and very thorough!--review. Thanks, Benjamin! ---------- Added file: http://bugs.python.org/file24912/larry.parsekwonly.diff.5.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 19:06:48 2012 From: report at bugs.python.org (Georg Brandl) Date: Sat, 17 Mar 2012 18:06:48 +0000 Subject: [issue14333] queue unittest errors In-Reply-To: <1331883945.34.0.322652565121.issue14333@psf.upfronthosting.co.za> Message-ID: <1332007608.08.0.858676227203.issue14333@psf.upfronthosting.co.za> Georg Brandl added the comment: The decorator solution looks overly mind-boggling for this simple case. BTW, I'm not sure we support calling our tests in this way, but it would be a good goal to, so I'm in favor of fixing these kinds of problems. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 19:22:29 2012 From: report at bugs.python.org (Georg Brandl) Date: Sat, 17 Mar 2012 18:22:29 +0000 Subject: [issue12684] profile does not dump stats on exception like cProfile does In-Reply-To: <1312335798.44.0.743453347572.issue12684@psf.upfronthosting.co.za> Message-ID: <1332008549.68.0.625504181699.issue12684@psf.upfronthosting.co.za> Georg Brandl added the comment: The same fix should be applied to runctx() too. The SystemExit handling is fine, it's in the original code also. I would recommend making a single try-except-finally statement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 20:04:26 2012 From: report at bugs.python.org (Jakob Bowyer) Date: Sat, 17 Mar 2012 19:04:26 +0000 Subject: [issue14350] Strange Exception from copying an iterable Message-ID: <1332011066.2.0.397754612752.issue14350@psf.upfronthosting.co.za> New submission from Jakob Bowyer : Running: Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] Code: import copy copy.copy(iter([1,2,3])) Exception: --------------------------------------------------------------------------- TypeError Traceback (most recent call last) T:\languages\Python27\Scripts\ in () ----> 1 copy.copy(iter([1,2,3])) T:\languages\Python27\lib\copy.pyc in copy(x) 94 raise Error("un(shallow)copyable object of type %s" % cl s) 95 ---> 96 return _reconstruct(x, rv, 0) 97 98 T:\languages\Python27\lib\copy.pyc in _reconstruct(x, info, deep, memo) 327 if deep: 328 args = deepcopy(args, memo) --> 329 y = callable(*args) 330 memo[id(x)] = y 331 T:\languages\Python27\lib\copy_reg.pyc in __newobj__(cls, *args) 91 92 def __newobj__(cls, *args): ---> 93 return cls.__new__(cls, *args) 94 95 def _slotnames(cls): TypeError: object.__new__(listiterator) is not safe, use listiterator.__new__() Either this is a bug or not a clear error message in the exception ---------- components: None messages: 156189 nosy: Jakob.Bowyer priority: normal severity: normal status: open title: Strange Exception from copying an iterable type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 20:05:08 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 19:05:08 +0000 Subject: [issue14344] repr of email policies is wrong In-Reply-To: <1331952898.09.0.346715938946.issue14344@psf.upfronthosting.co.za> Message-ID: <1332011108.3.0.160469894843.issue14344@psf.upfronthosting.co.za> R. David Murray added the comment: Ach, I screwed up my testing at the interactive interpreter. Yes, it does work, and I will commit the fix. Thanks for the report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 20:12:15 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 19:12:15 +0000 Subject: [issue14344] repr of email policies is wrong In-Reply-To: <1331952898.09.0.346715938946.issue14344@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 97b0cf9df420 by R David Murray in branch 'default': #14344: fixed the repr of email.policy objects. http://hg.python.org/cpython/rev/97b0cf9df420 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 20:12:53 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 19:12:53 +0000 Subject: [issue14344] repr of email policies is wrong In-Reply-To: <1331952898.09.0.346715938946.issue14344@psf.upfronthosting.co.za> Message-ID: <1332011573.18.0.682168584602.issue14344@psf.upfronthosting.co.za> R. David Murray added the comment: Committed. ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 20:38:17 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 17 Mar 2012 19:38:17 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: <1332013097.82.0.165797997125.issue14204@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Sorry for the delay. I've run the tests (with OpenSSL 1.0.1-beta3) in debug mode and got an error: ====================================================================== ERROR: test_npn_ext (test.test_ssl.ThreadedTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/antoine/cpython/default/Lib/test/test_ssl.py", line 1882, in test_npn_ext chatty=True, connectionchatty=True) File "/home/antoine/cpython/default/Lib/test/test_ssl.py", line 1210, in server_params_test s.connect((HOST, server.port)) File "/home/antoine/cpython/default/Lib/ssl.py", line 543, in connect self._real_connect(addr, False) File "/home/antoine/cpython/default/Lib/ssl.py", line 533, in _real_connect self.do_handshake() File "/home/antoine/cpython/default/Lib/ssl.py", line 513, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [Errno 1] _ssl.c:434: error:140920E3:SSL routines:SSL3_GET_SERVER_HELLO:parse tlsext I've determined that this is because of the use of strlen() on a non-zero terminated string. I'll try to come up with an updated patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 20:44:53 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 19:44:53 +0000 Subject: [issue12757] undefined name in doctest.py In-Reply-To: <1313479086.68.0.065111934389.issue12757@psf.upfronthosting.co.za> Message-ID: <1332013493.15.0.801597643247.issue12757@psf.upfronthosting.co.za> R. David Murray added the comment: The patch was actually by Brian Curtin, before he got commit privs :). Attached is a fix. I don't know what t.py has to do with the issue, though. I'm experimenting to see if I can trigger the bug before I apply the fix. ---------- keywords: +patch stage: needs patch -> test needed Added file: http://bugs.python.org/file24913/doctest.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 20:47:08 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 19:47:08 +0000 Subject: [issue12757] undefined name in doctest.py In-Reply-To: <1313479086.68.0.065111934389.issue12757@psf.upfronthosting.co.za> Message-ID: <1332013628.06.0.0539478866814.issue12757@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- nosy: +brian.curtin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 20:51:32 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 17 Mar 2012 19:51:32 +0000 Subject: [issue14351] Script error in 3.2.3rc1 Windows doc Message-ID: <1332013892.73.0.333055094928.issue14351@psf.upfronthosting.co.za> New submission from Terry J. Reedy : 3.2.3rc1: When I click the Python manuals Start Menu icon, the Windows help version of the docs comes up, but with a Script Error box. Contents of the box: A error has occurred in the script on this page Line : 1 Char : 1 Error : The value of the property '$' is null or undefined, not a Function object Code : 0 URL : mk:@MSITStore:C:\<...>\pthon323rc1.chm:/_static/copybuttom.js Do you want to continue running script on this page? [yes] [no] Whether I click yes or no, clicking on anything, for instance, Language Reference, brings up the the error box again. After clicking away the error box, I get what I intended, but having to do that with every click makes that nice form of the doc, which I use daily, unusable. So I think this should be a release blocker. I did not notice before because I have been using and testing 3.3.0a1. The chm manual for that works fine, as normal. I have not loaded 2.7.3rc1. I am on Win7, 64bit. ---------- assignee: docs at python components: Documentation, Windows messages: 156195 nosy: docs at python, georg.brandl, loewis, terry.reedy priority: normal severity: normal status: open title: Script error in 3.2.3rc1 Windows doc type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 20:55:49 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sat, 17 Mar 2012 19:55:49 +0000 Subject: [issue14352] Distutils2 won't install on Ubuntu Message-ID: <1332014149.79.0.895203792627.issue14352@psf.upfronthosting.co.za> New submission from Alex Gr?nholm : Running distutils2 hg tip (changeset 2cec52b682a9): The command "pysetup install" fails with: u'Python': u'2.7.2+' is not a valid version (field 'Version') Not that it should matter, but this is Ubuntu 11.10. Also, distutils2 installs fine using setup.py. ---------- assignee: eric.araujo components: Distutils2 files: d2log.txt messages: 156196 nosy: agronholm, alexis, eric.araujo, tarek priority: normal severity: normal status: open title: Distutils2 won't install on Ubuntu type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file24914/d2log.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 20:59:51 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 19:59:51 +0000 Subject: [issue12757] undefined name in doctest.py In-Reply-To: <1313479086.68.0.065111934389.issue12757@psf.upfronthosting.co.za> Message-ID: <1332014391.96.0.972026307434.issue12757@psf.upfronthosting.co.za> R. David Murray added the comment: OK, ./python -OO -m test test_json will trigger it. Updated fix attached. I'm not completely happy with it, though, since it prints the 'skipping test from module XXX' twice, and I don't know why (some unittest thing I'm not getting right, doubtless). ---------- nosy: +michael.foord Added file: http://bugs.python.org/file24915/doctest.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 21:01:50 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 17 Mar 2012 20:01:50 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: <1332014510.25.0.323436731566.issue14204@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Here is a fixed patch. It also came to me that "selected_protocol" could be ambiguous, so I renamed it to "selected_npn_protocol". ---------- Added file: http://bugs.python.org/file24916/npn.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 21:02:21 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 20:02:21 +0000 Subject: [issue12757] undefined name in doctest.py In-Reply-To: <1313479086.68.0.065111934389.issue12757@psf.upfronthosting.co.za> Message-ID: <1332014541.26.0.123743092734.issue12757@psf.upfronthosting.co.za> R. David Murray added the comment: Oh, in case anyone is wondering, the fix for -OO test runs was originally made because the unladen swallow folks ran the test suite that way. (I think someone else wanted it too, but I don't remember who). It's broken again, so I doubt anyone is actually doing this now, and if we want to keep supporting this use case (maybe we don't), then we should have a buildbot running the test suite with -OO. I might be able to set one up at some point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 21:07:23 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 20:07:23 +0000 Subject: [issue14351] Script error in 3.2.3rc1 Windows doc In-Reply-To: <1332013892.73.0.333055094928.issue14351@psf.upfronthosting.co.za> Message-ID: <1332014843.25.0.48147873541.issue14351@psf.upfronthosting.co.za> R. David Murray added the comment: I believe this was already found by someone (Georg, Martin?) and fixed by Ezio. ---------- assignee: docs at python -> ezio.melotti nosy: +ezio.melotti, r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 21:45:35 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Mar 2012 20:45:35 +0000 Subject: [issue14333] queue unittest errors In-Reply-To: <1331883945.34.0.322652565121.issue14333@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 118f7bdd631b by R David Murray in branch '3.2': #14333: fix test_queue so it can be run via standard unittest test discovery. http://hg.python.org/cpython/rev/118f7bdd631b New changeset 3ea4d7adb3e7 by R David Murray in branch 'default': Merge #14333: fix test_queue so it can be run via standard unittest test discovery. http://hg.python.org/cpython/rev/3ea4d7adb3e7 New changeset 340053208864 by R David Murray in branch '2.7': #14333: fix test_queue so it can be run via standard unittest test discovery. http://hg.python.org/cpython/rev/340053208864 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 21:49:40 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 20:49:40 +0000 Subject: [issue14333] queue unittest errors In-Reply-To: <1331883945.34.0.322652565121.issue14333@psf.upfronthosting.co.za> Message-ID: <1332017380.77.0.963155117985.issue14333@psf.upfronthosting.co.za> R. David Murray added the comment: Not only do I think we should support calling our tests via unittest, I think we should move in the direction of having regrtest be implemented via standard unittest hooks rather than the monster it currently is. That will take quite a bit of effort, though :) Given that we are in fact using unittest, I think it is much clearer to follow the standard unittest pattern and have tests that are supposed to be run marked by subclassing TestCase, rather than by being explicitly nominated in boilerplate at the bottom. Certainly any new test files I write work that way (and I even explicitly use test discovery in test_email). ---------- nosy: +r.david.murray resolution: -> fixed stage: -> committed/rejected status: open -> closed versions: +Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 21:49:57 2012 From: report at bugs.python.org (Mel Flynn) Date: Sat, 17 Mar 2012 20:49:57 +0000 Subject: [issue14353] Proper gettext support in locale module Message-ID: <1332017397.14.0.261241263671.issue14353@psf.upfronthosting.co.za> New submission from Mel Flynn : Gettext support in Python is configured by two tests: - textdomain in libc or libintl - bind_textdomain_codeset in libc only The latter causes incomplete gettext support in the locale module. Since the implementation uses two different defines, the provided patch provides them and also ensures they exist. The issue is not present in 3.x branches, as only a single test is done for full gettext support in locale. ---------- components: Build files: python26-configure.in.patch keywords: patch messages: 156203 nosy: melflynn priority: normal severity: normal status: open title: Proper gettext support in locale module type: enhancement versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file24917/python26-configure.in.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 21:50:47 2012 From: report at bugs.python.org (Mel Flynn) Date: Sat, 17 Mar 2012 20:50:47 +0000 Subject: [issue14353] Proper gettext support in locale module In-Reply-To: <1332017397.14.0.261241263671.issue14353@psf.upfronthosting.co.za> Message-ID: <1332017447.37.0.825220859657.issue14353@psf.upfronthosting.co.za> Mel Flynn added the comment: Additional patch for 2.7 branch. ---------- Added file: http://bugs.python.org/file24918/python27-configure.in.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 21:54:39 2012 From: report at bugs.python.org (R. David Murray) Date: Sat, 17 Mar 2012 20:54:39 +0000 Subject: [issue14353] Proper gettext support in locale module In-Reply-To: <1332017397.14.0.261241263671.issue14353@psf.upfronthosting.co.za> Message-ID: <1332017679.83.0.447078520436.issue14353@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 21:55:44 2012 From: report at bugs.python.org (Joe Rumsey) Date: Sat, 17 Mar 2012 20:55:44 +0000 Subject: [issue14354] Crash in _ctypes_alloc_callback Message-ID: <1332017744.32.0.532482393485.issue14354@psf.upfronthosting.co.za> New submission from Joe Rumsey : I have reproduced this crash in Apple's default 2.7.1 python, and in 2.7.3 built from source myself. But only in release mode. If I rebuild 2.7.3 in debug, the crash goes away. The attached file reproduces the issue, which has to do with a union containing multiple structs being used as a value for a callback argument. I've stripped it down as much as I can. Removing any fields from either the union or the Dice struct will cause this to no longer crash. The original source of this is libtcod's python wrapper library, which seems to work fine on platforms other than Mac, though it had a lot of other problems on 64-bit systems before I got to this one. This issue may also be more 64-bit specific than Mac specific. This is the callstack from Apple's python: #0 0x00000001010c7712 in _ctypes_alloc_callback () #1 0x00000001010c4a1c in PyCData_AtAddress () #2 0x0000000100050afa in icu::DigitList::getDouble () #3 0x000000010000bd32 in PyObject_Call () #4 0x000000010008bf63 in ubrk_swap () #5 0x000000010008ecd8 in triedict_swap () #6 0x000000010008ed4d in triedict_swap () #7 0x00000001000a608f in ucnv_openStandardNames () #8 0x00000001000a614f in ucnv_openStandardNames () #9 0x00000001000a72a2 in ucnv_getUnicodeSet () #10 0x00000001000b72af in ucnv_getDisplayName () #11 0x0000000100000e88 in ?? () ---------- assignee: ronaldoussoren components: Macintosh, ctypes files: testctypes.py messages: 156205 nosy: ogre, ronaldoussoren priority: normal severity: normal status: open title: Crash in _ctypes_alloc_callback type: crash versions: Python 2.7 Added file: http://bugs.python.org/file24919/testctypes.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 21:58:49 2012 From: report at bugs.python.org (Eric Snow) Date: Sat, 17 Mar 2012 20:58:49 +0000 Subject: [issue14355] imp module should omit references to init_frozen Message-ID: <1332017929.34.0.162160469146.issue14355@psf.upfronthosting.co.za> New submission from Eric Snow : The imp.init_frozen() function was removed from the documentation prior to 3.2 (changeset 2cf7bb2bbfb8). One reference to the function was left behind. I've attached a very intricate patch. ---------- assignee: docs at python components: Documentation files: imp_doc.rst messages: 156206 nosy: docs at python, eric.snow priority: normal severity: normal status: open title: imp module should omit references to init_frozen versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file24920/imp_doc.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 22:25:29 2012 From: report at bugs.python.org (Michael Foord) Date: Sat, 17 Mar 2012 21:25:29 +0000 Subject: [issue14295] PEP 417: adding mock module In-Reply-To: <1331688038.8.0.131181977771.issue14295@psf.upfronthosting.co.za> Message-ID: <1332019529.18.0.329106183132.issue14295@psf.upfronthosting.co.za> Michael Foord added the comment: Interesting. As I have to keep the external version of mock in sync with unittest.mock, and I have more important things to do first (like the docs) it would be a gratuitous change for no benefit. If you have any more substantive suggestions for code cleanup then feel free to suggest them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 22:29:30 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 17 Mar 2012 21:29:30 +0000 Subject: [issue14351] Script error in 3.2.3rc1 Windows doc In-Reply-To: <1332013892.73.0.333055094928.issue14351@psf.upfronthosting.co.za> Message-ID: <1332019770.59.0.41648327829.issue14351@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I hope you are right. The module docs server is also not working for me. Has that also been found and fixed (I don't see any issues) or should I file a separate report? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 23:01:38 2012 From: report at bugs.python.org (Georg Brandl) Date: Sat, 17 Mar 2012 22:01:38 +0000 Subject: [issue14351] Script error in 3.2.3rc1 Windows doc In-Reply-To: <1332013892.73.0.333055094928.issue14351@psf.upfronthosting.co.za> Message-ID: <1332021698.1.0.188903183556.issue14351@psf.upfronthosting.co.za> Georg Brandl added the comment: Yes, it should be fixed in rc2. The "module docs server" (I'm not familiar with that) is probably another issue. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 23:04:40 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 17 Mar 2012 22:04:40 +0000 Subject: [issue14351] Script error in 3.2.3rc1 Windows doc In-Reply-To: <1332013892.73.0.333055094928.issue14351@psf.upfronthosting.co.za> Message-ID: <1332021880.19.0.194215477553.issue14351@psf.upfronthosting.co.za> Changes by Martin v. L?wis : ---------- resolution: fixed -> duplicate superseder: -> 2.7.3rc1 chm gives JS error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 17 23:55:30 2012 From: report at bugs.python.org (Joe Rumsey) Date: Sat, 17 Mar 2012 22:55:30 +0000 Subject: [issue14354] Crash in _ctypes_alloc_callback In-Reply-To: <1332017744.32.0.532482393485.issue14354@psf.upfronthosting.co.za> Message-ID: <1332024930.74.0.60278487148.issue14354@psf.upfronthosting.co.za> Joe Rumsey added the comment: I just built python 3.2.2 from source, and reproduced the issue there as well. Same location. Here's the slightly more informative stack trace from my release-with-symbols 3.2.2 build: #0 _ctypes_alloc_callback (callable=0x7fff5fbfef20, converters=0x100000003, restype=0x7fff5fbfef20, flags=1606414112) at callbacks.c:432 #1 0x00000001010c5395 in PyCFuncPtr_new (type=0x7fff5fbfefc0, args=0x101010580, kwds=0x7fff5fbfefc0) at _ctypes.c:3372 #2 0x000000010004986c in type_call (type=0x1006ca940, args=0x101041b90, kwds=0x0) at typeobject.c:676 #3 0x0000000100008605 in PyObject_Call (func=0x1006ca940, arg=0x101041b90, kw=0x0) at abstract.c:2149 #4 0x000000010008afcc in do_call [inlined] () at /Users/ogre/src/Python-3.2.2/Python/ceval.c:4141 #5 0x000000010008afcc in PyEval_EvalFrameEx (f=0x7fff5fbff1c0, throwflag=1606414784) at ceval.c:3944 #6 0x000000010009131b in PyEval_EvalCodeEx (_co=0x7fff5fbff260, globals=0x0, locals=0x1066c8800000101, args=0x7fff5fbff260, argcount=1606414944, kws=0x7fff5fbff260, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at ceval.c:3350 #7 0x000000010009139f in PyEval_EvalCode (co=0x101066828, globals=0x101066c88, locals=0x0) at ceval.c:767 #8 0x00000001000b0a21 in run_mod [inlined] () at /Users/ogre/src/Python-3.2.2/Python/pythonrun.c:1783 #9 0x00000001000b0a21 in PyRun_FileExFlags (fp=0x7fff7c677ee0, filename=0x101066828 "\002", start=0, globals=0x101066c88, locals=0x0, closeit=1, flags=0x7fff5fbff420) at pythonrun.c:1740 #10 0x00000001000b2992 in PyRun_SimpleFileExFlags (fp=0x7fff7c677ee0, filename=0x10104ac20 "testctypes.py", closeit=1606415200, flags=0x7fff5fbff360) at pythonrun.c:1265 #11 0x00000001000c45af in run_file [inlined] () at /Users/ogre/src/Python-3.2.2/Modules/main.c:297 #12 0x00000001000c45af in Py_Main (argc=1606415440, argv=0x7fff5fbff450) at main.c:692 #13 0x0000000100001522 in main (argc=17197096, argv=0x100609fe0) at python.c:59 converters doesn't seem to be pointing at valid data. (gdb) p *converters $2 = { ob_refcnt = 3302829852670, ob_type = 0xe0000000200 } But, being an optimized build, it's hard to say (especially for me, having never debugged python itself before) if that's the real data or some optimizer-mangled version. ---------- versions: +Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 00:30:07 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 17 Mar 2012 23:30:07 +0000 Subject: [issue14352] Distutils2 won't install on Ubuntu In-Reply-To: <1332014149.79.0.895203792627.issue14352@psf.upfronthosting.co.za> Message-ID: <1332027007.85.0.712004902141.issue14352@psf.upfronthosting.co.za> ?ric Araujo added the comment: Your log file seems to tell that the installation goes fine. The last message is just a warning. So what makes you say that d2 doesn?t install? ---------- versions: +3rd party _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 00:33:06 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sat, 17 Mar 2012 23:33:06 +0000 Subject: [issue14352] Distutils2 won't install on Ubuntu In-Reply-To: <1332014149.79.0.895203792627.issue14352@psf.upfronthosting.co.za> Message-ID: <1332027186.35.0.421627036336.issue14352@psf.upfronthosting.co.za> Alex Gr?nholm added the comment: Being new to d2, I wouldn't know that the installation was completed successfully or if there was something left out. Regardless, this needs to be fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 00:35:22 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 17 Mar 2012 23:35:22 +0000 Subject: [issue14352] Distutils2 won't install on Ubuntu In-Reply-To: <1332014149.79.0.895203792627.issue14352@psf.upfronthosting.co.za> Message-ID: <1332027322.82.0.831438436298.issue14352@psf.upfronthosting.co.za> ?ric Araujo added the comment: I would agree, if you told me *what* needs to be fixed :) First, the unhelpful warning will go (that?s another bug); second, would you be satisfied if I added a logging message to tell that the installation completed successfully? The tradition of unix command-line applications is to say nothing if everything goes fine, but if we?re not working in quiet mode then a final logging message would be better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 00:38:23 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sat, 17 Mar 2012 23:38:23 +0000 Subject: [issue14352] Distutils2 won't install on Ubuntu In-Reply-To: <1332014149.79.0.895203792627.issue14352@psf.upfronthosting.co.za> Message-ID: <1332027503.92.0.210493088781.issue14352@psf.upfronthosting.co.za> Alex Gr?nholm added the comment: It doesn't say "Warning" there, so how was I supposed to determine that it's not an error which terminated the installation process? If it is indeed just a warning, just getting rid of it would fix this for me. However, will this cause trouble with "requires-python" in setup.cfg? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 00:44:33 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 17 Mar 2012 23:44:33 +0000 Subject: [issue14352] Distutils2: add logging message to report successful installation In-Reply-To: <1332014149.79.0.895203792627.issue14352@psf.upfronthosting.co.za> Message-ID: <1332027873.5.0.531129851033.issue14352@psf.upfronthosting.co.za> ?ric Araujo added the comment: > It doesn't say "Warning" there Right, so that?s a problem with our logging config. > However, will this cause trouble with "requires-python" in setup.cfg? I?m not sure why you?re asking that, as d2?s setup.cfg does not use requires-python and does produce the warning, so it?s unrelated. (The warning comes from d2.database.) ---------- title: Distutils2 won't install on Ubuntu -> Distutils2: add logging message to report successful installation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 00:49:45 2012 From: report at bugs.python.org (Ned Deily) Date: Sat, 17 Mar 2012 23:49:45 +0000 Subject: [issue13370] test_ctypes fails when building python with clang In-Reply-To: <1320761474.93.0.268896325495.issue13370@psf.upfronthosting.co.za> Message-ID: <1332028185.85.0.00743444113638.issue13370@psf.upfronthosting.co.za> Ned Deily added the comment: An update: test_ctypes continues to fail on 2.7.3rc2 with exactly the same failures as originally reported when compiled non-debug 64-bit (x86_64) with either the latest clang *or* llvm-gcc from Xcode 4.3.1. It does not fail when compiled with gcc-4.2 from Xcode 3.2.6. Not does it fail with any of the three compilers when compiled and run as 32-bit (i386). So it does seem to come down to a difference between standard gcc and with the llvm-based compilers (clang, llvm-gcc), and not just clang. Python 2.7.3rc2 (2.7:f59ab537a5dc, Mar 17 2012, 15:26:37) [GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.54)] on darwin Python 2.7.3rc2 (2.7:f59ab537a5dc, Mar 17 2012, 15:47:25) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)] on darwin Python 2.7.3rc2 (2.7:f59ab537a5dc, Mar 17 2012, 16:08:58) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 00:50:17 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sat, 17 Mar 2012 23:50:17 +0000 Subject: [issue14352] Distutils2: add logging message to report successful installation In-Reply-To: <1332014149.79.0.895203792627.issue14352@psf.upfronthosting.co.za> Message-ID: <1332028217.14.0.492754605721.issue14352@psf.upfronthosting.co.za> Alex Gr?nholm added the comment: > I?m not sure why you?re asking that, as d2?s setup.cfg does not use requires-python and does produce the warning, so it?s unrelated. (The warning comes from d2.database.) I was concerned that maybe the version comparator would barf on a version like 2.7.2+ and refuse to process the "requires-python" directive, but if you say this is not the case then I'll just leave it at that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 00:56:00 2012 From: report at bugs.python.org (Ned Deily) Date: Sat, 17 Mar 2012 23:56:00 +0000 Subject: [issue14354] Crash in _ctypes_alloc_callback In-Reply-To: <1332017744.32.0.532482393485.issue14354@psf.upfronthosting.co.za> Message-ID: <1332028560.11.0.771568491985.issue14354@psf.upfronthosting.co.za> Ned Deily added the comment: This is likely related to Issue13370 which documents test_ctypes failures when using either of the llvm-based compilers (clang or llvm-gcc) supplied with recent versions of Xcode 4. test_ctypes and your test both do not fail when Python is compiled with the standard (non-llvm) gcc-4.2 supplied in Xcode 3.2.6 (for OS X 10.6). ---------- nosy: +meador.inge, ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 01:27:39 2012 From: report at bugs.python.org (Joe Rumsey) Date: Sun, 18 Mar 2012 00:27:39 +0000 Subject: [issue14354] Crash in _ctypes_alloc_callback In-Reply-To: <1332017744.32.0.532482393485.issue14354@psf.upfronthosting.co.za> Message-ID: <1332030459.62.0.773768456563.issue14354@psf.upfronthosting.co.za> Joe Rumsey added the comment: Thanks for that. This does seem to be the case. I rebuilt with CC=gcc-4.2 and my short sample and the full library I took it from both work fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 02:06:25 2012 From: report at bugs.python.org (Matt Joiner) Date: Sun, 18 Mar 2012 01:06:25 +0000 Subject: [issue14333] queue unittest errors In-Reply-To: <1331883945.34.0.322652565121.issue14333@psf.upfronthosting.co.za> Message-ID: <1332032785.91.0.355709546801.issue14333@psf.upfronthosting.co.za> Matt Joiner added the comment: Yes, FWIW much of the standard library tests are callable this way without issue. I have patches that fix the discoverability of a few test modules. I'll submit these in another issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 02:08:06 2012 From: report at bugs.python.org (Matt Joiner) Date: Sun, 18 Mar 2012 01:08:06 +0000 Subject: [issue12684] profile does not dump stats on exception like cProfile does In-Reply-To: <1312335798.44.0.743453347572.issue12684@psf.upfronthosting.co.za> Message-ID: <1332032886.05.0.87460101874.issue12684@psf.upfronthosting.co.za> Matt Joiner added the comment: I will submit a patch for this soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 02:17:31 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 18 Mar 2012 01:17:31 +0000 Subject: [issue14348] Whitespace - Lib/base64.py In-Reply-To: <1331990403.5.0.414904918457.issue14348@psf.upfronthosting.co.za> Message-ID: <1332033451.99.0.758943590453.issue14348@psf.upfronthosting.co.za> ?ric Araujo added the comment: Hi Dionysios. In the standard library, we do not usually make cosmetic changes, because they don?t bring much value, make the version control history less useful, and take time that could be spent on fixing bugs or adding features. Please read msg154729 for a longer explanation. Adding another core developer to confirm. Please don?t let this stop you from making other patches; there are a ton of bugs to choose from and your willingness to contribute is very much appreciated. ---------- nosy: +eric.araujo, r.david.murray resolution: -> wont fix stage: -> committed/rejected status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 02:23:00 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 18 Mar 2012 01:23:00 +0000 Subject: [issue13009] Remove documentation in distutils2 repo In-Reply-To: <1316444893.0.0.327846688186.issue13009@psf.upfronthosting.co.za> Message-ID: <1332033780.11.0.516401033452.issue13009@psf.upfronthosting.co.za> ?ric Araujo added the comment: Done in 21b8e29bcd5c. ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 03:07:56 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 18 Mar 2012 02:07:56 +0000 Subject: [issue13512] ~/.pypirc created insecurely In-Reply-To: <1322695403.24.0.389183798564.issue13512@psf.upfronthosting.co.za> Message-ID: <1332036476.29.0.656880257365.issue13512@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Check it in. It looks innocent enough to put in 2.7.3 final. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 03:12:58 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 18 Mar 2012 02:12:58 +0000 Subject: [issue13512] ~/.pypirc created insecurely In-Reply-To: <1322695403.24.0.389183798564.issue13512@psf.upfronthosting.co.za> Message-ID: <1332036778.02.0.667151521222.issue13512@psf.upfronthosting.co.za> Benjamin Peterson added the comment: On the other hand, it doesn't seem to be a very pressing issue, so let's wait for 2.7.4. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 03:20:25 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 18 Mar 2012 02:20:25 +0000 Subject: [issue13512] ~/.pypirc created insecurely In-Reply-To: <1322695403.24.0.389183798564.issue13512@psf.upfronthosting.co.za> Message-ID: <1332037225.71.0.511688056493.issue13512@psf.upfronthosting.co.za> ?ric Araujo added the comment: Alright, I?ll commit normally to the stable and development versions, skipping the security-mode branches. ---------- type: security -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 03:39:44 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Sun, 18 Mar 2012 02:39:44 +0000 Subject: [issue14350] Strange Exception from copying an iterable In-Reply-To: <1332011066.2.0.397754612752.issue14350@psf.upfronthosting.co.za> Message-ID: <1332038384.75.0.208122895763.issue14350@psf.upfronthosting.co.za> Ramchandra Apte added the comment: I get a normal exception. I see ipython at the top level in 'T:\languages\Python27\Scripts\ in ()' Perhaps you ran ipython accidentally? ---------- nosy: +ramchandra.apte _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 04:16:53 2012 From: report at bugs.python.org (R. David Murray) Date: Sun, 18 Mar 2012 03:16:53 +0000 Subject: [issue14348] Whitespace - Lib/base64.py In-Reply-To: <1331990403.5.0.414904918457.issue14348@psf.upfronthosting.co.za> Message-ID: <1332040613.85.0.947697674346.issue14348@psf.upfronthosting.co.za> R. David Murray added the comment: Yes, our preferred approach is to make such cleanups when we touch that section of code for some other reason. Like ?ric said, your willingness to contribute is very much appreciated and we hope you'll find another bug to work on. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 04:26:34 2012 From: report at bugs.python.org (R. David Murray) Date: Sun, 18 Mar 2012 03:26:34 +0000 Subject: [issue14350] Strange Exception from copying an iterable In-Reply-To: <1332011066.2.0.397754612752.issue14350@psf.upfronthosting.co.za> Message-ID: <1332041194.62.0.650539197016.issue14350@psf.upfronthosting.co.za> R. David Murray added the comment: @Ramchandra: I think you referring to the traceback format (which is indeed less useful than a normal Python traceback in the context of this tracker). The OP, however, is referring to the exception itself: TypeError: object.__new__(listiterator) is not safe, use listiterator.__new__() This is indeed a bit unexpected, though I don't know that copying iterators is actually supported. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 04:26:47 2012 From: report at bugs.python.org (R. David Murray) Date: Sun, 18 Mar 2012 03:26:47 +0000 Subject: [issue14350] Strange Exception from copying an iterable In-Reply-To: <1332011066.2.0.397754612752.issue14350@psf.upfronthosting.co.za> Message-ID: <1332041207.98.0.276850766494.issue14350@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- versions: +Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 07:10:35 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sun, 18 Mar 2012 06:10:35 +0000 Subject: [issue14356] Distutils2 ignores site-local configuration Message-ID: <1332051035.41.0.153841644882.issue14356@psf.upfronthosting.co.za> New submission from Alex Gr?nholm : Distutils2 seems to rely solely on a sysconfig.cfg shipped with distutils2 to get the path where to install packages. Ignoring site-local configuration means that it won't work on Python distributions where the site configuration has been customized. On Ubuntu, packages are supposed to go to /usr/local/lib/python2.7/dist-packages but distutils2 tries to install them to /usr/lib/python2.7/site-packages. ---------- assignee: eric.araujo components: Distutils2 messages: 156230 nosy: agronholm, alexis, eric.araujo, tarek priority: normal severity: normal status: open title: Distutils2 ignores site-local configuration type: behavior versions: 3rd party, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 07:26:52 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sun, 18 Mar 2012 06:26:52 +0000 Subject: [issue14357] Distutils2 does not work with virtualenv Message-ID: <1332052012.13.0.374309146875.issue14357@psf.upfronthosting.co.za> New submission from Alex Gr?nholm : The installed pysetup script launches (at least on my system) with /usr/bin/python regardless of the interpreter used for installing it. ---------- assignee: eric.araujo components: Distutils2 messages: 156231 nosy: agronholm, alexis, eric.araujo, tarek priority: normal severity: normal status: open title: Distutils2 does not work with virtualenv versions: 3rd party, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 07:27:01 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sun, 18 Mar 2012 06:27:01 +0000 Subject: [issue14357] Distutils2 does not work with virtualenv In-Reply-To: <1332052012.13.0.374309146875.issue14357@psf.upfronthosting.co.za> Message-ID: <1332052021.17.0.305337145561.issue14357@psf.upfronthosting.co.za> Changes by Alex Gr?nholm : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 08:16:52 2012 From: report at bugs.python.org (Ben Hayden) Date: Sun, 18 Mar 2012 07:16:52 +0000 Subject: [issue14358] test_os failing with errno 61: No Data Available Message-ID: <1332055012.37.0.633152160174.issue14358@psf.upfronthosting.co.za> New submission from Ben Hayden : When running the test suite on Linux 3.2.9-1, I get the following error on the test_os suite: test test_os crashed -- Traceback (most recent call last): File "/home/benhayden/Documents/cpython/Lib/test/regrtest.py", line 1229, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/home/benhayden/Documents/cpython/Lib/test/test_os.py", line 1767, in @unittest.skipUnless(supports_extended_attributes(), File "/home/benhayden/Documents/cpython/Lib/test/test_os.py", line 1754, in supports_extended_attributes os.fsetxattr(fp.fileno(), b"user.test", b"") OSError: [Errno 61] No data available I don't know the best way to handle this error, but instead of raising it, I just let the decorator return False. This allowed test_os to finish (and finish successfully) on my machine. Once again, I don't really know what ENODATA might mean, so I just tried the first thing that worked for me. ---------- components: Tests files: test_os_support_ext.patch keywords: patch messages: 156232 nosy: beardedp priority: normal severity: normal status: open title: test_os failing with errno 61: No Data Available type: crash versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file24921/test_os_support_ext.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 08:28:45 2012 From: report at bugs.python.org (Ross Lagerwall) Date: Sun, 18 Mar 2012 07:28:45 +0000 Subject: [issue14358] test_os failing with errno 61: No Data Available In-Reply-To: <1332055012.37.0.633152160174.issue14358@psf.upfronthosting.co.za> Message-ID: <1332055724.99.0.855213705319.issue14358@psf.upfronthosting.co.za> Ross Lagerwall added the comment: Perhaps any errors that occur during supports_extended_attributes should cause it to just return false? ---------- nosy: +benjamin.peterson, rosslagerwall _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 08:32:32 2012 From: report at bugs.python.org (=?utf-8?q?Herv=C3=A9_Coatanhay?=) Date: Sun, 18 Mar 2012 07:32:32 +0000 Subject: [issue14296] Compilation error on CentOS 5.8 In-Reply-To: <1331688181.08.0.800421526529.issue14296@psf.upfronthosting.co.za> Message-ID: <1332055952.27.0.812252311085.issue14296@psf.upfronthosting.co.za> Herv? Coatanhay added the comment: You can consider it fixed, compilation runs OK now. However I have an error on building _posixsubprocess.o when I do `make test`, I'll report it in another ticket. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 08:47:24 2012 From: report at bugs.python.org (Matt Joiner) Date: Sun, 18 Mar 2012 07:47:24 +0000 Subject: [issue13448] PEP 3155 implementation In-Reply-To: <1321908830.82.0.349913947268.issue13448@psf.upfronthosting.co.za> Message-ID: <1332056844.02.0.984575954918.issue13448@psf.upfronthosting.co.za> Matt Joiner added the comment: Doc/library/dis.rst wasn't updated for the extra pop introduced to MAKE_CLOSURE opcode. ---------- nosy: +anacrolix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 08:59:48 2012 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Sun, 18 Mar 2012 07:59:48 +0000 Subject: [issue14354] Crash in _ctypes_alloc_callback In-Reply-To: <1332017744.32.0.532482393485.issue14354@psf.upfronthosting.co.za> Message-ID: <1332057588.73.0.913291187299.issue14354@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: I also noticed that the script crashes on Debian 64bit as well, versions 2.6 and 2.7.3rc2 at least, optimized builds. So it's not a clang issue after all. ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 09:04:38 2012 From: report at bugs.python.org (=?utf-8?q?Herv=C3=A9_Coatanhay?=) Date: Sun, 18 Mar 2012 08:04:38 +0000 Subject: [issue14359] _posixsubprocess.o compilation error on CentOS 5.8 Message-ID: <1332057878.8.0.554902086593.issue14359@psf.upfronthosting.co.za> New submission from Herv? Coatanhay : Linux Version: 2.6.18-238.19.1.el5 / CentOS release 5.8 (Final) On changeset 75803:b26056192653 , I have the following compilation error: gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -IInclude -I. -I./Include -I/usr/local/include -I/home/proexp/cpython2 -c /home/proexp/cpython2/Modules/_posixsubprocess.c -o build/temp.linux-x86_64-3.3/home/proexp/cpython2/Modules/_posixsubprocess.o /home/proexp/cpython2/Modules/_posixsubprocess.c: In function ?_close_open_fd_range_safe?: /home/proexp/cpython2/Modules/_posixsubprocess.c:207: erreur: ?O_CLOEXEC? undeclared (first use in this function) /home/proexp/cpython2/Modules/_posixsubprocess.c:207: erreur: (Each undeclared identifier is reported only once /home/proexp/cpython2/Modules/_posixsubprocess.c:207: erreur: for each function it appears in.) The problem is the too old kernel version provided on CentOS 5 and RHEL 5 whic does not support O_CLOEXEC. I join my proposed patch for this issue. ---------- components: Build files: _posixmodule.patch keywords: patch messages: 156237 nosy: Alzakath priority: normal severity: normal status: open title: _posixsubprocess.o compilation error on CentOS 5.8 type: compile error versions: Python 3.3 Added file: http://bugs.python.org/file24922/_posixmodule.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 09:13:46 2012 From: report at bugs.python.org (Eric Snow) Date: Sun, 18 Mar 2012 08:13:46 +0000 Subject: [issue14355] imp module docs should omit references to init_frozen In-Reply-To: <1332017929.34.0.162160469146.issue14355@psf.upfronthosting.co.za> Message-ID: <1332058426.37.0.149404693492.issue14355@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- title: imp module should omit references to init_frozen -> imp module docs should omit references to init_frozen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 10:36:35 2012 From: report at bugs.python.org (Dmitry Shachnev) Date: Sun, 18 Mar 2012 09:36:35 +0000 Subject: [issue14360] email.encoders.encode_quopri doesn't work with python 3.2 Message-ID: <1332063395.16.0.293436373736.issue14360@psf.upfronthosting.co.za> New submission from Dmitry Shachnev : Currently my /usr/lib/python3.2/email/encoders.py has this code: def _qencode(s): enc = _encodestring(s, quotetabs=True) # Must encode spaces, which quopri.encodestring() doesn't do return enc.replace(' ', '=20') The problem is that _encodestring (which is just quopri.encodestring) always returns bytes, trying to run replace() on bytes raises "TypeError: expected an object with the buffer interface". This leads to email.encoders.encode_quopri never working. So, I think this should be changed to something like this: <...> return enc.decode().replace(' ', '=20') Example log: Python 3.2.3rc1 (default, Mar 9 2012, 23:02:43) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import email.encoders >>> from email.mime.text import MIMEText >>> msg = MIMEText(b'some text here') >>> email.encoders.encode_quopri(msg) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.2/email/encoders.py", line 44, in encode_quopri encdata = _qencode(orig) File "/usr/lib/python3.2/email/encoders.py", line 23, in _qencode return enc.replace(' ', '=20') TypeError: expected an object with the buffer interface Reproduced on Ubuntu precise with Python 3.2.3rc1. Replacing encode_quopri with encode_base64 works fine. ---------- components: Library (Lib) messages: 156238 nosy: barry, mitya57 priority: normal severity: normal status: open title: email.encoders.encode_quopri doesn't work with python 3.2 type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 10:57:04 2012 From: report at bugs.python.org (Jakob Bowyer) Date: Sun, 18 Mar 2012 09:57:04 +0000 Subject: [issue14350] Strange Exception from copying an iterable In-Reply-To: <1332011066.2.0.397754612752.issue14350@psf.upfronthosting.co.za> Message-ID: <1332064624.61.0.510850037264.issue14350@psf.upfronthosting.co.za> Jakob Bowyer added the comment: C:\Users\Jakob>python -c "import copy; copy.copy(iter([1,2,3]))" Traceback (most recent call last): File "", line 1, in File "T:\languages\Python27\lib\copy.py", line 96, in copy return _reconstruct(x, rv, 0) File "T:\languages\Python27\lib\copy.py", line 329, in _reconstruct y = callable(*args) File "T:\languages\Python27\lib\copy_reg.py", line 93, in __newobj__ return cls.__new__(cls, *args) TypeError: object.__new__(listiterator) is not safe, use listiterator.__new__() C:\Users\Jakob>python3 -c "import copy; copy.copy(iter([1,2,3]))" Traceback (most recent call last): File "", line 1, in File "T:\languages\Python32\lib\copy.py", line 97, in copy return _reconstruct(x, rv, 0) File "T:\languages\Python32\lib\copy.py", line 285, in _reconstruct y = callable(*args) File "T:\languages\Python32\lib\copyreg.py", line 88, in __newobj__ return cls.__new__(cls, *args) TypeError: object.__new__(list_iterator) is not safe, use list_iterator.__new__() Pure python traceback. Just for clarity. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 10:58:16 2012 From: report at bugs.python.org (Dmitry Shachnev) Date: Sun, 18 Mar 2012 09:58:16 +0000 Subject: [issue14360] email.encoders.encode_quopri doesn't work with python 3.2 In-Reply-To: <1332063395.16.0.293436373736.issue14360@psf.upfronthosting.co.za> Message-ID: <1332064696.95.0.740641940368.issue14360@psf.upfronthosting.co.za> Changes by Dmitry Shachnev : ---------- type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 11:13:53 2012 From: report at bugs.python.org (Roumen Petrov) Date: Sun, 18 Mar 2012 10:13:53 +0000 Subject: [issue3754] cross-compilation support for python build In-Reply-To: <1220305759.82.0.468834426074.issue3754@psf.upfronthosting.co.za> Message-ID: <1332065633.11.0.963590249537.issue3754@psf.upfronthosting.co.za> Changes by Roumen Petrov : Added file: http://bugs.python.org/file24923/python-py3k-20120318-CROSS.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 11:14:56 2012 From: report at bugs.python.org (Roumen Petrov) Date: Sun, 18 Mar 2012 10:14:56 +0000 Subject: [issue3871] cross and native build of python for mingw32 with packaging In-Reply-To: <1221433699.47.0.0165458312451.issue3871@psf.upfronthosting.co.za> Message-ID: <1332065696.42.0.0213464225235.issue3871@psf.upfronthosting.co.za> Changes by Roumen Petrov : Added file: http://bugs.python.org/file24924/python-py3k-20120318-MINGW.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 11:44:11 2012 From: report at bugs.python.org (Roumen Petrov) Date: Sun, 18 Mar 2012 10:44:11 +0000 Subject: [issue3754] cross-compilation support for python build In-Reply-To: <1220305759.82.0.468834426074.issue3754@psf.upfronthosting.co.za> Message-ID: <1332067451.75.0.389711928978.issue3754@psf.upfronthosting.co.za> Roumen Petrov added the comment: I cannot test arm build due to issue 12010 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 12:14:27 2012 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 18 Mar 2012 11:14:27 +0000 Subject: [issue14361] No link to issue tracker on Python home page Message-ID: <1332069267.85.0.0257661397774.issue14361@psf.upfronthosting.co.za> New submission from Steven D'Aprano : There is no link to the tracker http://bugs.python.org/ on the Python website http://www.python.org/ (or if there is, it's so well hidden I can't see it). I seem to remember that there used to be; whether or not there was, there should be. Curiously, the issue tracker itself includes a link to the issue tracker, in the side-bar. Tested with Firefox 3.6, Konqueror, and wget + grep. ---------- messages: 156241 nosy: stevenjd priority: normal severity: normal status: open title: No link to issue tracker on Python home page _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 12:16:52 2012 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Sun, 18 Mar 2012 11:16:52 +0000 Subject: [issue14354] Crash in _ctypes_alloc_callback In-Reply-To: <1332017744.32.0.532482393485.issue14354@psf.upfronthosting.co.za> Message-ID: <1332069412.3.0.0443195422248.issue14354@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: There is a out-of-bounds error in Modules/_ctypes/libffi/src/x86/ffi64.c: at line 225, classes[i + pos] can go outside the allocated memory for classes (MAX_CLASSES=4). This code is not prepared to received "structures" with a small size (<32bytes) but where individual elements total more than 32bytes. libffi support for unions is weak; at least ctypes should not use FFI_TYPE_STRUCT for unions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 12:17:13 2012 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Sun, 18 Mar 2012 11:17:13 +0000 Subject: [issue14354] Crash in _ctypes_alloc_callback In-Reply-To: <1332017744.32.0.532482393485.issue14354@psf.upfronthosting.co.za> Message-ID: <1332069433.43.0.50996720573.issue14354@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Not a Mac issue. ---------- assignee: ronaldoussoren -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 12:18:24 2012 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 18 Mar 2012 11:18:24 +0000 Subject: [issue14362] No mention of collections.ChainMap in What's New for 3.3 Message-ID: <1332069504.3.0.514334264343.issue14362@psf.upfronthosting.co.za> New submission from Steven D'Aprano : The 3.3 What's New doesn't mention collections.ChainMap ---------- assignee: docs at python components: Documentation messages: 156244 nosy: docs at python, stevenjd priority: normal severity: normal status: open title: No mention of collections.ChainMap in What's New for 3.3 versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 12:23:53 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 18 Mar 2012 11:23:53 +0000 Subject: [issue14361] No link to issue tracker on Python home page In-Reply-To: <1332069267.85.0.0257661397774.issue14361@psf.upfronthosting.co.za> Message-ID: <1332069833.19.0.0242088708051.issue14361@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I disagree that there should be such a link. www.python.org is the home page of the Python programming language, not of CPython. To find the tracker, go to "Core development", and find it in the "Resources" section. ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 12:31:50 2012 From: report at bugs.python.org (Merlijn van Deen) Date: Sun, 18 Mar 2012 11:31:50 +0000 Subject: [issue14361] No link to issue tracker on Python home page In-Reply-To: <1332069267.85.0.0257661397774.issue14361@psf.upfronthosting.co.za> Message-ID: <1332070310.99.0.40154590218.issue14361@psf.upfronthosting.co.za> Merlijn van Deen added the comment: Maybe, but python.org also is the host of CPython itself (and this issue tracker is also for issues on the programming language). I think the "Core development" page makes sense, but having it in a sidebar instead of somewhere at the bottom of the page would be helpful, or an introduction that notes there are useful links at the bottom. Maybe just move the "quick links" section to above the "quick start" section? To be more specific- the devguide made me think 'oh, so this is the page on how I compile CPython, but I'm looking for the issue tracker. *clicks "back"*' ---------- nosy: +valhallasw _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 12:44:56 2012 From: report at bugs.python.org (Alexis Metaireau) Date: Sun, 18 Mar 2012 11:44:56 +0000 Subject: [issue14356] Distutils2 ignores site-local configuration In-Reply-To: <1332051035.41.0.153841644882.issue14356@psf.upfronthosting.co.za> Message-ID: <4F65CAB6.6060505@notmyidea.org> Alexis Metaireau added the comment: The supposed way to work, for OS packagers, is to ship this sysconfig.cfg thing. I'm not sure we should rely on a customized site-local configuration, without defining any standard way of doing this (IOW: what are we looking for in the site-local config?) Also, I would add that this seem to be a compatibility thing, maybe could we add a fallback to site-local if no sysconfig is found? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 13:03:17 2012 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 18 Mar 2012 12:03:17 +0000 Subject: [issue14363] Can't build Python 3.3a1 on Centos 5 Message-ID: <1332072196.05.0.286336740543.issue14363@psf.upfronthosting.co.za> New submission from Steven D'Aprano : I attempted to build Python 3.3a1 but failed. I am running Centos 5. After running ./configure (no apparent errors), I ran make and got a whole lot of warnings and errors, ending with: collect2: ld returned 1 exit status make: *** [python] Error 1 Output attached as a file. ---------- components: Build files: out messages: 156248 nosy: stevenjd priority: normal severity: normal status: open title: Can't build Python 3.3a1 on Centos 5 versions: Python 3.3 Added file: http://bugs.python.org/file24925/out _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 13:10:49 2012 From: report at bugs.python.org (Stefan Krah) Date: Sun, 18 Mar 2012 12:10:49 +0000 Subject: [issue14363] Can't build Python 3.3a1 on Centos 5 In-Reply-To: <1332072196.05.0.286336740543.issue14363@psf.upfronthosting.co.za> Message-ID: <1332072649.86.0.377479899499.issue14363@psf.upfronthosting.co.za> Stefan Krah added the comment: This is a duplicate of #14296. See also #14359. ---------- nosy: +skrah resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> Compilation error on CentOS 5.8 type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 14:52:41 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 18 Mar 2012 13:52:41 +0000 Subject: [issue14115] 2.7.3rc hangs on test_asynchat on 32-bit Windows In-Reply-To: <1330115184.52.0.720295270361.issue14115@psf.upfronthosting.co.za> Message-ID: <1332078761.49.0.152268745466.issue14115@psf.upfronthosting.co.za> Martin v. L?wis added the comment: This still happens for 3.2.3rc2 ---------- keywords: +3.2regression nosy: +benjamin.peterson, georg.brandl priority: normal -> release blocker versions: +Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 14:54:56 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 18 Mar 2012 13:54:56 +0000 Subject: [issue14115] 2.7.3rc and 3.2.3rc hang on test_asynchat and test_asyncore on 32-bit Windows In-Reply-To: <1330115184.52.0.720295270361.issue14115@psf.upfronthosting.co.za> Message-ID: <1332078896.58.0.97758502213.issue14115@psf.upfronthosting.co.za> Martin v. L?wis added the comment: test_asyncore hangs as well. ---------- title: 2.7.3rc hangs on test_asynchat on 32-bit Windows -> 2.7.3rc and 3.2.3rc hang on test_asynchat and test_asyncore on 32-bit Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 14:57:24 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 18 Mar 2012 13:57:24 +0000 Subject: [issue14359] _posixsubprocess.o compilation error on CentOS 5.8 In-Reply-To: <1332057878.8.0.554902086593.issue14359@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset fe1dfc066a38 by Ross Lagerwall in branch 'default': Issue 14359: Only use O_CLOEXEC in _posixmodule.c if it is defined. http://hg.python.org/cpython/rev/fe1dfc066a38 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 14:59:02 2012 From: report at bugs.python.org (Ross Lagerwall) Date: Sun, 18 Mar 2012 13:59:02 +0000 Subject: [issue7997] http://www.python.org/dev/faq/ doesn't seem to explain how to regenerate "configure" In-Reply-To: <1266882841.0.0.727782074241.issue7997@psf.upfronthosting.co.za> Message-ID: <1332079142.27.0.470905695012.issue7997@psf.upfronthosting.co.za> Changes by Ross Lagerwall : ---------- assignee: -> rosslagerwall nosy: +rosslagerwall resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 15:25:11 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 18 Mar 2012 14:25:11 +0000 Subject: [issue14115] 2.7.3rc and 3.2.3rc hang on test_asynchat and test_asyncore on 32-bit Windows In-Reply-To: <1330115184.52.0.720295270361.issue14115@psf.upfronthosting.co.za> Message-ID: <1332080711.19.0.959862858104.issue14115@psf.upfronthosting.co.za> Martin v. L?wis added the comment: This was a false alarm; I just didn't wait long enough (test_asyncore needs 3 minutes when running under the PGI python). ---------- priority: release blocker -> resolution: -> invalid _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 15:29:13 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Sun, 18 Mar 2012 14:29:13 +0000 Subject: [issue14364] Argparse incorrectly handles '--' Message-ID: <1332080953.55.0.495639573781.issue14364@psf.upfronthosting.co.za> New submission from Michele Orr? : http://docs.python.org/library/argparse.html#arguments-containing The attached file shows different behaviours when using '--' immediately after an optional argument. tumbolandia:cpython maker$ python foo.py --test=-- foo [] tumbolandia:cpython maker$ python foo.py --test -- foo usage: foo.py [-h] [-t TEST] [yuri] foo.py: error: argument -t/--test: expected 1 argument(s) The same is for single-dash arguments. tumbolandia:cpython maker$ python foo.py -t -- foo usage: foo.py [-h] [-t TEST] [yuri] foo.py: error: argument -t/--test: expected 1 argument(s) tumbolandia:cpython maker$ python foo.py -t-- foo [] Obviously argparse should return an error in both cases. The bug is probably due to Lib/argparser.py:2211 ---------- files: foo.py messages: 156254 nosy: maker priority: normal severity: normal status: open title: Argparse incorrectly handles '--' versions: Python 2.7, Python 3.1 Added file: http://bugs.python.org/file24926/foo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 15:42:52 2012 From: report at bugs.python.org (R. David Murray) Date: Sun, 18 Mar 2012 14:42:52 +0000 Subject: [issue13922] argparse handling multiple "--" in args improperly In-Reply-To: <1328132556.72.0.92385645061.issue13922@psf.upfronthosting.co.za> Message-ID: <1332081772.24.0.38803333768.issue13922@psf.upfronthosting.co.za> R. David Murray added the comment: I think it is unlikely that anyone depends on argparse consuming multiple -- strings. If you are worried about it we could restrict the change to 3.3. But personally I think this would be OK for a bug fix. ---------- nosy: +r.david.murray versions: -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 15:45:01 2012 From: report at bugs.python.org (R. David Murray) Date: Sun, 18 Mar 2012 14:45:01 +0000 Subject: [issue14364] Argparse incorrectly handles '--' In-Reply-To: <1332080953.55.0.495639573781.issue14364@psf.upfronthosting.co.za> Message-ID: <1332081901.11.0.924887234764.issue14364@psf.upfronthosting.co.za> R. David Murray added the comment: It does look like there's anomalous behavior here of some sort, but I'd expect --test=-- to result in test="--", myself, rather than an error. My intuition is that '--' would need to be preceded by a space to function as the 'end of options' marker. Because of that, I've never tried the above scenario with a unix command, so maybe my intuition is wrong :) Just for reference (the code paths may be different), there is another open issue about -- parsing, issue 13922. ---------- components: +Library (Lib) nosy: +bethard, r.david.murray stage: -> needs patch versions: +Python 3.2, Python 3.3 -Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 16:10:22 2012 From: report at bugs.python.org (R. David Murray) Date: Sun, 18 Mar 2012 15:10:22 +0000 Subject: [issue14115] 2.7.3rc and 3.2.3rc hang on test_asynchat and test_asyncore on 32-bit Windows In-Reply-To: <1330115184.52.0.720295270361.issue14115@psf.upfronthosting.co.za> Message-ID: <1332083422.31.0.977450251329.issue14115@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 16:54:07 2012 From: report at bugs.python.org (Steven Bethard) Date: Sun, 18 Mar 2012 15:54:07 +0000 Subject: [issue13922] argparse handling multiple "--" in args improperly In-Reply-To: <1328132556.72.0.92385645061.issue13922@psf.upfronthosting.co.za> Message-ID: <1332086047.1.0.169737987887.issue13922@psf.upfronthosting.co.za> Steven Bethard added the comment: Ok, I agree - I'm fine with it as a bugfix. Depending on the removal of extra -- strings would be pretty crazy anyway. ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 16:54:22 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 18 Mar 2012 15:54:22 +0000 Subject: [issue14357] Distutils2 does not work with virtualenv In-Reply-To: <1332052012.13.0.374309146875.issue14357@psf.upfronthosting.co.za> Message-ID: <1332086062.45.0.991255045627.issue14357@psf.upfronthosting.co.za> ?ric Araujo added the comment: The shebang uses /usr/bin/env python; when installing with a virtualenv?s pip, distutils rewrites it to use the venv?s Python. Could you give me the exact steps to reproduce? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 17:08:38 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 18 Mar 2012 16:08:38 +0000 Subject: [issue14348] Minor whitespace changes in base64 module In-Reply-To: <1331990403.5.0.414904918457.issue14348@psf.upfronthosting.co.za> Message-ID: <1332086918.21.0.711815177024.issue14348@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- assignee: -> eric.araujo status: open -> closed title: Whitespace - Lib/base64.py -> Minor whitespace changes in base64 module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 18:11:51 2012 From: report at bugs.python.org (Jeff Knupp) Date: Sun, 18 Mar 2012 17:11:51 +0000 Subject: [issue13922] argparse handling multiple "--" in args improperly In-Reply-To: <1328132556.72.0.92385645061.issue13922@psf.upfronthosting.co.za> Message-ID: <1332090711.98.0.00950063709298.issue13922@psf.upfronthosting.co.za> Jeff Knupp added the comment: I don't know that this is a bug. Rather, the string '--' means different things to argparse and optparse. In argparse, '--' is a psuedo-argument taken to mean "everything after this is a postional argument" and not "stop processing arguments", which is the optparse meaning. In that context it doesn't seem like removing additional '--' is a bug in argparse, since additional '--' would merely be restating the same thing. ---------- nosy: +Jeff.Knupp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 18:31:11 2012 From: report at bugs.python.org (R. David Murray) Date: Sun, 18 Mar 2012 17:31:11 +0000 Subject: [issue13922] argparse handling multiple "--" in args improperly In-Reply-To: <1328132556.72.0.92385645061.issue13922@psf.upfronthosting.co.za> Message-ID: <1332091871.4.0.434605346615.issue13922@psf.upfronthosting.co.za> R. David Murray added the comment: No, it is definitely a bug. It prevents implementing parsers that pass strings on to another sub-parser or command. Imagine, for example, implementing a script that takes some arguments, but takes the entire rest of the command string and passes it to some unix program that it calls...and that unix program will recognize '--' in that string as the end of processing *its* options, and the user of the python command may well want to do that. Unless this bug is fixed, it would be impossible to use argparse to implement such a reasonable scenario. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 18:32:53 2012 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 18 Mar 2012 17:32:53 +0000 Subject: [issue13922] argparse handling multiple "--" in args improperly In-Reply-To: <1328132556.72.0.92385645061.issue13922@psf.upfronthosting.co.za> Message-ID: <1332091973.06.0.223121095397.issue13922@psf.upfronthosting.co.za> Eric V. Smith added the comment: I agree with David. It's a bug. I have programs (not using argparse yet) that do exactly what he describes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 19:14:56 2012 From: report at bugs.python.org (Jeff Knupp) Date: Sun, 18 Mar 2012 18:14:56 +0000 Subject: [issue13922] argparse handling multiple "--" in args improperly In-Reply-To: <1332091973.06.0.223121095397.issue13922@psf.upfronthosting.co.za> Message-ID: Jeff Knupp added the comment: In that case, wouldn't you use 'parse_known_args' instead of 'parse_args' and pass the remaining arguments to the next script? This case is explicitly mentioned in the argparse documentation. Again it seems to me that the meaning of '--' has changed slightly between optparse and argparse. Whether or not that was correct or intended is perhaps another isssue. On Sun, Mar 18, 2012 at 1:32 PM, Eric V. Smith wrote: > > Eric V. Smith added the comment: > > I agree with David. It's a bug. I have programs (not using argparse yet) > that do exactly what he describes. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 19:30:44 2012 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 18 Mar 2012 18:30:44 +0000 Subject: [issue13922] argparse handling multiple "--" in args improperly In-Reply-To: <1328132556.72.0.92385645061.issue13922@psf.upfronthosting.co.za> Message-ID: <1332095444.57.0.405683844365.issue13922@psf.upfronthosting.co.za> Eric V. Smith added the comment: No. parse_known_args assumes you have known and unknown args intermixed. Going back to the original example, what if "hack" and ":target" had overlapping parameter names (say, they both supported "--arg1")? I think parse_known_args would pick up all instances of "--arg1". I really want "--" to mean "treat everything else as non-optional arguments". Whether that's the original intent, I don't know. But as David says, unless it is, it's impossible to implement such a scheme with argparse. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 19:41:34 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sun, 18 Mar 2012 18:41:34 +0000 Subject: [issue14357] Distutils2 does not work with virtualenv In-Reply-To: <1332052012.13.0.374309146875.issue14357@psf.upfronthosting.co.za> Message-ID: <1332096094.71.0.218485689214.issue14357@psf.upfronthosting.co.za> Alex Gr?nholm added the comment: Log attached. ---------- Added file: http://bugs.python.org/file24927/d2log.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 19:50:36 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Sun, 18 Mar 2012 18:50:36 +0000 Subject: [issue14356] Distutils2 ignores site-local configuration In-Reply-To: <1332051035.41.0.153841644882.issue14356@psf.upfronthosting.co.za> Message-ID: <1332096636.37.0.444469869185.issue14356@psf.upfronthosting.co.za> Alex Gr?nholm added the comment: >The supposed way to work, for OS packagers, is to ship this >sysconfig.cfg thing. Even for Pythons older than 3.3? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 20:40:10 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 18 Mar 2012 19:40:10 +0000 Subject: [issue14004] Distutils filelist selects too many files on Windows In-Reply-To: <1329166628.27.0.616152401371.issue14004@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset edcdef70c44e by ?ric Araujo in branch '3.2': Fix long-standing bugs with MANIFEST.in parsing on Windows (#6884). http://hg.python.org/cpython/rev/edcdef70c44e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 20:40:10 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 18 Mar 2012 19:40:10 +0000 Subject: [issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat In-Reply-To: <1331254591.33.0.490720998909.issue14234@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset cf7337a49a07 by Georg Brandl in branch '3.2': Transplant from main repo d6c197edd99b: Fixes Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes http://hg.python.org/cpython/rev/cf7337a49a07 New changeset d54508a86a5d by Gregory P. Smith in branch '3.2': Fixes Issue 14234: fix for the previous commit, keep compilation when http://hg.python.org/cpython/rev/d54508a86a5d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 20:40:11 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 18 Mar 2012 19:40:11 +0000 Subject: [issue6884] Impossible to include file in sdist that starts with 'build' on Win32 In-Reply-To: <1252679308.98.0.343140927716.issue6884@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset edcdef70c44e by ?ric Araujo in branch '3.2': Fix long-standing bugs with MANIFEST.in parsing on Windows (#6884). http://hg.python.org/cpython/rev/edcdef70c44e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 20:40:13 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 18 Mar 2012 19:40:13 +0000 Subject: [issue13193] packaging.tests.test_manifest and distutils.tests.test_filelist failures In-Reply-To: <1318800293.23.0.0737706148876.issue13193@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset edcdef70c44e by ?ric Araujo in branch '3.2': Fix long-standing bugs with MANIFEST.in parsing on Windows (#6884). http://hg.python.org/cpython/rev/edcdef70c44e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 20:40:13 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 18 Mar 2012 19:40:13 +0000 Subject: [issue9691] sdist includes files that are not in MANIFEST.in In-Reply-To: <1282822249.86.0.974734126224.issue9691@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset edcdef70c44e by ?ric Araujo in branch '3.2': Fix long-standing bugs with MANIFEST.in parsing on Windows (#6884). http://hg.python.org/cpython/rev/edcdef70c44e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 20:40:17 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 18 Mar 2012 19:40:17 +0000 Subject: [issue14114] 2.7.3rc1 chm gives JS error In-Reply-To: <1330114530.4.0.50026951866.issue14114@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset b585c33077d2 by Ezio Melotti in branch '3.2': #14114: don't include copybutton.js in the htmlhelp output. http://hg.python.org/cpython/rev/b585c33077d2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 21:28:00 2012 From: report at bugs.python.org (Jakub Warmuz) Date: Sun, 18 Mar 2012 20:28:00 +0000 Subject: [issue14365] argparse: subparsers, argument abbreviations and ambiguous option Message-ID: <1332102480.28.0.401837291603.issue14365@psf.upfronthosting.co.za> New submission from Jakub Warmuz : Assuming following: 1. optional argument, say "--foo", in a subparser; 2. at least two different optional arguments in the main parser prefixed with "--foo", say "--foo1" and "--foo2"; parsing fails with "error: ambiguous option: --foo could match --foo1, --foo2". It seems like argument abbreviation mechanism described at http://docs.python.org/library/argparse.html#argument-abbreviations is not working properly when in use with subparsers... ---------- components: Library (Lib) files: argparse_subparsers_ambiguous_bug.py messages: 156272 nosy: bethard, jakub priority: normal severity: normal status: open title: argparse: subparsers, argument abbreviations and ambiguous option type: behavior versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file24928/argparse_subparsers_ambiguous_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 21:31:43 2012 From: report at bugs.python.org (miro ilias) Date: Sun, 18 Mar 2012 20:31:43 +0000 Subject: [issue9631] Python 2.7 installation issue for Linux gcc-4.1.0-3 (Fedora Core 5?) In-Reply-To: <1330480159.89.0.133099991131.issue9631@psf.upfronthosting.co.za> Message-ID: miro ilias added the comment: Dear Space, On my Ubuntu 11.10 x86_64 Linux I have static python buildup prescription: ./configure LDFLAGS="-static -static-libgcc" --disable-shared CPPFLAGS=-static --prefix=/home/ilias/bin/python_static with *static* in Modules/Setup but 'make' failes, getting errors like: collect2: ld returned 1 exit status /usr/bin/ld: error: /usr/lib/gcc/x86_64-linux-gnu/4.6.1/crtbeginT.o: requires dynamic R_X86_64_32 reloc against '__DTOR_END__' which may overflow at runtime; recompile with -fPIC collect2: ld returned 1 exit status /usr/bin/ld: error: /usr/lib/gcc/x86_64-linux-gnu/4.6.1/crtbeginT.o: requires dynamic R_X86_64_32 reloc against '__DTOR_END__' which may overflow at runtime; recompile with -fPIC collect2: ld returned 1 exit status . . . /home/ilias/bin/python_static/Python-2.7.2/Modules/_ctypes/libffi/src/dlmalloc.c: In function ?mmap_resize?: /home/ilias/bin/python_static/Python-2.7.2/Modules/_ctypes/libffi/src/dlmalloc.c:3193:5: warning: implicit declaration of function ?mremap? [-Wimplicit-function-declaration] /home/ilias/bin/python_static/Python-2.7.2/Modules/_ctypes/libffi/src/dlmalloc.c:3193:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] /home/ilias/bin/python_static/Python-2.7.2/Modules/_ctypes/libffi/src/dlmalloc.c: In function ?sys_trim?: /home/ilias/bin/python_static/Python-2.7.2/Modules/_ctypes/libffi/src/dlmalloc.c:3612:62: warning: comparison between pointer and integer [enabled by default] /usr/bin/ld: error: /usr/lib/gcc/x86_64-linux-gnu/4.6.1/crtbeginT.o: requires dynamic R_X86_64_32 reloc against '__DTOR_END__' which may overflow at runtime; recompile with -fPIC collect2: ld returned 1 exit status Python build finished, but the necessary bits to build these modules were not found: _bsddb _curses _curses_panel _sqlite3 _ssl _tkinter bsddb185 bz2 dbm dl gdbm imageop linuxaudiodev ossaudiodev readline sunaudiodev zlib To find the necessary bits, look in setup.py in detect_modules() for the module's name. Failed to build these modules: _bisect _codecs_cn _codecs_hk _codecs_iso2022 _codecs_jp _codecs_kr _codecs_tw _collections _csv _ctypes _ctypes_test _elementtree _functools _heapq _hotshot _io _json _locale _lsprof _md5 _multibytecodec _multiprocessing _random _sha _sha256 _sha512 _socket _struct _testcapi array audioop binascii cmath cPickle crypt cStringIO datetime fcntl future_builtins grp itertools math mmap nis operator parser pyexpat resource select spwd strop syslog termios time unicodedata Any help, please ? ________________________________________ From: Space Li [report at bugs.python.org] Sent: Wednesday, February 29, 2012 2:49 AM To: Ilias Miroslav Subject: [issue9631] Python 2.7 installation issue for Linux gcc-4.1.0-3 (Fedora Core 5?) Space Li added the comment: Hi, I recently compiled Python 2.7.2 and got an ImportError on struct module during 'make install'. What I found working for me is just to 'make'. Before doing 'make install', copy the lib.linux-xxxxx directory in 'build' to {prefix}/lib/python2.7 and rename it as lib-dynload. Then find something that looks like followings: $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST) -f \ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ $(DESTDIR)$(LIBDEST) PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST) -f \ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ $(DESTDIR)$(LIBDEST) -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -PYTHONPATH=$(DESTDIR)$(LIBDEST):$(DESTSHARED) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" Add :$(DESTSHARED) behind each PYTHONPATH. Then it looks like $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt PYTHONPATH=$(DESTDIR)$(LIBDEST):$(DESTSHARED) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST) -f \ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ $(DESTDIR)$(LIBDEST) PYTHONPATH=$(DESTDIR)$(LIBDEST):$(DESTSHARED) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST) -f \ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ $(DESTDIR)$(LIBDEST) -PYTHONPATH=$(DESTDIR)$(LIBDEST):$(DESTSHARED) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -PYTHONPATH=$(DESTDIR)$(LIBDEST):$(DESTSHARED) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -PYTHONPATH=$(DESTDIR)$(LIBDEST):$(DESTSHARED) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" After doing so, you can 'make install'. This is tested on OpenSUSE 10.3 with GCC 4.2.1. ---------- nosy: +spaceli _______________________________________ Python tracker _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 21:35:34 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 18 Mar 2012 20:35:34 +0000 Subject: [issue14359] _posixsubprocess.o compilation error on CentOS 5.8 In-Reply-To: <1332057878.8.0.554902086593.issue14359@psf.upfronthosting.co.za> Message-ID: <1332102934.46.0.621520090137.issue14359@psf.upfronthosting.co.za> Gregory P. Smith added the comment: please apply this to 3.2 as well. ---------- assignee: -> rosslagerwall nosy: +gregory.p.smith, rosslagerwall versions: +Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 22:31:42 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 18 Mar 2012 21:31:42 +0000 Subject: [issue10423] s/args/options in arpgarse "Upgrading optparse code" In-Reply-To: <1289817035.63.0.362408496183.issue10423@psf.upfronthosting.co.za> Message-ID: <1332106302.67.0.737515054645.issue10423@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 22:31:49 2012 From: report at bugs.python.org (Steven Bethard) Date: Sun, 18 Mar 2012 21:31:49 +0000 Subject: [issue14364] Argparse incorrectly handles '--' In-Reply-To: <1332080953.55.0.495639573781.issue14364@psf.upfronthosting.co.za> Message-ID: <1332106309.22.0.512639026115.issue14364@psf.upfronthosting.co.za> Steven Bethard added the comment: I just tried this with grep's "-e" and "--regexp": $ cat > temp.txt a--b cdef $ grep -e-- -v temp.txt cdef $ grep --regexp=-- -v temp.txt cdef $ grep -e -- -v temp.txt cdef $ grep --regexp -- -v temp.txt cdef And with diff's "-I" and "--ignore-matching-lines": $ cat > temp2.txt cdef a--b $ diff temp.txt temp2.txt 1d0 < a--b 2a2 > a--b $ diff -I-- temp.txt temp2.txt $ diff -I -- temp.txt temp2.txt $ diff --ignore-matching-lines -- temp.txt temp2.txt $ diff --ignore-matching-lines=-- temp.txt temp2.txt $ Note though that for options that don't take an argument, the "--" is just removed: $ grep -v -- a temp.txt cdef $ diff -i -- temp.txt temp2.txt 1d0 < a--b 2a2 > a--b So I guess the unix rule is: if an option that takes an argument is followed by "--", use that as the option's argument and continue parsing as usual. If an option that takes no argument is followed by "--", then delete the "--" and treat all following flags as positional arguments. Argparse can't follow this directly, because then people who are using "--" to signal the end of an option with nargs="*" would start getting "--" included in that list. (And I know people have used "--" this way for a while.) I guess my preference is what R. David Murray suggests: "--" when part of an argument (i.e. not separated by spaces) is treated like any other characters, and only a lone "--" signals the end of options (and is ignored otherwise). That would mean that both "--test=--" and "-t--" in your example would give you ["--"], and the other errors would stay as you saw them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 22:35:25 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 18 Mar 2012 21:35:25 +0000 Subject: [issue11176] give more meaningful argument names in argparse documentation In-Reply-To: <1297352937.46.0.470038569364.issue11176@psf.upfronthosting.co.za> Message-ID: <1332106525.44.0.893691629317.issue11176@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 22:39:46 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 18 Mar 2012 21:39:46 +0000 Subject: [issue13271] When -h is used with argparse, default values that fail should not matter In-Reply-To: <1319664352.05.0.511704738067.issue13271@psf.upfronthosting.co.za> Message-ID: <1332106786.52.0.160836223244.issue13271@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 22:41:39 2012 From: report at bugs.python.org (Steven Bethard) Date: Sun, 18 Mar 2012 21:41:39 +0000 Subject: [issue13922] argparse handling multiple "--" in args improperly In-Reply-To: <1328132556.72.0.92385645061.issue13922@psf.upfronthosting.co.za> Message-ID: <1332106899.97.0.563731511313.issue13922@psf.upfronthosting.co.za> Steven Bethard added the comment: > It prevents implementing parsers that pass strings on to another > sub-parser or command. ... > wouldn't you use 'parse_known_args' instead of 'parse_args' > and pass the remaining arguments to the next script I'll just say again that the recommended way of passing arguments to another command is via nargs=argparse.REMAINDER. (Though you may still need "--" if the first argument in the remainder is a flag shared by your parser, as Warren Turka pointed out.) > I really want "--" to mean "treat everything else as non-optional > arguments" Yep, and that's what it's intended to mean, and what the documentation says: "you can insert the pseudo-argument '--' which tells parse_args() that everything after that is a positional argument" http://docs.python.org/library/argparse.html#arguments-containing It's therefore a bug if there's a '--' after the first '--', but it's not being treated as a positional argument. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 22:45:34 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 18 Mar 2012 21:45:34 +0000 Subject: [issue12713] argparse: allow abbreviation of sub commands by users In-Reply-To: <1312854957.22.0.437190269629.issue12713@psf.upfronthosting.co.za> Message-ID: <1332107134.41.0.46077633627.issue12713@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 22:56:51 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 18 Mar 2012 21:56:51 +0000 Subject: [issue13850] Summary tables for argparse add_argument options In-Reply-To: <1327384498.23.0.981832544617.issue13850@psf.upfronthosting.co.za> Message-ID: <1332107811.87.0.69890480169.issue13850@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 22:58:16 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 18 Mar 2012 21:58:16 +0000 Subject: [issue13540] Document the Action API in argparse In-Reply-To: <1323183395.55.0.489132691311.issue13540@psf.upfronthosting.co.za> Message-ID: <1332107896.42.0.196832929606.issue13540@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 23:06:35 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 18 Mar 2012 22:06:35 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: <1329417262.26.0.419020263055.issue14034@psf.upfronthosting.co.za> Message-ID: <1332108395.94.0.15444219318.issue14034@psf.upfronthosting.co.za> Tshepang Lekhonkhobe added the comment: friendly ping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 23:07:47 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 18 Mar 2012 22:07:47 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: <1329417262.26.0.419020263055.issue14034@psf.upfronthosting.co.za> Message-ID: <1332108467.71.0.449225433478.issue14034@psf.upfronthosting.co.za> ?ric Araujo added the comment: I?m going to Rietveld to review the patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 23:16:25 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 18 Mar 2012 22:16:25 +0000 Subject: [issue14365] argparse: subparsers, argument abbreviations and ambiguous option In-Reply-To: <1332102480.28.0.401837291603.issue14365@psf.upfronthosting.co.za> Message-ID: <1332108985.99.0.555265813007.issue14365@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 23:21:07 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 18 Mar 2012 22:21:07 +0000 Subject: [issue14365] argparse: subparsers, argument abbreviations and ambiguous option In-Reply-To: <1332102480.28.0.401837291603.issue14365@psf.upfronthosting.co.za> Message-ID: <1332109267.8.0.0934089301132.issue14365@psf.upfronthosting.co.za> Tshepang Lekhonkhobe added the comment: More or less a duplicate of 12713? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 23:21:28 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 18 Mar 2012 22:21:28 +0000 Subject: [issue14365] argparse: subparsers, argument abbreviations and ambiguous option In-Reply-To: <1332102480.28.0.401837291603.issue14365@psf.upfronthosting.co.za> Message-ID: <1332109288.49.0.290587404295.issue14365@psf.upfronthosting.co.za> Tshepang Lekhonkhobe added the comment: Sorry, I meant #12713. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 23:26:00 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 18 Mar 2012 22:26:00 +0000 Subject: [issue14357] Distutils2 does not work with virtualenv In-Reply-To: <1332052012.13.0.374309146875.issue14357@psf.upfronthosting.co.za> Message-ID: <1332109560.25.0.563311073038.issue14357@psf.upfronthosting.co.za> ?ric Araujo added the comment: I can?t reproduce. Can you delete your venv, start again and tell me how it goes? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 23:37:57 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 18 Mar 2012 22:37:57 +0000 Subject: [issue14362] No mention of collections.ChainMap in What's New for 3.3 In-Reply-To: <1332069504.3.0.514334264343.issue14362@psf.upfronthosting.co.za> Message-ID: <1332110277.21.0.0956566773504.issue14362@psf.upfronthosting.co.za> ?ric Araujo added the comment: Raymond is the author of What?s New In Python 3.3 and of the collections changes (adding ChainMap and moving ABCs to collections.abc from the top of my head). Maybe he?s waiting for later in the release cycle to review all changes and expand whatsnew. Raymond, is that the case or would you like me to add a stub entry for collections changes? ---------- nosy: +eric.araujo, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 23:41:11 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 18 Mar 2012 22:41:11 +0000 Subject: [issue11874] argparse assertion failure with brackets in metavars In-Reply-To: <1303201252.58.0.236363581255.issue11874@psf.upfronthosting.co.za> Message-ID: <1332110471.88.0.958505139001.issue11874@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 23:42:00 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 18 Mar 2012 22:42:00 +0000 Subject: [issue14361] No link to issue tracker on Python home page In-Reply-To: <1332069267.85.0.0257661397774.issue14361@psf.upfronthosting.co.za> Message-ID: <1332110520.19.0.937019407697.issue14361@psf.upfronthosting.co.za> ?ric Araujo added the comment: The devguide index page links to the bug tracker on its ninth line. Isn?t that enough? If not, I?m +0 on adding a link. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 23:42:38 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 18 Mar 2012 22:42:38 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN In-Reply-To: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> Message-ID: <1332110558.76.0.39611037148.issue14331@psf.upfronthosting.co.za> Gregory P. Smith added the comment: side by side code review of the 3.2 version revealed some missing PyMem_FREE calls. patch updated. ---------- Added file: http://bugs.python.org/file24929/malloc-import-pathbufs-py32.004.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 23:49:29 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Sun, 18 Mar 2012 22:49:29 +0000 Subject: [issue9694] argparse: Default Help Message Lists Required Args As Optional In-Reply-To: <1282846759.11.0.900867962743.issue9694@psf.upfronthosting.co.za> Message-ID: <1332110969.45.0.149858735031.issue9694@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 23:54:11 2012 From: report at bugs.python.org (R. David Murray) Date: Sun, 18 Mar 2012 22:54:11 +0000 Subject: [issue14361] No link to issue tracker on Python home page In-Reply-To: <1332069267.85.0.0257661397774.issue14361@psf.upfronthosting.co.za> Message-ID: <1332111251.42.0.943503223594.issue14361@psf.upfronthosting.co.za> R. David Murray added the comment: Interesting. I would have said that an open source project ought to have a link for reporting bugs on the front page, but I just checked perl.org and apache.org, and they both put the bug tracker links on the 'get involved' page. The devguide is *not* equivalent to those 'get involved' pages, and users are not likely to find the bug tracker link on it. IMO we really should create a 'get involved' page, and link both the devguide and the bug tracker from it. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 23:55:54 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 18 Mar 2012 22:55:54 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN In-Reply-To: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> Message-ID: <1332111354.14.0.353420239315.issue14331@psf.upfronthosting.co.za> Gregory P. Smith added the comment: minor corresponding updated to the 2.7 patch as well - Patch 6 in reitveld/review. The 3.2 patch from the previous comment is Patch 5 in reitveld/review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Mar 18 23:56:06 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 18 Mar 2012 22:56:06 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN In-Reply-To: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> Message-ID: <1332111366.78.0.788334074508.issue14331@psf.upfronthosting.co.za> Changes by Gregory P. Smith : Added file: http://bugs.python.org/file24930/malloc-import-pathbufs-py27.004.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 00:07:05 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 18 Mar 2012 23:07:05 +0000 Subject: [issue14361] No link to issue tracker on Python home page In-Reply-To: <1332069267.85.0.0257661397774.issue14361@psf.upfronthosting.co.za> Message-ID: <1332112025.52.0.790860090247.issue14361@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I wish the devguide wouldn't have replaced the original "core development" pages: http://web.archive.org/web/20090305022527/http://www.python.org/dev/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 00:10:36 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Mar 2012 23:10:36 +0000 Subject: [issue14366] Suporting bzip2 and lzma compression in zip files Message-ID: <1332112236.1.0.964135054036.issue14366@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : ZIP files specification supports new compression algorithms since 2006. Since bzip2 and lzma now contained in Python standart library, it would be nice to add support for these methods in zipfile. This will allow to process more foreign zip files and create more compact distributives. The proposed patch adds two new methods ZIP_BZIP2 and ZIP_LZMA, which are automatically detecting when unpacking and that can be used for packing. ---------- components: Library (Lib) files: bzip2_and_lzma_in_zip.patch keywords: patch messages: 156288 nosy: storchaka priority: normal severity: normal status: open title: Suporting bzip2 and lzma compression in zip files type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24931/bzip2_and_lzma_in_zip.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 00:13:43 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Sun, 18 Mar 2012 23:13:43 +0000 Subject: [issue14366] Suporting bzip2 and lzma compression in zip files In-Reply-To: <1332112236.1.0.964135054036.issue14366@psf.upfronthosting.co.za> Message-ID: <1332112423.63.0.132519379243.issue14366@psf.upfronthosting.co.za> Changes by Nadeem Vawda : ---------- nosy: +alanmcintyre, nadeem.vawda _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 00:14:30 2012 From: report at bugs.python.org (Roundup Robot) Date: Sun, 18 Mar 2012 23:14:30 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN In-Reply-To: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset daed636a3536 by Gregory P. Smith in branch '3.2': Fixes Issue #14331: Use significantly less stack space when importing modules by http://hg.python.org/cpython/rev/daed636a3536 New changeset ad030571e6c0 by Gregory P. Smith in branch '2.7': Fixes Issue #14331: Use significantly less stack space when importing modules by http://hg.python.org/cpython/rev/ad030571e6c0 New changeset 5ad5625715b5 by Gregory P. Smith in branch 'default': Empty merge; imports rewritten in 3.3. issue #14331 may no longer apply. http://hg.python.org/cpython/rev/5ad5625715b5 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 00:16:58 2012 From: report at bugs.python.org (Steven Bethard) Date: Sun, 18 Mar 2012 23:16:58 +0000 Subject: [issue14365] argparse: subparsers, argument abbreviations and ambiguous option In-Reply-To: <1332102480.28.0.401837291603.issue14365@psf.upfronthosting.co.za> Message-ID: <1332112618.26.0.427234194338.issue14365@psf.upfronthosting.co.za> Steven Bethard added the comment: Yep. Closing as duplicate. ---------- resolution: -> duplicate status: open -> closed superseder: -> argparse: allow abbreviation of sub commands by users _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 00:26:10 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Mar 2012 23:26:10 +0000 Subject: [issue14366] Suporting bzip2 and lzma compression in zip files In-Reply-To: <1332112236.1.0.964135054036.issue14366@psf.upfronthosting.co.za> Message-ID: <1332113170.1.0.787340365383.issue14366@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is not completed patch yet, without tests and documentation. I would like to receive feedback before the end of polishing. It might be worth transfer a portion of code in _lzmamodule.c for better use of capacity of LZMA API (used in zip format somewhat differs from LZMA_ALONE). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 00:31:48 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Mar 2012 23:31:48 +0000 Subject: [issue14366] Suporting bzip2 and lzma compression in zip files In-Reply-To: <1332112236.1.0.964135054036.issue14366@psf.upfronthosting.co.za> Message-ID: <1332113508.96.0.507020163854.issue14366@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file24932/sample-bzip2.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 00:32:52 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 18 Mar 2012 23:32:52 +0000 Subject: [issue9514] platform.linux_distribution() under Ubuntu returns ('debian', 'squeeze/sid', '') In-Reply-To: <1280944069.64.0.760525549047.issue9514@psf.upfronthosting.co.za> Message-ID: <1332113572.38.0.826258784604.issue9514@psf.upfronthosting.co.za> ?ric Araujo added the comment: Debian and Ubuntu use this patch: http://patch-tracker.debian.org/patch/series/view/python3.2/3.2.3~rc1-1/platform-lsbrelease.diff ---------- versions: +Python 3.3 -Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 00:33:57 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Mar 2012 23:33:57 +0000 Subject: [issue14366] Suporting bzip2 and lzma compression in zip files In-Reply-To: <1332112236.1.0.964135054036.issue14366@psf.upfronthosting.co.za> Message-ID: <1332113637.39.0.935414446525.issue14366@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file24933/sample-lzma.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 00:34:18 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 18 Mar 2012 23:34:18 +0000 Subject: [issue14366] Supporting bzip2 and lzma compression in zip files In-Reply-To: <1332112236.1.0.964135054036.issue14366@psf.upfronthosting.co.za> Message-ID: <1332113658.43.0.446243578808.issue14366@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo title: Suporting bzip2 and lzma compression in zip files -> Supporting bzip2 and lzma compression in zip files _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 00:40:47 2012 From: report at bugs.python.org (=?utf-8?q?Michele_Orr=C3=B9?=) Date: Sun, 18 Mar 2012 23:40:47 +0000 Subject: [issue14364] Argparse incorrectly handles '--' In-Reply-To: <1332080953.55.0.495639573781.issue14364@psf.upfronthosting.co.za> Message-ID: <1332114047.16.0.87505513804.issue14364@psf.upfronthosting.co.za> Michele Orr? added the comment: +1 also for me. I will try to work for a patch in the next days. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 00:52:55 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 18 Mar 2012 23:52:55 +0000 Subject: [issue14356] Distutils2 ignores site-local configuration In-Reply-To: <1332051035.41.0.153841644882.issue14356@psf.upfronthosting.co.za> Message-ID: <1332114775.07.0.531308249579.issue14356@psf.upfronthosting.co.za> ?ric Araujo added the comment: > Distutils2 seems to rely solely on a sysconfig.cfg shipped with distutils2 to get the path where to install packages. That is correct. > Ignoring site-local configuration What do you mean? sitecustomize is executed, for example. If you only mean Debian/Ubuntu/derivatives-specific edits/kludges, read on :) > On Ubuntu, packages are supposed to go to /usr/local/lib/python2.7/dist-packages but distutils2 tries to > install them to /usr/lib/python2.7/site-packages. Yes and no. We need to make a difference between a Python installed with the Debuntu packaging tools (let?s call it the system Python) and a Python downloaded or cloned from python.org and installed locally by a sysadmin in /opt or /usr/local (let?s call it local Python). In a local Python installed in /usr/local (location recommended over /opt by the Debian policy, if memory serves), third-party distributions get installed to /usr/local/lib/pythonX.Y/site-packages. That?s good. On Debian, the system Python used to look for third-party distributions in /usr/lib/pythonX.Y/site-packages. One should never use tools like pip or pysetup to install things here, but only system packaging tools, i.e. dpkg and APT. The recommended way to install things without using system tools, according to Debian?s interpretation of the File Hierarchy Standard, is to put them under /usr/local, so /usr/local/lib/pythonX.Y/site-packages. (Just like /usr/local/bin completes what?s available in /usr/bin, /usr/local/lib/pythonX.Y completes /usr/lib/pythonX.Y.) That?s good too. If we combine these two sets of things we have a conflict: projects installed for use with a local Python may affect and break the system Python. That happened to Barry, for example. That?s why paths were changed in Debian and derivatives: now you can install things for a local Python in /usr/local/lib/pythonX.Y/site-packages and install other things for the system Python in /usr/local/lib/pythonX.Y/dist-packages. Now, with Python 3.3 we have a change to make life easier for Debuntu: instead of patching the site and distutils modules, they can edit sysconfig.cfg and Python will automatically look for things in dist-packages and packaging will install to that directory too. distutils will still need the manual patching. A local Python will still use site-packages, or whatever the admin configures in sysconfig.cfg, and the system Python will use dist-packages, or whatever the Debian Python maintainer decides. If there is a Debian package of distutils2 for older Pythons, then they?ll just have to patch d2/_backport/sysconfig.cfg. The only corner cases that I could see are for example if an admin installs distutils2 for their system Python in /usr/local/lib/pythonX.Y/dist-packages: they will have to adapt d2/_backport/sysconfig.cfg, or use the setup.py script instead of pysetup (because setup.py uses distutils and thus will use the patched paths). If I understand correctly that you used ?/usr/bin/python pysetup install spam? and wanted it to install to /usr/lib/python2.7/site-packages, then I think that the correct reply is: Not supported, don?t do that. If you did something else, please tell what it was :) ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 01:21:47 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 19 Mar 2012 00:21:47 +0000 Subject: [issue14366] Supporting bzip2 and lzma compression in zip files In-Reply-To: <1332112236.1.0.964135054036.issue14366@psf.upfronthosting.co.za> Message-ID: <1332116507.01.0.025782099531.issue14366@psf.upfronthosting.co.za> Martin v. L?wis added the comment: ISTM that the LZMA support differs from the specification, see http://www.pkware.com/documents/casestudies/APPNOTE.TXT In particular, there appears to be no support for the EOS marker, which should be emitted when compressing. Changing the LZMA module is fine as long as it a) happens before the release of 3.3, and b) is truly justified by the ZIP spec I also recommend to split this issue into two: bzip support and lzma support. Adding bzip support might be easier. ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 01:30:52 2012 From: report at bugs.python.org (R. David Murray) Date: Mon, 19 Mar 2012 00:30:52 +0000 Subject: [issue14361] No link to issue tracker on Python home page In-Reply-To: <1332069267.85.0.0257661397774.issue14361@psf.upfronthosting.co.za> Message-ID: <1332117052.98.0.94616343433.issue14361@psf.upfronthosting.co.za> R. David Murray added the comment: That is indeed better than the current devguide for introducing people to the community. I think the current devguide is better at explaining the development process in detail, but that's not what is needed for a 'getting involved' page. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 01:32:13 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 19 Mar 2012 00:32:13 +0000 Subject: [issue14366] Supporting bzip2 and lzma compression in zip files In-Reply-To: <1332112236.1.0.964135054036.issue14366@psf.upfronthosting.co.za> Message-ID: <1332117133.64.0.829540908705.issue14366@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I also think that create_version and extract_version need to be adjusted. Since LZMA is version 6.3, we need to check for any features that might be in a zip file of extract version 6.3 or lower that we do not support (such as PPMd+ compression, strong encryption, etc.). In general, if we claim to support version x.y, we need to recognize that a feature is used that is supported for x1.y1 (x1.y1 <= x.y) even if we don't support the feature. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 01:41:46 2012 From: report at bugs.python.org (R. David Murray) Date: Mon, 19 Mar 2012 00:41:46 +0000 Subject: [issue14360] email.encoders.encode_quopri doesn't work with python 3.2 In-Reply-To: <1332063395.16.0.293436373736.issue14360@psf.upfronthosting.co.za> Message-ID: <1332117706.78.0.953253132195.issue14360@psf.upfronthosting.co.za> R. David Murray added the comment: Interesting. Apparently we have no tests for the encode_ functions, nor do we use them inside the email package itself (except for encode_7or8bit). Do you have any interest in writing a patch with tests? ---------- assignee: -> r.david.murray nosy: +r.david.murray stage: -> needs patch versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 01:50:46 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 19 Mar 2012 00:50:46 +0000 Subject: [issue14361] No link to issue tracker on Python home page In-Reply-To: <1332069267.85.0.0257661397774.issue14361@psf.upfronthosting.co.za> Message-ID: <1332118246.15.0.340997663732.issue14361@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I think the core issue here is that bug reporters often don't want to "get involved", and don't consider themselves contributors. Instead, they post to the bug tracker in order to get help. In some cases, this is misguided (i.e. when Python behaves correctly, and they just fail to understand how it works). In other cases, they may report a genuine bug, but have no intention to work on this beyond installing a bug fix release, which they hope will be released quickly. The question now really is how much we want to help people that want to "get support", rather than "getting involved". I think that a tracker link on www.python.org would primarily serve this kind of people, and I think it is giving them too much. If people want to get support for Python, they should hire somebody (and there are versions of Python with commercial support). I think that we *somewhat* need to support people who don't want to get involved. Either the devguide needs to accommodate them better (e.g. with a introductory section: "Several ways to contribute"), or a separate page in front of the devguide is needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 01:50:56 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 19 Mar 2012 00:50:56 +0000 Subject: [issue14355] imp module docs should omit references to init_frozen In-Reply-To: <1332017929.34.0.162160469146.issue14355@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 66e2dab98041 by R David Murray in branch '3.2': #14355: remove obsolete doc reference to previously removed init_frozen. http://hg.python.org/cpython/rev/66e2dab98041 New changeset 1e827a176306 by R David Murray in branch 'default': Merge #14355: remove obsolete doc reference to previously removed init_frozen. http://hg.python.org/cpython/rev/1e827a176306 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 01:51:34 2012 From: report at bugs.python.org (R. David Murray) Date: Mon, 19 Mar 2012 00:51:34 +0000 Subject: [issue14355] imp module docs should omit references to init_frozen In-Reply-To: <1332017929.34.0.162160469146.issue14355@psf.upfronthosting.co.za> Message-ID: <1332118294.77.0.453036459473.issue14355@psf.upfronthosting.co.za> R. David Murray added the comment: Thanks, Eric. ---------- nosy: +r.david.murray resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 02:27:27 2012 From: report at bugs.python.org (Jakub Warmuz) Date: Mon, 19 Mar 2012 01:27:27 +0000 Subject: [issue14365] argparse: subparsers, argument abbreviations and ambiguous option In-Reply-To: <1332102480.28.0.401837291603.issue14365@psf.upfronthosting.co.za> Message-ID: <1332120447.37.0.796832828878.issue14365@psf.upfronthosting.co.za> Jakub Warmuz added the comment: I don't understand how both bugs are related. Surely, patch provided for #12713 does not fix the issue I described. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 02:36:31 2012 From: report at bugs.python.org (Ben Hayden) Date: Mon, 19 Mar 2012 01:36:31 +0000 Subject: [issue14358] test_os failing with errno 61: No Data Available In-Reply-To: <1332055012.37.0.633152160174.issue14358@psf.upfronthosting.co.za> Message-ID: <1332120991.8.0.138185855005.issue14358@psf.upfronthosting.co.za> Ben Hayden added the comment: That was my thought, but again, I didn't really know if it was 'safe' to snuff the OSError all together. This patch just returns False if any OSError is raised. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 02:38:18 2012 From: report at bugs.python.org (Ben Hayden) Date: Mon, 19 Mar 2012 01:38:18 +0000 Subject: [issue14358] test_os failing with errno 61: No Data Available In-Reply-To: <1332055012.37.0.633152160174.issue14358@psf.upfronthosting.co.za> Message-ID: <1332121098.65.0.666028053879.issue14358@psf.upfronthosting.co.za> Changes by Ben Hayden : Added file: http://bugs.python.org/file24934/test_os_support_ext_return_false.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 02:39:04 2012 From: report at bugs.python.org (Steven Bethard) Date: Mon, 19 Mar 2012 01:39:04 +0000 Subject: [issue14365] argparse: subparsers, argument abbreviations and ambiguous option In-Reply-To: <1332102480.28.0.401837291603.issue14365@psf.upfronthosting.co.za> Message-ID: <1332121144.77.0.00804833936887.issue14365@psf.upfronthosting.co.za> Steven Bethard added the comment: My mistake. I see that the error you're getting is a bad interaction between the option in the main parser and an ambiguous option in the subparser. ---------- resolution: duplicate -> status: closed -> open superseder: argparse: allow abbreviation of sub commands by users -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 02:43:53 2012 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 19 Mar 2012 01:43:53 +0000 Subject: [issue14361] No link to issue tracker on Python home page In-Reply-To: <1332118246.15.0.340997663732.issue14361@psf.upfronthosting.co.za> Message-ID: <4F668F4F.3010908@pearwood.info> Steven D'Aprano added the comment: Martin v. L?wis wrote: > Martin v. L?wis added the comment: > > I think the core issue here is that bug reporters often don't want to "get > involved", and don't consider themselves contributors. Instead, they post > to the bug tracker in order to get help. Or they just want to make a bug report. Technically, this is "getting involved", but they don't think of it that way. I know I don't. Getting involved is submitting a patch. They want to do the right thing in reporting a bug, and then work around it until it is fixed. Starting from the Python web site, it is not obvious how to find the issue tracker to report a bug. I had to resort to googling for "Python bug tracker" to find it. I never would have thought that clicking "Core Development" was the way to get to a link to the issue tracker. I don't want to do core development, I want to report a bug. And even on the core development page, there's nothing in the side-bar about the issue tracker. I have to actually *read the page content* to discover links to the tracker. [...] > The question now really is how much we want to help people that want to > "get support", rather than "getting involved". I think that a tracker link > on www.python.org would primarily serve this kind of people, and I think it I think you are mistaken. I don't think that people looking for support raise bug requests. That's too much like work. They go to StackOverflow or one of the many Python mailing lists and say "Please fix my code". Imagine you've written to comp.lang.python (python-list at python.org) and asked for help: "is this a bug?". 99 times out of 100, it's a bug in your code, but this time it turns out to be an actual bug. Somebody says, "yes, that's a bug, please report it on the issue tracker". Where the hell is the issue tracker? How do you find it from the Python home page? You shouldn't have to resort to Google to find the tracker. The home page has an explicit "Alternative download page for China". (Why China?) I'm sure that's important, but is it more important than the issue tracker, that it gets prime billing in the side-bar and the tracker doesn't? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 02:51:55 2012 From: report at bugs.python.org (Steven Bethard) Date: Mon, 19 Mar 2012 01:51:55 +0000 Subject: [issue14365] argparse: subparsers, argument abbreviations and ambiguous option In-Reply-To: <1332102480.28.0.401837291603.issue14365@psf.upfronthosting.co.za> Message-ID: <1332121915.41.0.304958918809.issue14365@psf.upfronthosting.co.za> Steven Bethard added the comment: The problem is basically that _parse_known_args calls _parse_optional to determine whether something is an optional or a positional. But _parse_optional only checks "if arg_string in self._option_string_actions", that is, if the string can be found in the main parser actions. So either this method needs to check the subparser actions, or the "if arg_string in self._option_string_actions" stuff needs to be delayed until the subparser. Neither of these seems like a simple change, but I agree it's a bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 03:26:17 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 19 Mar 2012 02:26:17 +0000 Subject: [issue14358] test_os failing with errno 61: No Data Available In-Reply-To: <1332055012.37.0.633152160174.issue14358@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset ada766b07686 by Benjamin Peterson in branch 'default': all OSErrors should indicate there are no extended attributes (closes #14358) http://hg.python.org/cpython/rev/ada766b07686 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 03:51:53 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 19 Mar 2012 02:51:53 +0000 Subject: [issue14361] No link to issue tracker on Python home page In-Reply-To: <4F668F4F.3010908@pearwood.info> Message-ID: <4F669F47.8020207@v.loewis.de> Martin v. L?wis added the comment: > I think you are mistaken. I don't think that people looking for support raise > bug requests. There is *plenty* of evidence to the contrary, please trust me on that. > The home page has an explicit "Alternative download page for China". (Why > China?) Please also trust that there is a very good reason for that link which I'm not going to reveal in public (else there is a risk that it becomes pointless). I remain -1 on adding a link to the tracker to www.python.org. As long as we cannot really cope with the flood of bug reports that we get, there is little point in making the tracker more prominent. Plus, using Google is an established, useful practice, and it comes as the first hit when searching for "Python bug tracker". "Python issue tracker" brings it only as the second link, with the 2.7.2 documentation on "Reporting bugs" being the first link. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 04:20:52 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 19 Mar 2012 03:20:52 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1332127252.03.0.462858263886.issue14302@psf.upfronthosting.co.za> Martin v. L?wis added the comment: After more discussion, it appears that this change is too incompatible to be done in a single release. Therefore, I propose a long-term change into this direction, with the actual change not happening until 3.5. For the change of the python.exe location, I propose to add a key to the registry, say, "BinaryDir", which is added to 3.3 and later. Adding it to older installers is not useful, IMO, since people still need to implement a fallback logic. In 3.3 and 3.4, this will point to the toplevel directory, and in 3.5, it will point to the bin/scripts directory. Now, for the change from scipts to bin, I don't have any good solution. Proposals, in particular including registry keys, are welcome. Symlinks are out as they require admin privileges. Testing for the presence of some directory might be an acceptable solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 04:30:47 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 19 Mar 2012 03:30:47 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: <1329417262.26.0.419020263055.issue14034@psf.upfronthosting.co.za> Message-ID: <1332127847.57.0.545480154984.issue14034@psf.upfronthosting.co.za> ?ric Araujo added the comment: Sorry, a burger party fell on me. I?ll make time this week. Nick, I just read on python-dev that you had suggestions for argparse docs; could you post the bug numbers / message IDs here or the list of suggestions? ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 04:57:34 2012 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 19 Mar 2012 03:57:34 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: <1329417262.26.0.419020263055.issue14034@psf.upfronthosting.co.za> Message-ID: <1332129454.9.0.449814458686.issue14034@psf.upfronthosting.co.za> Nick Coghlan added the comment: 13850 (already mentioned above) is my relevant argparse docs proposal - it turns out the other argparse issues I remembered posting were actual feature requests rather than docs suggestions (FWIW, those are 14037 and 14039) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 05:13:55 2012 From: report at bugs.python.org (Roundup Robot) Date: Mon, 19 Mar 2012 04:13:55 +0000 Subject: [issue14359] _posixsubprocess.o compilation error on CentOS 5.8 In-Reply-To: <1332057878.8.0.554902086593.issue14359@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 09371e2ae84d by Ross Lagerwall in branch '3.2': Issue #14359: Only use O_CLOEXEC in _posixmodule.c if it is defined. http://hg.python.org/cpython/rev/09371e2ae84d New changeset 0d5fcbfd646f by Ross Lagerwall in branch 'default': Merge with 3.2 for #14359. http://hg.python.org/cpython/rev/0d5fcbfd646f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 05:17:43 2012 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 19 Mar 2012 04:17:43 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: <1329417262.26.0.419020263055.issue14034@psf.upfronthosting.co.za> Message-ID: <1332130663.43.0.872734730459.issue14034@psf.upfronthosting.co.za> Nick Coghlan added the comment: A couple of thoughts on the draft HOWTO: I like the "verbosity" example, but I'd also like to see it continue on into introducing the "action='count'" alternative that allows "-vv" to set the verbosity level to 2, etc. I also find the idea of having higher verbosity levels that aren't supersets of lower verbosity levels to be an anti-pattern, so I'd prefer not to see it in an official HOWTO. To my mind, verbosity levels should be checked with ">=", never "==". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 05:42:23 2012 From: report at bugs.python.org (Dave Burton) Date: Mon, 19 Mar 2012 04:42:23 +0000 Subject: [issue14367] try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2 Message-ID: <1332132143.66.0.7093323157.issue14367@psf.upfronthosting.co.za> New submission from Dave Burton : I noticed that pydoc doesn't work for pygame under python 3.2.1 or 3.2.2 for Win32; it just reports: NotImplementedError: scrap module not available (ImportError: No module named scrap) I made a small patch to inspect.py to solve the problem (I just added a try/expect around the failing statement in ismethoddescriptor). Here's the diff: http://www.burtonsys.com/python32/inspect.diff With that patch, pydoc works with pygame, and reports just a few pygame issues: *scrap* = *sndarray* = *surfarray* = ---------- components: Library (Lib) files: inspect.diff keywords: patch messages: 156314 nosy: ncdave4life priority: normal severity: normal status: open title: try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2 type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file24935/inspect.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 05:52:44 2012 From: report at bugs.python.org (Jeff Knupp) Date: Mon, 19 Mar 2012 04:52:44 +0000 Subject: [issue13922] argparse handling multiple "--" in args improperly In-Reply-To: <1328132556.72.0.92385645061.issue13922@psf.upfronthosting.co.za> Message-ID: <1332132764.04.0.0852390050518.issue13922@psf.upfronthosting.co.za> Jeff Knupp added the comment: Added patch so that only the first '--' is removed by an argparse.PARSE or argparse.REMAINDER argument. Note that, as Steven said, argparse.REMAINDER should be used in the OP's issue (and the added test makes sure all remaining arguments are preserved even if they appear in the parent parser). ---------- keywords: +patch Added file: http://bugs.python.org/file24936/argparse.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 06:15:21 2012 From: report at bugs.python.org (Arnaud Fontaine) Date: Mon, 19 Mar 2012 05:15:21 +0000 Subject: [issue12776] argparse: type conversion function should be called only once In-Reply-To: <1313657878.1.0.958946060112.issue12776@psf.upfronthosting.co.za> Message-ID: <1332134121.02.0.920500697004.issue12776@psf.upfronthosting.co.za> Arnaud Fontaine added the comment: Could you please apply this patch? It's been 4 months without reply now... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 06:30:06 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Mon, 19 Mar 2012 05:30:06 +0000 Subject: [issue14357] Distutils2 does not work with virtualenv In-Reply-To: <1332052012.13.0.374309146875.issue14357@psf.upfronthosting.co.za> Message-ID: <1332135006.84.0.164562491487.issue14357@psf.upfronthosting.co.za> Alex Gr?nholm added the comment: >I can?t reproduce. Can you delete your venv, start again and tell me how it goes? I've repeated this several times, and the result is always the same. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 06:39:13 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Mon, 19 Mar 2012 05:39:13 +0000 Subject: [issue14356] Distutils2 ignores site-local configuration In-Reply-To: <1332051035.41.0.153841644882.issue14356@psf.upfronthosting.co.za> Message-ID: <1332135553.43.0.783144080956.issue14356@psf.upfronthosting.co.za> Alex Gr?nholm added the comment: >If I understand correctly that you used ?/usr/bin/python pysetup install spam? and wanted it to install to /usr/lib/python2.7/site-packages, then I think that the correct reply is: Not supported, don?t do that. If you did something else, please tell what it was :) Did something along the lines of "pysetup install sqlalchemy" and it's trying to install it under /usr/lib/python2.7/site-packages, which is of course wrong. But since it ignores the customized site-local configuration, how could it possibly know where to install? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 07:36:21 2012 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 19 Mar 2012 06:36:21 +0000 Subject: [issue14361] No link to issue tracker on Python home page In-Reply-To: <4F669F47.8020207@v.loewis.de> Message-ID: <20120319063611.GA23163@ando> Steven D'Aprano added the comment: On Mon, Mar 19, 2012 at 02:51:53AM +0000, Martin v. L?wis wrote: > > Martin v. L?wis added the comment: > I remain -1 on adding a link to the tracker to www.python.org. As long > as we cannot really cope with the flood of bug reports that we get, > there is little point in making the tracker more prominent. In other words, the fact that there is no link to the tracker on the main page is a feature, not a bug. I can't say I'm happy about it, but I accept your reasoning. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 08:55:54 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Mar 2012 07:55:54 +0000 Subject: [issue14362] No mention of collections.ChainMap in What's New for 3.3 In-Reply-To: <1332069504.3.0.514334264343.issue14362@psf.upfronthosting.co.za> Message-ID: <1332143754.3.0.583521318184.issue14362@psf.upfronthosting.co.za> Raymond Hettinger added the comment: ?ric, please go ahead and add a stub entry or a draft entry. I haven't had a chance to start my whatsnew edits yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 09:34:42 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Mon, 19 Mar 2012 08:34:42 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: <1332130663.43.0.872734730459.issue14034@psf.upfronthosting.co.za> Message-ID: Tshepang Lekhonkhobe added the comment: > Nick Coghlan added the comment: > > A couple of thoughts on the draft HOWTO: > > I like the "verbosity" example, but I'd also like to see it continue on into introducing the "action='count'" alternative that allows "-vv" to set the verbosity level to 2, etc. I wonder if this usage is common enough to get an entry in this introductory text. > I also find the idea of having higher verbosity levels that aren't supersets of lower verbosity levels to be an anti-pattern, so I'd prefer not to see it in an official HOWTO. To my mind, verbosity levels should be checked with ">=", never "==". I don't really understand this paragraph. Do you have an example to compare with any of the examples in the attached patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 09:43:59 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Mon, 19 Mar 2012 08:43:59 +0000 Subject: [issue13210] Support Visual Studio 2010 In-Reply-To: <1318942521.44.0.961979099616.issue13210@psf.upfronthosting.co.za> Message-ID: <1332146639.86.0.501174151102.issue13210@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Super Brian, let me know if I can help. I already did the necessary changes locally. Martin, what I mean by "forward compatibility" is simply that the source code compiles and works with more recent versions of the compiler. The assumption in "errnomodule.c" that e.g. WSAEAGAIN and EAGAIN are defined to the same value prevent that. Just this little fix would fix almost everything. I'm sure that a lot of people hacking on python compile it locally without expecting it to work out of the box with downloaded extension modules. FYI, Eve Online has been running with VS2010 compiled python 2.7 since the middle of last year :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 09:49:03 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Mon, 19 Mar 2012 08:49:03 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: Message-ID: Tshepang Lekhonkhobe added the comment: On Mon, Mar 19, 2012 at 10:34, Tshepang Lekhonkhobe wrote: >> Nick Coghlan added the comment: >> >> A couple of thoughts on the draft HOWTO: >> >> I like the "verbosity" example, but I'd also like to see it continue on into introducing the "action='count'" alternative that allows "-vv" to set the verbosity level to 2, etc. > > I wonder if this usage is common enough to get an entry in this > introductory text. > >> I also find the idea of having higher verbosity levels that aren't supersets of lower verbosity levels to be an anti-pattern, so I'd prefer not to see it in an official HOWTO. To my mind, verbosity levels should be checked with ">=", never "==". > > I don't really understand this paragraph. Do you have an example to > compare with any of the examples in the attached patch? After playing a bit more with this and thinking about it a bit, I do get your point. It makes a lot of sense. I will attach a patch soon, which will also include the count keyword. Thanks for the review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 11:45:04 2012 From: report at bugs.python.org (Steffen Daode Nurpmeso) Date: Mon, 19 Mar 2012 10:45:04 +0000 Subject: [issue11686] Update of some email/ __all__ lists In-Reply-To: <1331952716.36.0.552832482122.issue11686@psf.upfronthosting.co.za> Message-ID: <20120319104454.GA475@sherwood.local> Steffen Daode Nurpmeso added the comment: R. David Murray wrote [2012-03-17 03:51+0100]: > Thanks for the patch, Steffen. Warm to the cleanroom-squatters! (I count this as the promised petit glass of red wine.) --steffen Forza Figa! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 11:50:59 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Mon, 19 Mar 2012 10:50:59 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: Message-ID: Tshepang Lekhonkhobe added the comment: > After playing a bit more with this and thinking about it a bit, I do > get your point. It makes a lot of sense. I will attach a patch soon, > which will also include the count keyword. Thanks for the review. Find attached. Note that I kept some of those anti-pattern examples you mentioned, and then later on introduced your preferred way of doing things (using action="count" and ">=" checks instead of "==" ones). ---------- Added file: http://bugs.python.org/file24937/argparse_howto2.patch _______________________________________ Python tracker _______________________________________ -------------- next part -------------- diff --git a/Doc/howto/argparse.rst b/Doc/howto/argparse.rst new file mode 100644 --- /dev/null +++ b/Doc/howto/argparse.rst @@ -0,0 +1,720 @@ +***************************** +Command Line Interface HOWTO +***************************** + +:author: Tshepang Lekhonkhobe + +.. _argparse-howto: + +This is intended to be a gentle introduction to command line parsing +using :mod:`argparse` module, the recommended module for such a purpose +in Python. Please pay careful attention to the code and its output. All of +it was carefully selected for its instructive value. + +.. note:: + + There's two other modules that fulfill the same task, namely + :mod:`getopt` (an equivalent for :c:func:`getopt` from the C + language) and the deprecated :mod:`optparse`. + + +Concepts +======== + +Let's show the sort of functionality that we are going to explore in this +introductory tutorial by making use of the :command:`ls` command:: + + + $ ls + cpython devguide prog.py pypy rm-unused-function.patch + $ ls pypy + ctypes_configure demo dotviewer include lib_pypy lib-python ... + $ ls -l + total 20 + drwxr-xr-x 19 wena wena 4096 Feb 18 18:51 cpython + drwxr-xr-x 4 wena wena 4096 Feb 8 12:04 devguide + -rwxr-xr-x 1 wena wena 535 Feb 19 00:05 prog.py + drwxr-xr-x 14 wena wena 4096 Feb 7 00:59 pypy + -rw-r--r-- 1 wena wena 741 Feb 18 01:01 rm-unused-function.patch + $ ls --help + Usage: ls [OPTION]... [FILE]... + List information about the FILEs (the current directory by default). + Sort entries alphabetically if none of -cftuvSUX nor --sort is specified. + ... + +A few concepts we can learn from the four commands: + +#. The :command:`ls` command is useful when run without any options at all. It defaults + to displaying the contents of the current directory. + +#. If we want beyond what it provides by default, we tell it a bit more. In + this case, we want it to display a different directory, ``pypy``. + What we did is specify what is known as a positional argument. It's named so + because the program should know what to do with the value, solely based on + where it appears on the command line. This concept is more relevant + to a command like :command:`cp`, whose most basic usage is ``cp SRC DEST``. + The first position is *what you want copied,* and the second + position is *where you want it copied to*. + +#. Now, say we want to change behaviour of the program. In our example, + we display more info for each file instead of just showing the file names. + The ``-l`` in that case is known as an optional argument. + +#. That's a snippet of the help text. It's very useful in that you can + come across a program you have never used before, and can figure out + how it works simply by reading it's help text. + + +The basics +========== + +Let us start with a very simple example which does (almost) nothing:: + + import argparse + parser = argparse.ArgumentParser() + parser.parse_args() + +Following is a result of running the code:: + + $ python3 prog.py + $ python3 prog.py --help + usage: prog.py [-h] + + optional arguments: + -h, --help show this help message and exit + $ python3 prog.py --verbose + usage: prog.py [-h] + prog.py: error: unrecognized arguments: --verbose + $ python3 prog.py foo + usage: prog.py [-h] + prog.py: error: unrecognized arguments: foo + +Here is what is happening: + +* Running the script without any options results in nothing displayed to + stdout. Not so useful. + +* The second one starts to display the usefulness of the :mod:`argparse` + module. We have done almost nothing, but already we get a nice help message. + +* The ``--help`` option, which can also be shortened to ``-h``, is the only + option we get for free (i.e. no need to specify it). Specifying anything + else results in an error. But even then, we do get a useful usage message, + also for free. + + +Introducing Positional arguments +================================ + +An example:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("echo") + args = parser.parse_args() + print(args.echo) + +And running the code:: + + $ python3 prog.py + usage: prog.py [-h] echo + prog.py: error: the following arguments are required: echo + $ python3 prog.py --help + usage: prog.py [-h] echo + + positional arguments: + echo + + optional arguments: + -h, --help show this help message and exit + $ python3 prog.py foo + foo + +Here is what's happening: + +#. We've added :meth:`add_argument` method, which is what we use to specify + which command line options the program is willing to accept. In this case, + I've named it ``echo`` so that it's in line with its function. + +#. Calling our program now requires us to specify an option. + +#. Also, the :meth:`parse_args` method actually returns some data from the + options specified, in this case, ``echo``. Note that the variable is some + form of 'magic' that :mod:`argparse` performs for free (i.e. no need to + specify which variable that value is stored in). Note also that it's + name matches the string argument given to the method, ``echo``. + +Note however that, although the help display looks nice and all, it currently +is not as helpful as it can be. For example we see that we got ``echo`` as a +positional argument, but we don't know what it does, other than by guessing or +by reading the source code. So, let's make it a bit more useful:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("echo", help="echo the string you use here") + args = parser.parse_args() + print(args.echo) + +And we get:: + + $ python3 prog.py -h + usage: prog.py [-h] echo + + positional arguments: + echo echo the string you use here + + optional arguments: + -h, --help show this help message and exit + +Now, how about doing something even more useful:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", help="display a square of a given number") + args = parser.parse_args() + print(pow(args.square, 2)) + +Following is a result of running the code:: + + $ python3 prog.py 4 + Traceback (most recent call last): + File "prog.py", line 5, in + print(pow(args.square, 2)) + TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int' + +That didn't go so well. That's because :mod:`argparse` treats the options we +give it as strings, unless we tell it otherwise and the :func:`pow` function +doesn't accept strings as arguments. So, let's tell +:mod:`argparse` to treat that input as an integer:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", help="display a square of a given number", + type=int) + args = parser.parse_args() + print(pow(args.square, 2)) + +Following is a result of running the code:: + + $ python3 prog.py 4 + 16 + $ python3 prog.py four + usage: prog.py [-h] square + prog.py: error: argument square: invalid int value: 'four' + +That went well. The program now even helpfully quits on bad illegal input +before proceeding. + + +Introducing Optional arguments +============================== + +So far we, have been playing with positional arguments. Let us +have a look on how to add optional ones:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("--verbosity", help="increase output verbosity") + args = parser.parse_args() + if args.verbosity: + print("verbosity turned on") + +And the output:: + + $ python3 prog.py --verbosity 1 + verbosity turned on + $ python3 prog.py + $ python3 prog.py --help + usage: prog.py [-h] [--verbosity VERBOSITY] + + optional arguments: + -h, --help show this help message and exit + --verbosity VERBOSITY + increase output verbosity + $ python3 prog.py --verbosity + usage: prog.py [-h] [--verbosity VERBOSITY] + prog.py: error: argument --verbosity: expected one argument + +Here is what is happening: + +#. The program is written so as to display something when ``--verbosity`` is + specified and display nothing when not. + +#. To show that the option is actually optional, there is no error when running + the program without it. Note that by default, if an optional argument isn't + used, the relevant variable, in this case :data:`args.verbosity`, is + given ``None`` as a value, which is the reason it fails the truth + test of the :keyword:`if` statement. + +#. The help message is a bit different. + +#. When using the ``--verbosity`` option, one must also specify some value, any + value. + +The above example accepts arbitrary integer values for ``--verbosity``, but for +our simple program, only two values are actually useful, ``True`` or ``False``. +Let's modify the code accordingly:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("--verbose", help="increase output verbosity", + action="store_true") + args = parser.parse_args() + if args.verbose: + print("verbosity turned on") + +And the output:: + + $ python3 prog.py --verbose + verbosity turned on + $ python3 prog.py --verbose 1 + usage: prog.py [-h] [--verbose] + prog.py: error: unrecognized arguments: 1 + $ python3 prog.py --help + usage: prog.py [-h] [--verbose] + + optional arguments: + -h, --help show this help message and exit + --verbose increase output verbosity + +Here is what is happening: + +#. The option is now more of a flag than something that requires a value. + We even changed the name of the option to match that idea. + Note that we now specify a new keyword, ``action``, and give it the value + "store_true". This means that, if the option is specified, assign the value + ``True`` to :data:`args.verbose` ``True``. Not specifying it implies + ``False``. + +#. It complains when you specify a value, in true spirit of what flags + actually are. + +#. Notice the different help text. + +If you are familiar with command line usage, you will notice that I haven't yet +touched on the topic of short versions of the options. It's quite simple:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("-v", "--verbose", help="increase output verbosity", + action="store_true") + args = parser.parse_args() + if args.verbose: + print("verbosity turned on") + +And here goes:: + + $ python3 prog.py -v + verbosity turned on + $ python3 prog.py --help + usage: prog.py [-h] [-v] + + optional arguments: + -h, --help show this help message and exit + -v, --verbose increase output verbosity + +Note that the new ability is also reflected in the help text. + + +Combining Positional and Optional arguments +=========================================== + +Our program keeps growing in complexity:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbose", action="store_true", + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbose: + print("the square of {} equals {}".format(args.square, answer)) + else: + print(answer) + +And now the output:: + + $ python3 prog.py + usage: prog.py [-h] [-v] square + prog.py: error: the following arguments are required: square + $ python3 prog.py 4 + 16 + $ python3 prog.py 4 --verbose + the square of 4 equals 16 + $ python3 prog.py --verbose 4 + the square of 4 equals 16 + +* We've brought back a positional argument, hence the complaint. + +* As for the fourth output, note that the order does not matter. + +How about we give this program of ours back the ability to have +multiple verbosity values, and actually get to use them:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", type=int, + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbosity == 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity == 1: + print("pow({}, 2) == {}".format(args.square, answer)) + else: + print(answer) + +And the output:: + + $ python3 prog.py 4 + 16 + $ python3 prog.py 4 -v + usage: prog.py [-h] [-v VERBOSITY] square + prog.py: error: argument -v/--verbosity: expected one argument + $ python3 prog.py 4 -v 1 + pow(4, 2) == 16 + $ python3 prog.py 4 -v 2 + the square of 4 equals 16 + $ python3 prog.py 4 -v 3 + 16 + +These all look good except the last one, which exposes a bug in our program. +Let's fix it by restricting the values the ``--verbosity`` option can accept:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", type=int, choices=[0, 1, 2], + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbosity == 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity == 1: + print("pow({}, 2) == {}".format(args.square, answer)) + else: + print(answer) + +And the output:: + + $ python3 prog.py 4 -v 3 + usage: prog.py [-h] [-v {0,1,2}] square + prog.py: error: argument -v/--verbosity: invalid choice: 3 (choose from 0, 1, 2) + $ python3 prog.py 4 -h + usage: prog.py [-h] [-v {0,1,2}] square + + positional arguments: + square display a square of a given number + + optional arguments: + -h, --help show this help message and exit + -v {0,1,2}, --verbosity {0,1,2} + increase output verbosity + +Note that the change also reflects both in the error message as well as the +help string. + +Now, let's use a different approach of playing with verbosity, which is pretty +common (and is recommended by at least one core CPython developer):: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", action="count", + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbosity == 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity == 1: + print("pow({}, 2) == {}".format(args.square, answer)) + else: + print(answer) + +We have introduced another action, "count". What it does is keep a count of +optional arguments:: + + $ python3 prog.py 4 -v 1 + usage: prog.py [-h] [-v] square + prog.py: error: unrecognized arguments: 1 + $ python3 prog.py 4 -v + pow(4, 2) == 16 + $ python3 prog.py 4 -vv + the square of 4 equals 16 + $ python3 prog.py 4 + 16 + $ python3 prog.py 4 --verbosity --verbosity + the square of 4 equals 16 + $ python3 prog.py 4 -h + usage: prog.py [-h] [-v] square + + positional arguments: + square display a square of a given number + + optional arguments: + -h, --help show this help message and exit + -v, --verbosity increase output verbosity + $ python3 prog.py 4 -vvv + 16 + +* Yes, it's now more of a flag (similar tp `action="store_true"`) in the + previous version of our script. That should explain the complaint. +* See what I mean that it behaves similar to "store_true" action? +* Now here's a demonstration of what the "count" action gives. You've probably + seen this sort of usage before. +* And, just like the "store_true" action, if you don't specify the `-v` flag, + that flag is considered to have ``None`` value. +* As should be expected, specifying the long form of the flag, we should get + the same output. +* Sadly, our help output isn't very informative on the new ability our script + has acquired, but that can always be fixed by improving the documentation for + out script (e.g. via the `help` keyword argument). +* That's a bug in our program. Let's fix:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", action="count", + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbosity >= 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity >= 1: + print("pow({}, 2) == {}".format(args.square, answer)) + else: + print(answer) + +And this is what it gives:: + + $ python3 prog.py 4 -vvv + the square of 4 equals 16 + $ python3 prog.py 4 -vvvv + the square of 4 equals 16 + $ python3 prog.py 4 + Traceback (most recent call last): + File "prog.py", line 11, in + if args.verbosity >= 2: + TypeError: unorderable types: NoneType() >= int() + +* First output went as well, and fixes the bug we had before. That is, to avoid + such problems, do `>=` checks in future, not `==`. +* Third output not so good, so let's fix that bug:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", action="count", + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if not args.verbosity: + print(answer) + elif args.verbosity >= 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity >= 1: + print("pow({}, 2) == {}".format(args.square, answer)) + +And:: + + $ python3 prog.py 4 + 16 + +All's well. + +Powerful isn't it. We have only scratched the surface. The :mod:`argparse` +module is excessively powerful, and we'll explore a bit more of it before we +end this tutorial. + + +Getting a little more advanced +============================== + +What if we wanted to expand our tiny program to perform other powers, not +just 2:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("power", type=int, nargs=2) + parser.add_argument("-v", "--verbosity", action="count") + args = parser.parse_args() + answer = pow(args.power[0], args.power[1]) + if not args.verbosity: + print(answer) + elif args.verbosity >= 2: + print("{} to the power {} equals {}".format(args.power[0], args.power[1], answer)) + elif args.verbosity >= 1: + print("pow({}, {}) == {}".format(args.power[0], args.power[1], answer)) + +Output:: + + $ python3 prog.py + usage: prog.py [-h] [-v] power power + prog.py: error: the following arguments are required: power + $ python3 prog.py -h + usage: prog.py [-h] [-v] power power + + positional arguments: + power + + optional arguments: + -h, --help show this help message and exit + -v, --verbosity + $ python3 prog.py 4 2 + 16 + $ python3 prog.py 4 2 -v + pow(4, 2) == 16 + $ python3 prog.py 4 2 -vv + 4 to the power 2 equals 16 + $ python3 prog.py 4 2 -vvv + 4 to the power 2 equals 16 + +We introduced another keyword argument, ``nargs``. It helps us specify +how many arguments are expected for a given command line option, which is +2 in this case. + +As you can see, the help text could be a little better than what it is +(``usage: prog.py [-h] [-v {0,1,2}] power power``). Let's fix it:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("x", type=int, help="the 'x' in x^y") + parser.add_argument("y", type=int, help="the 'y' in x^y") + parser.add_argument("-v", "--verbosity", action="count") + args = parser.parse_args() + answer = pow(args.x, args.y) + if not args.verbosity: + print(answer) + elif args.verbosity >= 2: + print("{} to the power {} equals {}".format(args.x, args.y, answer)) + elif args.verbosity >= 1: + print("pow({}, {}) == {}".format(args.x, args.y, answer)) + +Output:: + + $ python3 prog.py + usage: prog.py [-h] [-v] x y + prog.py: error: the following arguments are required: x, y + $ python3 prog.py -h + usage: prog.py [-h] [-v] x y + + positional arguments: + x the 'x' in x^y + y the 'y' in x^y + + optional arguments: + -h, --help show this help message and exit + -v, --verbosity + $ python3 prog.py 4 2 -v + pow(4, 2) == 16 + $ python3 prog.py 4 2 -v 1 + usage: prog.py [-h] [-v] x y + prog.py: error: unrecognized arguments: 1 + +That looks much better, and the last example serves as a reminder that this +is pretty much a flag, removing the need to provide values. + +So far, we have been working with two methods of an +:class:`argparse.ArgumentParser` instance. Let's introduce a third one, +``add_mutually_exclusive_group``. It allows for us to specify options that +conflict with each other. Let's also change the rest of the program make the +new functionality makes more sense:: + + import argparse + + parser = argparse.ArgumentParser() + group = parser.add_mutually_exclusive_group() + group.add_argument("-v", "--verbose", action="store_true") + group.add_argument("-q", "--quiet", action="store_true") + parser.add_argument("x", type=int, help="the 'x' in x^y") + parser.add_argument("y", type=int, help="the 'y' in x^y") + args = parser.parse_args() + answer = pow(args.x, args.y) + + if args.quiet: + print(answer) + elif args.verbose: + print("{} to the power {} equals {}".format(args.x, args.y, answer)) + else: + print("pow({}, {}) == {}".format(args.x, args.y, answer)) + +Our program is now simpler, and we've lost some functionality for the sake of +demonstration. Anyways, here's the output:: + + $ python3 prog.py 4 2 + pow(4, 2) == 16 + $ python3 prog.py 4 2 -q + 16 + $ python3 prog.py 4 2 -v + 4 to the power 2 equals 16 + $ python3 prog.py 4 2 -vq + usage: prog.py [-h] [-v | -q] x y + prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose + $ python3 prog.py 4 2 -v --quiet + usage: prog.py [-h] [-v | -q] x y + prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose + +That should be easy to follow. I've added that last output so you can see the +sort of flexibility you get, i.e. mixing long form options with short form +ones. That's nice. + +Before we conclude, you probably want to tell your users the main purpose of +your program, just in case they don't know:: + + import argparse + + parser = argparse.ArgumentParser(description="calculate X to the power of Y") + group = parser.add_mutually_exclusive_group() + group.add_argument("-v", "--verbose", action="store_true") + group.add_argument("-q", "--quiet", action="store_true") + parser.add_argument("x", type=int, help="the 'x' in x^y") + parser.add_argument("y", type=int, help="the 'y' in x^y") + args = parser.parse_args() + answer = pow(args.x, args.y) + + if args.quiet: + print(answer) + elif args.verbose: + print("{} to the power {} equals {}".format(args.x, args.y, answer)) + else: + print("pow({}, {}) == {}".format(args.x, args.y, answer)) + +Which outputs:: + + $ python3 prog.py --help + usage: prog.py [-h] [-v | -q] x y + + calculate X to the power of Y + + positional arguments: + x the 'x' in x^y + y the 'y' in x^y + + optional arguments: + -h, --help show this help message and exit + -v, --verbose + -q, --quiet + +Note that slight difference in the usage text. Note the `[-v | -q]`, which +tells us that we can either use `-v` or `-q`, but not both at the same time. + +Conclusion +========== + +There's lots more to the module of course, things like customising +the help message, or simply disabling its getting generated. +You can also force optional arguments to be required, or even change the +character used to denote them (e.g. ``+v`` instead of ``-v``). + +Have a look at the API docs. +They are quite detailed and thorough, and full of examples. I hope that +having gone through this tutorial, you will easily digest them +without feeling overwhelmed. diff --git a/Doc/howto/index.rst b/Doc/howto/index.rst --- a/Doc/howto/index.rst +++ b/Doc/howto/index.rst @@ -27,4 +27,5 @@ unicode.rst urllib2.rst webservers.rst + argparse.rst diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -10,6 +10,12 @@ **Source code:** :source:`Lib/argparse.py` +.. sidebar:: Tutorial + + This page contains the API reference information. For a more gentle + introduction to Python command line parsing, have a look at the + :ref:`Basic Tutorial `. + -------------- The :mod:`argparse` module makes it easy to write user-friendly command-line From report at bugs.python.org Mon Mar 19 12:02:10 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Mon, 19 Mar 2012 11:02:10 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: Message-ID: Tshepang Lekhonkhobe added the comment: > Find attached. Note that I kept some of those anti-pattern examples > you mentioned, and then later on introduced your preferred way of > doing things (using action="count" and ">=" checks instead of "==" > ones). Reason I kept those is to easily lead the reader into the "more correct" way of doing things, by first doing them in a more obvious but less ideal way. For example, when the goal of one is to teach one to remove duplicates from list, it's nice if you first do the process manually, and then later on introduce the set() type, just so the user can appreciate them more. Same applies to doing "for item in range(len(iterable))" vs. "for item in iterable". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 12:11:03 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Mon, 19 Mar 2012 11:11:03 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: <1329417262.26.0.419020263055.issue14034@psf.upfronthosting.co.za> Message-ID: <1332155463.51.0.429576311793.issue14034@psf.upfronthosting.co.za> Tshepang Lekhonkhobe added the comment: Okay, there was some bad markup on my version 2. Lemme fix. ---------- Added file: http://bugs.python.org/file24938/argparse_howto2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 12:23:32 2012 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 19 Mar 2012 11:23:32 +0000 Subject: [issue14361] No link to issue tracker on Python home page In-Reply-To: <1332069267.85.0.0257661397774.issue14361@psf.upfronthosting.co.za> Message-ID: <1332156212.2.0.445294963831.issue14361@psf.upfronthosting.co.za> Ezio Melotti added the comment: > Starting from the Python web site, it is not obvious how to find the issue > tracker to report a bug. (I had to resort to) For this very reason, what I always do is > googling for "Python bug tracker" to find it. Which doesn't mean that I agree that a link should be added to the homepage, but just that if I'm looking for a bug tracker, I search for "[projectname] bug tracker" rather than searching for "[projectname]" and then try to find a link to the bug tracker on their homepage. I would probably do the same even if I knew there is a link to the bug tracker on the homepage. (For the Python bug tracker I have a dedicated button on my browser though :) ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From martin.gradwell at gmail.com Mon Mar 19 04:44:40 2012 From: martin.gradwell at gmail.com (Martin Gradwell) Date: Mon, 19 Mar 2012 03:44:40 +0000 Subject: [issue13926] pydoc - stall when requesting a list of available modules in the online help utility Message-ID: I'm having the same problem. The problem seems to be that help("modules") iterates through all the modules, loading each one in turn, and if any one of them is broken then the iteration will fail, without a sensible indication of where the failure occurred. As an alternative method of listing all the modules I've tried from pydoc import apropos apropos(None) This still fails, but at least it gives a partial list of modules prior to failing. so I got a list ending with ... _yaml anyjson appindicator I uninstalled appindicator, in case that was the problem, but it wasn't. So I looked for something which came closely after appindicator alphabetically, found python-apport, and uninstalled that. Now apropos gets much further, but it still fails, this time at gufw.model, suggesting that the next problematic module comes alphabetically shortly after gufw. I could keep uninstalling modules until pydoc.apropos or help("modules") works, but all these modules are presumably there for a reason. For instance, when I uninstalled python-apport, I think the Ubuntu-One control panel got uninstalled as a dependency. In any case, having a command which is so fragile that it can be broken by any fault at all, anywhere in the entire system, doesn't seem to me to be a sensible design. There has to be a way of listing modules without loading every module. Martin Gradwell From report at bugs.python.org Mon Mar 19 12:59:40 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Mon, 19 Mar 2012 11:59:40 +0000 Subject: [issue14350] Strange Exception from copying an iterable In-Reply-To: <1332011066.2.0.397754612752.issue14350@psf.upfronthosting.co.za> Message-ID: <1332158380.53.0.825975062469.issue14350@psf.upfronthosting.co.za> Ramchandra Apte added the comment: BTW, can we add support for copying iterators by using itertools.tee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 13:08:44 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Mar 2012 12:08:44 +0000 Subject: [issue13370] test_ctypes fails when building python with clang In-Reply-To: <1320761474.93.0.268896325495.issue13370@psf.upfronthosting.co.za> Message-ID: <1332158924.61.0.423862548418.issue13370@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: -haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 13:13:22 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Mar 2012 12:13:22 +0000 Subject: [issue14222] Using time.time() in Queue.get breaks when system time is changed In-Reply-To: <1331149120.51.0.79082225225.issue14222@psf.upfronthosting.co.za> Message-ID: <1332159202.26.0.978502746525.issue14222@psf.upfronthosting.co.za> STINNER Victor added the comment: > Yo, I had marked this as something I was going to review once > the python-dev discussion to complete. FWIW, I'm the maintainer > of the Queue module. And so, do you agree with the change? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 13:15:12 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Mar 2012 12:15:12 +0000 Subject: [issue14277] time.monotonic docstring does not mention the time unit returned In-Reply-To: <1331594684.47.0.548556595506.issue14277@psf.upfronthosting.co.za> Message-ID: <1332159312.18.0.845922093405.issue14277@psf.upfronthosting.co.za> STINNER Victor added the comment: The unit (seconds) is not mentioned in the doc. Related changesets: 27441e0d6a75 and c11946846474. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 13:15:38 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Mar 2012 12:15:38 +0000 Subject: [issue14277] time.monotonic docstring does not mention the time unit returned In-Reply-To: <1331594684.47.0.548556595506.issue14277@psf.upfronthosting.co.za> Message-ID: <1332159338.16.0.766082888086.issue14277@psf.upfronthosting.co.za> STINNER Victor added the comment: > The unit (seconds) is not mentioned in the doc The unit (seconds) is *now* mentioned in the doc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 13:20:54 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Mon, 19 Mar 2012 12:20:54 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: <1329417262.26.0.419020263055.issue14034@psf.upfronthosting.co.za> Message-ID: <1332159654.16.0.0478018101342.issue14034@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : Removed file: http://bugs.python.org/file24937/argparse_howto2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 13:21:53 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Mar 2012 12:21:53 +0000 Subject: [issue14318] clarify "may not" in time.steady docs In-Reply-To: <1331829668.71.0.947018206764.issue14318@psf.upfronthosting.co.za> Message-ID: <1332159713.49.0.838978482208.issue14318@psf.upfronthosting.co.za> STINNER Victor added the comment: > Does "may not" mean that the user isn't allowed to adjust it, > or that they system won't always have adjusted it? It depends on which clock is used. - clock_gettime(CLOCK_MONOTONIC_RAW) cannot be adjusted - clock_gettime(CLOCK_MONOTONIC) can be adjusted by NTP (only its speed, no forward or backward jump) - I don't think that QueryPerformanceCounter() can be adjusted - gettimeofday(), ftime() and time() are the system clock and can be changed manually by the system administrator or automatically by NTP (maybe with a jump, forward or backward) - clock() is used on Windows if QueryPerformanceFrequency failed. I donk't know if it can be ajdusted It is important to mention that time.steady() may be adjusted in some cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 13:28:50 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Mar 2012 12:28:50 +0000 Subject: [issue14368] floattime() should not raise an exception Message-ID: <1332160130.55.0.774132301526.issue14368@psf.upfronthosting.co.za> New submission from STINNER Victor : floattime() raises an OSError if _PyTime_gettimeofday() returns secs=0 and usec=0. This is wrong because _PyTime_gettimeofday() cannot fail and secs=0 is valid if the current time is 0 (1970.1.1 at 12:00 UTC). Extract of _PyTime_gettimeofday() "doc": /* Similar to POSIX gettimeofday but cannot fail. If system gettimeofday * fails or is not available, fall back to lower resolution clocks. */ PyAPI_FUNC(void) _PyTime_gettimeofday(_PyTime_timeval *tp); In practice, I suppose that nobody noticed the bug because we are in 2012, not in 1969 :-) And even if you change your system clock to 1969.11.31, you may not be able to reproduce the bug because you have to call gettimeofday() exactly at midnight to get also usec=0 ... Attached patch removes the exception. ---------- components: Library (Lib) files: floattime.patch keywords: patch messages: 156334 nosy: haypo priority: normal severity: normal status: open title: floattime() should not raise an exception versions: Python 3.3 Added file: http://bugs.python.org/file24939/floattime.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 13:46:57 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Mar 2012 12:46:57 +0000 Subject: [issue14309] Deprecate time.clock() In-Reply-To: <1331772722.48.0.0484604711161.issue14309@psf.upfronthosting.co.za> Message-ID: <1332161217.02.0.220671060861.issue14309@psf.upfronthosting.co.za> STINNER Victor added the comment: > There's no other single function providing the same functionality time.clock() is not portable: it is a different clock depending on the OS. To write portable code, you have to use the right function: - time.time() - time.steady() - os.times(), resource.getrusage() On Windows, time.clock() should be replaced by time.steady(). On UNIX, time.clock() can be replaced with "usage=os.times(); usage[0]+usage[1]" for example. Which kind of use case is not covered by these functions? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 13:48:35 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Mar 2012 12:48:35 +0000 Subject: [issue14318] clarify "may not" in time.steady docs In-Reply-To: <1331829668.71.0.947018206764.issue14318@psf.upfronthosting.co.za> Message-ID: <1332161315.97.0.298484019617.issue14318@psf.upfronthosting.co.za> STINNER Victor added the comment: FYI "may not" comes from the C++ Timeout Specification: "Objects of class steady_clock represent clocks for which values of time_point never decrease as physical time advances and for which values of time_point advance at a steady rate relative to real time. That is, the clock may not be adjusted." http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3191.htm ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 13:50:26 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Mar 2012 12:50:26 +0000 Subject: [issue14222] Use time.steady() to implement timeout In-Reply-To: <1331149120.51.0.79082225225.issue14222@psf.upfronthosting.co.za> Message-ID: <1332161426.3.0.665258668061.issue14222@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: Using time.time() in Queue.get breaks when system time is changed -> Use time.steady() to implement timeout _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 13:59:06 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Mar 2012 12:59:06 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1332161946.76.0.987175844351.issue12568@psf.upfronthosting.co.za> STINNER Victor added the comment: > Martin: I agree that there are going to be cases where it is not > correct because the terminal does something strange, but what we > need is something that gets as close as possible to what the > terminal is likely to be doing Can't we expose wcswidth() as locale.strwidth() with a recipe explaining how to use unicodedata to get a "correct" result? At least until everyone implements correctly Unicode and Unicode stops evolving? :-) -- For unicodedata, a function to get the width of a string would be more convinient than unicodedata.east_asian_width(): >>> import unicodedata >>> unicodedata.east_asian_width('abc') Traceback (most recent call last): File "", line 1, in TypeError: need a single Unicode character as parameter >>> 'abc'.ljust(unicodedata.east_asian_width(' ')) Traceback (most recent call last): File "", line 1, in TypeError: 'str' object cannot be interpreted as an integer The function posted in msg155361 looks like east_asian_width() is not enough to get the width in columns of a single character. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 14:05:43 2012 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 19 Mar 2012 13:05:43 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: <1329417262.26.0.419020263055.issue14034@psf.upfronthosting.co.za> Message-ID: <1332162343.57.0.59473390537.issue14034@psf.upfronthosting.co.za> Nick Coghlan added the comment: Rather than "is recommended by at least one core CPython developer" I'd say "matches the way the CPython executable handles its own verbosity argument" (check the output of "python --help") Also, a better fix for the non-orderable types problem is to use "default=0" when defining the verbosity arg rather than changing the test in the code. Finally, the "not a superset" problem that I have with the way the running example uses its verbosity argument is that it uses it to *change* the message that gets displayed, instead of using it to *display more messages* at higher verbosity levels. >From that point of view, more idiomatic usage might look something like: if verbosity >= 2: print("Running {!r}".format(self.__file__) if verbosity >= 1: print("Calculating {}^2".format(args.square) print(answer) However, I'll grant that things like test runners do use their verbosity argument to switch from shorthand progress markers to printing out the test names and results, so I can live with the examples as they are. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 14:48:26 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Mon, 19 Mar 2012 13:48:26 +0000 Subject: [issue14310] Socket duplication for windows In-Reply-To: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> Message-ID: <1332164906.77.0.323161635538.issue14310@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: I'm adding an updated version of the patch, taking into account issues raised from reviewers. No documentation yet. ---------- Added file: http://bugs.python.org/file24940/duplicate.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 15:13:14 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 19 Mar 2012 14:13:14 +0000 Subject: [issue14366] Supporting bzip2 and lzma compression in zip files In-Reply-To: <1332112236.1.0.964135054036.issue14366@psf.upfronthosting.co.za> Message-ID: <1332166394.61.0.0426106973714.issue14366@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you, Martin, for review and advices. Lzma in zip format: 2-bytes version (LZMA SDK version, it has not relations with version of XZ Utils used by lzma module), 2-bytes properties size (I have not seen a value other than 5), N-bytes (N=5) property data, and raw compressed data (LZMA_RAW). Lzma file format (LZMA_ALONE): 5-bytes property data, 8-bytes uncompressed size (~0 if unknown), and raw compressed data (LZMA_RAW). 7-Zip ignores version and supports only 5-bytes property data. Because the LZMA1 codec is declared obsolete, it is highly unlikely for new versions with properties size != 5. Nevertheless, it would be wise to create a lzma module functions for parsing the bytes to the codec properties and for dumping the codec properties to the bytes (this is functions lzma_lzma_props_encode() and lzma_lzma_props_decode() in liblzma). It is not necessary but desirable. I see no other reasonable choice but to hardcode some arbitrary version in the compressing and to ignore it in the decompressing. This EOS marker is only helpful for stream zip-files when the size of the compressed data is not known beforehand and it is not possible to specify the following (see lzma-file-format.txt in liblzma docs). But that's must be another issue, the current implementation of the zipfile module does not work with non-seekable files (I hope to work on it later). > I also recommend to split this issue into two: bzip support and lzma support. Assuredly. I will create a new issue for bzip2, but what do I do with lzma? Do I need to rename this issue or create a new one? Does the lzma patch include the bzip2 patch, because the latter will contain the code necessary to support all codecs? Or should defer any work with lzma until the bzip2 support will commited? I think we should add the ability to register new codecs. Support for PPMd, jpeg and WavPack is unlikely to emerge in the Python in the foreseeable future, but users of third-party libraries (such as PIL), will use the new codecs as needed. > I also think that create_version and extract_version need to be adjusted. Agree. Should we raise an exception when using new compressor if allowZip64 == False? Or set allowZip64 = True, if we explicitly use the new compressor? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 15:14:17 2012 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Mon, 19 Mar 2012 14:14:17 +0000 Subject: [issue14309] Deprecate time.clock() In-Reply-To: <1332161217.02.0.220671060861.issue14309@psf.upfronthosting.co.za> Message-ID: <4F673F34.7090206@egenix.com> Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > >> There's no other single function providing the same functionality > > time.clock() is not portable: it is a different clock depending on the OS. To write portable code, you have to use the right function: > > - time.time() > - time.steady() > - os.times(), resource.getrusage() time.clock() does exactly what the docs say: you get access to a CPU timer. It's normal that CPU timers work differently on different OSes. > On Windows, time.clock() should be replaced by time.steady(). What for ? time.clock() uses the same timer as time.steady() on Windows, AFAICT, so all you change is the name of the function. > On UNIX, time.clock() can be replaced with "usage=os.times(); usage[0]+usage[1]" for example. And what's the advantage of that over using time.clock() directly ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 15:19:55 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Mon, 19 Mar 2012 14:19:55 +0000 Subject: [issue14310] Socket duplication for windows In-Reply-To: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> Message-ID: <1332166795.37.0.280388189853.issue14310@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: I like the idea of having a frominfo() function. Though "info" is maybe too generic? Also, dupinfo() is probably better than duplicate, even though there is no dup involved. But I also wonder if we can make this windows/unix agnostic? on unix, you would achieve the same thing by: 1) getting fd with fileno() 2) sending it over a unix domain socket using sendmsg() (used for duplicating fds betwerrn processes 3) calling fromfd() on the target host. We could have a uniform process (more or less) if dupinfo(pid) would return a string containing the fileno on linux, and frominfo() were to accept such a string too. The differeince between linux/windows would then be that linux needs to transfer the "info" between processes using the "magic" sendmsg() control info ona UNIX domain sock, whereas on Windows one can use whatever RPC one wishes. To implement this, we could therefore have special "sendinfo" and "recvinfo" functions. The process would then become, on either platform: 1) info = dupinfo(pid) 2) sendinfo(info)/info=recvinfo() 3) frominfo(info) But again: "info" is very generic here. any suggestions for a better name? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 15:38:38 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Mon, 19 Mar 2012 14:38:38 +0000 Subject: [issue14310] Socket duplication for windows In-Reply-To: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> Message-ID: <1332167918.81.0.591621642837.issue14310@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: On second thought, sendinfo/recvinfo makes no sense. On unix, one has to create and manage the necessary unix domain sockets, and such code belongs higher up somewhere. So dupinfo(pid), and frominfo() I'll add. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 15:42:01 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Mon, 19 Mar 2012 14:42:01 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: <1332162343.57.0.59473390537.issue14034@psf.upfronthosting.co.za> Message-ID: Tshepang Lekhonkhobe added the comment: > Nick Coghlan added the comment: > > Rather than "is recommended by at least one core CPython developer" I'd say "matches the way the CPython executable handles its own verbosity argument" (check the output of "python --help") Done. > Also, a better fix for the non-orderable types problem is to use "default=0" when defining the verbosity arg rather than changing the test in the code. Done. > Finally, the "not a superset" problem that I have with the way the running example uses its verbosity argument is that it uses it to *change* the message that gets displayed, instead of using it to *display more messages* at higher verbosity levels. > > >From that point of view, more idiomatic usage might look something like: > > ? ?if verbosity >= 2: > ? ? ? ?print("Running {!r}".format(self.__file__) > ? ?if verbosity >= 1: > ? ? ? ?print("Calculating {}^2".format(args.square) > ? ?print(answer) Yeah, I clearly didn't understand what you meant by 'superset'. I've added one example similar to the above. These were good suggestions. I've attached the patch. ---------- Added file: http://bugs.python.org/file24941/argparse_howto3.patch _______________________________________ Python tracker _______________________________________ -------------- next part -------------- diff --git a/Doc/howto/argparse.rst b/Doc/howto/argparse.rst new file mode 100644 --- /dev/null +++ b/Doc/howto/argparse.rst @@ -0,0 +1,755 @@ +***************************** +Command Line Interface HOWTO +***************************** + +:author: Tshepang Lekhonkhobe + +.. _argparse-howto: + +This is intended to be a gentle introduction to command line parsing +using :mod:`argparse` module, the recommended module for such a purpose +in Python. Please pay careful attention to the code and its output. All of +it was carefully selected for its instructive value. + +.. note:: + + There's two other modules that fulfill the same task, namely + :mod:`getopt` (an equivalent for :c:func:`getopt` from the C + language) and the deprecated :mod:`optparse`. + + +Concepts +======== + +Let's show the sort of functionality that we are going to explore in this +introductory tutorial by making use of the :command:`ls` command:: + + + $ ls + cpython devguide prog.py pypy rm-unused-function.patch + $ ls pypy + ctypes_configure demo dotviewer include lib_pypy lib-python ... + $ ls -l + total 20 + drwxr-xr-x 19 wena wena 4096 Feb 18 18:51 cpython + drwxr-xr-x 4 wena wena 4096 Feb 8 12:04 devguide + -rwxr-xr-x 1 wena wena 535 Feb 19 00:05 prog.py + drwxr-xr-x 14 wena wena 4096 Feb 7 00:59 pypy + -rw-r--r-- 1 wena wena 741 Feb 18 01:01 rm-unused-function.patch + $ ls --help + Usage: ls [OPTION]... [FILE]... + List information about the FILEs (the current directory by default). + Sort entries alphabetically if none of -cftuvSUX nor --sort is specified. + ... + +A few concepts we can learn from the four commands: + +#. The :command:`ls` command is useful when run without any options at all. It defaults + to displaying the contents of the current directory. + +#. If we want beyond what it provides by default, we tell it a bit more. In + this case, we want it to display a different directory, ``pypy``. + What we did is specify what is known as a positional argument. It's named so + because the program should know what to do with the value, solely based on + where it appears on the command line. This concept is more relevant + to a command like :command:`cp`, whose most basic usage is ``cp SRC DEST``. + The first position is *what you want copied,* and the second + position is *where you want it copied to*. + +#. Now, say we want to change behaviour of the program. In our example, + we display more info for each file instead of just showing the file names. + The ``-l`` in that case is known as an optional argument. + +#. That's a snippet of the help text. It's very useful in that you can + come across a program you have never used before, and can figure out + how it works simply by reading it's help text. + + +The basics +========== + +Let us start with a very simple example which does (almost) nothing:: + + import argparse + parser = argparse.ArgumentParser() + parser.parse_args() + +Following is a result of running the code:: + + $ python3 prog.py + $ python3 prog.py --help + usage: prog.py [-h] + + optional arguments: + -h, --help show this help message and exit + $ python3 prog.py --verbose + usage: prog.py [-h] + prog.py: error: unrecognized arguments: --verbose + $ python3 prog.py foo + usage: prog.py [-h] + prog.py: error: unrecognized arguments: foo + +Here is what is happening: + +* Running the script without any options results in nothing displayed to + stdout. Not so useful. + +* The second one starts to display the usefulness of the :mod:`argparse` + module. We have done almost nothing, but already we get a nice help message. + +* The ``--help`` option, which can also be shortened to ``-h``, is the only + option we get for free (i.e. no need to specify it). Specifying anything + else results in an error. But even then, we do get a useful usage message, + also for free. + + +Introducing Positional arguments +================================ + +An example:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("echo") + args = parser.parse_args() + print(args.echo) + +And running the code:: + + $ python3 prog.py + usage: prog.py [-h] echo + prog.py: error: the following arguments are required: echo + $ python3 prog.py --help + usage: prog.py [-h] echo + + positional arguments: + echo + + optional arguments: + -h, --help show this help message and exit + $ python3 prog.py foo + foo + +Here is what's happening: + +#. We've added :meth:`add_argument` method, which is what we use to specify + which command line options the program is willing to accept. In this case, + I've named it ``echo`` so that it's in line with its function. + +#. Calling our program now requires us to specify an option. + +#. Also, the :meth:`parse_args` method actually returns some data from the + options specified, in this case, ``echo``. Note that the variable is some + form of 'magic' that :mod:`argparse` performs for free (i.e. no need to + specify which variable that value is stored in). Note also that it's + name matches the string argument given to the method, ``echo``. + +Note however that, although the help display looks nice and all, it currently +is not as helpful as it can be. For example we see that we got ``echo`` as a +positional argument, but we don't know what it does, other than by guessing or +by reading the source code. So, let's make it a bit more useful:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("echo", help="echo the string you use here") + args = parser.parse_args() + print(args.echo) + +And we get:: + + $ python3 prog.py -h + usage: prog.py [-h] echo + + positional arguments: + echo echo the string you use here + + optional arguments: + -h, --help show this help message and exit + +Now, how about doing something even more useful:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", help="display a square of a given number") + args = parser.parse_args() + print(pow(args.square, 2)) + +Following is a result of running the code:: + + $ python3 prog.py 4 + Traceback (most recent call last): + File "prog.py", line 5, in + print(pow(args.square, 2)) + TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int' + +That didn't go so well. That's because :mod:`argparse` treats the options we +give it as strings, unless we tell it otherwise and the :func:`pow` function +doesn't accept strings as arguments. So, let's tell +:mod:`argparse` to treat that input as an integer:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", help="display a square of a given number", + type=int) + args = parser.parse_args() + print(pow(args.square, 2)) + +Following is a result of running the code:: + + $ python3 prog.py 4 + 16 + $ python3 prog.py four + usage: prog.py [-h] square + prog.py: error: argument square: invalid int value: 'four' + +That went well. The program now even helpfully quits on bad illegal input +before proceeding. + + +Introducing Optional arguments +============================== + +So far we, have been playing with positional arguments. Let us +have a look on how to add optional ones:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("--verbosity", help="increase output verbosity") + args = parser.parse_args() + if args.verbosity: + print("verbosity turned on") + +And the output:: + + $ python3 prog.py --verbosity 1 + verbosity turned on + $ python3 prog.py + $ python3 prog.py --help + usage: prog.py [-h] [--verbosity VERBOSITY] + + optional arguments: + -h, --help show this help message and exit + --verbosity VERBOSITY + increase output verbosity + $ python3 prog.py --verbosity + usage: prog.py [-h] [--verbosity VERBOSITY] + prog.py: error: argument --verbosity: expected one argument + +Here is what is happening: + +#. The program is written so as to display something when ``--verbosity`` is + specified and display nothing when not. + +#. To show that the option is actually optional, there is no error when running + the program without it. Note that by default, if an optional argument isn't + used, the relevant variable, in this case :data:`args.verbosity`, is + given ``None`` as a value, which is the reason it fails the truth + test of the :keyword:`if` statement. + +#. The help message is a bit different. + +#. When using the ``--verbosity`` option, one must also specify some value, any + value. + +The above example accepts arbitrary integer values for ``--verbosity``, but for +our simple program, only two values are actually useful, ``True`` or ``False``. +Let's modify the code accordingly:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("--verbose", help="increase output verbosity", + action="store_true") + args = parser.parse_args() + if args.verbose: + print("verbosity turned on") + +And the output:: + + $ python3 prog.py --verbose + verbosity turned on + $ python3 prog.py --verbose 1 + usage: prog.py [-h] [--verbose] + prog.py: error: unrecognized arguments: 1 + $ python3 prog.py --help + usage: prog.py [-h] [--verbose] + + optional arguments: + -h, --help show this help message and exit + --verbose increase output verbosity + +Here is what is happening: + +#. The option is now more of a flag than something that requires a value. + We even changed the name of the option to match that idea. + Note that we now specify a new keyword, ``action``, and give it the value + "store_true". This means that, if the option is specified, assign the value + ``True`` to :data:`args.verbose` ``True``. Not specifying it implies + ``False``. + +#. It complains when you specify a value, in true spirit of what flags + actually are. + +#. Notice the different help text. + +If you are familiar with command line usage, you will notice that I haven't yet +touched on the topic of short versions of the options. It's quite simple:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("-v", "--verbose", help="increase output verbosity", + action="store_true") + args = parser.parse_args() + if args.verbose: + print("verbosity turned on") + +And here goes:: + + $ python3 prog.py -v + verbosity turned on + $ python3 prog.py --help + usage: prog.py [-h] [-v] + + optional arguments: + -h, --help show this help message and exit + -v, --verbose increase output verbosity + +Note that the new ability is also reflected in the help text. + + +Combining Positional and Optional arguments +=========================================== + +Our program keeps growing in complexity:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbose", action="store_true", + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbose: + print("the square of {} equals {}".format(args.square, answer)) + else: + print(answer) + +And now the output:: + + $ python3 prog.py + usage: prog.py [-h] [-v] square + prog.py: error: the following arguments are required: square + $ python3 prog.py 4 + 16 + $ python3 prog.py 4 --verbose + the square of 4 equals 16 + $ python3 prog.py --verbose 4 + the square of 4 equals 16 + +* We've brought back a positional argument, hence the complaint. + +* As for the fourth output, note that the order does not matter. + +How about we give this program of ours back the ability to have +multiple verbosity values, and actually get to use them:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", type=int, + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbosity == 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity == 1: + print("pow({}, 2) == {}".format(args.square, answer)) + else: + print(answer) + +And the output:: + + $ python3 prog.py 4 + 16 + $ python3 prog.py 4 -v + usage: prog.py [-h] [-v VERBOSITY] square + prog.py: error: argument -v/--verbosity: expected one argument + $ python3 prog.py 4 -v 1 + pow(4, 2) == 16 + $ python3 prog.py 4 -v 2 + the square of 4 equals 16 + $ python3 prog.py 4 -v 3 + 16 + +These all look good except the last one, which exposes a bug in our program. +Let's fix it by restricting the values the ``--verbosity`` option can accept:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", type=int, choices=[0, 1, 2], + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbosity == 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity == 1: + print("pow({}, 2) == {}".format(args.square, answer)) + else: + print(answer) + +And the output:: + + $ python3 prog.py 4 -v 3 + usage: prog.py [-h] [-v {0,1,2}] square + prog.py: error: argument -v/--verbosity: invalid choice: 3 (choose from 0, 1, 2) + $ python3 prog.py 4 -h + usage: prog.py [-h] [-v {0,1,2}] square + + positional arguments: + square display a square of a given number + + optional arguments: + -h, --help show this help message and exit + -v {0,1,2}, --verbosity {0,1,2} + increase output verbosity + +Note that the change also reflects both in the error message as well as the +help string. + +Now, let's use a different approach of playing with verbosity, which is pretty +common. It also matches the way the CPython executable handles its own +verbosity argument (check the output of `python --help`):: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", action="count", + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbosity == 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity == 1: + print("pow({}, 2) == {}".format(args.square, answer)) + else: + print(answer) + +We have introduced another action, "count". What it does is keep a count of +optional arguments:: + + $ python3 prog.py 4 -v 1 + usage: prog.py [-h] [-v] square + prog.py: error: unrecognized arguments: 1 + $ python3 prog.py 4 -v + pow(4, 2) == 16 + $ python3 prog.py 4 -vv + the square of 4 equals 16 + $ python3 prog.py 4 + 16 + $ python3 prog.py 4 --verbosity --verbosity + the square of 4 equals 16 + $ python3 prog.py 4 -h + usage: prog.py [-h] [-v] square + + positional arguments: + square display a square of a given number + + optional arguments: + -h, --help show this help message and exit + -v, --verbosity increase output verbosity + $ python3 prog.py 4 -vvv + 16 + +* Yes, it's now more of a flag (similar tp `action="store_true"`) in the + previous version of our script. That should explain the complaint. +* See what I mean that it behaves similar to "store_true" action? +* Now here's a demonstration of what the "count" action gives. You've probably + seen this sort of usage before. +* And, just like the "store_true" action, if you don't specify the `-v` flag, + that flag is considered to have ``None`` value. +* As should be expected, specifying the long form of the flag, we should get + the same output. +* Sadly, our help output isn't very informative on the new ability our script + has acquired, but that can always be fixed by improving the documentation for + out script (e.g. via the `help` keyword argument). +* That's a bug in our program. + +Let's fix:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", action="count", + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbosity >= 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity >= 1: + print("pow({}, 2) == {}".format(args.square, answer)) + else: + print(answer) + +And this is what it gives:: + + $ python3 prog.py 4 -vvv + the square of 4 equals 16 + $ python3 prog.py 4 -vvvv + the square of 4 equals 16 + $ python3 prog.py 4 + Traceback (most recent call last): + File "prog.py", line 11, in + if args.verbosity >= 2: + TypeError: unorderable types: NoneType() >= int() + +* First output went as well, and fixes the bug we had before. That is, to avoid + such problems, do `>=` checks in future, not `==`. +* Third output not so good + +Let's fix that bug:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", action="count", default=0, + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbosity >= 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity >= 1: + print("pow({}, 2) == {}".format(args.square, answer)) + else: + print(answer) + +We've just introduced yet another keyword, `default`. We've set it to `0` in +order to make it comparable to the other int values. Remember that by +default, if an optional argument isn't specified, it gets the `None` value, and +that cannot be compared to an int value (hence the :exc:`TypeError` exception). + +And:: + + $ python3 prog.py 4 + 16 + +You can go quite far just with what we've learned so, and we have only +scratched the surface. The :mod:`argparse` module is excessively powerful, and +we'll explore a bit more of it before we end this tutorial. + + +Getting a little more advanced +============================== + +What if we wanted to expand our tiny program to perform other powers, not +just 2:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("power", type=int, nargs=2) + parser.add_argument("-v", "--verbosity", action="count", default=0) + args = parser.parse_args() + answer = pow(args.power[0], args.power[1]) + if args.verbosity >= 2: + print("{} to the power {} equals {}".format(args.power[0], args.power[1], answer)) + elif args.verbosity >= 1: + print("pow({}, {}) == {}".format(args.power[0], args.power[1], answer)) + else: + print(answer) + +Output:: + + $ python3 prog.py + usage: prog.py [-h] [-v] power power + prog.py: error: the following arguments are required: power + $ python3 prog.py -h + usage: prog.py [-h] [-v] power power + + positional arguments: + power + + optional arguments: + -h, --help show this help message and exit + -v, --verbosity + $ python3 prog.py 4 2 + 16 + $ python3 prog.py 4 2 -v + pow(4, 2) == 16 + $ python3 prog.py 4 2 -vv + 4 to the power 2 equals 16 + $ python3 prog.py 4 2 -vvv + 4 to the power 2 equals 16 + +We introduced yet another keyword argument, ``nargs``. It helps us specify +how many arguments are expected for a given command line option, which is +2 in this case. + +As you can see, the help text could be a little better than what it is +(``usage: prog.py [-h] [-v {0,1,2}] power power``). Let's fix it:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("x", type=int, help="the 'x' in x^y") + parser.add_argument("y", type=int, help="the 'y' in x^y") + parser.add_argument("-v", "--verbosity", action="count", default=0) + args = parser.parse_args() + answer = pow(args.x, args.y) + if args.verbosity >= 2: + print("{} to the power {} equals {}".format(args.x, args.y, answer)) + elif args.verbosity >= 1: + print("pow({}, {}) == {}".format(args.x, args.y, answer)) + else: + print(answer) + +Output:: + + $ python3 prog.py + usage: prog.py [-h] [-v] x y + prog.py: error: the following arguments are required: x, y + $ python3 prog.py -h + usage: prog.py [-h] [-v] x y + + positional arguments: + x the 'x' in x^y + y the 'y' in x^y + + optional arguments: + -h, --help show this help message and exit + -v, --verbosity + $ python3 prog.py 4 2 -v + pow(4, 2) == 16 + $ python3 prog.py 4 2 -v 1 + usage: prog.py [-h] [-v] x y + prog.py: error: argument -v/--verbosity: ignored explicit argument '1' + +That looks much better, and the last example serves as a reminder that this +is pretty much a flag, removing the need to provide values. + +Notice that so far we've been using verbosity level to *change* the text +that gets displayed. The following example instead uses verbosity level +to display *more* text instead:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("x", type=int, help="the 'x' in x^y") + parser.add_argument("y", type=int, help="the 'y' in x^y") + parser.add_argument("-v", "--verbosity", action="count", default=0) + args = parser.parse_args() + answer = pow(args.x, args.y) + if args.verbosity >= 2: + print("Running '{}'".format(__file__)) + if args.verbosity >= 1: + print("pow({}, {}) == ".format(args.x, args.y), end="") + print(answer) + +Output: + + $ python3 prog.py 4 2 + 16 + $ python3 prog.py 4 2 -v + pow(4, 2) == 16 + $ python3 prog.py 4 2 -vv + Running 'prog.py' + pow(4, 2) == 16 + +So far, we have been working with two methods of an +:class:`argparse.ArgumentParser` instance. Let's introduce a third one, +``add_mutually_exclusive_group``. It allows for us to specify options that +conflict with each other. Let's also change the rest of the program make the +new functionality makes more sense:: + + import argparse + + parser = argparse.ArgumentParser() + group = parser.add_mutually_exclusive_group() + group.add_argument("-v", "--verbose", action="store_true") + group.add_argument("-q", "--quiet", action="store_true") + parser.add_argument("x", type=int, help="the 'x' in x^y") + parser.add_argument("y", type=int, help="the 'y' in x^y") + args = parser.parse_args() + answer = pow(args.x, args.y) + + if args.quiet: + print(answer) + elif args.verbose: + print("{} to the power {} equals {}".format(args.x, args.y, answer)) + else: + print("pow({}, {}) == {}".format(args.x, args.y, answer)) + +Our program is now simpler, and we've lost some functionality for the sake of +demonstration. Anyways, here's the output:: + + $ python3 prog.py 4 2 + pow(4, 2) == 16 + $ python3 prog.py 4 2 -q + 16 + $ python3 prog.py 4 2 -v + 4 to the power 2 equals 16 + $ python3 prog.py 4 2 -vq + usage: prog.py [-h] [-v | -q] x y + prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose + $ python3 prog.py 4 2 -v --quiet + usage: prog.py [-h] [-v | -q] x y + prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose + +That should be easy to follow. I've added that last output so you can see the +sort of flexibility you get, i.e. mixing long form options with short form +ones. + +Before we conclude, you probably want to tell your users the main purpose of +your program, just in case they don't know:: + + import argparse + + parser = argparse.ArgumentParser(description="calculate X to the power of Y") + group = parser.add_mutually_exclusive_group() + group.add_argument("-v", "--verbose", action="store_true") + group.add_argument("-q", "--quiet", action="store_true") + parser.add_argument("x", type=int, help="the 'x' in x^y") + parser.add_argument("y", type=int, help="the 'y' in x^y") + args = parser.parse_args() + answer = pow(args.x, args.y) + + if args.quiet: + print(answer) + elif args.verbose: + print("{} to the power {} equals {}".format(args.x, args.y, answer)) + else: + print("pow({}, {}) == {}".format(args.x, args.y, answer)) + +Which outputs:: + + $ python3 prog.py --help + usage: prog.py [-h] [-v | -q] x y + + calculate X to the power of Y + + positional arguments: + x the 'x' in x^y + y the 'y' in x^y + + optional arguments: + -h, --help show this help message and exit + -v, --verbose + -q, --quiet + +Note that slight difference in the usage text. Note the `[-v | -q]`, which +tells us that we can either use `-v` or `-q`, but not both at the same time. + +Conclusion +========== + +There's lots more to the module of course, things like customising +the help message, or simply disabling its getting generated. +You can also force optional arguments to be required, or even change the +character used to denote them (e.g. ``+v`` instead of ``-v``). + +Have a look at the API docs. +They are quite detailed and thorough, and full of examples. I hope that +having gone through this tutorial, you will easily digest them +without feeling overwhelmed. diff --git a/Doc/howto/index.rst b/Doc/howto/index.rst --- a/Doc/howto/index.rst +++ b/Doc/howto/index.rst @@ -27,4 +27,5 @@ unicode.rst urllib2.rst webservers.rst + argparse.rst diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -10,6 +10,12 @@ **Source code:** :source:`Lib/argparse.py` +.. sidebar:: Tutorial + + This page contains the API reference information. For a more gentle + introduction to Python command line parsing, have a look at the + :ref:`Basic Tutorial `. + -------------- The :mod:`argparse` module makes it easy to write user-friendly command-line From report at bugs.python.org Mon Mar 19 15:48:34 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Mon, 19 Mar 2012 14:48:34 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: Message-ID: Tshepang Lekhonkhobe added the comment: Fixing a markup error. Sorry for the noise. ---------- Added file: http://bugs.python.org/file24942/argparse_howto3.patch _______________________________________ Python tracker _______________________________________ -------------- next part -------------- diff --git a/Doc/howto/argparse.rst b/Doc/howto/argparse.rst new file mode 100644 --- /dev/null +++ b/Doc/howto/argparse.rst @@ -0,0 +1,755 @@ +***************************** +Command Line Interface HOWTO +***************************** + +:author: Tshepang Lekhonkhobe + +.. _argparse-howto: + +This is intended to be a gentle introduction to command line parsing +using :mod:`argparse` module, the recommended module for such a purpose +in Python. Please pay careful attention to the code and its output. All of +it was carefully selected for its instructive value. + +.. note:: + + There's two other modules that fulfill the same task, namely + :mod:`getopt` (an equivalent for :c:func:`getopt` from the C + language) and the deprecated :mod:`optparse`. + + +Concepts +======== + +Let's show the sort of functionality that we are going to explore in this +introductory tutorial by making use of the :command:`ls` command:: + + + $ ls + cpython devguide prog.py pypy rm-unused-function.patch + $ ls pypy + ctypes_configure demo dotviewer include lib_pypy lib-python ... + $ ls -l + total 20 + drwxr-xr-x 19 wena wena 4096 Feb 18 18:51 cpython + drwxr-xr-x 4 wena wena 4096 Feb 8 12:04 devguide + -rwxr-xr-x 1 wena wena 535 Feb 19 00:05 prog.py + drwxr-xr-x 14 wena wena 4096 Feb 7 00:59 pypy + -rw-r--r-- 1 wena wena 741 Feb 18 01:01 rm-unused-function.patch + $ ls --help + Usage: ls [OPTION]... [FILE]... + List information about the FILEs (the current directory by default). + Sort entries alphabetically if none of -cftuvSUX nor --sort is specified. + ... + +A few concepts we can learn from the four commands: + +#. The :command:`ls` command is useful when run without any options at all. It defaults + to displaying the contents of the current directory. + +#. If we want beyond what it provides by default, we tell it a bit more. In + this case, we want it to display a different directory, ``pypy``. + What we did is specify what is known as a positional argument. It's named so + because the program should know what to do with the value, solely based on + where it appears on the command line. This concept is more relevant + to a command like :command:`cp`, whose most basic usage is ``cp SRC DEST``. + The first position is *what you want copied,* and the second + position is *where you want it copied to*. + +#. Now, say we want to change behaviour of the program. In our example, + we display more info for each file instead of just showing the file names. + The ``-l`` in that case is known as an optional argument. + +#. That's a snippet of the help text. It's very useful in that you can + come across a program you have never used before, and can figure out + how it works simply by reading it's help text. + + +The basics +========== + +Let us start with a very simple example which does (almost) nothing:: + + import argparse + parser = argparse.ArgumentParser() + parser.parse_args() + +Following is a result of running the code:: + + $ python3 prog.py + $ python3 prog.py --help + usage: prog.py [-h] + + optional arguments: + -h, --help show this help message and exit + $ python3 prog.py --verbose + usage: prog.py [-h] + prog.py: error: unrecognized arguments: --verbose + $ python3 prog.py foo + usage: prog.py [-h] + prog.py: error: unrecognized arguments: foo + +Here is what is happening: + +* Running the script without any options results in nothing displayed to + stdout. Not so useful. + +* The second one starts to display the usefulness of the :mod:`argparse` + module. We have done almost nothing, but already we get a nice help message. + +* The ``--help`` option, which can also be shortened to ``-h``, is the only + option we get for free (i.e. no need to specify it). Specifying anything + else results in an error. But even then, we do get a useful usage message, + also for free. + + +Introducing Positional arguments +================================ + +An example:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("echo") + args = parser.parse_args() + print(args.echo) + +And running the code:: + + $ python3 prog.py + usage: prog.py [-h] echo + prog.py: error: the following arguments are required: echo + $ python3 prog.py --help + usage: prog.py [-h] echo + + positional arguments: + echo + + optional arguments: + -h, --help show this help message and exit + $ python3 prog.py foo + foo + +Here is what's happening: + +#. We've added :meth:`add_argument` method, which is what we use to specify + which command line options the program is willing to accept. In this case, + I've named it ``echo`` so that it's in line with its function. + +#. Calling our program now requires us to specify an option. + +#. Also, the :meth:`parse_args` method actually returns some data from the + options specified, in this case, ``echo``. Note that the variable is some + form of 'magic' that :mod:`argparse` performs for free (i.e. no need to + specify which variable that value is stored in). Note also that it's + name matches the string argument given to the method, ``echo``. + +Note however that, although the help display looks nice and all, it currently +is not as helpful as it can be. For example we see that we got ``echo`` as a +positional argument, but we don't know what it does, other than by guessing or +by reading the source code. So, let's make it a bit more useful:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("echo", help="echo the string you use here") + args = parser.parse_args() + print(args.echo) + +And we get:: + + $ python3 prog.py -h + usage: prog.py [-h] echo + + positional arguments: + echo echo the string you use here + + optional arguments: + -h, --help show this help message and exit + +Now, how about doing something even more useful:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", help="display a square of a given number") + args = parser.parse_args() + print(pow(args.square, 2)) + +Following is a result of running the code:: + + $ python3 prog.py 4 + Traceback (most recent call last): + File "prog.py", line 5, in + print(pow(args.square, 2)) + TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int' + +That didn't go so well. That's because :mod:`argparse` treats the options we +give it as strings, unless we tell it otherwise and the :func:`pow` function +doesn't accept strings as arguments. So, let's tell +:mod:`argparse` to treat that input as an integer:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", help="display a square of a given number", + type=int) + args = parser.parse_args() + print(pow(args.square, 2)) + +Following is a result of running the code:: + + $ python3 prog.py 4 + 16 + $ python3 prog.py four + usage: prog.py [-h] square + prog.py: error: argument square: invalid int value: 'four' + +That went well. The program now even helpfully quits on bad illegal input +before proceeding. + + +Introducing Optional arguments +============================== + +So far we, have been playing with positional arguments. Let us +have a look on how to add optional ones:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("--verbosity", help="increase output verbosity") + args = parser.parse_args() + if args.verbosity: + print("verbosity turned on") + +And the output:: + + $ python3 prog.py --verbosity 1 + verbosity turned on + $ python3 prog.py + $ python3 prog.py --help + usage: prog.py [-h] [--verbosity VERBOSITY] + + optional arguments: + -h, --help show this help message and exit + --verbosity VERBOSITY + increase output verbosity + $ python3 prog.py --verbosity + usage: prog.py [-h] [--verbosity VERBOSITY] + prog.py: error: argument --verbosity: expected one argument + +Here is what is happening: + +#. The program is written so as to display something when ``--verbosity`` is + specified and display nothing when not. + +#. To show that the option is actually optional, there is no error when running + the program without it. Note that by default, if an optional argument isn't + used, the relevant variable, in this case :data:`args.verbosity`, is + given ``None`` as a value, which is the reason it fails the truth + test of the :keyword:`if` statement. + +#. The help message is a bit different. + +#. When using the ``--verbosity`` option, one must also specify some value, any + value. + +The above example accepts arbitrary integer values for ``--verbosity``, but for +our simple program, only two values are actually useful, ``True`` or ``False``. +Let's modify the code accordingly:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("--verbose", help="increase output verbosity", + action="store_true") + args = parser.parse_args() + if args.verbose: + print("verbosity turned on") + +And the output:: + + $ python3 prog.py --verbose + verbosity turned on + $ python3 prog.py --verbose 1 + usage: prog.py [-h] [--verbose] + prog.py: error: unrecognized arguments: 1 + $ python3 prog.py --help + usage: prog.py [-h] [--verbose] + + optional arguments: + -h, --help show this help message and exit + --verbose increase output verbosity + +Here is what is happening: + +#. The option is now more of a flag than something that requires a value. + We even changed the name of the option to match that idea. + Note that we now specify a new keyword, ``action``, and give it the value + "store_true". This means that, if the option is specified, assign the value + ``True`` to :data:`args.verbose` ``True``. Not specifying it implies + ``False``. + +#. It complains when you specify a value, in true spirit of what flags + actually are. + +#. Notice the different help text. + +If you are familiar with command line usage, you will notice that I haven't yet +touched on the topic of short versions of the options. It's quite simple:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("-v", "--verbose", help="increase output verbosity", + action="store_true") + args = parser.parse_args() + if args.verbose: + print("verbosity turned on") + +And here goes:: + + $ python3 prog.py -v + verbosity turned on + $ python3 prog.py --help + usage: prog.py [-h] [-v] + + optional arguments: + -h, --help show this help message and exit + -v, --verbose increase output verbosity + +Note that the new ability is also reflected in the help text. + + +Combining Positional and Optional arguments +=========================================== + +Our program keeps growing in complexity:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbose", action="store_true", + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbose: + print("the square of {} equals {}".format(args.square, answer)) + else: + print(answer) + +And now the output:: + + $ python3 prog.py + usage: prog.py [-h] [-v] square + prog.py: error: the following arguments are required: square + $ python3 prog.py 4 + 16 + $ python3 prog.py 4 --verbose + the square of 4 equals 16 + $ python3 prog.py --verbose 4 + the square of 4 equals 16 + +* We've brought back a positional argument, hence the complaint. + +* As for the fourth output, note that the order does not matter. + +How about we give this program of ours back the ability to have +multiple verbosity values, and actually get to use them:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", type=int, + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbosity == 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity == 1: + print("pow({}, 2) == {}".format(args.square, answer)) + else: + print(answer) + +And the output:: + + $ python3 prog.py 4 + 16 + $ python3 prog.py 4 -v + usage: prog.py [-h] [-v VERBOSITY] square + prog.py: error: argument -v/--verbosity: expected one argument + $ python3 prog.py 4 -v 1 + pow(4, 2) == 16 + $ python3 prog.py 4 -v 2 + the square of 4 equals 16 + $ python3 prog.py 4 -v 3 + 16 + +These all look good except the last one, which exposes a bug in our program. +Let's fix it by restricting the values the ``--verbosity`` option can accept:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", type=int, choices=[0, 1, 2], + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbosity == 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity == 1: + print("pow({}, 2) == {}".format(args.square, answer)) + else: + print(answer) + +And the output:: + + $ python3 prog.py 4 -v 3 + usage: prog.py [-h] [-v {0,1,2}] square + prog.py: error: argument -v/--verbosity: invalid choice: 3 (choose from 0, 1, 2) + $ python3 prog.py 4 -h + usage: prog.py [-h] [-v {0,1,2}] square + + positional arguments: + square display a square of a given number + + optional arguments: + -h, --help show this help message and exit + -v {0,1,2}, --verbosity {0,1,2} + increase output verbosity + +Note that the change also reflects both in the error message as well as the +help string. + +Now, let's use a different approach of playing with verbosity, which is pretty +common. It also matches the way the CPython executable handles its own +verbosity argument (check the output of `python --help`):: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", action="count", + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbosity == 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity == 1: + print("pow({}, 2) == {}".format(args.square, answer)) + else: + print(answer) + +We have introduced another action, "count". What it does is keep a count of +optional arguments:: + + $ python3 prog.py 4 -v 1 + usage: prog.py [-h] [-v] square + prog.py: error: unrecognized arguments: 1 + $ python3 prog.py 4 -v + pow(4, 2) == 16 + $ python3 prog.py 4 -vv + the square of 4 equals 16 + $ python3 prog.py 4 + 16 + $ python3 prog.py 4 --verbosity --verbosity + the square of 4 equals 16 + $ python3 prog.py 4 -h + usage: prog.py [-h] [-v] square + + positional arguments: + square display a square of a given number + + optional arguments: + -h, --help show this help message and exit + -v, --verbosity increase output verbosity + $ python3 prog.py 4 -vvv + 16 + +* Yes, it's now more of a flag (similar tp `action="store_true"`) in the + previous version of our script. That should explain the complaint. +* See what I mean that it behaves similar to "store_true" action? +* Now here's a demonstration of what the "count" action gives. You've probably + seen this sort of usage before. +* And, just like the "store_true" action, if you don't specify the `-v` flag, + that flag is considered to have ``None`` value. +* As should be expected, specifying the long form of the flag, we should get + the same output. +* Sadly, our help output isn't very informative on the new ability our script + has acquired, but that can always be fixed by improving the documentation for + out script (e.g. via the `help` keyword argument). +* That's a bug in our program. + +Let's fix:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", action="count", + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbosity >= 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity >= 1: + print("pow({}, 2) == {}".format(args.square, answer)) + else: + print(answer) + +And this is what it gives:: + + $ python3 prog.py 4 -vvv + the square of 4 equals 16 + $ python3 prog.py 4 -vvvv + the square of 4 equals 16 + $ python3 prog.py 4 + Traceback (most recent call last): + File "prog.py", line 11, in + if args.verbosity >= 2: + TypeError: unorderable types: NoneType() >= int() + +* First output went as well, and fixes the bug we had before. That is, to avoid + such problems, do `>=` checks in future, not `==`. +* Third output not so good + +Let's fix that bug:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("square", type=int, + help="display a square of a given number") + parser.add_argument("-v", "--verbosity", action="count", default=0, + help="increase output verbosity") + args = parser.parse_args() + answer = pow(args.square, 2) + if args.verbosity >= 2: + print("the square of {} equals {}".format(args.square, answer)) + elif args.verbosity >= 1: + print("pow({}, 2) == {}".format(args.square, answer)) + else: + print(answer) + +We've just introduced yet another keyword, `default`. We've set it to `0` in +order to make it comparable to the other int values. Remember that by +default, if an optional argument isn't specified, it gets the `None` value, and +that cannot be compared to an int value (hence the :exc:`TypeError` exception). + +And:: + + $ python3 prog.py 4 + 16 + +You can go quite far just with what we've learned so, and we have only +scratched the surface. The :mod:`argparse` module is excessively powerful, and +we'll explore a bit more of it before we end this tutorial. + + +Getting a little more advanced +============================== + +What if we wanted to expand our tiny program to perform other powers, not +just 2:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("power", type=int, nargs=2) + parser.add_argument("-v", "--verbosity", action="count", default=0) + args = parser.parse_args() + answer = pow(args.power[0], args.power[1]) + if args.verbosity >= 2: + print("{} to the power {} equals {}".format(args.power[0], args.power[1], answer)) + elif args.verbosity >= 1: + print("pow({}, {}) == {}".format(args.power[0], args.power[1], answer)) + else: + print(answer) + +Output:: + + $ python3 prog.py + usage: prog.py [-h] [-v] power power + prog.py: error: the following arguments are required: power + $ python3 prog.py -h + usage: prog.py [-h] [-v] power power + + positional arguments: + power + + optional arguments: + -h, --help show this help message and exit + -v, --verbosity + $ python3 prog.py 4 2 + 16 + $ python3 prog.py 4 2 -v + pow(4, 2) == 16 + $ python3 prog.py 4 2 -vv + 4 to the power 2 equals 16 + $ python3 prog.py 4 2 -vvv + 4 to the power 2 equals 16 + +We introduced yet another keyword argument, ``nargs``. It helps us specify +how many arguments are expected for a given command line option, which is +2 in this case. + +As you can see, the help text could be a little better than what it is +(``usage: prog.py [-h] [-v {0,1,2}] power power``). Let's fix it:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("x", type=int, help="the 'x' in x^y") + parser.add_argument("y", type=int, help="the 'y' in x^y") + parser.add_argument("-v", "--verbosity", action="count", default=0) + args = parser.parse_args() + answer = pow(args.x, args.y) + if args.verbosity >= 2: + print("{} to the power {} equals {}".format(args.x, args.y, answer)) + elif args.verbosity >= 1: + print("pow({}, {}) == {}".format(args.x, args.y, answer)) + else: + print(answer) + +Output:: + + $ python3 prog.py + usage: prog.py [-h] [-v] x y + prog.py: error: the following arguments are required: x, y + $ python3 prog.py -h + usage: prog.py [-h] [-v] x y + + positional arguments: + x the 'x' in x^y + y the 'y' in x^y + + optional arguments: + -h, --help show this help message and exit + -v, --verbosity + $ python3 prog.py 4 2 -v + pow(4, 2) == 16 + $ python3 prog.py 4 2 -v 1 + usage: prog.py [-h] [-v] x y + prog.py: error: argument -v/--verbosity: ignored explicit argument '1' + +That looks much better, and the last example serves as a reminder that this +is pretty much a flag, removing the need to provide values. + +Notice that so far we've been using verbosity level to *change* the text +that gets displayed. The following example instead uses verbosity level +to display *more* text instead:: + + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("x", type=int, help="the 'x' in x^y") + parser.add_argument("y", type=int, help="the 'y' in x^y") + parser.add_argument("-v", "--verbosity", action="count", default=0) + args = parser.parse_args() + answer = pow(args.x, args.y) + if args.verbosity >= 2: + print("Running '{}'".format(__file__)) + if args.verbosity >= 1: + print("pow({}, {}) == ".format(args.x, args.y), end="") + print(answer) + +Output:: + + $ python3 prog.py 4 2 + 16 + $ python3 prog.py 4 2 -v + pow(4, 2) == 16 + $ python3 prog.py 4 2 -vv + Running 'prog.py' + pow(4, 2) == 16 + +So far, we have been working with two methods of an +:class:`argparse.ArgumentParser` instance. Let's introduce a third one, +``add_mutually_exclusive_group``. It allows for us to specify options that +conflict with each other. Let's also change the rest of the program make the +new functionality makes more sense:: + + import argparse + + parser = argparse.ArgumentParser() + group = parser.add_mutually_exclusive_group() + group.add_argument("-v", "--verbose", action="store_true") + group.add_argument("-q", "--quiet", action="store_true") + parser.add_argument("x", type=int, help="the 'x' in x^y") + parser.add_argument("y", type=int, help="the 'y' in x^y") + args = parser.parse_args() + answer = pow(args.x, args.y) + + if args.quiet: + print(answer) + elif args.verbose: + print("{} to the power {} equals {}".format(args.x, args.y, answer)) + else: + print("pow({}, {}) == {}".format(args.x, args.y, answer)) + +Our program is now simpler, and we've lost some functionality for the sake of +demonstration. Anyways, here's the output:: + + $ python3 prog.py 4 2 + pow(4, 2) == 16 + $ python3 prog.py 4 2 -q + 16 + $ python3 prog.py 4 2 -v + 4 to the power 2 equals 16 + $ python3 prog.py 4 2 -vq + usage: prog.py [-h] [-v | -q] x y + prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose + $ python3 prog.py 4 2 -v --quiet + usage: prog.py [-h] [-v | -q] x y + prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose + +That should be easy to follow. I've added that last output so you can see the +sort of flexibility you get, i.e. mixing long form options with short form +ones. + +Before we conclude, you probably want to tell your users the main purpose of +your program, just in case they don't know:: + + import argparse + + parser = argparse.ArgumentParser(description="calculate X to the power of Y") + group = parser.add_mutually_exclusive_group() + group.add_argument("-v", "--verbose", action="store_true") + group.add_argument("-q", "--quiet", action="store_true") + parser.add_argument("x", type=int, help="the 'x' in x^y") + parser.add_argument("y", type=int, help="the 'y' in x^y") + args = parser.parse_args() + answer = pow(args.x, args.y) + + if args.quiet: + print(answer) + elif args.verbose: + print("{} to the power {} equals {}".format(args.x, args.y, answer)) + else: + print("pow({}, {}) == {}".format(args.x, args.y, answer)) + +Which outputs:: + + $ python3 prog.py --help + usage: prog.py [-h] [-v | -q] x y + + calculate X to the power of Y + + positional arguments: + x the 'x' in x^y + y the 'y' in x^y + + optional arguments: + -h, --help show this help message and exit + -v, --verbose + -q, --quiet + +Note that slight difference in the usage text. Note the `[-v | -q]`, which +tells us that we can either use `-v` or `-q`, but not both at the same time. + +Conclusion +========== + +There's lots more to the module of course, things like customising +the help message, or simply disabling its getting generated. +You can also force optional arguments to be required, or even change the +character used to denote them (e.g. ``+v`` instead of ``-v``). + +Have a look at the API docs. +They are quite detailed and thorough, and full of examples. I hope that +having gone through this tutorial, you will easily digest them +without feeling overwhelmed. diff --git a/Doc/howto/index.rst b/Doc/howto/index.rst --- a/Doc/howto/index.rst +++ b/Doc/howto/index.rst @@ -27,4 +27,5 @@ unicode.rst urllib2.rst webservers.rst + argparse.rst diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -10,6 +10,12 @@ **Source code:** :source:`Lib/argparse.py` +.. sidebar:: Tutorial + + This page contains the API reference information. For a more gentle + introduction to Python command line parsing, have a look at the + :ref:`Basic Tutorial `. + -------------- The :mod:`argparse` module makes it easy to write user-friendly command-line From report at bugs.python.org Mon Mar 19 15:49:07 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Mon, 19 Mar 2012 14:49:07 +0000 Subject: [issue14034] Add argparse howto In-Reply-To: <1329417262.26.0.419020263055.issue14034@psf.upfronthosting.co.za> Message-ID: <1332168547.08.0.682254030651.issue14034@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : Removed file: http://bugs.python.org/file24941/argparse_howto3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 16:31:44 2012 From: report at bugs.python.org (Jay Deiman) Date: Mon, 19 Mar 2012 15:31:44 +0000 Subject: [issue14338] Document how to forward POST data on redirects In-Reply-To: <1331929501.86.0.889924099512.issue14338@psf.upfronthosting.co.za> Message-ID: <1332171104.34.0.947824621796.issue14338@psf.upfronthosting.co.za> Jay Deiman added the comment: I actually just worked around this issue in my library to do specifically what I needed it to do, which was an automatic redirect POST with data. As far as general recipes are concerned, anyone could just follow what I did in my library at: https://github.com/crustymonkey/py-sonic or http://pypi.python.org/pypi/py-sonic All I did was just subclass HTTPRedirectHandler and essentially add my patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 16:55:43 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 19 Mar 2012 15:55:43 +0000 Subject: [issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN In-Reply-To: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za> Message-ID: <1332172543.11.0.0747113795779.issue14331@psf.upfronthosting.co.za> Gregory P. Smith added the comment: 2.7 and 3.2 have been fixed. I'm keeping this open as a reminder to investigate how 3.3 behaves. I'll fix it or close it after verifying that. ---------- versions: +Python 3.3 -Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 17:00:43 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 19 Mar 2012 16:00:43 +0000 Subject: [issue12568] Add functions to get the width in columns of a character In-Reply-To: <1310683436.9.0.375403702242.issue12568@psf.upfronthosting.co.za> Message-ID: <1332172843.32.0.914806245683.issue12568@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Has anyone tested wcswidth on FreeBSD, old Solaris? With non-utf8 locales? ---------- nosy: +storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 17:52:54 2012 From: report at bugs.python.org (Ross Lagerwall) Date: Mon, 19 Mar 2012 16:52:54 +0000 Subject: [issue14359] _posixsubprocess.o compilation error on CentOS 5.8 In-Reply-To: <1332057878.8.0.554902086593.issue14359@psf.upfronthosting.co.za> Message-ID: <1332175974.94.0.462760177912.issue14359@psf.upfronthosting.co.za> Ross Lagerwall added the comment: Thanks! ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 18:51:17 2012 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 19 Mar 2012 17:51:17 +0000 Subject: [issue14369] make __closure__ writable Message-ID: <1332179477.04.0.11685261564.issue14369@psf.upfronthosting.co.za> New submission from Yury Selivanov : __code__ and __closure__ are designed to work together. There is no point in allowing to completely substitute the __code__ object, but protecting the __closure__. ---------- components: Interpreter Core files: writable_closure.patch keywords: patch messages: 156350 nosy: Yury.Selivanov, asvetlov, pitrou priority: normal severity: normal status: open title: make __closure__ writable type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24943/writable_closure.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 18:59:39 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Mon, 19 Mar 2012 17:59:39 +0000 Subject: [issue14310] Socket duplication for windows In-Reply-To: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> Message-ID: <1332179979.35.0.883422058316.issue14310@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Here is a new version of thepatch. We now have socket.socket.share(pid) and socket.fromshare(data) to do these. I think this captures the functionality better than "duplicate" or duppid() since there is no actual duplication involved until the fromshare() function is called. Still no documentation. What do you think? ---------- Added file: http://bugs.python.org/file24944/duplicate.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 19:10:16 2012 From: report at bugs.python.org (Jakub Warmuz) Date: Mon, 19 Mar 2012 18:10:16 +0000 Subject: [issue14365] argparse: subparsers, argument abbreviations and ambiguous option In-Reply-To: <1332102480.28.0.401837291603.issue14365@psf.upfronthosting.co.za> Message-ID: <1332180616.63.0.453952518031.issue14365@psf.upfronthosting.co.za> Jakub Warmuz added the comment: Attached quick&dirty fix I'm currently using in my project. Maybe this will help to create a valid patch. Instead of changing _parse_optional, I've overridden _get_option_tuples to scan subparsers for matching optional arguments if option is ambiguous in the current parser. I've only skimmed through the code, so forgive me if that fix is useless. ---------- Added file: http://bugs.python.org/file24945/argparse_dirty_hack.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 19:41:13 2012 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Mon, 19 Mar 2012 18:41:13 +0000 Subject: [issue14296] Compilation error on CentOS 5.8 In-Reply-To: <1331688181.08.0.800421526529.issue14296@psf.upfronthosting.co.za> Message-ID: <1332182473.08.0.81517986584.issue14296@psf.upfronthosting.co.za> Changes by Charles-Fran?ois Natali : ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 19:56:44 2012 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Mon, 19 Mar 2012 18:56:44 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1332183404.55.0.709650751737.issue14228@psf.upfronthosting.co.za> Charles-Fran?ois Natali added the comment: I must be missing something, but I fail to see the problem here. Basically, when SIGINT is received before the user code is run, it's caught by the default handler which prints a traceback and exits. What's wrong with that? Not catching SIGINT would result in an unclean exit, and I don't see how that would be an improvement. The exit code may be a valid request, but that's another story. ---------- nosy: +neologix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 20:01:21 2012 From: report at bugs.python.org (sbt) Date: Mon, 19 Mar 2012 19:01:21 +0000 Subject: [issue14310] Socket duplication for windows In-Reply-To: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> Message-ID: <1332183681.49.0.656385290208.issue14310@psf.upfronthosting.co.za> sbt added the comment: > I think this captures the functionality better than "duplicate" or > duppid() since there is no actual duplication involved until the > fromshare() function is called. Are you saying the WSADuplicateSocket() call in share() doesn't duplicate the handle in to the target process? I am pretty sure it does. (Delaying handle duplication till WSASocket() is called in the target process would be rather problematic since then you cannot close the original socket in the source processes until you know the duplication has occurred.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 20:10:07 2012 From: report at bugs.python.org (R. David Murray) Date: Mon, 19 Mar 2012 19:10:07 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1332184207.58.0.42136612234.issue14228@psf.upfronthosting.co.za> R. David Murray added the comment: If one could distinguish that python had ended because of a sigint from the error code, then it would be possible for the caller to throw away stderr in that case. I agree with the OP that that having to deal with the traceback when you know what you want instead is a bit of a pain, but it may be better than an unclean shutdown. (I don't know if it is, because I don't know the possible failure modes from an unclean shutdown of the Python startup code). ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 20:18:36 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Mon, 19 Mar 2012 19:18:36 +0000 Subject: [issue14310] Socket duplication for windows In-Reply-To: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> Message-ID: <1332184716.51.0.320003444901.issue14310@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Good point. The docs don't actually say, except that the docs show a pretty elaborate process dance, where the source process only closes its side of the socket once the target process has called WSASocket(). If duplication happened early, then there would have to be a way to "unduplicate" it in the source process if, say, IPC somehow failed. There is currently no api to undo the effects of WSADuplicateSocket(). It's easy enough to test, of course. I?ll do some test using my unittest. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 20:33:53 2012 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 19 Mar 2012 19:33:53 +0000 Subject: [issue14369] make __closure__ writable In-Reply-To: <1332179477.04.0.11685261564.issue14369@psf.upfronthosting.co.za> Message-ID: <1332185633.3.0.764635079851.issue14369@psf.upfronthosting.co.za> Changes by Yury Selivanov : Removed file: http://bugs.python.org/file24943/writable_closure.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 20:34:07 2012 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 19 Mar 2012 19:34:07 +0000 Subject: [issue14369] make __closure__ writable In-Reply-To: <1332179477.04.0.11685261564.issue14369@psf.upfronthosting.co.za> Message-ID: <1332185647.01.0.69315327746.issue14369@psf.upfronthosting.co.za> Changes by Yury Selivanov : Added file: http://bugs.python.org/file24946/writable_closure.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 20:50:59 2012 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 19 Mar 2012 19:50:59 +0000 Subject: [issue14369] make __closure__ writable In-Reply-To: <1332179477.04.0.11685261564.issue14369@psf.upfronthosting.co.za> Message-ID: <1332186659.02.0.757087679585.issue14369@psf.upfronthosting.co.za> Yury Selivanov added the comment: Updated patch as per Andrew's code review. Thank you. ---------- Added file: http://bugs.python.org/file24947/writable_closure_02.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 21:23:13 2012 From: report at bugs.python.org (Jason Killen) Date: Mon, 19 Mar 2012 20:23:13 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332188593.56.0.0431292542254.issue14269@psf.upfronthosting.co.za> Jason Killen added the comment: Redone diff including wording preferred by R. David Murray. ---------- Added file: http://bugs.python.org/file24948/smtpd.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 21:25:05 2012 From: report at bugs.python.org (Jason Killen) Date: Mon, 19 Mar 2012 20:25:05 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332188705.53.0.692989669345.issue14269@psf.upfronthosting.co.za> Jason Killen added the comment: Change of the smtpd test code to match the wording from the smtpd.patch. Also, added \r\n to the end of the expected string. ---------- Added file: http://bugs.python.org/file24949/test_smtpd.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 22:42:08 2012 From: report at bugs.python.org (sbt) Date: Mon, 19 Mar 2012 21:42:08 +0000 Subject: [issue14310] Socket duplication for windows In-Reply-To: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> Message-ID: <1332193328.81.0.864408874389.issue14310@psf.upfronthosting.co.za> sbt added the comment: > If duplication happened early, then there would have to be a way to > "unduplicate" it in the source process if, say, IPC somehow failed. > There is currently no api to undo the effects of WSADuplicateSocket(). If this were a normal handle then you could use the DUPLICATE_CLOSE_SOURCE flag with DuplicateHandle() to close it. But using DuplicateHandle() with socket handles is discouraged. I find the ability to duplicate and close handles in unrelated processes of the same user rather surprising. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 22:48:31 2012 From: report at bugs.python.org (Larry Hastings) Date: Mon, 19 Mar 2012 21:48:31 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1332193711.48.0.303436732546.issue14328@psf.upfronthosting.co.za> Larry Hastings added the comment: Anyone else? Or can I get the go-ahead? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 22:49:37 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 19 Mar 2012 21:49:37 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1332193777.46.0.77478469472.issue14328@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Did you not see Georg's comments? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 22:56:12 2012 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Mon, 19 Mar 2012 21:56:12 +0000 Subject: [issue14154] reimplement the bigmem test memory watchdog as a subprocess In-Reply-To: Message-ID: Charles-Fran?ois Natali added the comment: Here's a new version, with a dedicated script for the watchdog process. ---------- Added file: http://bugs.python.org/file24950/mem_watchdog_1.diff _______________________________________ Python tracker _______________________________________ -------------- next part -------------- diff --git a/Lib/test/memory_watchdog.py b/Lib/test/memory_watchdog.py new file mode 100644 --- /dev/null +++ b/Lib/test/memory_watchdog.py @@ -0,0 +1,27 @@ +"""Memory watchdog: periodically read the memory usage of the main test process +and print it out, until terminated.""" +# stdin should refer to the process' /proc//statm: we don't pass the +# process' PID to avoid a race condition in case of - unlikely - PID recycling. +# If the process crashes, reading from the /proc entry will fail with ESRCH. + + +import os +import sys +import time + + +try: + page_size = os.sysconf('SC_PAGESIZE') +except (ValueError, AttributeError): + try: + page_size = os.sysconf('SC_PAGE_SIZE') + except (ValueError, AttributeError): + page_size = 4096 + +while True: + sys.stdin.seek(0) + statm = sys.stdin.read() + data = int(statm.split()[5]) + print(" ... process data size: {data:.1f}G" + .format(data=data * page_size / (1024 ** 3))) + time.sleep(1) diff --git a/Lib/test/support.py b/Lib/test/support.py --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -36,20 +36,10 @@ multiprocessing = None try: - import faulthandler -except ImportError: - faulthandler = None - -try: import zlib except ImportError: zlib = None -try: - import fcntl -except ImportError: - fcntl = None - __all__ = [ "Error", "TestFailed", "ResourceDenied", "import_module", "verbose", "use_resources", "max_memuse", "record_original_stdout", @@ -1151,62 +1141,26 @@ def __init__(self): self.procfile = '/proc/{pid}/statm'.format(pid=os.getpid()) self.started = False - self.thread = None - try: - self.page_size = os.sysconf('SC_PAGESIZE') - except (ValueError, AttributeError): - try: - self.page_size = os.sysconf('SC_PAGE_SIZE') - except (ValueError, AttributeError): - self.page_size = 4096 - - def consumer(self, fd): - HEADER = "l" - header_size = struct.calcsize(HEADER) - try: - while True: - header = os.read(fd, header_size) - if len(header) < header_size: - # Pipe closed on other end - break - data_len, = struct.unpack(HEADER, header) - data = os.read(fd, data_len) - statm = data.decode('ascii') - data = int(statm.split()[5]) - print(" ... process data size: {data:.1f}G" - .format(data=data * self.page_size / (1024 ** 3))) - finally: - os.close(fd) def start(self): - if not faulthandler or not hasattr(faulthandler, '_file_watchdog'): - return try: - rfd = os.open(self.procfile, os.O_RDONLY) + f = open(self.procfile, 'r') except OSError as e: warnings.warn('/proc not available for stats: {}'.format(e), RuntimeWarning) sys.stderr.flush() return - pipe_fd, wfd = os.pipe() - # set the write end of the pipe non-blocking to avoid blocking the - # watchdog thread when the consumer doesn't drain the pipe fast enough - if fcntl: - flags = fcntl.fcntl(wfd, fcntl.F_GETFL) - fcntl.fcntl(wfd, fcntl.F_SETFL, flags|os.O_NONBLOCK) - # _file_watchdog() doesn't take the GIL in its child thread, and - # therefore collects statistics timely - faulthandler._file_watchdog(rfd, wfd, 1.0) + + watchdog_script = findfile("memory_watchdog.py") + self.mem_watchdog = subprocess.Popen([sys.executable, watchdog_script], + stdin=f) + f.close() self.started = True - self.thread = threading.Thread(target=self.consumer, args=(pipe_fd,)) - self.thread.daemon = True - self.thread.start() def stop(self): - if not self.started: - return - faulthandler._cancel_file_watchdog() - self.thread.join() + if self.started: + self.mem_watchdog.terminate() + self.mem_watchdog.wait() def bigmemtest(size, memuse, dry_run=True): @@ -1234,7 +1188,7 @@ "not enough memory: %.1fG minimum needed" % (size * memuse / (1024 ** 3))) - if real_max_memuse and verbose and faulthandler and threading: + if real_max_memuse and verbose: print() print(" ... expected peak memory use: {peak:.1f}G" .format(peak=size * memuse / (1024 ** 3))) diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -13,7 +13,6 @@ #ifdef WITH_THREAD # define FAULTHANDLER_LATER -# define FAULTHANDLER_WATCHDOG #endif #ifndef MS_WINDOWS @@ -66,20 +65,6 @@ } thread; #endif -#ifdef FAULTHANDLER_WATCHDOG -static struct { - int rfd; - int wfd; - PY_TIMEOUT_T period_us; /* period in microseconds */ - /* The main thread always holds this lock. It is only released when - faulthandler_watchdog() is interrupted before this thread exits, or at - Python exit. */ - PyThread_type_lock cancel_event; - /* released by child thread when joined */ - PyThread_type_lock running; -} watchdog; -#endif - #ifdef FAULTHANDLER_USER typedef struct { int enabled; @@ -604,139 +589,6 @@ } #endif /* FAULTHANDLER_LATER */ -#ifdef FAULTHANDLER_WATCHDOG - -static void -file_watchdog(void *unused) -{ - PyLockStatus st; - PY_TIMEOUT_T timeout; - -#define MAXDATA 1024 - char buf1[MAXDATA], buf2[MAXDATA]; - char *data = buf1, *old_data = buf2; - Py_ssize_t data_len, old_data_len = -1; - -#if defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK) - sigset_t set; - - /* we don't want to receive any signal */ - sigfillset(&set); - pthread_sigmask(SIG_SETMASK, &set, NULL); -#endif - - /* On first pass, feed file contents immediately */ - timeout = 0; - do { - st = PyThread_acquire_lock_timed(watchdog.cancel_event, - timeout, 0); - timeout = watchdog.period_us; - if (st == PY_LOCK_ACQUIRED) { - PyThread_release_lock(watchdog.cancel_event); - break; - } - /* Timeout => read and write data */ - assert(st == PY_LOCK_FAILURE); - - if (lseek(watchdog.rfd, 0, SEEK_SET) < 0) { - break; - } - data_len = read(watchdog.rfd, data, MAXDATA); - if (data_len < 0) { - break; - } - if (data_len != old_data_len || memcmp(data, old_data, data_len)) { - char *tdata; - Py_ssize_t tlen; - /* Contents changed, feed them to wfd */ - long x = (long) data_len; - /* We can't do anything if the consumer is too slow, just bail out */ - if (write(watchdog.wfd, (void *) &x, sizeof(x)) < sizeof(x)) - break; - if (write(watchdog.wfd, data, data_len) < data_len) - break; - tdata = data; - data = old_data; - old_data = tdata; - tlen = data_len; - data_len = old_data_len; - old_data_len = tlen; - } - } while (1); - - close(watchdog.rfd); - close(watchdog.wfd); - - /* The only way out */ - PyThread_release_lock(watchdog.running); -#undef MAXDATA -} - -static void -cancel_file_watchdog(void) -{ - /* Notify cancellation */ - PyThread_release_lock(watchdog.cancel_event); - - /* Wait for thread to join */ - PyThread_acquire_lock(watchdog.running, 1); - PyThread_release_lock(watchdog.running); - - /* The main thread should always hold the cancel_event lock */ - PyThread_acquire_lock(watchdog.cancel_event, 1); -} - -static PyObject* -faulthandler_file_watchdog(PyObject *self, - PyObject *args, PyObject *kwargs) -{ - static char *kwlist[] = {"rfd", "wfd", "period", NULL}; - double period; - PY_TIMEOUT_T period_us; - int rfd, wfd; - - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "iid:_file_watchdog", kwlist, - &rfd, &wfd, &period)) - return NULL; - if ((period * 1e6) >= (double) PY_TIMEOUT_MAX) { - PyErr_SetString(PyExc_OverflowError, "period value is too large"); - return NULL; - } - period_us = (PY_TIMEOUT_T)(period * 1e6); - if (period_us <= 0) { - PyErr_SetString(PyExc_ValueError, "period must be greater than 0"); - return NULL; - } - - /* Cancel previous thread, if running */ - cancel_file_watchdog(); - - watchdog.rfd = rfd; - watchdog.wfd = wfd; - watchdog.period_us = period_us; - - /* Arm these locks to serve as events when released */ - PyThread_acquire_lock(watchdog.running, 1); - - if (PyThread_start_new_thread(file_watchdog, NULL) == -1) { - PyThread_release_lock(watchdog.running); - PyErr_SetString(PyExc_RuntimeError, - "unable to start file watchdog thread"); - return NULL; - } - - Py_RETURN_NONE; -} - -static PyObject* -faulthandler_cancel_file_watchdog(PyObject *self) -{ - cancel_file_watchdog(); - Py_RETURN_NONE; -} -#endif /* FAULTHANDLER_WATCHDOG */ - #ifdef FAULTHANDLER_USER static int faulthandler_register(int signum, int chain, _Py_sighandler_t *p_previous) @@ -1126,18 +978,6 @@ "to dump_tracebacks_later().")}, #endif -#ifdef FAULTHANDLER_WATCHDOG - {"_file_watchdog", - (PyCFunction)faulthandler_file_watchdog, METH_VARARGS|METH_KEYWORDS, - PyDoc_STR("_file_watchdog(rfd, wfd, period):\n" - "feed the contents of 'rfd' to 'wfd', if changed,\n" - "every 'period seconds'.")}, - {"_cancel_file_watchdog", - (PyCFunction)faulthandler_cancel_file_watchdog, METH_NOARGS, - PyDoc_STR("_cancel_file_watchdog():\ncancel the previous call " - "to _file_watchdog().")}, -#endif - #ifdef FAULTHANDLER_USER {"register", (PyCFunction)faulthandler_register_py, METH_VARARGS|METH_KEYWORDS, @@ -1263,16 +1103,6 @@ } PyThread_acquire_lock(thread.cancel_event, 1); #endif -#ifdef FAULTHANDLER_WATCHDOG - watchdog.cancel_event = PyThread_allocate_lock(); - watchdog.running = PyThread_allocate_lock(); - if (!watchdog.cancel_event || !watchdog.running) { - PyErr_SetString(PyExc_RuntimeError, - "could not allocate locks for faulthandler"); - return -1; - } - PyThread_acquire_lock(watchdog.cancel_event, 1); -#endif return faulthandler_env_options(); } @@ -1297,20 +1127,6 @@ } #endif -#ifdef FAULTHANDLER_WATCHDOG - /* file watchdog */ - if (watchdog.cancel_event) { - cancel_file_watchdog(); - PyThread_release_lock(watchdog.cancel_event); - PyThread_free_lock(watchdog.cancel_event); - watchdog.cancel_event = NULL; - } - if (watchdog.running) { - PyThread_free_lock(watchdog.running); - watchdog.running = NULL; - } -#endif - #ifdef FAULTHANDLER_USER /* user */ if (user_signals != NULL) { From report at bugs.python.org Mon Mar 19 23:03:54 2012 From: report at bugs.python.org (Larry Hastings) Date: Mon, 19 Mar 2012 22:03:54 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1332194634.57.0.81173598402.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: Revision 7 of my patch. Incorporates all suggestions from Georg. Added "as an integer" in the docs to make Antoine happy. If I fail to create the "billion" int in INITFUNC, I return NULL and leak references. I figure this is fine, as a) the other such tests in this function also leak, and b) if you can't initialize the os module, you're not going to have a very productive session. Dare I dream that it's ready for checkin? ---------- Added file: http://bugs.python.org/file24951/larry.st_mtime_ns.patch.7.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 23:12:08 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Mar 2012 22:12:08 +0000 Subject: [issue14154] reimplement the bigmem test memory watchdog as a subprocess In-Reply-To: <1330459989.98.0.769260493369.issue14154@psf.upfronthosting.co.za> Message-ID: <1332195128.2.0.352853523235.issue14154@psf.upfronthosting.co.za> STINNER Victor added the comment: memory_watchdog.py should probably use sys.stdout.flush(), and you should replace print("...") by sys.stdout.write("...\n") to only call sys.stdout.write once (print calls write a second time just to write the newline). +1 for the subprocess instead of the thread. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 23:15:36 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Mar 2012 22:15:36 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1332194634.57.0.81173598402.issue14127@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > Revision 7 of my patch. - assert(sizeof(time_t) <= sizeof(long)); You should keep this assertion in _PyLong_FromTime_t(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Mar 19 23:56:57 2012 From: report at bugs.python.org (R. David Murray) Date: Mon, 19 Mar 2012 22:56:57 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332197817.09.0.470384712174.issue14269@psf.upfronthosting.co.za> R. David Murray added the comment: I applied both patches, and I get 16 test failures in test_smtpd. I haven't looked at the errors, but probably most of them are lack of a HELO in the test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 00:18:06 2012 From: report at bugs.python.org (Larry Hastings) Date: Mon, 19 Mar 2012 23:18:06 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1332199086.16.0.185518670143.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: Incorporated Victor's reinstated assert suggestion. Fingers crossed. ---------- Added file: http://bugs.python.org/file24952/larry.st_mtime_ns.patch.8.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 00:41:41 2012 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Mar 2012 23:41:41 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1332200501.21.0.472480838669.issue14127@psf.upfronthosting.co.za> STINNER Victor added the comment: The patch looks good to me. I was going to commit it but then I realized that Larry is a core developer. Last nits: you should add a newline after } in "} else {", and it would be better to move billion variable into fill_time(). Something like: static void fill_time(PyObject *v, int index, time_t sec, unsigned long nsec) { ... static PyObject *billion = NULL; if (billion == NULL) { billion = PyLong_FromLong(1000000000); if (!billion) return; } ... } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 01:03:09 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Mar 2012 00:03:09 +0000 Subject: [issue14262] Allow using decimals as arguments to `timedelta` In-Reply-To: <1331557988.1.0.944940856764.issue14262@psf.upfronthosting.co.za> Message-ID: <1332201789.24.0.827754826881.issue14262@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 01:12:48 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 20 Mar 2012 00:12:48 +0000 Subject: [issue14366] Supporting bzip2 and lzma compression in zip files In-Reply-To: <1332112236.1.0.964135054036.issue14366@psf.upfronthosting.co.za> Message-ID: <1332202368.59.0.014961470392.issue14366@psf.upfronthosting.co.za> Martin v. L?wis added the comment: For EOS, please re-read the specification. If you then still think it is not needed, read it again :-) The documentation in liblzma is irrelevant, only the PKWARE specification matters. Take particular notice of the phrase "implementers should include the EOS marker whenever possible" For bzip: propose a patch that does just the bzip stuff, and any infrastructure changes needed for it. Having the LZMA patch depend on this is fine. Re: extensible compressors. I don't think that's needed. There is only a finite set, and if somebody wants to support some compression method, they should submit a patch. Re: allowZip64. This depends on whether you create or extract. Not using a feature on creation is fine - we don't *have* to use all supported features. On extraction, if a feature is used and we support it, it should get used regardless of any configuration (note: I didn't check what allowZip64 currently does). Re: 7zip. What it does is irrelevant. The ZIP format is defined by PKWARE, so if you want to look at a reference implementation, use theirs. Else use the spec. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 01:14:54 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Mar 2012 00:14:54 +0000 Subject: [issue14262] Allow using decimals as arguments to `timedelta` In-Reply-To: <1331557988.1.0.944940856764.issue14262@psf.upfronthosting.co.za> Message-ID: <1332202494.81.0.460679304607.issue14262@psf.upfronthosting.co.za> STINNER Victor added the comment: My patch looses precision for big numbers. It's better to convert Decimal to a number of microseconds. Wrong: >>> value=86400*365.25*999999+1e-6; print(datetime.timedelta(seconds=value)) 365249634 days, 18:00:00 >>> value=decimal.Decimal(86400*365.25*999999)+decimal.Decimal('1e-6'); print(datetime.timedelta(seconds=float(value))) 365249634 days, 18:00:00 Correct: >>> value=decimal.Decimal(86400*365.25*999999)+decimal.Decimal('1e-6'); print(datetime.timedelta(microseconds=int(value*decimal.Decimal(10**6)))) 365249634 days, 18:00:00.000001 I'm not completly conviced by the need of supporting Decimal in timedelta constructor. Why do you use Decimal if the result should be a timedelta? Why not using timedelta directly? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 01:30:51 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Mar 2012 00:30:51 +0000 Subject: [issue14249] unicodeobject.c: aliasing warnings In-Reply-To: <1331417993.32.0.291164156337.issue14249@psf.upfronthosting.co.za> Message-ID: <1332203451.22.0.724931415173.issue14249@psf.upfronthosting.co.za> STINNER Victor added the comment: Attached patch uses an union to make the compiler warning quiet. It should not speed up Python because the function already ensures that the pointer is aligned to the size of a long. It may slow down the function, I don't know gcc enough to guess exactly the impact on performances. An alternative is to use __attribute__((__may_alias__)), a GCC specific attribute. I don't know the impact on performances of this attribute. ---------- keywords: +patch nosy: +pitrou Added file: http://bugs.python.org/file24953/utf16_decoder_union.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 01:34:22 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Mar 2012 00:34:22 +0000 Subject: [issue10496] Python startup should not require passwd entry In-Reply-To: <1290398281.89.0.568058332092.issue10496@psf.upfronthosting.co.za> Message-ID: <1332203662.06.0.607580748884.issue10496@psf.upfronthosting.co.za> STINNER Victor added the comment: > I?d be happy to update it to address my remarks if you want me to. Please write your own patch addressing your concerns. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 01:39:36 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Mar 2012 00:39:36 +0000 Subject: [issue9408] curses: Link against libncursesw instead of libncurses In-Reply-To: <1280360992.02.0.384889308435.issue9408@psf.upfronthosting.co.za> Message-ID: <1332203976.63.0.814433952042.issue9408@psf.upfronthosting.co.za> STINNER Victor added the comment: > I should maybe open a *Debian* bug Done: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=602720 I don't think that we should drop support of libncurses because it is still the only option on some OSes. I'm closing the issue because it is now fixed in Debian which was my initial concern. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 02:27:25 2012 From: report at bugs.python.org (Larry Hastings) Date: Tue, 20 Mar 2012 01:27:25 +0000 Subject: [issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds In-Reply-To: <1330248202.41.0.0356274409354.issue14127@psf.upfronthosting.co.za> Message-ID: <1332206845.53.0.0672159749726.issue14127@psf.upfronthosting.co.za> Larry Hastings added the comment: > The patch looks good to me. I was going to commit it > but then I realized that Larry is a core developer. Indeed; please permit me the pleasure of checking it in myself. That is, assuming I actually get the go-ahead someday. (Probably in the far-flung future. I'm imagining my house CPU telling me the good news via my cranial implant. Perhaps while I'm landing my jet car!) > Last nits: you should add a newline after } in "} else {", 1/3 of the "else {" statements in the Python tree are "} else {". And that's not a new line with me; I merely renamed the variable. But I just checked, and PEP 7 says so, and I figure it's harmless enough, so I have made that change. > and it would be better to move billion variable into fill_time(). That's how it was until patch 5 or 6 or so. Greg P. Smith suggested moving into INITFUNC and I agreed. I think it should stay where it is. Attached is patch #9, adding a newline between "}" and "else" as Victor suggests. ---------- Added file: http://bugs.python.org/file24954/larry.st_mtime_ns.patch.9.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 02:43:15 2012 From: report at bugs.python.org (Larry Hastings) Date: Tue, 20 Mar 2012 01:43:15 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1332207795.99.0.217160058709.issue14328@psf.upfronthosting.co.za> Larry Hastings added the comment: Whoops! Actually, I did. But then I promptly forgot about them. They're now all incorporated; please see attached patch. ---------- Added file: http://bugs.python.org/file24955/larry.parsekwonly.diff.7.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 02:44:37 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 20 Mar 2012 01:44:37 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1332207795.99.0.217160058709.issue14328@psf.upfronthosting.co.za> Message-ID: Benjamin Peterson added the comment: Fine with me now. 2012/3/19 Larry Hastings : > > Larry Hastings added the comment: > > Whoops! ?Actually, I did. ?But then I promptly forgot about them. ?They're now all incorporated; please see attached patch. > > ---------- > Added file: http://bugs.python.org/file24955/larry.parsekwonly.diff.7.txt > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 04:57:45 2012 From: report at bugs.python.org (telmich) Date: Tue, 20 Mar 2012 03:57:45 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1332215865.35.0.331996495191.issue14228@psf.upfronthosting.co.za> telmich added the comment: Dear Charles-Fran?ois, for everybody who is not *programming* python (imagine there is a *real* user) the tracebacks are useless. Even worse, because the error messages are *changing*, because of different library parts not catching the exception. Thus someone who is not used to python must have the impression that something must be really broken, if random errors appear on pressing the de-facto standard key kombination to exit a program. The problem here is that the user is confronted with unwanted output, produced by the interpreter, which is not possible to be caught by a programmer to prevent this situation happening. It is like the Windows 3.11 error message boxes, which never made sense to you, but appeared way too often and made you feel bad (hope this makes the problem more clear). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 05:37:13 2012 From: report at bugs.python.org (aaron315) Date: Tue, 20 Mar 2012 04:37:13 +0000 Subject: [issue14370] enumerate() lead to system crashes Message-ID: <1332218233.23.0.940342826692.issue14370@psf.upfronthosting.co.za> New submission from aaron315 : alist=list(range(5)) alist.extend(enumerate(alist)) the computer will down !!! ---------- messages: 156379 nosy: aaron315 priority: normal severity: normal status: open title: enumerate() lead to system crashes type: performance versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 06:13:06 2012 From: report at bugs.python.org (Brian Curtin) Date: Tue, 20 Mar 2012 05:13:06 +0000 Subject: [issue14370] enumerate() lead to system crashes In-Reply-To: <1332218233.23.0.940342826692.issue14370@psf.upfronthosting.co.za> Message-ID: <1332220386.0.0.858748733806.issue14370@psf.upfronthosting.co.za> Brian Curtin added the comment: I just get a MemoryError. Do you actually receive a crash? ---------- nosy: +brian.curtin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 06:20:39 2012 From: report at bugs.python.org (Dave Burton) Date: Tue, 20 Mar 2012 05:20:39 +0000 Subject: [issue14367] try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2 In-Reply-To: <1332132143.66.0.7093323157.issue14367@psf.upfronthosting.co.za> Message-ID: <1332220839.38.0.254050030401.issue14367@psf.upfronthosting.co.za> Dave Burton added the comment: "expect?" Did I type that?? Should be "try/except," of course. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 07:33:05 2012 From: report at bugs.python.org (aaron315) Date: Tue, 20 Mar 2012 06:33:05 +0000 Subject: [issue14370] enumerate() lead to system crashes In-Reply-To: <1332218233.23.0.940342826692.issue14370@psf.upfronthosting.co.za> Message-ID: <1332225185.63.0.18630173618.issue14370@psf.upfronthosting.co.za> aaron315 added the comment: Have not been able to respond in a lower performance on the computer running, I restart the computer; On another computer, indeed MemoryError? ---------- _______________________________________ Python tracker _______________________________________ From don.chen at oracle.com Mon Mar 19 18:17:33 2012 From: don.chen at oracle.com (Don Chen) Date: Mon, 19 Mar 2012 10:17:33 -0700 (PDT) Subject: Python 2.7 crashed during compilation on HP PA-RISC Message-ID: Hello, I am compiling Python2.7 on a HP11i PA-RISC machine and received a segmentation fault. Platform Information "uname -a" = HP-UX hpdev2 B.11.11 U 9000/800 2280874925 unlimited-user license Steps 1) uncompress Python tgz file 2) run "configure CC=aCC CXX=aCC" 3) make Result: Segmentation fault at library generation time. $> ranlib libpython2.7.a aCC -Ae -Wl,-E -Wl,+s -o python \ Modules/python.o \ libpython2.7.a -lnsl -lrt -ldld -lpthread -lm sh[3]: 15168 Bus error(coredump) *** Error exit code 138 Analysis: core file generated by Python executable $> file python python: PA-RISC2.0 shared executable dynamically linked -not stripped $> file libpython2.7.a libpython2.7.a: archive file -PA-RISC2.0 relocatable library $> strings core|more platform # Build the shared modules sharedmods: $(BUILDPYTHON) @case $$MAKEFLAGS in \ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ esac # Build static library # avoid long command lines, same as LIBRARY_OBJS $(LIBRARY): $(LIBRARY_OBJS) -rm -f $@ $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o $(AR) $(ARFLAGS) $@ $(PARSER_OBJS) $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS) $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS) $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS) $(AR) $(ARFLAGS) $@ $(MODOBJS) $(RANLIB) $@ libpython$(VERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ else \ $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ fi libpython$(VERSION).dylib: $(LIBRARY_OBJS) $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ libpython$(VERSION).sl: $(LIBRARY_OBJS) $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) # Copy up the gdb python hooks into a position where they can be automatically # loaded by gdb during Lib/test/test_gdb.py # # Distributors are likely to want to install this somewhere else e.g. relative # to the stripped DWARF data for the shared library. gdbhooks: $(BUILDPYTHON)-gdb.py SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py $(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS) $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary # minimal framework (not including the Lib directory and such) in the current # directory. RESSRCDIR=Mac/Resources/framework $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \ $(LIBRARY) \ $(RESSRCDIR)/Info.plist $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION) $(CC) -o $(LDLIBRARY) $(LDFLAGS) -dynamiclib \ -all_load $(LIBRARY) -Wl,-single_module \ -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \ -compatibility_version $(VERSION) \ -current_version $(VERSION); $(INSTALL) -d -m $(DIRMODE) \ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK) $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources # This rule builds the Cygwin Python DLL and import library if configured # for a shared core library; otherwise, this rule is a noop. $(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS) if test -n "$(DLLLIBRARY)"; then \ $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \ $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST); \ else true; \ fi oldsharedmods: $(SHAREDMODS) Makefile Modules/config.c: Makefile.pre \ $(srcdir)/Modules/config.c.in \ $(MAKESETUP) \ Modules/Setup.config \ Modules/Setup \ Modules/Setup.local $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \ -s Modules \ Modules/Setup.config \ Modules/Setup.local \ Modules/Setup @mv config.c Modules @echo "The Makefile was updated, you may need to re-run make." Modules/Setup: $(srcdir)/Modules/Setup.dist @if test -f Modules/Setup; then \ echo "-----------------------------------------------"; \ echo "Modules/Setup.dist is newer than Modules/Setup;"; \ echo "check to make sure you have all the updates you"; \ echo "need in your Modules/Setup file."; \ echo "Usually, copying Modules/Setup.dist to Modules/Setup will work."; \ echo "-----------------------------------------------"; \ fi ############################################################################ # Special rules for object files Modules/getbuildinfo.o: $(PARSER_OBJS) \ $(OBJECT_OBJS) \ $(PYTHON_OBJS) \ $(MODULE_OBJS) \ $(SIGNAL_OBJS) \ $(MODOBJS) \ $(srcdir)/Modules/getbuildinfo.c $(CC) -c $(PY_CFLAGS) \ -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" \ -DHGVERSION="\"`LC_ALL=C $(HGVERSION)`\"" \ -DHGTAG="\"`LC_ALL=C $(HGTAG)`\"" \ -DHGBRANCH="\"`LC_ALL=C $(HGBRANCH)`\"" \ -o $@ $(srcdir)/Modules/getbuildinfo.c Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ -DPREFIX='"$(prefix)"' \ -DEXEC_PREFIX='"$(exec_prefix)"' \ -DVERSION='"$(VERSION)"' \ -DVPATH='"$(VPATH)"' \ -o $@ $(srcdir)/Modules/getpath.c Modules/python.o: $(srcdir)/Modules/python.c $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c # Use a stamp file to prevent make -j invoking pgen twice $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT) -@$(INSTALL) -d Include $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) -touch Parser/pgen.stamp $(PGEN): $(PGENOBJS) $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) Parser/grammar.o: $(srcdir)/Parser/grammar.c \ $(srcdir)/Include/token.h \ $(srcdir)/Include/grammar.h Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c Parser/tokenizer_pgen.o: $(srcdir)/Parser/tokenizer.c Parser/pgenmain.o: $(srcdir)/Include/parsetok.h $(AST_H): $(AST_ASDL) $(ASDLGEN_FILES) $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL) $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES) $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL) Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) Python/getplatform.o: $(srcdir)/Python/getplatform.c $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c Python/importdl.o: $(srcdir)/Python/importdl.c $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \ $(srcdir)/Objects/unicodetype_db.h STRINGLIB_HEADERS= \ $(srcdir)/Include/bytes_methods.h \ $(srcdir)/Objects/stringlib/count.h \ $(srcdir)/Objects/stringlib/ctype.h \ $(srcdir)/Objects/stringlib/fastsearch.h \ $(srcdir)/Objects/stringlib/find.h \ $(srcdir)/Objects/stringlib/formatter.h \ $(srcdir)/Objects/stringlib/partition.h \ $(srcdir)/Objects/stringlib/split.h \ $(srcdir)/Objects/stringlib/stringdefs.h \ $(srcdir)/Objects/stringlib/string_format.h \ $(srcdir)/Objects/stringlib/transmogrify.h \ $(srcdir)/Objects/stringlib/unicodedefs.h \ $(srcdir)/Objects/stringlib/localeutil.h Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \ $(STRINGLIB_HEADERS) Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c \ $(STRINGLIB_HEADERS) Objects/stringobject.o: $(srcdir)/Objects/stringobject.c \ $(STRINGLIB_HEADERS) Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \ $(STRINGLIB_HEADERS) Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \ $(STRINGLIB_HEADERS) ############################################################################ # Header files PYTHON_HEADERS= \ Include/Python-ast.h \ Include/Python.h \ Include/abstract.h \ Include/asdl.h \ Include/ast.h \ Include/bitset.h \ Include/boolobject.h \ Include/bytearrayobject.h \ Include/bytes_methods.h \ Include/bytesobject.h \ Include/bufferobject.h \ Include/cellobject.h \ Include/ceval.h \ Include/classobject.h \ Include/cobject.h \ Include/code.h \ Include/codecs.h \ Include/compile.h \ Include/complexobject.h \ Include/descrobject.h \ Include/dictobject.h \ Include/dtoa.h \ Include/enumobject.h \ Include/errcode.h \ Include/eval.h \ Include/fileobject.h \ Include/floatobject.h \ Include/frameobject.h \ Include/funcobject.h \ Include/genobject.h \ Include/import.h \ Include/intobject.h \ Include/intrcheck.h \ Include/iterobject.h \ Include/listobject.h \ Include/longintrepr.h \ Include/longobject.h \ Include/marshal.h \ Include/memoryobject.h \ Include/metagrammar.h \ Include/methodobject.h \ Include/modsupport.h \ Include/moduleobject.h \ Include/node.h \ Include/object.h \ Include/objimpl.h \ Include/opcode.h \ Include/osdefs.h \ Include/parsetok.h \ Include/patchlevel.h \ Include/pgen.h \ Include/pgenheaders.h \ Include/pyarena.h \ Include/pycapsule.h \ Include/pyctype.h \ Include/pydebug.h \ Include/pyerrors.h \ Include/pyfpe.h \ Include/pymath.h \ Include/pygetopt.h \ Include/pymem.h \ Include/pyport.h \ Include/pystate.h \ Include/pystrcmp.h \ Include/pystrtod.h \ Include/pythonrun.h \ Include/pythread.h \ Include/rangeobject.h \ Include/setobject.h \ Include/sliceobject.h \ Include/stringobject.h \ Include/structmember.h \ Include/structseq.h \ Include/symtable.h \ Include/sysmodule.h \ Include/traceback.h \ Include/tupleobject.h \ Include/ucnhash.h \ Include/unicodeobject.h \ Include/warnings.h \ Include/weakrefobject.h \ pyconfig.h \ $(PARSER_HEADERS) $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS) ###################################################################### # Test the interpreter (twice, once without .pyc files, once with) # In the past, we've had problems where bugs in the marshalling or # elsewhere caused bytecode read from .pyc files to behave differently # than bytecode generated directly from a .py source file. Sometimes # the bytecode read from a .pyc file had the bug, sometimes the directly # generated bytecode. This is sometimes a very shy bug needing a lot of # sample data. TESTOPTS= -l $(EXTRATESTOPTS) TESTPROG= $(srcdir)/Lib/test/regrtest.py TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS) test: all platform -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) testall: all platform -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f $(TESTPYTHON) $(srcdir)/Lib/compileall.py -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f -$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS) $(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS) # Run the unitests for both architectures in a Universal build on OSX # Must be run on an Intel box. testuniversal: all platform if [ `arch` != 'i386' ];then \ echo "This can only be used on OSX/i386" ;\ exit 1 ;\ fi -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f -$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS) $(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS) $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E -tt $(TESTPROG) -uall $(TESTOPTS) # Like testall, but with a single pass only # run an optional script to include some information about the build environment buildbottest: all platform - at if which pybuildbot.identify >/dev/null 2>&1; then \ pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \ fi $(TESTPYTHON) $(TESTPROG) -uall -rwW $(TESTOPTS) QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \ test_multibytecodec test_urllib2_localnet test_itertools \ test_multiprocessing test_mailbox test_socket test_poll \ test_select test_zipfile quicktest: all platform -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS) $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS) MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \ test_longexp memtest: all platform -rm -f $(srcdir)/Lib/test/*.py[co] -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS) $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS) # Install everything install: altinstall bininstall maninstall # Install almost everything without disturbing previous versions altinstall: altbininstall libinstall inclinstall libainstall \ sharedinstall oldsharedinstall # Install shared libraries enabled by Setup DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED) oldsharedinstall: $(DESTSHARED) $(SHAREDMODS) @for i in X $(SHAREDMODS); do \ if test $$i != X; then \ echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \ $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \ fi; \ done $(DESTSHARED): @for i in $(DESTDIRS); \ do \ if test ! -d $(DESTDIR)$$i; then \ echo "Creating directory $$i"; \ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ else true; \ fi; \ done # Install the interpreter (by creating a hard link to python$(VERSION)) bininstall: altbininstall -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \ then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \ else true; \ fi (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)) -rm -f $(DESTDIR)$(BINDIR)/python-config (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config) -test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC) -rm -f $(DESTDIR)$(LIBPC)/python.pc (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python.pc) # Install the interpreter with $(VERSION) affixed # This goes into $(exec_prefix) altbininstall: $(BUILDPYTHON) @for i in $(BINDIR) $(LIBDIR); \ do \ if test ! -d $(DESTDIR)$$i; then \ echo "Creating directory $$i"; \ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ else true; \ fi; \ done $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) if test -f $(LDLIBRARY); then \ if test -n "$(DLLLIBRARY)" ; then \ $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ else \ $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ if test $(LDLIBRARY) != $(INSTSONAME); then \ (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \ fi \ fi; \ else true; \ fi # Install the manual page maninstall: @for i in $(MANDIR) $(MANDIR)/man1; \ do \ if test ! -d $(DESTDIR)$$i; then \ echo "Creating directory $$i"; \ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ else true; \ fi; \ done $(INSTALL_DATA) $(srcdir)/Misc/python.man \ $(DESTDIR)$(MANDIR)/man1/python$(VERSION).1 # Install the library PLATDIR= plat-$(MACHDEP) EXTRAPLATDIR= EXTRAMACHDEPPATH= MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR) XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \ plat-mac/lib-scriptpackages/_builtinSuites \ plat-mac/lib-scriptpackages/CodeWarrior \ plat-mac/lib-scriptpackages/Explorer \ plat-mac/lib-scriptpackages/Finder \ plat-mac/lib-scriptpackages/Netscape \ plat-mac/lib-scriptpackages/StdSuites \ plat-mac/lib-scriptpackages/SystemEvents \ plat-mac/lib-scriptpackages/Terminal PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \ lib-tk/test/test_ttk site-packages test test/data \ test/cjkencodings test/decimaltestdata test/xmltestdata test/subprocessdata \ test/tracedmodules \ encodings compiler hotshot \ email email/mime email/test email/test/data \ json json/tests \ sqlite3 sqlite3/test \ logging bsddb bsddb/test csv importlib wsgiref \ lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \ lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \ ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \ distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \ multiprocessing multiprocessing/dummy \ unittest unittest/test \ lib-old \ curses pydoc_data $(MACHDEPS) libinstall: build_all $(srcdir)/Lib/$(PLATDIR) @for i in $(SCRIPTDIR) $(LIBDEST); \ do \ if test ! -d $(DESTDIR)$$i; then \ echo "Creating directory $$i"; \ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ else true; \ fi; \ done @for d in $(LIBSUBDIRS); \ do \ a=$(srcdir)/Lib/$$d; \ if test ! -d $$a; then continue; else true; fi; \ b=$(LIBDEST)/$$d; \ if test ! -d $(DESTDIR)$$b; then \ echo "Creating directory $$b"; \ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \ else true; \ fi; \ done @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \ do \ if test -x $$i; then \ $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \ echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \ else \ $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \ echo $(INSTALL_DATA) $$i $(LIBDEST); \ fi; \ done @for d in $(LIBSUBDIRS); \ do \ a=$(srcdir)/Lib/$$d; \ if test ! -d $$a; then continue; else true; fi; \ if test `ls $$a | wc -l` -lt 1; then continue; fi; \ b=$(LIBDEST)/$$d; \ for i in $$a/*; \ do \ case $$i in \ *CVS) ;; \ *.py[co]) ;; \ *.orig) ;; \ *~) ;; \ *) \ if test -d $$i; then continue; fi; \ if test -x $$i; then \ echo $(INSTALL_SCRIPT) $$i $$b; \ $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \ else \ echo $(INSTALL_DATA) $$i $$b; \ $(INSTALL_DATA) $$i $(DESTDIR)$$b; \ fi;; \ esac; \ done; \ done $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST) -f \ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ $(DESTDIR)$(LIBDEST) PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST) -f \ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ $(DESTDIR)$(LIBDEST) -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" # Create the PLATDIR source directory, if one wasn't distributed.. $(srcdir)/Lib/$(PLATDIR): mkdir $(srcdir)/Lib/$(PLATDIR) cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen export PATH; PATH="`pwd`:$$PATH"; \ export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \ export EXE; EXE="$(BUILDEXE)"; \ cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen python-config: $(srcdir)/Misc/python-config.in # Substitution happens here, as the completely-expanded BINDIR # is not available in configure sed -e "s, at EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config # Install the include files INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY) inclinstall: @for i in $(INCLDIRSTOMAKE); \ do \ if test ! -d $(DESTDIR)$$i; then \ echo "Creating directory $$i"; \ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ else true; \ fi; \ done @for i in $(srcdir)/Include/*.h; \ do \ echo $(INSTALL_DATA) $$i $(INCLUDEPY); \ $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \ done $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h # Install the library and miscellaneous stuff needed for extending/embedding # This goes into $(exec_prefix) LIBPL= $(LIBP)/config # pkgconfig directory LIBPC= $(LIBDIR)/pkgconfig libainstall: all python-config @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \ do \ if test ! -d $(DESTDIR)$$i; then \ echo "Creating directory $$i"; \ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ else true; \ fi; \ done @if test -d $(LIBRARY); then :; else \ if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ if test "$(SO)" = .dll; then \ $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ else \ $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ fi; \ else \ echo Skip install of $(LIBRARY) - use make frameworkinstall; \ fi; \ fi $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config rm python-config @if [ -s Modules/python.exp -a \ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \ echo; echo "Installing support files for building shared extension modules on AIX:"; \ $(INSTALL_DATA) Modules/python.exp \ $(DESTDIR)$(LIBPL)/python.exp; \ echo; echo "$(LIBPL)/python.exp"; \ $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \ $(DESTDIR)$(LIBPL)/makexp_aix; \ echo "$(LIBPL)/makexp_aix"; \ $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix \ $(DESTDIR)$(LIBPL)/ld_so_aix; \ echo "$(LIBPL)/ld_so_aix"; \ echo; echo "See Misc/AIX-NOTES for details."; \ else true; \ fi @case "$(MACHDEP)" in beos*) \ echo; echo "Installing support files for building shared extension modules on BeOS:"; \ $(INSTALL_DATA) Misc/BeOS-NOTES $(DESTDIR)$(LIBPL)/README; \ echo; echo "$(LIBPL)/README"; \ $(INSTALL_SCRIPT) Modules/ar_beos $(DESTDIR)$(LIBPL)/ar_beos; \ echo "$(LIBPL)/ar_beos"; \ $(INSTALL_SCRIPT) Modules/ld_so_beos $(DESTDIR)$(LIBPL)/ld_so_beos; \ echo "$(LIBPL)/ld_so_beos"; \ echo; echo "See Misc/BeOS-NOTES for details."; \ ;; \ esac # Install the dynamically loadable modules # This goes into $(exec_prefix) sharedinstall: sharedmods $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ --prefix=$(prefix) \ --install-scripts=$(BINDIR) \ --install-platlib=$(DESTSHARED) \ --root=$(DESTDIR)/ # Here are a couple of targets for MacOSX again, to install a full # framework-based Python. frameworkinstall installs everything, the # subtargets install specific parts. Much of the actual work is offloaded to # the Makefile in Mac # # # This target is here for backward compatiblity, previous versions of Python # hadn't integrated framework installation in the normal install process. frameworkinstall: install # On install, we re-make the framework # structure in the install location, /Library/Frameworks/ or the argument to # --enable-framework. If --enable-framework has been specified then we have # automatically set prefix to the location deep down in the framework, so we # only have to cater for the structural bits of the framework. frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib frameworkinstallstructure: $(LDLIBRARY) @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ echo Not configured with --enable-framework; \ exit 1; \ else true; \ fi @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\ if test ! -d $(DESTDIR)$$i; then \ echo "Creating directory $(DESTDIR)$$i"; \ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ else true; \ fi; \ done $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK) $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY) # This installs Mac/Lib into the framework # Install a number of symlinks to keep software that expects a normal unix # install (which includes python-config) happy. frameworkinstallmaclib: ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a" ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).dylib" ln -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib" cd Mac && $(MAKE) installmacsubtree DESTDIR="$(DESTDIR)" # This installs the IDE, the Launcher and other apps into /Applications frameworkinstallapps: cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)" # This install the unix python and pythonw tools in /usr/local/bin frameworkinstallunixtools: cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)" frameworkaltinstallunixtools: cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)" # This installs the Demos and Tools into the applications directory. # It is not part of a normal frameworkinstall frameworkinstallextras: cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)" # This installs a few of the useful scripts in Tools/scripts scriptsinstall: SRCDIR=$(srcdir) $(RUNSHARED) \ ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \ --prefix=$(prefix) \ --install-scripts=$(BINDIR) \ --root=$(DESTDIR)/ # Build the toplevel Makefile Makefile.pre: Makefile.pre.in config.status CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status $(MAKE) -f Makefile.pre Makefile # Run the configure script. config.status: $(srcdir)/configure $(SHELL) $(srcdir)/configure $(CONFIG_ARGS) .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre # Some make's put the object file in the current directory .c.o: $(CC) -c $(PY_CFLAGS) -o $@ $< # Run reindent on the library reindent: ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib # Rerun configure with the same options as it was run last time, # provided the config.status script exists recheck: $(SHELL) config.status --recheck $(SHELL) config.status # Rebuild the configure script from configure.in; also rebuild pyconfig.h.in autoconf: (cd $(srcdir); autoconf) (cd $(srcdir); autoheader) # Create a tags file for vi tags:: cd $(srcdir); \ ctags -w -t Include/*.h; \ for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \ done; \ sort -o tags tags # Create a tags file for GNU Emacs TAGS:: cd $(srcdir); \ etags Include/*.h; \ for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done # Sanitation targets -- clean leaves libraries, executables and tags # files, which clobber removes as well pycremoval: find $(srcdir) -name '*.py[co]' -exec rm -f {} ';' clean: pycremoval find . -name '*.[oa]' -exec rm -f {} ';' find . -name '*.s[ol]' -exec rm -f {} ';' find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';' find build -name 'fficonfig.h' -exec rm -f {} ';' || true find build -name 'fficonfig.py' -exec rm -f {} ';' || true -rm -f Lib/lib2to3/*Grammar*.pickle profile-removal: find . -name '*.gc??' -exec rm -f {} ';' clobber: clean profile-removal -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ tags TAGS Parser/pgen.stamp \ config.cache config.log pyconfig.h Modules/config.c -rm -rf build platform -rm -rf $(PYTHONFRAMEWORKDIR) # Make things extra clean, before making a distribution: # remove all generated files, even Makefile[.pre] # Keep configure and Python-ast.[ch], it's possible they can't be generated distclean: clobber for file in Lib/test/data/* ; do \ if test "$$file" != "Lib/test/data/README"; then rm "$$file"; fi; \ done -rm -f core Makefile Makefile.pre config.status \ Modules/Setup Modules/Setup.local Modules/Setup.config \ Modules/ld_so_aix Modules/python.exp Misc/python.pc -rm -f python*-gdb.py find $(srcdir) '(' -name '*.fdc' -o -name '*~' \ -o -name '[@,#]*' -o -name '*.old' \ -o -name '*.orig' -o -name '*.rej' \ -o -name '*.bak' ')' \ -exec rm -f {} ';' # Check for smelly exported symbols (not starting with Py/_Py) smelly: all nm -p $(LIBRARY) | \ sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \ # Find files with funny names funny: find $(DISTDIRS) -type d \ -o -name '*.[chs]' \ -o -name '*.py' \ -o -name '*.doc' \ -o -name '*.sty' \ -o -name '*.bib' \ -o -name '*.dat' \ -o -name '*.el' \ -o -name '*.fd' \ -o -name '*.in' \ -o -name '*.tex' \ -o -name '*,[vpt]' \ -o -name 'Setup' \ -o -name 'Setup.*' \ -o -name README \ -o -name Makefile \ -o -name ChangeLog \ -o -name Repository \ -o -name Root \ -o -name Entries \ -o -name Tag \ -o -name tags \ -o -name TAGS \ -o -name .cvsignore \ -o -name MANIFEST \ -o -print # Perform some verification checks on any modified files. patchcheck: $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py # Dependencies Python/thread.o: $(srcdir)/Python/thread_atheos.h $(srcdir)/Python/thread_beos.h $(srcdir)/Python/thread_cthread.h $(srcdir)/Python/thread_foobar.h $(srcdir)/Python/thread_lwp.h $(srcdir)/Python/thread_nt.h $(srcdir)/Python/thread_os2.h $(srcdir)/Python/thread_pth.h $(srcdir)/Python/thread_pthread.h $(srcdir)/Python/thread_sgi.h $(srcdir)/Python/thread_solaris.h $(srcdir)/Python/thread_wince.h # Declare targets that aren't real files .PHONY: all build_all sharedmods oldsharedmods test quicktest memtest .PHONY: install altinstall oldsharedinstall bininstall altbininstall .PHONY: maninstall libinstall inclinstall libainstall sharedinstall .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean .PHONY: smelly funny patchcheck .PHONY: gdbhooks # IF YOU PUT ANYTHING HERE IT WILL GO AWAY # Rules appended by makedepend Modules/threadmodule.o: $(srcdir)/Modules/threadmodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/threadmodule.c -o Modules/threadmodule.o Modules/threadmodule$(SO): Modules/threadmodule.o; $(BLDSHARED) Modules/threadmodule.o -o Modules/threadmodule$(SO) Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/signalmodule.c -o Modules/signalmodule.o Modules/signalmodule$(SO): Modules/signalmodule.o; $(BLDSHARED) Modules/signalmodule.o -o Modules/signalmodule$(SO) Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/posixmodule.c -o Modules/posixmodule.o Modules/posixmodule$(SO): Modules/posixmodule.o; $(BLDSHARED) Modules/posixmodule.o -o Modules/posixmodule$(SO) Modules/errnomodule.o: $(srcdir)/Modules/errnomodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/errnomodule.c -o Modules/errnomodule.o Modules/errnomodule$(SO): Modules/errnomodule.o; $(BLDSHARED) Modules/errnomodule.o -o Modules/errnomodule$(SO) Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/pwdmodule.c -o Modules/pwdmodule.o Modules/pwdmodule$(SO): Modules/pwdmodule.o; $(BLDSHARED) Modules/pwdmodule.o -o Modules/pwdmodule$(SO) Modules/_sre.o: $(srcdir)/Modules/_sre.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/_sre.c -o Modules/_sre.o Modules/_sre$(SO): Modules/_sre.o; $(BLDSHARED) Modules/_sre.o -o Modules/_sre$(SO) Modules/_codecsmodule.o: $(srcdir)/Modules/_codecsmodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/_codecsmodule.c -o Modules/_codecsmodule.o Modules/_codecsmodule$(SO): Modules/_codecsmodule.o; $(BLDSHARED) Modules/_codecsmodule.o -o Modules/_codecsmodule$(SO) Modules/_weakref.o: $(srcdir)/Modules/_weakref.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/_weakref.c -o Modules/_weakref.o Modules/_weakref$(SO): Modules/_weakref.o; $(BLDSHARED) Modules/_weakref.o -o Modules/_weakref$(SO) Modules/zipimport.o: $(srcdir)/Modules/zipimport.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/zipimport.c -o Modules/zipimport.o Modules/zipimport$(SO): Modules/zipimport.o; $(BLDSHARED) Modules/zipimport.o -o Modules/zipimport$(SO) Modules/symtablemodule.o: $(srcdir)/Modules/symtablemodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/symtablemodule.c -o Modules/symtablemodule.o Modules/_symtablemodule$(SO): Modules/symtablemodule.o; $(BLDSHARED) Modules/symtablemodule.o -o Modules/_symtablemodule$(SO) Modules/xxsubtype.o: $(srcdir)/Modules/xxsubtype.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/xxsubtype.c -o Modules/xxsubtype.o Modules/xxsubtype$(SO): Modules/xxsubtype.o; $(BLDSHARED) Modules/xxsubtype.o -o Modules/xxsubtype$(SO) From report at bugs.python.org Tue Mar 20 09:09:32 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 20 Mar 2012 08:09:32 +0000 Subject: [issue14370] enumerate() lead to system crashes In-Reply-To: <1332218233.23.0.940342826692.issue14370@psf.upfronthosting.co.za> Message-ID: <1332230972.91.0.986178522742.issue14370@psf.upfronthosting.co.za> Stefan Krah added the comment: I can reproduce this with Python 3.2 on Linux-2.4.32/i686 with 512M of RAM. The machine does not crash, it freezes completely in the same manner as with a fork bomb. A hard reboot is required. ---------- nosy: +skrah type: performance -> resource usage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 09:32:33 2012 From: report at bugs.python.org (Petri Lehtinen) Date: Tue, 20 Mar 2012 08:32:33 +0000 Subject: [issue14370] list.extend() called on an iterator of the list itself leads to an infinite loop In-Reply-To: <1332218233.23.0.940342826692.issue14370@psf.upfronthosting.co.za> Message-ID: <1332232353.09.0.840089214234.issue14370@psf.upfronthosting.co.za> Petri Lehtinen added the comment: This has the same effect: a = list(range(5)) a.extend(iter(a)) So the problem is not in enumerate but in list.extend() ---------- nosy: +petri.lehtinen title: enumerate() lead to system crashes -> list.extend() called on an iterator of the list itself leads to an infinite loop _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 09:44:00 2012 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Tue, 20 Mar 2012 08:44:00 +0000 Subject: [issue14370] list.extend() called on an iterator of the list itself leads to an infinite loop In-Reply-To: <1332218233.23.0.940342826692.issue14370@psf.upfronthosting.co.za> Message-ID: <1332233040.84.0.00731689547779.issue14370@psf.upfronthosting.co.za> Charles-Fran?ois Natali added the comment: I think you're simply running OOM, and Linux is thrashing to death. If you wait long enough, the process should get nuked by the OOM killer (well, in theory). What happens if you disable swap altogether ('swapoff -a')? You can also change to strict overcommitting ('echo 2 > /proc/sys/vm/overcommit_memory'). Anyway, I guess you would get the same effect by simply running list(range())... ---------- nosy: +neologix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 09:56:15 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 20 Mar 2012 08:56:15 +0000 Subject: [issue3367] Uninitialized value read in parsetok.c In-Reply-To: <1216153264.95.0.467111480464.issue3367@psf.upfronthosting.co.za> Message-ID: <1332233775.21.0.739431127212.issue3367@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: bump, what is the status of this? Was it fixed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 10:08:59 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 20 Mar 2012 09:08:59 +0000 Subject: [issue14198] Backport parts of the new memoryview documentation In-Reply-To: <1330939816.35.0.731110214123.issue14198@psf.upfronthosting.co.za> Message-ID: <1332234539.02.0.204733256957.issue14198@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Stefan, I just want to point out this issue, if you are touching 2.7: http://bugs.python.org/issue10538 Do you think it merits being fixed? ---------- nosy: +krisvale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 10:12:03 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 20 Mar 2012 09:12:03 +0000 Subject: [issue10211] BufferObject doesn't support new buffer interface In-Reply-To: <1288169352.49.0.219368546772.issue10211@psf.upfronthosting.co.za> Message-ID: <1332234723.3.0.765201686613.issue10211@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Bumping this. Do we want this fixed as a bug in 2.7 or left alone? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 10:14:03 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 20 Mar 2012 09:14:03 +0000 Subject: [issue10212] struct.unpack and cStringIO.StringIO don't support new buffer In-Reply-To: <1288175813.33.0.0310491559114.issue10212@psf.upfronthosting.co.za> Message-ID: <1332234843.78.0.629455199405.issue10212@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: The patch is still there. Any new consensus? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 10:18:05 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 20 Mar 2012 09:18:05 +0000 Subject: [issue9787] Release the TLS lock during allocations In-Reply-To: <1283839386.17.0.522591872287.issue9787@psf.upfronthosting.co.za> Message-ID: <1332235085.93.0.948123632939.issue9787@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: I'll rework this for python 3.x and see where that gets us. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 10:23:59 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 20 Mar 2012 09:23:59 +0000 Subject: [issue14198] Backport parts of the new memoryview documentation In-Reply-To: <1332234539.02.0.204733256957.issue14198@psf.upfronthosting.co.za> Message-ID: <20120320092357.GA31140@sleipnir.bytereef.org> Stefan Krah added the comment: Kristj??n Valur J??nsson wrote: > Stefan, I just want to point out this issue, if you are touching 2.7: > http://bugs.python.org/issue10538 > Do you think it merits being fixed? I think so. A patch would be appreciated, since the issue touches the old buffer interface (which I haven't looked at in detail at all). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 10:24:06 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 20 Mar 2012 09:24:06 +0000 Subject: [issue10538] PyArg_ParseTuple("s*") does not always incref object In-Reply-To: <1290758853.31.0.608837110631.issue10538@psf.upfronthosting.co.za> Message-ID: <1332235446.14.0.523340399107.issue10538@psf.upfronthosting.co.za> Changes by Stefan Krah : ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 10:50:59 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 20 Mar 2012 09:50:59 +0000 Subject: [issue3367] Uninitialized value read in parsetok.c In-Reply-To: <1216153264.95.0.467111480464.issue3367@psf.upfronthosting.co.za> Message-ID: <1332237059.95.0.663653169228.issue3367@psf.upfronthosting.co.za> Stefan Krah added the comment: It isn't fixed. Also, there's now an additional invalid read in sys_update_path(): $ valgrind --db-attach=yes --suppressions=Misc/valgrind-python.supp ./python ==20258== Memcheck, a memory error detector ==20258== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==20258== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==20258== Command: ./python ==20258== Python 3.3.0a1+ (default:0554183066b5, Mar 20 2012, 10:47:41) [GCC 4.4.3] on linux Type "help", "copyright", "credits" or "license" for more information. ==20258== Invalid read of size 8 ==20258== at 0x4C9F6F: sys_update_path (sysmodule.c:1742) ==20258== by 0x4CA268: PySys_SetArgvEx (sysmodule.c:1830) ==20258== by 0x4CA28F: PySys_SetArgv (sysmodule.c:1836) ==20258== by 0x4D9930: Py_Main (main.c:647) ==20258== by 0x41AE1F: main (python.c:63) ==20258== Address 0x5a58048 is 0 bytes after a block of size 8 alloc'd ==20258== at 0x4C27878: malloc (vg_replace_malloc.c:236) ==20258== by 0x41DF90: PyMem_Malloc (object.c:1841) ==20258== by 0x41ACC4: main (python.c:25) ==20258== ==20258== ==20258== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- n >>> ==20258== Conditional jump or move depends on uninitialised value(s) ==20258== at 0x52B030: parsetok (parsetok.c:207) ==20258== by 0x52AD51: PyParser_ParseFileFlagsEx (parsetok.c:108) ==20258== by 0x4BFCDA: PyParser_ASTFromFile (pythonrun.c:1973) ==20258== by 0x4BDB5A: PyRun_InteractiveOneFlags (pythonrun.c:1196) ==20258== by 0x4BD83D: PyRun_InteractiveLoopFlags (pythonrun.c:1106) ==20258== by 0x4BD6E2: PyRun_AnyFileExFlags (pythonrun.c:1075) ==20258== by 0x4D9118: run_file (main.c:306) ==20258== by 0x4D9C0B: Py_Main (main.c:720) ==20258== by 0x41AE1F: main (python.c:63) ==20258== ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 11:18:02 2012 From: report at bugs.python.org (Ram Rachum) Date: Tue, 20 Mar 2012 10:18:02 +0000 Subject: [issue14262] Allow using decimals as arguments to `timedelta` In-Reply-To: <1331557988.1.0.944940856764.issue14262@psf.upfronthosting.co.za> Message-ID: <1332238682.82.0.805468416283.issue14262@psf.upfronthosting.co.za> Ram Rachum added the comment: "I'm not completly conviced by the need of supporting Decimal in timedelta constructor. Why do you use Decimal if the result should be a timedelta? Why not using timedelta directly?" What do you mean, "Why not using timedelta directly?" How could I use timedelta directly in the timedelta constructor? I'm creating a timedelta, I don't have one ready. I'm getting an `n_hours` variable for some component of my system. And this value happens to come as a `Decimal`. I want to create a `timedelta` out of it. So I'd want to be able to do `timedelta(hours=n_hours)` rather than `timedelta(hours=float(n_hours))`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 12:20:39 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 20 Mar 2012 11:20:39 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1332242439.97.0.0253874780585.issue14302@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 12:30:42 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Mar 2012 11:30:42 +0000 Subject: [issue14371] Add support for bzip2 compression to the zipfile module Message-ID: <1332243041.43.0.499117498297.issue14371@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : ZIP File Format Specification (http://www.pkware.com/documents/casestudies/APPNOTE.TXT) supports bzip2 compression since at least 2003. Since bzip2 contained in Python standart library, it would be nice to add support for these method in zipfile. This will allow to process more foreign zip files and create more compact distributives. The proposed patch adds new method ZIP_BZIP2, which is automatically detecting when unpacking and that can be used for packing. ---------- components: Library (Lib) files: bzip2_in_zip.patch keywords: patch messages: 156394 nosy: storchaka priority: normal severity: normal status: open title: Add support for bzip2 compression to the zipfile module type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24956/bzip2_in_zip.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 12:33:03 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Mar 2012 11:33:03 +0000 Subject: [issue14366] Supporting bzip2 and lzma compression in zip files In-Reply-To: <1332112236.1.0.964135054036.issue14366@psf.upfronthosting.co.za> Message-ID: <1332243183.04.0.969116822856.issue14366@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Issue #14371: Add support for bzip2 compression to the zipfile module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 12:35:48 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Mar 2012 11:35:48 +0000 Subject: [issue14262] Allow using decimals as arguments to `timedelta` In-Reply-To: <1332238682.82.0.805468416283.issue14262@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: "I'm getting an `n_hours` variable for some component of my system. And this value happens to come as a `Decimal`." Can't you modify your program to use timedelta instead of Decimal for n_hours? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 12:37:55 2012 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Tue, 20 Mar 2012 11:37:55 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1332215865.35.0.331996495191.issue14228@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: > for everybody who is not *programming* python (imagine there is a *real* user) the tracebacks are useless. Even worse, because the error messages are *changing*, because of different library parts not catching the exception. Well, I also use it sometimes ;-) > The problem here is that the user is confronted with unwanted output, produced by the interpreter, which is not possible to be caught by a programmer to prevent this situation happening. You can start the interpreter with '-S' to avoid importing the site module, then: """ import signal signal.signal(signal.SIGINT, signal.SIG_DFL) import site site.main() [...] """ or """ try: import site site.main() import signal signal.signal(signal.SIGINT, signal.SIG_DFL) except KeyboardInterrupt: whatever [...] """ Or we could change Py_InitializeEx() to setup the signal handlers after having imported the site module: """ --- cpython-93769b8ff40b/Python/pythonrun.c 2012-01-19 10:29:48.000000000 +0000 +++ cpython/Python/pythonrun.c 2012-03-20 11:27:37.000000000 +0000 @@ -313,9 +313,6 @@ if (initfsencoding(interp) < 0) Py_FatalError("Py_Initialize: unable to load the file system codec"); - if (install_sigs) - initsigs(); /* Signal handling stuff, including initintr() */ - initmain(); /* Module __main__ */ if (initstdio() < 0) Py_FatalError( @@ -333,6 +330,9 @@ if (!Py_NoSiteFlag) initsite(); /* Module site */ + + if (install_sigs) + initsigs(); /* Signal handling stuff, including initintr() */ """ Note, however, that there will always be a race window, if the signal is delivered after the signal handlers have been setup and the first line of the user code is executed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 12:38:02 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 20 Mar 2012 11:38:02 +0000 Subject: [issue14370] list.extend() called on an iterator of the list itself leads to an infinite loop In-Reply-To: <1332218233.23.0.940342826692.issue14370@psf.upfronthosting.co.za> Message-ID: <1332243482.97.0.398131283845.issue14370@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 12:39:59 2012 From: report at bugs.python.org (Ram Rachum) Date: Tue, 20 Mar 2012 11:39:59 +0000 Subject: [issue14262] Allow using decimals as arguments to `timedelta` In-Reply-To: <1331557988.1.0.944940856764.issue14262@psf.upfronthosting.co.za> Message-ID: <1332243599.49.0.306491917738.issue14262@psf.upfronthosting.co.za> Ram Rachum added the comment: In some cases we indeed use a timedelta directly, but sometimes we get a "number of hours", and in those cases it's more convenient for us to work with "number of hours" directly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 12:46:33 2012 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Tue, 20 Mar 2012 11:46:33 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: Message-ID: Charles-Fran?ois Natali added the comment: > Or we could change Py_InitializeEx() to setup the signal handlers > after having imported the site module: Note that I don't really like this solution, because it's better to setup handlers for fatal signals (SIGPIPE, SIGXF...) before executing arbitrary Python code (site). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 12:50:20 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 20 Mar 2012 11:50:20 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: Message-ID: <1332243942.3443.0.camel@localhost.localdomain> Antoine Pitrou added the comment: > > Or we could change Py_InitializeEx() to setup the signal handlers > > after having imported the site module: > > Note that I don't really like this solution, because it's better to > setup handlers for fatal signals (SIGPIPE, SIGXF...) before executing > arbitrary Python code (site). Agreed. I think we'd better disable SIGINT initialization when a certain environment variable is set. (AFAICT, the issue is only about SIGINT since it's the only one where the default behaviour is overriden) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 13:32:44 2012 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Mar 2012 12:32:44 +0000 Subject: [issue14311] ConfigParser does not parse utf-8 files with BOM bytes In-Reply-To: <1331778292.28.0.574531846286.issue14311@psf.upfronthosting.co.za> Message-ID: <1332246764.53.0.667242238487.issue14311@psf.upfronthosting.co.za> Changes by ?ukasz Langa : ---------- resolution: -> duplicate stage: needs patch -> committed/rejected status: open -> closed superseder: -> Python3: guess text file charset using the BOM versions: -Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 13:33:40 2012 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Mar 2012 12:33:40 +0000 Subject: [issue7651] Python3: guess text file charset using the BOM In-Reply-To: <1262833437.24.0.308267564541.issue7651@psf.upfronthosting.co.za> Message-ID: <1332246820.02.0.282744415734.issue7651@psf.upfronthosting.co.za> Changes by ?ukasz Langa : ---------- assignee: -> lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 13:43:44 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Mar 2012 12:43:44 +0000 Subject: [issue14372] Fix all invalid usage of borrowed references Message-ID: <1332247424.34.0.747604429133.issue14372@psf.upfronthosting.co.za> New submission from STINNER Victor : I fixed the issues #14211 and #14231. These issues were invalid usage of borrowed reference: the reference can be destroyed before the reference is used. Armin Rigo replied: "I will attempt a last time to mention that the docstrings in borrowed_ref_*.py used to say they were *examples*. That means: (1) find any internal or external C function that returns a borrowed reference; (2) find all callers and write down all the places that don't immediately either Py_INCREF() the returned value or immediately forget about it; (3) for each such place, either come up painfully with a complicated explanation of why it's safe in all possible cases, or in doubt, just fix it by adding Py_INCREF()/Py_DECREF(). What I did in writing these two borrowed_ref_*.py was to do instead (3') spend a few hours figuring out how to exploit the issue until we get a segfault. I did it for two examples, but what I'm definitely not going to do is spend N times a few hours for a large number N. If python-dev people just fix the two examples, remove the crashers, and just forget about the issue, then well, the point is missed, but I'm not going to fight it." Sorry Armin, I didn't know that the issue of borrowed was a generic issue and more code need to be fixed. So I'm opening this issue to track of invalid usage of borrowed references. ---------- components: Interpreter Core, Library (Lib) messages: 156401 nosy: haypo priority: normal severity: normal status: open title: Fix all invalid usage of borrowed references type: crash versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 13:45:36 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Mar 2012 12:45:36 +0000 Subject: [issue14372] Fix all invalid usage of borrowed references In-Reply-To: <1332247424.34.0.747604429133.issue14372@psf.upfronthosting.co.za> Message-ID: <1332247536.43.0.457047378989.issue14372@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +arigo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 13:49:29 2012 From: report at bugs.python.org (Stefan Krah) Date: Tue, 20 Mar 2012 12:49:29 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1332247769.86.0.118560421518.issue7652@psf.upfronthosting.co.za> Stefan Krah added the comment: We need to decide what to do with the different limits of the 64-bit and 32-bit versions: MAX_EMAX default context 10**9-1 64-bit 10**18-1 32-bit 425000000 I think it would be annoying to have the values in DefaultContext, ExtendedContext and BasicContext depend on the machine. The best thing might be to use Emax=10**8-1 and Emin=-(10**8-1) throughout. I don't think many applications depend on having Emax=10**9-1. If they do, they'll have to use the 64-bit version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 13:54:01 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Mar 2012 12:54:01 +0000 Subject: [issue14372] Fix all invalid usage of borrowed references In-Reply-To: <1332247424.34.0.747604429133.issue14372@psf.upfronthosting.co.za> Message-ID: <1332248041.01.0.836544225331.issue14372@psf.upfronthosting.co.za> STINNER Victor added the comment: > (1) find any internal or external C function that returns a borrowed reference Doc/data/refcounts.dat can be used for that: PyCell_GET PyDict_GetItem PyDict_GetItemString PyErr_Occurred PyEval_GetBuiltins PyEval_GetLocals PyEval_GetGlobals PyEval_GetFrame PyFile_Name PyFunction_GetClosure PyFunction_GetCode PyFunction_GetDefaults PyFunction_GetGlobals PyFunction_GetModule Py_InitModule Py_InitModule3 Py_InitModule4 PyImport_AddModule PyImport_GetModuleDict PyList_GET_ITEM PyList_GetItem PyMethod_Class PyMethod_Function PyMethod_GET_CLASS PyMethod_GET_FUNCTION PyMethod_GET_SELF PyMethod_Self PyModule_GetDict PyObject_Init PySequence_Fast_GET_ITEM PySys_GetObject PySys_GetXOptions PyThreadState_GetDict PyTuple_GET_ITEM PyTuple_GetItem PyWeakref_GET_OBJECT PyWeakref_GetObject (this list may be incomplete, it should be checked) Not affected (always return NULL): PyErr_NoMemory PyErr_Set... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 14:37:27 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 20 Mar 2012 13:37:27 +0000 Subject: [issue14369] make __closure__ writable In-Reply-To: <1332179477.04.0.11685261564.issue14369@psf.upfronthosting.co.za> Message-ID: <1332250647.62.0.280304772582.issue14369@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Please update the doc also. I think changing from 'Read-only' to 'Writable' in Doc/reference/datamodel.rst is enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 14:40:46 2012 From: report at bugs.python.org (Matt Joiner) Date: Tue, 20 Mar 2012 13:40:46 +0000 Subject: [issue14373] C implementation of functools.lru_cache Message-ID: <1332250846.11.0.753199667334.issue14373@psf.upfronthosting.co.za> New submission from Matt Joiner : functools.lru_cache is optimized to the point that it may benefit from a C implementation. ---------- components: Interpreter Core, Library (Lib) messages: 156405 nosy: anacrolix, rhettinger priority: normal severity: normal status: open title: C implementation of functools.lru_cache type: performance versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 14:50:24 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Mar 2012 13:50:24 +0000 Subject: [issue14249] unicodeobject.c: aliasing warnings In-Reply-To: <1331417993.32.0.291164156337.issue14249@psf.upfronthosting.co.za> Message-ID: <1332251424.74.0.552800434522.issue14249@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What if add more hacking? If long integer already used for buffering and checking, let use it for swapping and splitting too. With my patch (attached) codecs.utf_16_be_decode runs 5% faster (on 32-bit Linux, I was not tested 64-bit). And of cause no pointers -- no aliasing warnings. ---------- nosy: +storchaka Added file: http://bugs.python.org/file24957/utf16_decoder_shift.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 15:04:48 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Mar 2012 14:04:48 +0000 Subject: [issue14249] unicodeobject.c: aliasing warnings In-Reply-To: <1332251424.74.0.552800434522.issue14249@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > With my patch (attached) codecs.utf_16_be_decode runs 5% faster (on 32-bit Linux, I was not tested 64-bit). And of cause no pointers -- no aliasing warnings. Your patch is wrong: you need to use & 0xffff to get lower 16 bits when reading a UTF-16 unit. For example, (Py_UCS2)(block >> 32) should be written (Py_UCS2)((block >> 32) & 0xffff). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 15:14:47 2012 From: report at bugs.python.org (Matt Joiner) Date: Tue, 20 Mar 2012 14:14:47 +0000 Subject: [issue14373] C implementation of functools.lru_cache In-Reply-To: <1332250846.11.0.753199667334.issue14373@psf.upfronthosting.co.za> Message-ID: <1332252887.63.0.653452201757.issue14373@psf.upfronthosting.co.za> Changes by Matt Joiner : Added file: http://bugs.python.org/file24958/functools.lru_cache-in-c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 15:20:17 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Mar 2012 14:20:17 +0000 Subject: [issue14249] unicodeobject.c: aliasing warnings In-Reply-To: <1331417993.32.0.291164156337.issue14249@psf.upfronthosting.co.za> Message-ID: <1332253217.05.0.385982657457.issue14249@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Heh. This was in previous version of my patch. I have removed '& 0xFFFFu' and parents for simplicity. GCC produces same binaries for both sources. But you can return it back. It has effect only on plathforms with non-16-bit short, but now Python not supports they (Python is not well portable on exotic plathforms). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 15:22:42 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 20 Mar 2012 14:22:42 +0000 Subject: [issue9787] Release the TLS lock during allocations In-Reply-To: <1283839386.17.0.522591872287.issue9787@psf.upfronthosting.co.za> Message-ID: <1332253362.07.0.813020528823.issue9787@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: New patch, based on the cpython tip. ---------- Added file: http://bugs.python.org/file24959/tlspatch.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 15:23:15 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Mar 2012 14:23:15 +0000 Subject: [issue14249] unicodeobject.c: aliasing warnings In-Reply-To: <1331417993.32.0.291164156337.issue14249@psf.upfronthosting.co.za> Message-ID: <1332253395.79.0.9625191555.issue14249@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file24960/utf16_decoder_shift_2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 15:24:38 2012 From: report at bugs.python.org (VanL) Date: Tue, 20 Mar 2012 14:24:38 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1332253478.5.0.515687848868.issue14302@psf.upfronthosting.co.za> VanL added the comment: As ?ric mentioned, there are two proposals here: 1. Move the python exe 2. Change 'Scripts' to 'bin' As for #1, what about letting the location of the python binary be an install option: [ ] Put python.exe into binaries directory and add to PATH? And then make it unchecked by default in 3.3, checked by default in 3.4, and then remove the option for 3.5? As for #2, I don't see a lot of resistance; the issues seem to mostly be with #1. Could #2 move into 3.3? ---------- nosy: +VanL _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 15:25:41 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 20 Mar 2012 14:25:41 +0000 Subject: [issue9787] Release the TLS lock during allocations In-Reply-To: <1283839386.17.0.522591872287.issue9787@psf.upfronthosting.co.za> Message-ID: <1332253541.6.0.881851538799.issue9787@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: hm, for some reason this patch isn't viewable in side-by-side ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 15:27:30 2012 From: report at bugs.python.org (Matt Joiner) Date: Tue, 20 Mar 2012 14:27:30 +0000 Subject: [issue12684] profile does not dump stats on exception like cProfile does In-Reply-To: <1312335798.44.0.743453347572.issue12684@psf.upfronthosting.co.za> Message-ID: <1332253650.54.0.892471779163.issue12684@psf.upfronthosting.co.za> Changes by Matt Joiner : Added file: http://bugs.python.org/file24961/profiler-unhandled-exceptions.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 15:35:28 2012 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 20 Mar 2012 14:35:28 +0000 Subject: [issue14369] make __closure__ writable In-Reply-To: <1332179477.04.0.11685261564.issue14369@psf.upfronthosting.co.za> Message-ID: <1332254128.48.0.207664410351.issue14369@psf.upfronthosting.co.za> Yury Selivanov added the comment: > Please update the doc also. I think changing from 'Read-only' to 'Writable' in Doc/reference/datamodel.rst is enough. Updated in writable_closure_03.patch. Thanks. ---------- Added file: http://bugs.python.org/file24962/writable_closure_03.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 15:35:55 2012 From: report at bugs.python.org (David Andrzejewski) Date: Tue, 20 Mar 2012 14:35:55 +0000 Subject: [issue9720] zipfile writes incorrect local file header for large files in zip64 In-Reply-To: <1283216540.17.0.624049939978.issue9720@psf.upfronthosting.co.za> Message-ID: <1332254155.18.0.761267588658.issue9720@psf.upfronthosting.co.za> Changes by David Andrzejewski : ---------- nosy: +dandrzejewski _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 15:38:44 2012 From: report at bugs.python.org (Jason Killen) Date: Tue, 20 Mar 2012 14:38:44 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332254324.85.0.114243608743.issue14269@psf.upfronthosting.co.za> Jason Killen added the comment: I'm adding a patch for test_smtpd.py. This version includes the changes in my previous patch and adds sending HELO before the commands in the test. Works good for me. ---------- Added file: http://bugs.python.org/file24963/test_smtpd.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 15:40:19 2012 From: report at bugs.python.org (Matt Joiner) Date: Tue, 20 Mar 2012 14:40:19 +0000 Subject: [issue13694] asynchronous connect in asyncore.dispatcher does not set addr In-Reply-To: <1325470516.27.0.519900720027.issue13694@psf.upfronthosting.co.za> Message-ID: <1332254419.19.0.434876723634.issue13694@psf.upfronthosting.co.za> Matt Joiner added the comment: This patch is a shoo-in, can someone review and commit this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 15:43:52 2012 From: report at bugs.python.org (Matt Joiner) Date: Tue, 20 Mar 2012 14:43:52 +0000 Subject: [issue12684] profile does not dump stats on exception like cProfile does In-Reply-To: <1312335798.44.0.743453347572.issue12684@psf.upfronthosting.co.za> Message-ID: <1332254632.09.0.381210017625.issue12684@psf.upfronthosting.co.za> Matt Joiner added the comment: I attached a minimal patch that additionally tidies the exception handling for {cP,p}rofile.runctx. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 15:54:01 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Mar 2012 14:54:01 +0000 Subject: [issue14249] unicodeobject.c: aliasing warnings In-Reply-To: <1332253217.05.0.385982657457.issue14249@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > It has effect only on plathforms with non-16-bit short The problem is for 64-bit long: "long >> 32" returns the 32 higher bits (32..64), not 16 bits (32..48). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 16:08:41 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 20 Mar 2012 15:08:41 +0000 Subject: [issue14371] Add support for bzip2 compression to the zipfile module In-Reply-To: <1332243041.43.0.499117498297.issue14371@psf.upfronthosting.co.za> Message-ID: <1332256121.19.0.977591646011.issue14371@psf.upfronthosting.co.za> Changes by Martin v. L?wis : Added file: http://bugs.python.org/file24964/bzip2_in_zip_review.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 16:09:17 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 20 Mar 2012 15:09:17 +0000 Subject: [issue14310] Socket duplication for windows In-Reply-To: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> Message-ID: <1332256157.29.0.904504766285.issue14310@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: A new patch with fixes and documentation. And yes, socket.share() does in fact perform duplication, because socket.close() can be performed immediately afterwards. ---------- Added file: http://bugs.python.org/file24965/duplicate.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 16:11:26 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 20 Mar 2012 15:11:26 +0000 Subject: [issue14310] Socket duplication for windows In-Reply-To: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> Message-ID: <1332256286.5.0.352169768471.issue14310@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: hm, patch doesn't work, removing the [mq] section ---------- Added file: http://bugs.python.org/file24966/duplicate.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 16:12:07 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 20 Mar 2012 15:12:07 +0000 Subject: [issue14310] Socket duplication for windows In-Reply-To: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> Message-ID: <1332256327.68.0.693130081817.issue14310@psf.upfronthosting.co.za> Changes by Kristj?n Valur J?nsson : Removed file: http://bugs.python.org/file24966/duplicate.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 16:12:24 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 20 Mar 2012 15:12:24 +0000 Subject: [issue14310] Socket duplication for windows In-Reply-To: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> Message-ID: <1332256344.43.0.141620115884.issue14310@psf.upfronthosting.co.za> Changes by Kristj?n Valur J?nsson : ---------- Removed message: http://bugs.python.org/msg156418 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 16:23:47 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 20 Mar 2012 15:23:47 +0000 Subject: [issue14371] Add support for bzip2 compression to the zipfile module In-Reply-To: <1332243041.43.0.499117498297.issue14371@psf.upfronthosting.co.za> Message-ID: <1332257027.34.0.379977388758.issue14371@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Can you please submit a contributor form? http://python.org/psf/contrib/contrib-form/ http://python.org/psf/contrib/ ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 16:34:54 2012 From: report at bugs.python.org (donchen) Date: Tue, 20 Mar 2012 15:34:54 +0000 Subject: [issue14374] Compiling Python 2.7.2 on HP11i PA-RISC ends with segmentation fault in Python executable Message-ID: <1332257692.97.0.440321951611.issue14374@psf.upfronthosting.co.za> New submission from donchen : Hello, I am compiling Python2.7 on a HP11i PA-RISC machine and received a segmentation fault. Platform Information "uname -a" = HP-UX hpdev2 B.11.11 U 9000/800 2280874925 unlimited-user license Steps 1) uncompress Python tgz file 2) run "configure CC=aCC CXX=aCC" 3) make Result: Segmentation fault at library generation time. $> ranlib libpython2.7.a aCC -Ae -Wl,-E -Wl,+s -o python \ Modules/python.o \ libpython2.7.a -lnsl -lrt -ldld -lpthread -lm sh[3]: 15168 Bus error(coredump) *** Error exit code 138 Analysis: core file generated by Python executable $> file python python: PA-RISC2.0 shared executable dynamically linked -not stripped $> file libpython2.7.a libpython2.7.a: archive file -PA-RISC2.0 relocatable library $> strings core|more _______________________________________ From report at bugs.python.org Tue Mar 20 16:44:38 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 20 Mar 2012 15:44:38 +0000 Subject: [issue13694] asynchronous connect in asyncore.dispatcher does not set addr In-Reply-To: <1325470516.27.0.519900720027.issue13694@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 1c0058991740 by Giampaolo Rodola' in branch 'default': Fix issue #13694: asynchronous connect in asyncore.dispatcher does not set addr. http://hg.python.org/cpython/rev/1c0058991740 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 16:47:03 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 20 Mar 2012 15:47:03 +0000 Subject: [issue13694] asynchronous connect in asyncore.dispatcher does not set addr In-Reply-To: <1325470516.27.0.519900720027.issue13694@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 4e5ddde76dbe by Giampaolo Rodola' in branch '2.7': Fix issue #13694: asynchronous connect in asyncore.dispatcher does not set addr. http://hg.python.org/cpython/rev/4e5ddde76dbe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 16:50:05 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 20 Mar 2012 15:50:05 +0000 Subject: [issue13694] asynchronous connect in asyncore.dispatcher does not set addr In-Reply-To: <1325470516.27.0.519900720027.issue13694@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset a5add01e96be by Giampaolo Rodola' in branch '3.2': Fix issue #13694: asynchronous connect in asyncore.dispatcher does not set addr. http://hg.python.org/cpython/rev/a5add01e96be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 16:51:40 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 20 Mar 2012 15:51:40 +0000 Subject: [issue13694] asynchronous connect in asyncore.dispatcher does not set addr In-Reply-To: <1325470516.27.0.519900720027.issue13694@psf.upfronthosting.co.za> Message-ID: <1332258700.46.0.70692098973.issue13694@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: Done. Sorry for the delay. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 16:57:59 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 20 Mar 2012 15:57:59 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1332259079.26.0.47217215064.issue14302@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I'm still opposed to having the path manipulated by default, but Brian is working on a patch to edit the path with the default being off. If python.exe stays in the toplevel directory, it means that two entries have to be added to the path, making it even more messy and bloated than path editing already is. So I still think that it should be all in bin in the long term. Anybody opposed to changing scripts to bin please speak up; I'm happy to change it for the next alpha release, and let people object here in this issue (with the potential of reverting the change if there is too much opposition). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:08:52 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 20 Mar 2012 16:08:52 +0000 Subject: [issue10212] struct.unpack and cStringIO.StringIO don't support new buffer In-Reply-To: <1288175813.33.0.0310491559114.issue10212@psf.upfronthosting.co.za> Message-ID: <1332259732.15.0.0499125795991.issue10212@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Stefan, since you have been working on Memoryview, any opinions? ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:09:50 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 20 Mar 2012 16:09:50 +0000 Subject: [issue14371] Add support for bzip2 compression to the zipfile module In-Reply-To: <1332243041.43.0.499117498297.issue14371@psf.upfronthosting.co.za> Message-ID: <1332259790.84.0.598819407501.issue14371@psf.upfronthosting.co.za> Martin v. L?wis added the comment: The patch looks good. Can you also provide a test case? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:11:40 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 20 Mar 2012 16:11:40 +0000 Subject: [issue14374] Compiling Python 2.7.2 on HP11i PA-RISC ends with segmentation fault in Python executable In-Reply-To: <1332257692.97.0.440321951611.issue14374@psf.upfronthosting.co.za> Message-ID: <1332259900.36.0.286372788092.issue14374@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I don't think we will be able to help. Can you run the generated Python under a debugger and find out what happened? If not, just try disabling optimization in the compiler and see whether this helps. ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:12:52 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 20 Mar 2012 16:12:52 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332259972.44.0.245393674083.issue14269@psf.upfronthosting.co.za> R. David Murray added the comment: Hmm. I'm certain that QUIT shouldn't require HELO, and I wouldn't expect that NOOP would either. I just checked the RFC. The *only* command that requires HELO/EHLO is MAIL (and by implication RCPT, since it in turn requires MAIL). See http://tools.ietf.org/html/rfc5321#section-4.1.4. Sorry to keep bouncing this back. I appreciate the work you are doing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:18:13 2012 From: report at bugs.python.org (Joe Rumsey) Date: Tue, 20 Mar 2012 16:18:13 +0000 Subject: [issue14354] Crash in _ctypes_alloc_callback In-Reply-To: <1332017744.32.0.532482393485.issue14354@psf.upfronthosting.co.za> Message-ID: <1332260293.83.0.857774212537.issue14354@psf.upfronthosting.co.za> Joe Rumsey added the comment: It's maybe not directly relevant to fixing this, but I worked around it on the project where this came up by redefining dice as (c_int * 4) and col as (c_uint8 * 3) in the union, then using ctypes.cast to get those as pointers to the actual struct. That seems to work just fine for now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:27:41 2012 From: report at bugs.python.org (Jason Killen) Date: Tue, 20 Mar 2012 16:27:41 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332260861.53.0.0877042881125.issue14269@psf.upfronthosting.co.za> Jason Killen added the comment: smtpd.py does not require HELO before NOOP or QUIT. I added them to test_smtpd.py because I felt it made test_smtpd.py well written as opposed to doing the least the spec requires. That said I suppose I should have added QUITs to every test also if that's the way I really feel. I'll make the change and post a diff. I don't mind this going back and forth. It's my first time around and I'm glad I've been helpful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:47:21 2012 From: report at bugs.python.org (Jason Killen) Date: Tue, 20 Mar 2012 16:47:21 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332262041.97.0.452558256375.issue14269@psf.upfronthosting.co.za> Changes by Jason Killen : Removed file: http://bugs.python.org/file24948/smtpd_nogo.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:47:30 2012 From: report at bugs.python.org (Jason Killen) Date: Tue, 20 Mar 2012 16:47:30 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332262050.65.0.342788243907.issue14269@psf.upfronthosting.co.za> Changes by Jason Killen : Removed file: http://bugs.python.org/file24826/smtpd_nogo.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:47:40 2012 From: report at bugs.python.org (Jason Killen) Date: Tue, 20 Mar 2012 16:47:40 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332262060.85.0.900555546935.issue14269@psf.upfronthosting.co.za> Changes by Jason Killen : Removed file: http://bugs.python.org/file24949/test_smtpd_nogo.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:49:30 2012 From: report at bugs.python.org (Jason Killen) Date: Tue, 20 Mar 2012 16:49:30 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332262170.63.0.373183061869.issue14269@psf.upfronthosting.co.za> Changes by Jason Killen : Added file: http://bugs.python.org/file24968/smtpd.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:49:42 2012 From: report at bugs.python.org (Jason Killen) Date: Tue, 20 Mar 2012 16:49:42 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332262182.43.0.0865791028943.issue14269@psf.upfronthosting.co.za> Changes by Jason Killen : Removed file: http://bugs.python.org/file24968/smtpd.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:50:13 2012 From: report at bugs.python.org (Jason Killen) Date: Tue, 20 Mar 2012 16:50:13 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332262213.09.0.216395783855.issue14269@psf.upfronthosting.co.za> Changes by Jason Killen : Added file: http://bugs.python.org/file24969/smtpd.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:53:11 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 20 Mar 2012 16:53:11 +0000 Subject: [issue14375] Add socketserver.running property Message-ID: <1332262391.3.0.759761369976.issue14375@psf.upfronthosting.co.za> New submission from Giampaolo Rodola' : Patch in attachment adds a "running" property to figure out whether the server is running or not. Also it raises an exception in case the server has already been started or stopped. IMO such an event should be prevented beforehand as it signals an application error. Finally, __repr__ has been modified in order to reflect the current server status. ---------- files: socketserver.patch keywords: patch messages: 156432 nosy: giampaolo.rodola, pitrou priority: normal severity: normal stage: patch review status: open title: Add socketserver.running property versions: Python 3.3 Added file: http://bugs.python.org/file24970/socketserver.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:53:25 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Mar 2012 16:53:25 +0000 Subject: [issue14249] unicodeobject.c: aliasing warnings In-Reply-To: <1331417993.32.0.291164156337.issue14249@psf.upfronthosting.co.za> Message-ID: <1332262405.46.0.993079913895.issue14249@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: "(unsigned short)(long >> 32)" returns the 16 bits (32..48) if short is 16-bit. I agree that this variant is more strict and reliable (and this was my original version) and if you do not find it verbose and redundant, so be it. The difference will be noticeable only on a very exotic platform (with a 9-bit chars, for example), where the original code also will not work. Frankly, in this straightforward patch hacking is less than in the original code. I made a mistake with the microbenchmark. In fact, acceleration is not 5%, but 20-40%. ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = (" " * 1000).encode("utf-16be")' 'd(x)' ./python -m timeit -s 'import codecs; d = codecs.utf_16_be_decode; x = ("\u263A" * 1000).encode("utf-16be")' 'd(x)' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:53:31 2012 From: report at bugs.python.org (Jason Killen) Date: Tue, 20 Mar 2012 16:53:31 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332262411.62.0.337380479399.issue14269@psf.upfronthosting.co.za> Jason Killen added the comment: Ok I think this quote from the spec referenced pretty much sums it up. "The NOOP, HELP, EXPN, VRFY, and RSET commands can be used at any time during a session, or without previously initializing a session. SMTP servers SHOULD process these normally (that is, not return a 503 code) even if no EHLO command has yet been received; clients SHOULD open a session with EHLO before sending these commands." All in all either way fits the spec, choose your favorite. ---------- Added file: http://bugs.python.org/file24971/test_smtpd.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:54:54 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 20 Mar 2012 16:54:54 +0000 Subject: [issue14375] Add socketserver running property In-Reply-To: <1332262391.3.0.759761369976.issue14375@psf.upfronthosting.co.za> Message-ID: <1332262494.77.0.298935922585.issue14375@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- title: Add socketserver.running property -> Add socketserver running property _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 17:55:26 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 20 Mar 2012 16:55:26 +0000 Subject: [issue14375] Add socketserver running property In-Reply-To: <1332262391.3.0.759761369976.issue14375@psf.upfronthosting.co.za> Message-ID: <1332262526.01.0.329784320551.issue14375@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- keywords: +needs review -patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 18:02:53 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 20 Mar 2012 17:02:53 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332262973.7.0.806497033141.issue14269@psf.upfronthosting.co.za> R. David Murray added the comment: If you mean "either way in the test", that's true. But what we need to test is that the smtpd server we are providing matches the spec, which means that we need to confirm that it does *accept* QUIT, NOOP, etc without a previous HELO. Also testing that it accepts them after a HELO has been issued would be a bonus :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 18:03:23 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Mar 2012 17:03:23 +0000 Subject: [issue14371] Add support for bzip2 compression to the zipfile module In-Reply-To: <1332243041.43.0.499117498297.issue14371@psf.upfronthosting.co.za> Message-ID: <1332263003.69.0.754426491399.issue14371@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I am working on this. Should I add tests to test_zipfile.py or create new test_zipfile_bzip2.py? It would add a note that the bzip2 compression can understand not all programs (and do not understand the older versions of Python), but understands the Info-Unzip? My English is not enough for the documentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 18:13:23 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Mar 2012 17:13:23 +0000 Subject: [issue9720] zipfile writes incorrect local file header for large files in zip64 In-Reply-To: <1283216540.17.0.624049939978.issue9720@psf.upfronthosting.co.za> Message-ID: <1332263603.66.0.86360024904.issue9720@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 18:17:47 2012 From: report at bugs.python.org (Glenn Linderman) Date: Tue, 20 Mar 2012 17:17:47 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1332263867.4.0.903267123787.issue14302@psf.upfronthosting.co.za> Glenn Linderman added the comment: msg156410 sounds good to me... +1 If the conversion is optional in 3.3, that would seem to solve the problem; if BinaryDir is added, people can use that for 3.3; if people want to use software that hasn't migrated yet, they choose the default path of least resistance, leaving things where they are but with BinaryDir pointing there. PATH manipulations would be simpler, being a single PATH entry, so tying that to choosing the non-default option seems practical. This would allow people that don't need the compatibility with installers that don't understand the new structure, to continue to function, gives the installer people a test bed if they don't get things done by the time 3.3 ships, gives people that prefer the consistency across platform structures the ability to have it, as long as they don't need the intsaller... in short, one question at install time could allow us to have our cake and eat it too! Clearly the launcher may need some adjustments for this, but BinaryDir should suffice to help it do the right thing for both types of installation. ---------- nosy: +v+python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 18:23:16 2012 From: report at bugs.python.org (Jason Killen) Date: Tue, 20 Mar 2012 17:23:16 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332264196.76.0.577558308668.issue14269@psf.upfronthosting.co.za> Jason Killen added the comment: Yes, "either way" in the test. The server shouldn't expect them and the client can do it either way. I'm adding a patch that tests with and without HELO for those commands that can be sent either way. ---------- Added file: http://bugs.python.org/file24972/test_smtpd.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 18:24:21 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 20 Mar 2012 17:24:21 +0000 Subject: [issue11273] asyncore creates selec (or poll) on every iteration In-Reply-To: <1298303363.56.0.939143119689.issue11273@psf.upfronthosting.co.za> Message-ID: <1332264261.27.0.0869942249509.issue11273@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: I agree it would be great to do this, in fact I'm using a modified version of asyncore supporting register(), unregister() and modify() methods for file descriptors, and the performance benefits are enormous. On the other hand, it appears to be quite difficult to integrate such a massive change into asyncore in a fully backward compatible manner. At least, it's not clear to me how to do this without breaking code relying on map's parameter and asyncore.socket_map. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 18:42:41 2012 From: report at bugs.python.org (Alex Gaynor) Date: Tue, 20 Mar 2012 17:42:41 +0000 Subject: [issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers In-Reply-To: <1326709751.32.0.965094376059.issue13797@psf.upfronthosting.co.za> Message-ID: <1332265361.31.0.0800831973382.issue13797@psf.upfronthosting.co.za> Alex Gaynor added the comment: FWIW pypy has an __buffer__ method (used exclusively internally, AFAIK), which has semantics similar to your first proposal. ---------- nosy: +alex _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 18:44:17 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 20 Mar 2012 17:44:17 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332265457.81.0.754040650849.issue14269@psf.upfronthosting.co.za> R. David Murray added the comment: I think we're close. You new test 'test_HELO_RSET_syntax' should be named just 'test_HELO_RSET'. And could you please add tests for RCPT and DATA generating the 'no HELO' error? Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 18:52:09 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Mar 2012 17:52:09 +0000 Subject: [issue9720] zipfile writes incorrect local file header for large files in zip64 In-Reply-To: <1283216540.17.0.624049939978.issue9720@psf.upfronthosting.co.za> Message-ID: <1332265929.03.0.720712891353.issue9720@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I am afraid that the problem is more complicated. With the option allowZip64=True all files need to write with this extension, because size of local file header may change and there will be after compression just go back and rewrite it. Now it appears that the Zip64 option simply does not work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 19:15:01 2012 From: report at bugs.python.org (Jason Killen) Date: Tue, 20 Mar 2012 18:15:01 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332267301.09.0.442017756135.issue14269@psf.upfronthosting.co.za> Jason Killen added the comment: Removed '_syntax' apparently I fix that before but didn't regen the patch. Added tests for noHELO before some commands to test that failures happen as expected. ---------- Added file: http://bugs.python.org/file24973/test_smtpd.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 19:24:29 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 20 Mar 2012 18:24:29 +0000 Subject: [issue14375] Add socketserver running property In-Reply-To: <1332262391.3.0.759761369976.issue14375@psf.upfronthosting.co.za> Message-ID: <1332267869.0.0.256130442623.issue14375@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 19:26:42 2012 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Tue, 20 Mar 2012 18:26:42 +0000 Subject: [issue14154] reimplement the bigmem test memory watchdog as a subprocess In-Reply-To: <1332195128.2.0.352853523235.issue14154@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: Here's a patch flushing stdout explicitely (should not be necessay unless the watchdog crashes, but...). Also, redirect stderr to /dev/null. ---------- Added file: http://bugs.python.org/file24974/mem_watchdog_2.diff _______________________________________ Python tracker _______________________________________ -------------- next part -------------- diff --git a/Lib/test/memory_watchdog.py b/Lib/test/memory_watchdog.py new file mode 100644 --- /dev/null +++ b/Lib/test/memory_watchdog.py @@ -0,0 +1,28 @@ +"""Memory watchdog: periodically read the memory usage of the main test process +and print it out, until terminated.""" +# stdin should refer to the process' /proc//statm: we don't pass the +# process' PID to avoid a race condition in case of - unlikely - PID recycling. +# If the process crashes, reading from the /proc entry will fail with ESRCH. + + +import os +import sys +import time + + +try: + page_size = os.sysconf('SC_PAGESIZE') +except (ValueError, AttributeError): + try: + page_size = os.sysconf('SC_PAGE_SIZE') + except (ValueError, AttributeError): + page_size = 4096 + +while True: + sys.stdin.seek(0) + statm = sys.stdin.read() + data = int(statm.split()[5]) + sys.stdout.write(" ... process data size: {data:.1f}G\n" + .format(data=data * page_size / (1024 ** 3))) + sys.stdout.flush() + time.sleep(1) diff --git a/Lib/test/support.py b/Lib/test/support.py --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -36,20 +36,10 @@ multiprocessing = None try: - import faulthandler -except ImportError: - faulthandler = None - -try: import zlib except ImportError: zlib = None -try: - import fcntl -except ImportError: - fcntl = None - __all__ = [ "Error", "TestFailed", "ResourceDenied", "import_module", "verbose", "use_resources", "max_memuse", "record_original_stdout", @@ -1151,62 +1141,26 @@ def __init__(self): self.procfile = '/proc/{pid}/statm'.format(pid=os.getpid()) self.started = False - self.thread = None - try: - self.page_size = os.sysconf('SC_PAGESIZE') - except (ValueError, AttributeError): - try: - self.page_size = os.sysconf('SC_PAGE_SIZE') - except (ValueError, AttributeError): - self.page_size = 4096 - - def consumer(self, fd): - HEADER = "l" - header_size = struct.calcsize(HEADER) - try: - while True: - header = os.read(fd, header_size) - if len(header) < header_size: - # Pipe closed on other end - break - data_len, = struct.unpack(HEADER, header) - data = os.read(fd, data_len) - statm = data.decode('ascii') - data = int(statm.split()[5]) - print(" ... process data size: {data:.1f}G" - .format(data=data * self.page_size / (1024 ** 3))) - finally: - os.close(fd) def start(self): - if not faulthandler or not hasattr(faulthandler, '_file_watchdog'): - return try: - rfd = os.open(self.procfile, os.O_RDONLY) + f = open(self.procfile, 'r') except OSError as e: warnings.warn('/proc not available for stats: {}'.format(e), RuntimeWarning) sys.stderr.flush() return - pipe_fd, wfd = os.pipe() - # set the write end of the pipe non-blocking to avoid blocking the - # watchdog thread when the consumer doesn't drain the pipe fast enough - if fcntl: - flags = fcntl.fcntl(wfd, fcntl.F_GETFL) - fcntl.fcntl(wfd, fcntl.F_SETFL, flags|os.O_NONBLOCK) - # _file_watchdog() doesn't take the GIL in its child thread, and - # therefore collects statistics timely - faulthandler._file_watchdog(rfd, wfd, 1.0) + + watchdog_script = findfile("memory_watchdog.py") + self.mem_watchdog = subprocess.Popen([sys.executable, watchdog_script], + stdin=f, stderr=subprocess.DEVNULL) + f.close() self.started = True - self.thread = threading.Thread(target=self.consumer, args=(pipe_fd,)) - self.thread.daemon = True - self.thread.start() def stop(self): - if not self.started: - return - faulthandler._cancel_file_watchdog() - self.thread.join() + if self.started: + self.mem_watchdog.terminate() + self.mem_watchdog.wait() def bigmemtest(size, memuse, dry_run=True): @@ -1234,7 +1188,7 @@ "not enough memory: %.1fG minimum needed" % (size * memuse / (1024 ** 3))) - if real_max_memuse and verbose and faulthandler and threading: + if real_max_memuse and verbose: print() print(" ... expected peak memory use: {peak:.1f}G" .format(peak=size * memuse / (1024 ** 3))) diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -13,7 +13,6 @@ #ifdef WITH_THREAD # define FAULTHANDLER_LATER -# define FAULTHANDLER_WATCHDOG #endif #ifndef MS_WINDOWS @@ -66,20 +65,6 @@ } thread; #endif -#ifdef FAULTHANDLER_WATCHDOG -static struct { - int rfd; - int wfd; - PY_TIMEOUT_T period_us; /* period in microseconds */ - /* The main thread always holds this lock. It is only released when - faulthandler_watchdog() is interrupted before this thread exits, or at - Python exit. */ - PyThread_type_lock cancel_event; - /* released by child thread when joined */ - PyThread_type_lock running; -} watchdog; -#endif - #ifdef FAULTHANDLER_USER typedef struct { int enabled; @@ -604,139 +589,6 @@ } #endif /* FAULTHANDLER_LATER */ -#ifdef FAULTHANDLER_WATCHDOG - -static void -file_watchdog(void *unused) -{ - PyLockStatus st; - PY_TIMEOUT_T timeout; - -#define MAXDATA 1024 - char buf1[MAXDATA], buf2[MAXDATA]; - char *data = buf1, *old_data = buf2; - Py_ssize_t data_len, old_data_len = -1; - -#if defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK) - sigset_t set; - - /* we don't want to receive any signal */ - sigfillset(&set); - pthread_sigmask(SIG_SETMASK, &set, NULL); -#endif - - /* On first pass, feed file contents immediately */ - timeout = 0; - do { - st = PyThread_acquire_lock_timed(watchdog.cancel_event, - timeout, 0); - timeout = watchdog.period_us; - if (st == PY_LOCK_ACQUIRED) { - PyThread_release_lock(watchdog.cancel_event); - break; - } - /* Timeout => read and write data */ - assert(st == PY_LOCK_FAILURE); - - if (lseek(watchdog.rfd, 0, SEEK_SET) < 0) { - break; - } - data_len = read(watchdog.rfd, data, MAXDATA); - if (data_len < 0) { - break; - } - if (data_len != old_data_len || memcmp(data, old_data, data_len)) { - char *tdata; - Py_ssize_t tlen; - /* Contents changed, feed them to wfd */ - long x = (long) data_len; - /* We can't do anything if the consumer is too slow, just bail out */ - if (write(watchdog.wfd, (void *) &x, sizeof(x)) < sizeof(x)) - break; - if (write(watchdog.wfd, data, data_len) < data_len) - break; - tdata = data; - data = old_data; - old_data = tdata; - tlen = data_len; - data_len = old_data_len; - old_data_len = tlen; - } - } while (1); - - close(watchdog.rfd); - close(watchdog.wfd); - - /* The only way out */ - PyThread_release_lock(watchdog.running); -#undef MAXDATA -} - -static void -cancel_file_watchdog(void) -{ - /* Notify cancellation */ - PyThread_release_lock(watchdog.cancel_event); - - /* Wait for thread to join */ - PyThread_acquire_lock(watchdog.running, 1); - PyThread_release_lock(watchdog.running); - - /* The main thread should always hold the cancel_event lock */ - PyThread_acquire_lock(watchdog.cancel_event, 1); -} - -static PyObject* -faulthandler_file_watchdog(PyObject *self, - PyObject *args, PyObject *kwargs) -{ - static char *kwlist[] = {"rfd", "wfd", "period", NULL}; - double period; - PY_TIMEOUT_T period_us; - int rfd, wfd; - - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "iid:_file_watchdog", kwlist, - &rfd, &wfd, &period)) - return NULL; - if ((period * 1e6) >= (double) PY_TIMEOUT_MAX) { - PyErr_SetString(PyExc_OverflowError, "period value is too large"); - return NULL; - } - period_us = (PY_TIMEOUT_T)(period * 1e6); - if (period_us <= 0) { - PyErr_SetString(PyExc_ValueError, "period must be greater than 0"); - return NULL; - } - - /* Cancel previous thread, if running */ - cancel_file_watchdog(); - - watchdog.rfd = rfd; - watchdog.wfd = wfd; - watchdog.period_us = period_us; - - /* Arm these locks to serve as events when released */ - PyThread_acquire_lock(watchdog.running, 1); - - if (PyThread_start_new_thread(file_watchdog, NULL) == -1) { - PyThread_release_lock(watchdog.running); - PyErr_SetString(PyExc_RuntimeError, - "unable to start file watchdog thread"); - return NULL; - } - - Py_RETURN_NONE; -} - -static PyObject* -faulthandler_cancel_file_watchdog(PyObject *self) -{ - cancel_file_watchdog(); - Py_RETURN_NONE; -} -#endif /* FAULTHANDLER_WATCHDOG */ - #ifdef FAULTHANDLER_USER static int faulthandler_register(int signum, int chain, _Py_sighandler_t *p_previous) @@ -1126,18 +978,6 @@ "to dump_tracebacks_later().")}, #endif -#ifdef FAULTHANDLER_WATCHDOG - {"_file_watchdog", - (PyCFunction)faulthandler_file_watchdog, METH_VARARGS|METH_KEYWORDS, - PyDoc_STR("_file_watchdog(rfd, wfd, period):\n" - "feed the contents of 'rfd' to 'wfd', if changed,\n" - "every 'period seconds'.")}, - {"_cancel_file_watchdog", - (PyCFunction)faulthandler_cancel_file_watchdog, METH_NOARGS, - PyDoc_STR("_cancel_file_watchdog():\ncancel the previous call " - "to _file_watchdog().")}, -#endif - #ifdef FAULTHANDLER_USER {"register", (PyCFunction)faulthandler_register_py, METH_VARARGS|METH_KEYWORDS, @@ -1263,16 +1103,6 @@ } PyThread_acquire_lock(thread.cancel_event, 1); #endif -#ifdef FAULTHANDLER_WATCHDOG - watchdog.cancel_event = PyThread_allocate_lock(); - watchdog.running = PyThread_allocate_lock(); - if (!watchdog.cancel_event || !watchdog.running) { - PyErr_SetString(PyExc_RuntimeError, - "could not allocate locks for faulthandler"); - return -1; - } - PyThread_acquire_lock(watchdog.cancel_event, 1); -#endif return faulthandler_env_options(); } @@ -1297,20 +1127,6 @@ } #endif -#ifdef FAULTHANDLER_WATCHDOG - /* file watchdog */ - if (watchdog.cancel_event) { - cancel_file_watchdog(); - PyThread_release_lock(watchdog.cancel_event); - PyThread_free_lock(watchdog.cancel_event); - watchdog.cancel_event = NULL; - } - if (watchdog.running) { - PyThread_free_lock(watchdog.running); - watchdog.running = NULL; - } -#endif - #ifdef FAULTHANDLER_USER /* user */ if (user_signals != NULL) { From report at bugs.python.org Tue Mar 20 19:30:15 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 20 Mar 2012 18:30:15 +0000 Subject: [issue14373] C implementation of functools.lru_cache In-Reply-To: <1332250846.11.0.753199667334.issue14373@psf.upfronthosting.co.za> Message-ID: <1332268215.3.0.0242185954198.issue14373@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 19:37:28 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Tue, 20 Mar 2012 18:37:28 +0000 Subject: [issue14371] Add support for bzip2 compression to the zipfile module In-Reply-To: <1332243041.43.0.499117498297.issue14371@psf.upfronthosting.co.za> Message-ID: <1332268648.72.0.747263222196.issue14371@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Please add it to test_zipfile. As for the documentation, I propose the wording "bzip2 compression was added to the zip file format in 2001. However, even more recent tools (including older Python releases) may not support it, causing either refusal to process the zip file altogether, or faiilure to extract individual files." I'm not a native speaker of English, either. Feel free to put things through Google translate; some native speaker will pick up the text and correct it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 19:56:38 2012 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Tue, 20 Mar 2012 18:56:38 +0000 Subject: [issue14229] On KeyboardInterrupt, the exit code should mirror the signal number In-Reply-To: <1331420636.67.0.0465453518787.issue14229@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: I agree with Martin: we really do handle the signal, and as such, the only way to convey the relevant information to the parent as to which signal caused the exit would be to re-raise it, which is really ugly and probably not a good idea. Processes that want default behavior upon signal reception (so that they can use WEXITSTATUS(), WCOREDUMP() and friends) can always use SIG_DFL: $ python -c "import subprocess, signal, time; p = subprocess.Popen(['python', '-c', 'import signal; signal.signal(signal.SIGINT, signal.SIG_DFL); input()']); time.sleep(1); p.send_signal(signal.SIGINT); print(p.wait())" -2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 20:05:55 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 20 Mar 2012 19:05:55 +0000 Subject: [issue14229] On KeyboardInterrupt, the exit code should mirror the signal number In-Reply-To: Message-ID: <1332270077.3440.7.camel@localhost.localdomain> Antoine Pitrou added the comment: > I agree with Martin: we really do handle the signal, and as such, the > only way to convey the relevant information to the parent as to which > signal caused the exit would be to re-raise it, which is really ugly > and probably not a good idea. Why would it be ugly? faulthandler does exactly that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 20:12:51 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 20 Mar 2012 19:12:51 +0000 Subject: [issue14370] list.extend() called on an iterator of the list itself leads to an infinite loop In-Reply-To: <1332218233.23.0.940342826692.issue14370@psf.upfronthosting.co.za> Message-ID: <1332270771.38.0.825728506997.issue14370@psf.upfronthosting.co.za> Raymond Hettinger added the comment: This a feature, not a bug. Lists are allowed to mutate during iteration and there are valid use cases for doing so (adding pending tasks, etc.) # Demonstrate list mutation during iteration # Infinite loop that overflows memory s = [None] for x in s: s.append(x) ---------- nosy: +rhettinger resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 20:14:14 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 20 Mar 2012 19:14:14 +0000 Subject: [issue14373] C implementation of functools.lru_cache In-Reply-To: <1332250846.11.0.753199667334.issue14373@psf.upfronthosting.co.za> Message-ID: <1332270854.97.0.0881441906995.issue14373@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Thank you for working on this. I look forward to reviewing it. ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 20:26:58 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 20 Mar 2012 19:26:58 +0000 Subject: [issue10576] Add a progress callback to gcmodule In-Reply-To: <1291033990.01.0.373880351287.issue10576@psf.upfronthosting.co.za> Message-ID: <1332271618.53.0.0714942313237.issue10576@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Hi! Michael Foord reminded me of this little gem. I'm getting this started again, hopefully for inclusion in 3.3 ---------- nosy: +michael.foord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 20:52:22 2012 From: report at bugs.python.org (donchen) Date: Tue, 20 Mar 2012 19:52:22 +0000 Subject: [issue14374] Compiling Python 2.7.2 on HP11i PA-RISC ends with segmentation fault in Python executable In-Reply-To: <1332257692.97.0.440321951611.issue14374@psf.upfronthosting.co.za> Message-ID: donchen added the comment: Taking away -O options in makefile still generates the crash. I have attached the stack below. Can you inform me what python executable is doing at this time? From the make I see it is linking python so why would it be running? Thanks $ gdb python core HP gdb 5.7 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00 and target hppa1.1-hp-hpux11.00. Copyright 1986 - 2001 Free Software Foundation, Inc. Hewlett-Packard Wildebeest 5.7 (based on GDB) is covered by the GNU General Public License. Type "show copying" to see the conditions to change it and/or distribute copies. Type "show warranty" for warranty/support. .. Core was generated by `python'. Program terminated with signal 10, Bus error. #0 0x12c674 in sre_match (state=0x4010b4f0, pattern=0x0) at ./Modules/_sre.c:846 846 switch (*ctx->pattern++) { (gdb) where #0 0x12c674 in sre_match (state=0x4010b4f0, pattern=0x0) at ./Modules/_sre.c:846 #1 0x13023c in pattern_match (self=0xaad83cc4, args=0xaad83cc4, kw=0x4013ac25) at ./Modules/_sre.c:1888 #2 0xa87d0 in PyCFunction_Call (func=0x40105c00, arg=0x4018a2bc, kw=0x4013acd1) at Objects/methodobject.c:85 #3 0x5274c in call_function (pp_stack=0x4014de90, oparg=1074097960) at Python/ceval.c:4013 #4 0x4fb9c in PyEval_EvalFrameEx (f=0x4018a128, throwflag=0) at Python/ceval.c:2666 #5 0x50d30 in PyEval_EvalCodeEx (co=0x401486f0, globals=0x0, locals=0x40056f28, args=0x401481fc, argcount=2, kws=0x401486bc, kwcount=0, defs=0x40109d5c, defcount=1, closure=0x0) at Python/ceval.c:3253 #6 0x52974 in fast_function (func=0x0, pp_stack=0x40148398, n=384, na=1074152536, nk=0) at Python/ceval.c:4109 #7 0x52824 in call_function (pp_stack=0x0, oparg=0) at Python/ceval.c:4034 #8 0x4fb9c in PyEval_EvalFrameEx (f=0x40148560, throwflag=0) at Python/ceval.c:2666 #9 0x52a94 in fast_function (func=0x0, pp_stack=0x40148390, n=1075032760, na=1075086160, nk=0) at Python/ceval.c:4099 #10 0x52824 in call_function (pp_stack=0x4010c260, oparg=1074650600) at Python/ceval.c:4034 #11 0x4fb9c in PyEval_EvalFrameEx (f=0x40148218, throwflag=0) at Python/ceval.c:2666 #12 0x50d30 in PyEval_EvalCodeEx (co=0x40068530, globals=0x40014258, locals=0x8, args=0x401424b4, argcount=0, kws=0x401481f0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253 #13 0x52974 in fast_function (func=0x785d4ea0, pp_stack=0x785cc6e0, n=344, na=1074152536, nk=0) at Python/ceval.c:4109 #14 0x52824 in call_function (pp_stack=0x0, oparg=1075062292) at Python/ceval.c:4034 #15 0x4fb9c in PyEval_EvalFrameEx (f=0x401480b0, throwflag=0) at Python/ceval.c:2666 #16 0x52a94 in fast_function (func=0x785d4ea0, pp_stack=0x0, n=344, na=1074152536, nk=0) at Python/ceval.c:4099 #17 0x52824 in call_function (pp_stack=0x4, oparg=1074364576) at Python/ceval.c:4034 #18 0x4fb9c in PyEval_EvalFrameEx (f=0x401424d0, throwflag=0) at Python/ceval.c:2666 #19 0x52a94 in fast_function (func=0x785d4ea0, pp_stack=0xffffffff, n=364, na=1074152536, nk=0) at Python/ceval.c:4099 ---Type to continue, or q to quit--- #20 0x52824 in call_function (pp_stack=0x0, oparg=1075028952) at Python/ceval.c:4034 #21 0x4fb9c in PyEval_EvalFrameEx (f=0x40147f30, throwflag=0) at Python/ceval.c:2666 #22 0x52a94 in fast_function (func=0x785d4ea0, pp_stack=0x4013a3d8, n=356, na=1074152536, nk=0) at Python/ceval.c:4099 #23 0x52824 in call_function (pp_stack=0x4, oparg=1074364576) at Python/ceval.c:4034 #24 0x4fb9c in PyEval_EvalFrameEx (f=0x4013a830, throwflag=0) at Python/ceval.c:2666 #25 0x52a94 in fast_function (func=0x1208e051, pp_stack=0xc941ef15, n=1074568539, na=1074898960, nk=0) at Python/ceval.c:4099 #26 0x52824 in call_function (pp_stack=0x40137970, oparg=1073899304) at Python/ceval.c:4034 #27 0x4fb9c in PyEval_EvalFrameEx (f=0x4011a6d8, throwflag=0) at Python/ceval.c:2666 #28 0x52a94 in fast_function (func=0x0, pp_stack=0x400c2148, n=1074565502, na=1074536776, nk=0) at Python/ceval.c:4099 #29 0x52824 in call_function (pp_stack=0x4, oparg=1074364896) at Python/ceval.c:4034 #30 0x4fb9c in PyEval_EvalFrameEx (f=0x400c2010, throwflag=0) at Python/ceval.c:2666 #31 0x50d30 in PyEval_EvalCodeEx (co=0x14, globals=0x0, locals=0x4867e2c0, args=0x4000f144, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253 #32 0x4c04c in PyEval_EvalCode (co=0x785c3dfe, globals=0x0, locals=0x785d4d40) at Python/ceval.c:667 #33 0x636ec in PyImport_ExecCodeModuleEx (name=0x785cb460 "", co=0xeccd053d, pathname=0x400242a8 "@\bP") at Python/import.c:681 #34 0x63fa0 in load_source_module ( name=0x400101d8 " Do not enter it in sys.modules.\nThe module name must include the full package name, if any.", pathname=0x785e0f48 "", fp=0x785e0f44) at Python/import.c:1021 #35 0x64e80 in load_module (name=0x0, fp=0x0, pathname=0x0, type=0, loader=0x0) at Python/import.c:1825 #36 0x66388 in import_submodule (mod=0x400101d8, subname=0x1 "", fullname=0x400611d8 "") at Python/import.c:2596 #37 0x65d18 in load_next (mod=0x785d4ea0, altmod=0x1, p_name=0x4, buf=0x40064458 "", p_buflen=0x785e0f40) at Python/import.c:2416 #38 0x65558 in import_module_level (name=0x0, globals=0x400966f0, locals=0x400966f0, fromlist=0x40092378, level=0) at Python/import.c:2137 ---Type to continue, or q to quit--- #39 0x657ac in PyImport_ImportModuleLevel (name=0x40091de0 "", globals=0x0, locals=0x4003d1f8, fromlist=0x4003dcf8, level=0) at Python/import.c:2189 #40 0xf9128 in builtin___import__ (self=0x785e0d88, args=0x40056f28, kwds=0x400611d8) at Python/bltinmodule.c:49 #41 0xa87d0 in PyCFunction_Call (func=0x400101d8, arg=0x1, kw=0x400611d8) at Objects/methodobject.c:85 #42 0x319dc in PyObject_Call (func=0x0, arg=0x0, kw=0x0) at Objects/abstract.c:2529 #43 0x31a6c in call_function_tail (callable=0x40083b48, args=0x6) at Objects/abstract.c:2561 #44 0x31b40 in PyObject_CallFunction (callable=0x40083b48, format=0x4000ed79 "OOOOi") at Objects/abstract.c:2585 #45 0x669b0 in PyImport_Import (module_name=0x4000eb68) at Python/import.c:2774 #46 0x653f4 in PyImport_ImportModule (name=0x4007ad20 "") at Python/import.c:2048 #47 0x69f20 in initsite () at Python/pythonrun.c:714 #48 0x699b4 in Py_InitializeEx (install_sigs=0) at Python/pythonrun.c:258 #49 0x69a44 in Py_Initialize () at Python/pythonrun.c:370 #50 0x2c944 in Py_Main (argc=0, argv=0x0) at Modules/main.c:505 #51 0x2b7f8 in main (argc=0, argv=0x0) at ./Modules/python.c:23 Current language: auto; currently c++ (gdb) print ctx $1 = (struct sre_match_context *) 0x0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 20:58:34 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 20 Mar 2012 19:58:34 +0000 Subject: [issue14369] make __closure__ writable In-Reply-To: <1332179477.04.0.11685261564.issue14369@psf.upfronthosting.co.za> Message-ID: <1332273514.67.0.307554132917.issue14369@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 20:59:29 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 20 Mar 2012 19:59:29 +0000 Subject: [issue14369] make __closure__ writable In-Reply-To: <1332179477.04.0.11685261564.issue14369@psf.upfronthosting.co.za> Message-ID: <1332273569.79.0.693864291292.issue14369@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 21:03:04 2012 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 20 Mar 2012 20:03:04 +0000 Subject: [issue14369] make __closure__ writable In-Reply-To: <1332179477.04.0.11685261564.issue14369@psf.upfronthosting.co.za> Message-ID: <1332273784.96.0.478315533868.issue14369@psf.upfronthosting.co.za> Yury Selivanov added the comment: Updated patch per Benjamin's review. See writable_closure_04.patch. ---------- Added file: http://bugs.python.org/file24975/writable_closure_04.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 21:05:02 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 20 Mar 2012 20:05:02 +0000 Subject: [issue10576] Add a progress callback to gcmodule In-Reply-To: <1291033990.01.0.373880351287.issue10576@psf.upfronthosting.co.za> Message-ID: <1332273902.15.0.80143757382.issue10576@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Hm, actually it wasn't Michael, but Martin. No matter! Here is a proposed patch, as promised without all the bells and whistles, in particular, there is no feature to cancel the garbage collection. Can we get this into 3.3? ---------- Added file: http://bugs.python.org/file24976/gccallback4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 21:06:29 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 20 Mar 2012 20:06:29 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 052779d34945 by Larry Hastings in branch 'default': Issue #14328: Add keyword-only parameters to PyArg_ParseTupleAndKeywords. http://hg.python.org/cpython/rev/052779d34945 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 21:08:02 2012 From: report at bugs.python.org (Larry Hastings) Date: Tue, 20 Mar 2012 20:08:02 +0000 Subject: [issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords In-Reply-To: <1331848158.95.0.138934192848.issue14328@psf.upfronthosting.co.za> Message-ID: <1332274082.53.0.284367729537.issue14328@psf.upfronthosting.co.za> Changes by Larry Hastings : ---------- keywords: -patch resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 21:10:04 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 20 Mar 2012 20:10:04 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: <1332274204.54.0.0629636393164.issue3573@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 21:16:53 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 20 Mar 2012 20:16:53 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 241c33b6cb95 by R David Murray in branch 'default': #14269: smtpd now conforms to the RFC and requires HELO before MAIL. http://hg.python.org/cpython/rev/241c33b6cb95 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 21:23:51 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 20 Mar 2012 20:23:51 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332275031.17.0.0799562341975.issue14269@psf.upfronthosting.co.za> R. David Murray added the comment: I tweaked a couple more of your test method names, but otherwise used your patch as is. Welcome to the ACKS file :) If you haven't already submitted a contributor agreement it would be great if you did. I'm hoping you'll want to continue making contributions. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 21:33:47 2012 From: report at bugs.python.org (John Ehresman) Date: Tue, 20 Mar 2012 20:33:47 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1332275627.91.0.0431798787528.issue14302@psf.upfronthosting.co.za> John Ehresman added the comment: Just a few thoughts from someone who uses Windows and who'd need to change code for this change: 1) I don't know if waiting to 3.5 is needed. I can make the change to look in the bin directory fairly quickly. 2) Is it safe to add scripts to the PATH? I'd worry about something in there that's named so it clashes with a standard program such as notepad or chkdsk or more likely something else from another 3rd party program that is installed. 3) A python3.3.exe command should be added so that if someone installs both 3.3 and an eventual 3.4, he or she can run both. 4) The uninstaller should remove the PATH entry if at all possible. Another alternative is to provide a Start menu item for a "Python 3.4 Command Prompt" that would set up the environment that's similar to the Visual Studio 2008 Command Prompt. ---------- nosy: +jpe _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 21:34:54 2012 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Tue, 20 Mar 2012 20:34:54 +0000 Subject: [issue14229] On KeyboardInterrupt, the exit code should mirror the signal number In-Reply-To: <1332270077.3440.7.camel@localhost.localdomain> Message-ID: Charles-Fran?ois Natali added the comment: >> I agree with Martin: we really do handle the signal, and as such, the >> only way to convey the relevant information to the parent as to which >> signal caused the exit would be to re-raise it, which is really ugly >> and probably not a good idea. > > Why would it be ugly? faulthandler does exactly that. Because calling exit() is the right way to end a process. For example, it does the following: - atexit()-registered finalizers are run - stdio streams are flushed and closed (although it could probably done by the interpreter) - files created with tmpfile() are removed (on POSIX systems, they're removed after creation, but you can imagine an implementation where they would need to be explicitely removed upon close) This would not be performed if the signal is raised. Since the user has the possibility of restoring default signal handlers with SIG_DFL, I think we could stcik with the current behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 21:35:05 2012 From: report at bugs.python.org (Jason Killen) Date: Tue, 20 Mar 2012 20:35:05 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332275705.07.0.846650206664.issue14269@psf.upfronthosting.co.za> Jason Killen added the comment: Thanks and thanks for all you help. My method names are known to need some tweaking. Where is the agreement I need to sign? I looked around the documentation stuff and didn't see it. I'd like to continue contributing just have to find another bug I know how to fix. One last thing, what is the ACKS file? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 21:42:18 2012 From: report at bugs.python.org (Brian Curtin) Date: Tue, 20 Mar 2012 20:42:18 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1332276138.54.0.436558583448.issue14302@psf.upfronthosting.co.za> Brian Curtin added the comment: On 2 and 4, see #3561 for that discussion. A short answer would be that we're consenting adults. Additionally, the current Path-adding installer handles uninstallation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 21:49:18 2012 From: report at bugs.python.org (R. David Murray) Date: Tue, 20 Mar 2012 20:49:18 +0000 Subject: [issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO In-Reply-To: <1331589516.59.0.0412719360894.issue14269@psf.upfronthosting.co.za> Message-ID: <1332276558.99.0.752271056299.issue14269@psf.upfronthosting.co.za> R. David Murray added the comment: Contributor agreement is here: http://python.org/psf/contrib/contrib-form-python/ ACKS file ships in every Python source tarball (not sure if goes out in the binary ones). Here it is in the repository: http://hg.python.org/cpython/file/default/Misc/ACKS ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 21:52:57 2012 From: report at bugs.python.org (John Ehresman) Date: Tue, 20 Mar 2012 20:52:57 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1332276777.52.0.740113092463.issue14302@psf.upfronthosting.co.za> John Ehresman added the comment: Does this mean that the PATH entry won't be removed on uninstall? I can't tell from reading #3561, though I may have missed something. My worries are about the developer who doesn't know what the PATH is and would find it difficult to diagnose any problems caused by the new entries on the path -- problems that may affect things other than python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 21:54:12 2012 From: report at bugs.python.org (Brian Curtin) Date: Tue, 20 Mar 2012 20:54:12 +0000 Subject: [issue14302] Move python.exe to bin/ In-Reply-To: <1331742575.57.0.919941207524.issue14302@psf.upfronthosting.co.za> Message-ID: <1332276852.16.0.348463559793.issue14302@psf.upfronthosting.co.za> Brian Curtin added the comment: > Additionally, the current Path-adding installer handles uninstallation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 22:04:55 2012 From: report at bugs.python.org (Roundup Robot) Date: Tue, 20 Mar 2012 21:04:55 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 01404295138d by Andrew Svetlov in branch 'default': #3573: idle now doesn't hungs if launched as: idle -e http://hg.python.org/cpython/rev/01404295138d ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 22:06:10 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 20 Mar 2012 21:06:10 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: <1332277570.81.0.162508455157.issue3573@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Fixed. Thanks to Guilherme Polo and Roger Serwy. ---------- assignee: -> asvetlov resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 22:06:26 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 20 Mar 2012 21:06:26 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: <1332277586.6.0.722874280289.issue3573@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 22:07:01 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 20 Mar 2012 21:07:01 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: <1332277621.98.0.41688499754.issue3573@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- stage: patch review -> committed/rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 22:31:21 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 20 Mar 2012 21:31:21 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: <1332279081.57.0.112044482495.issue3573@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- versions: +Python 3.3 -Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 22:36:16 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 20 Mar 2012 21:36:16 +0000 Subject: [issue13495] IDLE: Regressions - Two ColorDelegator instances loaded and -e no longer edits new files. In-Reply-To: <1322510218.36.0.927250562508.issue13495@psf.upfronthosting.co.za> Message-ID: <1332279376.38.0.933682995641.issue13495@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 22:59:43 2012 From: report at bugs.python.org (Andreas Klauer) Date: Tue, 20 Mar 2012 21:59:43 +0000 Subject: [issue10142] Support for SEEK_HOLE/SEEK_DATA In-Reply-To: <1287458119.59.0.0883351132174.issue10142@psf.upfronthosting.co.za> Message-ID: <1332280783.06.0.991652241657.issue10142@psf.upfronthosting.co.za> Andreas Klauer added the comment: > ZFS supports SEEK_HOLE/SEEK_DATA in "lseek()" syscall. > The feature has patches available too for Linux, but never integrated in mainline kernel, AFAIK. > it is difficult to write a testcase when I can only test under a system with ZFS I don't know if this could help, but recently Linux did get some commits regarding SEEK_HOLE/SEEK_DATA ( e.g. http://git.kernel.org/linus/982d816581eeeacfe5b2b7c6d47d13a157616eff ). I haven't tested whether it works / which filesystems support it. Grepping the Linux sources for SEEK_HOLES gives me several hits, e.g. for btrfs. ---------- nosy: +Andreas.Klauer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 23:07:03 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Tue, 20 Mar 2012 22:07:03 +0000 Subject: [issue14356] Distutils2 ignores site-local configuration In-Reply-To: <1332051035.41.0.153841644882.issue14356@psf.upfronthosting.co.za> Message-ID: <1332281223.86.0.588059608661.issue14356@psf.upfronthosting.co.za> Alex Gr?nholm added the comment: >> Ignoring site-local configuration >What do you mean? sitecustomize is executed, for example. Whatever, but it only looks for the paths in the included sysconfig.cfg. If the system Python uses a different sort of path in site.py, distutils2 won't use it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 23:08:30 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Mar 2012 22:08:30 +0000 Subject: [issue14154] reimplement the bigmem test memory watchdog as a subprocess In-Reply-To: Message-ID: STINNER Victor added the comment: mem_watchdog_2.diff looks good to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Mar 20 23:24:58 2012 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Mar 2012 22:24:58 +0000 Subject: [issue10142] Support for SEEK_HOLE/SEEK_DATA In-Reply-To: <1287458119.59.0.0883351132174.issue10142@psf.upfronthosting.co.za> Message-ID: <1332282298.48.0.165132229872.issue10142@psf.upfronthosting.co.za> STINNER Victor added the comment: + /* SEEK_SET and SEEK_CUR are special because we could seek inside the + buffer. Other whence values must be managed without this optimization. + Some Operating Systems can provide additional values, like + SEEK_HOLE/SEEK_DATA. */ + if (((whence == 0) || (whence == 1)) && self->readable) { Why not using SEEK_SET and SEEK_CUR instead of 0 and 1 here? + .. versionadded:: 3.2 This is now outdated, it should be 3.3. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 01:08:00 2012 From: report at bugs.python.org (Gareth Rees) Date: Wed, 21 Mar 2012 00:08:00 +0000 Subject: [issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int" Message-ID: <1332288480.19.0.200013792885.issue14376@psf.upfronthosting.co.za> New submission from Gareth Rees : The documentation for sys.exit says, "The optional argument arg can be an integer giving the exit status (defaulting to zero), or another type of object". However, the arguments that are treated as exit statuses are actually "subtypes of int". So, a bool argument is fine: $ python2.7 -c "import sys; sys.exit(False)"; echo $? 0 But a long argument is not: $ python2.7 -c "import sys; sys.exit(long(0))"; echo $? 0 1 The latter behaviour can be surprising since functions like os.spawnv may return the exit status of the executed process as a long on some platforms, so that if you try to pass on the exit code via code = os.spawnv(...) sys.exit(code) you may get a mysterious surprise: code is 0 but exit code is 1. It would be simple to change line 1112 of pythonrun.c from if (PyInt_Check(value)) to if (PyInt_Check(value) || PyLong_Check(value)) (This issue is not present in Python 3 because there is no longer a distinction between int and long.) ---------- components: Library (Lib) messages: 156470 nosy: Gareth.Rees priority: normal severity: normal status: open title: sys.exit documents argument as "integer" but actually requires "subtype of int" type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 02:31:46 2012 From: report at bugs.python.org (Jim Jewett) Date: Wed, 21 Mar 2012 01:31:46 +0000 Subject: [issue10576] Add a progress callback to gcmodule In-Reply-To: <1291033990.01.0.373880351287.issue10576@psf.upfronthosting.co.za> Message-ID: <1332293506.02.0.37958475367.issue10576@psf.upfronthosting.co.za> Jim Jewett added the comment: gccallback4a.patch is a few changes to gccallback4.patch. Most are just spelling or grammar in comments, but I did modify the test case so that the Uncollectable loop had *multiple* objects with __del__ methods. ---------- nosy: +Jim.Jewett Added file: http://bugs.python.org/file24977/gccallback4a.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 03:05:53 2012 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 21 Mar 2012 02:05:53 +0000 Subject: [issue14369] make __closure__ writable In-Reply-To: <1332179477.04.0.11685261564.issue14369@psf.upfronthosting.co.za> Message-ID: <1332295553.66.0.17394506303.issue14369@psf.upfronthosting.co.za> Changes by Yury Selivanov : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 05:46:26 2012 From: report at bugs.python.org (Ariel Poliak) Date: Wed, 21 Mar 2012 04:46:26 +0000 Subject: [issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing Message-ID: <1332305186.87.0.484792091693.issue14377@psf.upfronthosting.co.za> New submission from Ariel Poliak : As it stands in Hg, when the write() method of an xml.etree.ElementTree object is called, and a tag within the XML tree has no child tags or defined text, the tag is written using the short notation "". Whether or not the short notation is used instead of the long "" notation is used should be configurable by the programmer, without having to resort to serializing the XML into a string and then doing replace() on said string. The attached patch adds an optional parameter to the write() method that provides this choice. If the 'use_long_xml_tags' parameter is not set (or otherwise evaluates to the boolean False), the current behavior applies. If this parameter evaluates to the boolean True, long tags are used when producing XML output. ---------- components: Library (Lib) files: ElementTree_py-force_long_tags.patch keywords: patch messages: 156472 nosy: adpoliak priority: normal severity: normal status: open title: Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing type: enhancement versions: Python 3.2 Added file: http://bugs.python.org/file24978/ElementTree_py-force_long_tags.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 06:42:40 2012 From: report at bugs.python.org (Eric Snow) Date: Wed, 21 Mar 2012 05:42:40 +0000 Subject: [issue13959] Re-implement parts of imp in pure Python In-Reply-To: <1328575890.24.0.0737633689073.issue13959@psf.upfronthosting.co.za> Message-ID: <1332308560.69.0.0409106438275.issue13959@psf.upfronthosting.co.za> Eric Snow added the comment: Here's an incomplete (though essentially test-passing) patch that flips more of imp into importlib. It builds on Brett's patch. The gist is that imp.py is a minimal wrapper around importlib, which uses _imp directly. Ultimately the things implemented in Lib/importlib/_bootstrap.py should be yanked out of Python/import.c (and Python/dynload_*.c). I expect that this will wait for the bootstrap merge (#2377) to land. ---------- Added file: http://bugs.python.org/file24979/imp.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 06:43:32 2012 From: report at bugs.python.org (Eric Snow) Date: Wed, 21 Mar 2012 05:43:32 +0000 Subject: [issue13959] Re-implement parts of imp in pure Python In-Reply-To: <1328575890.24.0.0737633689073.issue13959@psf.upfronthosting.co.za> Message-ID: <1332308612.07.0.514355747283.issue13959@psf.upfronthosting.co.za> Eric Snow added the comment: Here's a listing of the places where import-ish modules are used in CPython. Once things all the import stuff currently on the table is wrapped up, I'll probably work on switching things over to using importlib directly. ---------- Added file: http://bugs.python.org/file24980/use_of_imp.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 07:00:30 2012 From: report at bugs.python.org (Eric Snow) Date: Wed, 21 Mar 2012 06:00:30 +0000 Subject: [issue13959] Re-implement parts of imp in pure Python In-Reply-To: <1328575890.24.0.0737633689073.issue13959@psf.upfronthosting.co.za> Message-ID: <1332309630.17.0.824090111864.issue13959@psf.upfronthosting.co.za> Eric Snow added the comment: Of note for my patch is the addition of SUFFIXES and MODE to the 3 main "file loader" classes. I did this to reverse the dependence on imp.get_suffixes(). As well, a couple of extra functions are added to Python/importlib/_bootstrap.py for a similar reason, but should also be meaningful externally in their own right. load_module_from_file(), is one of these, though the current incarnation relies on a mythical new method on loaders that may not pass muster. (FWIW, I accidently included the use_of_imp.txt file in the patch and don't intend it to get included) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 07:15:19 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Mar 2012 06:15:19 +0000 Subject: [issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing In-Reply-To: <1332305186.87.0.484792091693.issue14377@psf.upfronthosting.co.za> Message-ID: <1332310519.57.0.95392845868.issue14377@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: - if long_xml or text or len(elem): + if text or len(elem) or long_xml: Use alternatives in order of decreasing probability. ---------- nosy: +storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 07:19:42 2012 From: report at bugs.python.org (J. D. Bartlett) Date: Wed, 21 Mar 2012 06:19:42 +0000 Subject: [issue14378] __future__ imports fail when compiling from python ast Message-ID: <1332310782.47.0.882635712321.issue14378@psf.upfronthosting.co.za> New submission from J. D. Bartlett : GOAL I am trying to compile an AST which contains an ImportFrom node which performs a __future__ import. The ImportFrom node in question is the first node within the AST's body (as it should be, because __future__ imports must occur at the beginning of modules). ISSUE Compiling the AST fails with the error "SyntaxError: from __future__ imports must occur at the beginning of the file". ANALYSIS The future_parse() function in future.c looks for __future__ imports and identifies them based on the condition (ds->v.ImportFrom.module == future) where future is constructed using PyString_InternFromString("__future__"). That is, the module attribute of the ImportFrom node is compared by identity with the interned string "__future__". The AST which I was compiling used the string "__future__" after extracting that string from a much longer string of user input, and as a result, the string was not interned. The attached file futureimport.py is a simple script demonstrating this issue. I have confirmed that the issue occurs in Python 2.7.2 and 3.2.2. ---------- components: Interpreter Core files: futureimport.py messages: 156477 nosy: talljosh priority: normal severity: normal status: open title: __future__ imports fail when compiling from python ast type: behavior versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file24981/futureimport.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 07:23:38 2012 From: report at bugs.python.org (J. D. Bartlett) Date: Wed, 21 Mar 2012 06:23:38 +0000 Subject: [issue14378] __future__ imports fail when compiling from python ast In-Reply-To: <1332310782.47.0.882635712321.issue14378@psf.upfronthosting.co.za> Message-ID: <1332311018.21.0.078755224683.issue14378@psf.upfronthosting.co.za> J. D. Bartlett added the comment: Incidentally, the workaround that I'm using for the time being is to run the following code before attempting to compile root_node. for node in ast.walk(root_node): if isinstance(node, ast.ImportFrom) and node.module == '__future__': node.module = '__future__' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 07:59:13 2012 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 21 Mar 2012 06:59:13 +0000 Subject: [issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers In-Reply-To: <1326709751.32.0.965094376059.issue13797@psf.upfronthosting.co.za> Message-ID: <1332313153.05.0.665267832484.issue13797@psf.upfronthosting.co.za> Stefan Behnel added the comment: Ok, just for the record: a single __buffer__() special method with delegation-only semantics would also work for Cython. Taking this path would provide a cleaner separation of the (then delegation-only) Python level protocol and the (all purpose) C level protocol. I think I'd prefer that. I assume __buffer__() takes no arguments, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 09:00:58 2012 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 21 Mar 2012 08:00:58 +0000 Subject: [issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers In-Reply-To: <1326709751.32.0.965094376059.issue13797@psf.upfronthosting.co.za> Message-ID: <1332316858.42.0.803593937818.issue13797@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 09:03:30 2012 From: report at bugs.python.org (Stefan Krah) Date: Wed, 21 Mar 2012 08:03:30 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1332247769.86.0.118560421518.issue7652@psf.upfronthosting.co.za> Message-ID: <20120321080329.GA5440@sleipnir.bytereef.org> Stefan Krah added the comment: > The best thing might be to use Emax=10**8-1 and Emin=-(10**8-1) throughout. > I don't think many applications depend on having Emax=10**9-1. If they do, > they'll have to use the 64-bit version. 10**6-1 would be another option. The advantage is that it's visually obvious that the default exponents have changed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 09:27:16 2012 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 21 Mar 2012 08:27:16 +0000 Subject: [issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int" In-Reply-To: <1332288480.19.0.200013792885.issue14376@psf.upfronthosting.co.za> Message-ID: <1332318436.39.0.532296945624.issue14376@psf.upfronthosting.co.za> Mark Dickinson added the comment: > It would be simple to change line 1112 of pythonrun.c from > > if (PyInt_Check(value)) > > to > > if (PyInt_Check(value) || PyLong_Check(value)) Wouldn't you also have to deal with possible errors from the PyInt_AsLong call? E.g., after sys.exit(2**64), an OverflowException would be set. I don't know if not dealing with that exception (perhaps with PyErr_Clear) before exit might cause issues, though it seems to work in practice (with the -1 value indicating an error being turned into an exit code of 255). ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 10:08:01 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Mar 2012 09:08:01 +0000 Subject: [issue14371] Add support for bzip2 compression to the zipfile module In-Reply-To: <1332243041.43.0.499117498297.issue14371@psf.upfronthosting.co.za> Message-ID: <1332320881.41.0.483368952033.issue14371@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thanks to the tests, I found the error. Since the bzip2 is block algorithm, decompressor need to eat a certain amount of data, so it began to return data. Now when reading small chunks turns out premature end of data. I'm working on a fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 10:10:09 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 21 Mar 2012 09:10:09 +0000 Subject: [issue10142] Support for SEEK_HOLE/SEEK_DATA In-Reply-To: <1287458119.59.0.0883351132174.issue10142@psf.upfronthosting.co.za> Message-ID: <1332321009.51.0.55627898094.issue10142@psf.upfronthosting.co.za> Changes by Kristj?n Valur J?nsson : ---------- nosy: -krisvale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 10:11:34 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Mar 2012 09:11:34 +0000 Subject: [issue14371] Add support for bzip2 compression to the zipfile module In-Reply-To: <1332243041.43.0.499117498297.issue14371@psf.upfronthosting.co.za> Message-ID: <1332321094.2.0.0374981651627.issue14371@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file24982/bzip2_in_zip_tests.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 10:17:12 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 21 Mar 2012 09:17:12 +0000 Subject: [issue9787] Release the TLS lock during allocations In-Reply-To: <1283839386.17.0.522591872287.issue9787@psf.upfronthosting.co.za> Message-ID: <1332321432.61.0.945078070093.issue9787@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Making this low priority since it applies only to platforms without Windows and pthread support. ---------- priority: normal -> low versions: +Python 3.3 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 10:55:11 2012 From: report at bugs.python.org (Gareth Rees) Date: Wed, 21 Mar 2012 09:55:11 +0000 Subject: [issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int" In-Reply-To: <1332288480.19.0.200013792885.issue14376@psf.upfronthosting.co.za> Message-ID: <1332323711.07.0.396528666154.issue14376@psf.upfronthosting.co.za> Gareth Rees added the comment: > Wouldn't you also have to deal with possible errors from the PyInt_AsLong call? Good point. But I note that Python 3 just does exitcode = (int)PyLong_AsLong(value); so maybe it's not important to do error handling here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 11:16:03 2012 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 21 Mar 2012 10:16:03 +0000 Subject: [issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers In-Reply-To: <1326709751.32.0.965094376059.issue13797@psf.upfronthosting.co.za> Message-ID: <1332324963.31.0.942300332564.issue13797@psf.upfronthosting.co.za> Nick Coghlan added the comment: The reason I don't particularly like the "delegation only" API is that the combination of the new memoryview implementation and bytes/mmap/etc to get a flat region of memory to play with means you could do some quite interesting things entirely at the Python level. If you couldn't even use memoryview.cast() to change the shape of the exported memory, it makes the Python level API clearly inferior in power compared to what you can do in C. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 12:06:47 2012 From: report at bugs.python.org (anatoly techtonik) Date: Wed, 21 Mar 2012 11:06:47 +0000 Subject: [issue14379] Several traceback docs improvements Message-ID: <1332328007.08.0.704590425302.issue14379@psf.upfronthosting.co.za> New submission from anatoly techtonik : Some notes about current `traceback` documentation: http://docs.python.org/library/traceback.html 1. It needs a mentioning that traceback module works with traceback objects and frame objects 2. Functions that work with frames should probably be grouped together 3. Docs for frame function should include info about where to get frames (e.g. http://docs.python.org/library/inspect.html#the-interpreter-stack) 4. There is no traceback object description, which should be at http://docs.python.org/library/sys.html#sys.exc_info ---------- assignee: docs at python components: Documentation messages: 156486 nosy: docs at python, techtonik priority: normal severity: normal status: open title: Several traceback docs improvements _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 12:26:22 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 21 Mar 2012 11:26:22 +0000 Subject: [issue3367] Uninitialized value read in parsetok.c In-Reply-To: <1216153264.95.0.467111480464.issue3367@psf.upfronthosting.co.za> Message-ID: <1332329182.26.0.405791620093.issue3367@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Here is a patch for the sysmodule.c problem ---------- Added file: http://bugs.python.org/file24983/sysmodule.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 12:26:31 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 21 Mar 2012 11:26:31 +0000 Subject: [issue3367] Uninitialized value read in parsetok.c In-Reply-To: <1216153264.95.0.467111480464.issue3367@psf.upfronthosting.co.za> Message-ID: <1332329191.43.0.45425231421.issue3367@psf.upfronthosting.co.za> Changes by Kristj?n Valur J?nsson : ---------- versions: +Python 3.3 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 12:32:13 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 21 Mar 2012 11:32:13 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset a95b19b3b4cd by Andrew Svetlov in branch '3.2': #3573: idle now doesn't hungs if launched as: idle -e http://hg.python.org/cpython/rev/a95b19b3b4cd New changeset cdcd1f7f0882 by Andrew Svetlov in branch 'default': Merge from 3.2 for issue #3573, fix Misc/NEWS as Ned Deily guess. http://hg.python.org/cpython/rev/cdcd1f7f0882 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 12:36:10 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 21 Mar 2012 11:36:10 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset a9be863e5734 by Andrew Svetlov in branch '2.7': #3573: idle now doesn't hungs if launched as: idle -e http://hg.python.org/cpython/rev/a9be863e5734 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 12:36:56 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 11:36:56 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: <1332329816.55.0.771102278412.issue3573@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Backported to 3.2 and 2.7 ---------- versions: +Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 12:48:28 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 11:48:28 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: <1332330508.69.0.123704298883.issue7652@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 12:56:40 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 11:56:40 +0000 Subject: [issue5066] IDLE documentation for Unix obsolete/incorrect In-Reply-To: <1232942217.99.0.191249551049.issue5066@psf.upfronthosting.co.za> Message-ID: <1332331000.35.0.55494030946.issue5066@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 12:58:21 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 11:58:21 +0000 Subject: [issue1053687] PyOS_InputHook not called in IDLE subprocess Message-ID: <1332331101.48.0.802966231695.issue1053687@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 13:02:55 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 12:02:55 +0000 Subject: [issue7738] IDLE hang when tooltip comes up in Linux In-Reply-To: <1263889833.11.0.812168606755.issue7738@psf.upfronthosting.co.za> Message-ID: <1332331375.65.0.190702783718.issue7738@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Works fine on Ubuntu 11.10 with tk 8.5 for 3.2, 2.7 and 3.3 alpha. ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 13:10:45 2012 From: report at bugs.python.org (Matt Joiner) Date: Wed, 21 Mar 2012 12:10:45 +0000 Subject: [issue14373] C implementation of functools.lru_cache In-Reply-To: <1332250846.11.0.753199667334.issue14373@psf.upfronthosting.co.za> Message-ID: <1332331845.05.0.910635606679.issue14373@psf.upfronthosting.co.za> Matt Joiner added the comment: Updated patch to fix a crash if maxsize isn't given, and add a unit test for that. Possible issues: * I've tried to emulate object() by calling PyBaseObject_Type. Not sure if there's a more lightweight object for this that just provides the needed __hash__ and __eq__ attributes. * Not sure if kwd_mark is deallocated correctly. * Can't quite work out the best way to wrap the C cache_info() method to output the _CacheInfo named tuple. The current mechanism might not be wrapping the attributes correctly. ---------- keywords: +patch Added file: http://bugs.python.org/file24984/functools.lru_cache-in-c.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 15:52:09 2012 From: report at bugs.python.org (Meador Inge) Date: Wed, 21 Mar 2012 14:52:09 +0000 Subject: [issue14373] C implementation of functools.lru_cache In-Reply-To: <1332250846.11.0.753199667334.issue14373@psf.upfronthosting.co.za> Message-ID: <1332341529.93.0.183962893754.issue14373@psf.upfronthosting.co.za> Changes by Meador Inge : ---------- nosy: +meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 16:04:15 2012 From: report at bugs.python.org (Dmitry Shachnev) Date: Wed, 21 Mar 2012 15:04:15 +0000 Subject: [issue14360] email.encoders.encode_quopri doesn't work with python 3.2 In-Reply-To: <1332063395.16.0.293436373736.issue14360@psf.upfronthosting.co.za> Message-ID: <1332342255.82.0.935319181904.issue14360@psf.upfronthosting.co.za> Dmitry Shachnev added the comment: (Sorry for not replying earlier). I think the main priority here is getting things working, not the tests (so I have little interest in that). First of all, should quopri.encodestring() really return bytes? Everything it returns is ascii text, obviously. Then, which types of argument should encode_* functions take (I think str should be supported, and it's not a case here as encode_quopri will only accept bytes)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 16:47:30 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 21 Mar 2012 15:47:30 +0000 Subject: [issue14360] email.encoders.encode_quopri doesn't work with python 3.2 In-Reply-To: <1332063395.16.0.293436373736.issue14360@psf.upfronthosting.co.za> Message-ID: <1332344850.97.0.945705606079.issue14360@psf.upfronthosting.co.za> R. David Murray added the comment: Well, a patch won't get committed if it lacks tests, so commit would have to wait until I have time to write some, then. The encode_ methods (from email.encoders) take *message* objects as their arguments. MIMEText internally converts a byte string into the appropriate CTE *if* you give it a charset (if you don't it later produces an error, but that's a different bug). So if you pass bytes you don't need to call an encode_ method separately. In fact, there's really no reason to call an encode_ method at all, since if you pass a string to MIMEText when giving it a non-ascii unicode string, it will default to utf-8 and do the appropriate CTE encoding. But given that they exist in the documented API and exist in Python2, they need to be fixed to work in an equivalent fashion in Python3. I think the only case where they would do anything useful is if you don't like Python's default for the CTE encoding and want to change it. (Note that you can accomplish that globally by updating the charset alias in the charset module.) What is your use case, by the way? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 17:19:25 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 21 Mar 2012 16:19:25 +0000 Subject: [issue10469] test_socket fails using Visual Studio 2010 In-Reply-To: <1290263082.19.0.540702085336.issue10469@psf.upfronthosting.co.za> Message-ID: <1332346765.7.0.441339720254.issue10469@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Added a patch as used by CCP in production. Covers more WSA cases. ---------- nosy: +krisvale Added file: http://bugs.python.org/file24985/cpython_75849_to_75851.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 17:46:27 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 21 Mar 2012 16:46:27 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: <1332348387.5.0.57162607457.issue3573@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Thanks for applying. Just note that unlike with svn, with hg it is stronly recommended to apply to 3.2 first and forward port to 3.3. Something about the DAGs working better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 17:50:04 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 16:50:04 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: <1332348604.04.0.80916375748.issue3573@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Will do in next time. Thank you for instructions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 18:05:00 2012 From: report at bugs.python.org (Dmitry Shachnev) Date: Wed, 21 Mar 2012 17:05:00 +0000 Subject: [issue14360] email.encoders.encode_quopri doesn't work with python 3.2 In-Reply-To: <1332063395.16.0.293436373736.issue14360@psf.upfronthosting.co.za> Message-ID: <1332349500.19.0.692682334464.issue14360@psf.upfronthosting.co.za> Dmitry Shachnev added the comment: > In fact, there's really no reason to call an encode_ method at all, since if you pass a string to MIMEText when giving it a non-ascii unicode string, it will default to utf-8 and do the appropriate CTE encoding. No, it doesn't: Python 3.2.3rc1 (default, Mar 9 2012, 23:02:43) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from email.mime.text import MIMEText >>> print(MIMEText('??????')) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ?????? >>> As you can see, it leaves russian text in unmodified state and sets the charset to "us-ascii". Should it be considered as a bug? > What is your use case, by the way? I'm writing a "send via e-mail" plugin for my ReText editor (http://retext.sourceforge.net/). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 18:09:44 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 17:09:44 +0000 Subject: [issue978604] wait_variable hangs at exit Message-ID: <1332349784.98.0.950885935919.issue978604@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 18:11:14 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 17:11:14 +0000 Subject: [issue7057] tkinter doc: more 3.x updates In-Reply-To: <1254697168.63.0.205098696566.issue7057@psf.upfronthosting.co.za> Message-ID: <1332349874.37.0.57522013161.issue7057@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 18:12:37 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 17:12:37 +0000 Subject: [issue5136] Deprecating (and removing) "globalcall", "merge" and "globaleval" In-Reply-To: <1233623088.62.0.412008570682.issue5136@psf.upfronthosting.co.za> Message-ID: <1332349957.72.0.337407360259.issue5136@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov versions: +Python 3.3 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 18:23:56 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 17:23:56 +0000 Subject: [issue3035] Removing apparently unwanted functions from Tkinter In-Reply-To: <1212517969.87.0.228224366447.issue3035@psf.upfronthosting.co.za> Message-ID: <1332350636.51.0.43936002241.issue3035@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 18:26:46 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 21 Mar 2012 17:26:46 +0000 Subject: [issue14360] email.encoders.encode_quopri doesn't work with python 3.2 In-Reply-To: <1332063395.16.0.293436373736.issue14360@psf.upfronthosting.co.za> Message-ID: <1332350806.66.0.282131760055.issue14360@psf.upfronthosting.co.za> R. David Murray added the comment: Oh, you are right. I even noted that bug in my PyCon talk, but immediately forgot about it :( I do intend to fix it. You can get it to work by explicitly passing the charset: >>> x = MIMEText('??????', _charset='utf8') >>> str(x) 'Content-Type: text/plain; charset="utf8"\nMIME-Version: 1.0\nContent-Transfer-Encoding: base64\n\n0LnRhtGD0LrQtdC9\n' When I asked the use case, I meant specifically for calling encode_quopri, etc. Given the above, do you need it anymore? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 18:27:30 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 17:27:30 +0000 Subject: [issue802310] tkFont may reuse font names Message-ID: <1332350850.53.0.784234252876.issue802310@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov versions: +Python 3.3 -Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 18:27:57 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 21 Mar 2012 17:27:57 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 7355550d5357 by Stefan Krah in branch 'default': Issue #7652: Integrate the decimal floating point libmpdec library to speed http://hg.python.org/cpython/rev/7355550d5357 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 18:34:48 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 21 Mar 2012 17:34:48 +0000 Subject: [issue14380] MIMEText should default to utf8 charset if input text contains non-ASCII Message-ID: <1332351288.3.0.0981603454883.issue14380@psf.upfronthosting.co.za> New submission from R. David Murray : The MIMEText class of the email package in Python3 requires that a character set be specified in order for the resulting email to be valid. If no character set is specified, it currently assumes ascii but puts a unicode payload in the message. Because someone might actually be making use of this bug, I'm not going to backport a fix, but I do want to make utf8 the default if there are non-ascii characters in the input, in a similar fashion to how it is done for headers (well, now that *that* bug has been fixed). ---------- assignee: r.david.murray components: Library (Lib) keywords: easy messages: 156501 nosy: mitya57, r.david.murray priority: normal severity: normal stage: test needed status: open title: MIMEText should default to utf8 charset if input text contains non-ASCII type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 18:47:23 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 21 Mar 2012 17:47:23 +0000 Subject: [issue14381] Intern certain integral floats for memory savings and performance Message-ID: <1332352043.3.0.236525644282.issue14381@psf.upfronthosting.co.za> New submission from Kristj?n Valur J?nsson : Michael Foord reminded me of this issue recently. It was discussed on pydev a few years back and met with limited enthusiasm. I speak from experience in live production with EVE that this simple change saved us a lot of memory. Integral floating point numbers are surprisingly common, falling out of mathematical operations and when reading tabular data. 0.0 and 1.0 in particular. ---------- components: Interpreter Core files: internfloat.patch keywords: patch messages: 156502 nosy: krisvale, michael.foord priority: normal severity: normal status: open title: Intern certain integral floats for memory savings and performance type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24986/internfloat.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 18:55:48 2012 From: report at bugs.python.org (Dustin Kirkland) Date: Wed, 21 Mar 2012 17:55:48 +0000 Subject: [issue14308] '_DummyThread' object has no attribute '_Thread__block' In-Reply-To: <1331768900.76.0.717773710833.issue14308@psf.upfronthosting.co.za> Message-ID: <1332352548.45.0.109360599389.issue14308@psf.upfronthosting.co.za> Dustin Kirkland added the comment: Okay, update... I did rebuild all of Python from source (actually, I applied it to the Ubuntu python2.7 package, rebuilt that locally, and then upgraded to the new python2.7 deb's. I could see my change was applied /usr/lib/python2.7/threading.py, and I can safely assume that it landed in the pyc as well. I restarted Apache2 to reload my wsgi script. But unfortunately, I get the same error in /var/log/apache/error.log: [Wed Mar 21 12:52:36 2012] [error] Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'" ,) in ignored So please consider my patch as wrong/bad/insufficient. Issue is still open, though. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 19:42:51 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Mar 2012 18:42:51 +0000 Subject: [issue14381] Intern certain integral floats for memory savings and performance In-Reply-To: <1332352043.3.0.236525644282.issue14381@psf.upfronthosting.co.za> Message-ID: <1332355371.93.0.520681527486.issue14381@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Does it not decrease the performance? Falling out integral floating point numbers in the mathematical floating point calculations seems unlikely. I suggest interning integral floats only in conversions str -> float and int -> float. Exception can be made to zero, which can result in operations with zero, and which simple tested. ---------- nosy: +storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 20:02:44 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 21 Mar 2012 19:02:44 +0000 Subject: [issue12757] undefined name in doctest.py In-Reply-To: <1313479086.68.0.065111934389.issue12757@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 64f1b8ad9214 by R David Murray in branch '3.2': #12757: Make doctest skipping in -OO mode work with unittest/regrtest -v http://hg.python.org/cpython/rev/64f1b8ad9214 New changeset ff7957aa01a1 by R David Murray in branch 'default': Merge #12757: Make doctest skipping in -OO mode work with unittest/regrtest -v http://hg.python.org/cpython/rev/ff7957aa01a1 New changeset c50db3d06116 by R David Murray in branch '2.7': #12757: Make doctest skipping in -OO mode work with unittest/regrtest -v http://hg.python.org/cpython/rev/c50db3d06116 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 20:11:06 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 21 Mar 2012 19:11:06 +0000 Subject: [issue12757] undefined name in doctest.py In-Reply-To: <1313479086.68.0.065111934389.issue12757@psf.upfronthosting.co.za> Message-ID: <1332357066.07.0.0409458299928.issue12757@psf.upfronthosting.co.za> R. David Murray added the comment: Since nobody really cares about this issue :), I went ahead and applied the patch that at least avoids the tracebacks. Someone can open a new bug about the duplicated message if they really care. ---------- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 20:16:42 2012 From: report at bugs.python.org (Ned Deily) Date: Wed, 21 Mar 2012 19:16:42 +0000 Subject: [issue14078] Add 'sourceline' property to xml.etree Elements In-Reply-To: <1329863134.79.0.699697784351.issue14078@psf.upfronthosting.co.za> Message-ID: <1332357402.5.0.336079950916.issue14078@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- nosy: +eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 20:24:51 2012 From: report at bugs.python.org (Ned Deily) Date: Wed, 21 Mar 2012 19:24:51 +0000 Subject: [issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing In-Reply-To: <1332305186.87.0.484792091693.issue14377@psf.upfronthosting.co.za> Message-ID: <1332357891.58.0.49894007427.issue14377@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- nosy: +eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 20:33:34 2012 From: report at bugs.python.org (Ned Deily) Date: Wed, 21 Mar 2012 19:33:34 +0000 Subject: [issue7738] IDLE hang when tooltip comes up in Linux In-Reply-To: <1263889833.11.0.812168606755.issue7738@psf.upfronthosting.co.za> Message-ID: <1332358414.89.0.392683993861.issue7738@psf.upfronthosting.co.za> Ned Deily added the comment: Since most people can't reproduce this problem now, let's assume it was a problem in the particular version of Tk used. If someone can reproduce it with a current IDLE and Tk, please reopen with details. ---------- nosy: +ned.deily stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 20:35:55 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 19:35:55 +0000 Subject: [issue7738] IDLE hang when tooltip comes up in Linux In-Reply-To: <1263889833.11.0.812168606755.issue7738@psf.upfronthosting.co.za> Message-ID: <1332358555.87.0.822831775327.issue7738@psf.upfronthosting.co.za> Andrew Svetlov added the comment: +1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 20:40:43 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 19:40:43 +0000 Subject: [issue4652] IDLE does not work with Unicode In-Reply-To: <1229154229.3.0.726059762082.issue4652@psf.upfronthosting.co.za> Message-ID: <1332358843.83.0.096763783764.issue4652@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 20:42:30 2012 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 21 Mar 2012 19:42:30 +0000 Subject: [issue14381] Intern certain integral floats for memory savings and performance In-Reply-To: <1332352043.3.0.236525644282.issue14381@psf.upfronthosting.co.za> Message-ID: <1332358950.37.0.530868488797.issue14381@psf.upfronthosting.co.za> Mark Dickinson added the comment: This looks like a duplicate of issue 4024. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 20:44:27 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 19:44:27 +0000 Subject: [issue10118] Tkinter does not find font In-Reply-To: <1287192630.89.0.924571330725.issue10118@psf.upfronthosting.co.za> Message-ID: <1332359067.31.0.802653945271.issue10118@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 20:45:52 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 19:45:52 +0000 Subject: [issue1500773] wm_attributes doesn't take keyword arguments Message-ID: <1332359152.71.0.00982470841419.issue1500773@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 21:00:58 2012 From: report at bugs.python.org (Daniel Swanson) Date: Wed, 21 Mar 2012 20:00:58 +0000 Subject: [issue4652] IDLE does not work with Unicode In-Reply-To: <1229154229.3.0.726059762082.issue4652@psf.upfronthosting.co.za> Message-ID: <1332360058.18.0.0753586876792.issue4652@psf.upfronthosting.co.za> Daniel Swanson added the comment: I opened my IDLE (v. 3.2.2 windows xp) and pasted in print('??') it printed ?? just fine. ---------- nosy: +weirdink13 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 21:02:04 2012 From: report at bugs.python.org (Daniel Swanson) Date: Wed, 21 Mar 2012 20:02:04 +0000 Subject: [issue4652] IDLE does not work with Unicode In-Reply-To: <1229154229.3.0.726059762082.issue4652@psf.upfronthosting.co.za> Message-ID: <1332360124.45.0.0921895699767.issue4652@psf.upfronthosting.co.za> Daniel Swanson added the comment: alt-c does nothing for me ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 21:17:04 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 20:17:04 +0000 Subject: [issue4652] IDLE does not work with Unicode In-Reply-To: <1229154229.3.0.726059762082.issue4652@psf.upfronthosting.co.za> Message-ID: <1332361024.76.0.482061829733.issue4652@psf.upfronthosting.co.za> Andrew Svetlov added the comment: For now unicode BMP has full support in TK while non-BMP characters doesn't works. '?' character is BMP symbol: >>> hex(ord('?')) '0x3053' which is lesser than non-BMP space (starting from 0x10000). I have no idea why alt-c doesn't converted to '?' (also BMP by the way) and why it has been processed by Helary's IDLE. I have no any Mac box nearby to check. Sure, 'alt-c' is minor problem if this is problem at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 21:19:12 2012 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 21 Mar 2012 20:19:12 +0000 Subject: [issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int" In-Reply-To: <1332288480.19.0.200013792885.issue14376@psf.upfronthosting.co.za> Message-ID: <1332361152.5.0.416296792876.issue14376@psf.upfronthosting.co.za> Mark Dickinson added the comment: > so maybe it's not important to do error handling here. Hmm, seems it's not. And dealing with OverflowError is hardly likely to be a concern in practice anyway. +1 for the suggested fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 21:22:40 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 20:22:40 +0000 Subject: [issue4652] IDLE does not work with Unicode In-Reply-To: <1229154229.3.0.726059762082.issue4652@psf.upfronthosting.co.za> Message-ID: <1332361360.6.0.743744516497.issue4652@psf.upfronthosting.co.za> Andrew Svetlov added the comment: I close this issue because: - current 3.2 and upcoming 3.3 support Japanese characters very well. - there are problems with non-BMP characters not supported currently but it's another issue. See progress of #14200 and others for non-BMP. ---------- assignee: -> asvetlov resolution: -> works for me stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 21:25:29 2012 From: report at bugs.python.org (Daniel Swanson) Date: Wed, 21 Mar 2012 20:25:29 +0000 Subject: [issue4652] IDLE does not work with Unicode In-Reply-To: <1229154229.3.0.726059762082.issue4652@psf.upfronthosting.co.za> Message-ID: <1332361529.35.0.380638324261.issue4652@psf.upfronthosting.co.za> Daniel Swanson added the comment: I would say that alt-c is not a problem at all, but, some people might use '?' more that me, (I never have used '?' spesificaly) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 21:26:52 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 20:26:52 +0000 Subject: [issue4333] Reworked Dialog.py In-Reply-To: <1226881404.91.0.533308530681.issue4333@psf.upfronthosting.co.za> Message-ID: <1332361612.3.0.320300902393.issue4333@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 21:29:56 2012 From: report at bugs.python.org (Ned Deily) Date: Wed, 21 Mar 2012 20:29:56 +0000 Subject: [issue4652] IDLE does not work with Unicode In-Reply-To: <1229154229.3.0.726059762082.issue4652@psf.upfronthosting.co.za> Message-ID: <1332361796.73.0.30504860072.issue4652@psf.upfronthosting.co.za> Ned Deily added the comment: To add to the other comments, problems with input methods using Python 3 and Tkinter or IDLE are usually platform-specific issues with the implementation of Tk. In particular, the issue Jean-Christophe reported with Python 3.1.1 was very likely due to its use of the old Tk 8.4 (at least with the python.org installer). Current versions of Python 3.2.x for OS X 10.6+ link with the newer Tk 8.5, the very latest releases of which by ActiveState contain important fixes for input methods using composite characters (http://www.python.org/download/mac/tcltk/ has the most up-to-date information). Also, note to the original poster, you either made a typo in the bug report ("UFT-8" - it should be "UTF-8") or, if you actually tried that locale, it might explain why you had problems. If someone can reproduce a problem with a current Python 3.2.x or later, please re-open with details. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 21:39:26 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 20:39:26 +0000 Subject: [issue4652] IDLE does not work with Unicode In-Reply-To: <1229154229.3.0.726059762082.issue4652@psf.upfronthosting.co.za> Message-ID: <1332362366.37.0.464148421098.issue4652@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Daniel Swanson, maybe my msg156512 was not obvious. You can use '?' without any problem in IDLE ? it is BMP character. See http://en.wikipedia.org/wiki/Mapping_of_Unicode_characters for details. tkinter has full support for 'Basic Multilingual Plane' while last planes still has a problems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 22:48:01 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 21 Mar 2012 21:48:01 +0000 Subject: [issue3035] Removing apparently unwanted functions from Tkinter In-Reply-To: <1212517969.87.0.228224366447.issue3035@psf.upfronthosting.co.za> Message-ID: <1332366481.88.0.122168319392.issue3035@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Pushed as PendingDepricationWarnings for upcoming 3.3 ---------- assignee: -> asvetlov resolution: -> remind stage: patch review -> versions: +Python 3.3, Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 22:53:12 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 21 Mar 2012 21:53:12 +0000 Subject: [issue3035] Removing apparently unwanted functions from Tkinter In-Reply-To: <1212517969.87.0.228224366447.issue3035@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset d42f264f291e by Andrew Svetlov in branch 'default': Issue #3035: Unused functions from tkinter are marked as pending peprecated. http://hg.python.org/cpython/rev/d42f264f291e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 22:53:58 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 21 Mar 2012 21:53:58 +0000 Subject: [issue3035] Removing apparently unwanted functions from Tkinter In-Reply-To: <1212517969.87.0.228224366447.issue3035@psf.upfronthosting.co.za> Message-ID: <1332366838.4.0.169942370003.issue3035@psf.upfronthosting.co.za> R. David Murray added the comment: PendingDeprecationWarning would mean that we are going to remove it "someday". If you actually want to remove them in a reasonable time, you should use "DeprecationWarning" in 3.3, and then remove them in 3.4. But is there a need to remove them? Maybe PendingDeprecationWarning is right and we'll remove them in Python4 :) ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Mar 21 22:55:59 2012 From: report at bugs.python.org (R. David Murray) Date: Wed, 21 Mar 2012 21:55:59 +0000 Subject: [issue3035] Removing apparently unwanted functions from Tkinter In-Reply-To: <1212517969.87.0.228224366447.issue3035@psf.upfronthosting.co.za> Message-ID: <1332366959.27.0.00193427647376.issue3035@psf.upfronthosting.co.za> R. David Murray added the comment: Also, posting a patch for review before committing is a good idea. If you don't get a review in a reasonable time period, then as a committer you can of course go ahead and commit, based on your judgement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 00:26:28 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 21 Mar 2012 23:26:28 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: <1332372388.82.0.0802448852677.issue3573@psf.upfronthosting.co.za> ?ric Araujo added the comment: > with hg it is stronly recommended to apply to 3.2 first and forward port to 3.3. > Something about the DAGs working better. The default branch (3.3) are a superset of the changesets in 3.2: all bug fixes are in both branches, and new features are in 3.3 only. We?ve chosen the simplest way to achieve that with Mercurial: we commit to 3.2 and merge into default. This ensures that no fix committed to one version is forgotten in the other, and also automates the file merging. That?s just it. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 00:26:48 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 21 Mar 2012 23:26:48 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: <1332372408.79.0.181357564118.issue3573@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- Removed message: http://bugs.python.org/msg156522 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 00:27:02 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 21 Mar 2012 23:27:02 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: <1332372422.9.0.4197858914.issue3573@psf.upfronthosting.co.za> ?ric Araujo added the comment: 3-22 00:26 > with hg it is stronly recommended to apply to 3.2 first and forward port to 3.3. > Something about the DAGs working better. The default branch (3.3) is a superset of 3.2: all bug fixes are in both branches, and new features are in 3.3 only. We?ve chosen the simplest way to achieve that with Mercurial: we commit to 3.2 and merge into default. This ensures that no fix committed to one version is forgotten in the other, and also automates the file merging. That?s just it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 00:27:41 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 21 Mar 2012 23:27:41 +0000 Subject: [issue3573] IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) In-Reply-To: <1218929546.33.0.178143371283.issue3573@psf.upfronthosting.co.za> Message-ID: <1332372461.56.0.937108945221.issue3573@psf.upfronthosting.co.za> ?ric Araujo added the comment: (Edited for typos, ignore the ?3-22 00:26? that comes from I don?t know where) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 00:34:42 2012 From: report at bugs.python.org (Roundup Robot) Date: Wed, 21 Mar 2012 23:34:42 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 2514a4e2b3ce by Antoine Pitrou in branch 'default': Issue #14204: The ssl module now has support for the Next Protocol Negotiation extension, if available in the underlying OpenSSL library. http://hg.python.org/cpython/rev/2514a4e2b3ce ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 01:07:17 2012 From: report at bugs.python.org (Ned Deily) Date: Thu, 22 Mar 2012 00:07:17 +0000 Subject: [issue14382] test_unittest crashes loading 'unittest.test.testmock' when run from installed Python Message-ID: <1332374837.69.0.204107861729.issue14382@psf.upfronthosting.co.za> New submission from Ned Deily : When run from an installed location, rather than from the build directory, test_unittest now crashes: $ ./root/bin/python3.3 -m test -w -uall,-largefile test_unittest [1/1] test_unittest test test_unittest crashed -- Traceback (most recent call last): File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/test/regrtest.py", line 1236, in runtest_inner indirect_test() File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/test/test_unittest.py", line 8, in test_main support.run_unittest(unittest.test.suite()) File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/unittest/test/__init__.py", line 17, in suite suite.addTest(loader.loadTestsFromName('unittest.test.testmock')) File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/unittest/loader.py", line 105, in loadTestsFromName parent, obj = obj, getattr(obj, part) AttributeError: 'module' object has no attribute 'testmock' 1 test failed: test_unittest Re-running failed tests in verbose mode Re-running test 'test_unittest' in verbose mode test test_unittest crashed -- Traceback (most recent call last): File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/test/regrtest.py", line 1236, in runtest_inner indirect_test() File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/test/test_unittest.py", line 8, in test_main support.run_unittest(unittest.test.suite()) File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/unittest/test/__init__.py", line 17, in suite suite.addTest(loader.loadTestsFromName('unittest.test.testmock')) File "/py/dev/default/b10.7_t10.7_x4.2_cclang_d/unix/root/lib/python3.3/unittest/loader.py", line 105, in loadTestsFromName parent, obj = obj, getattr(obj, part) AttributeError: 'module' object has no attribute 'testmock' ---------- components: Tests messages: 156526 nosy: michael.foord, ned.deily priority: normal severity: normal stage: needs patch status: open title: test_unittest crashes loading 'unittest.test.testmock' when run from installed Python versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:04:03 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 22 Mar 2012 01:04:03 +0000 Subject: [issue13959] Re-implement parts of imp in pure Python In-Reply-To: <1328575890.24.0.0737633689073.issue13959@psf.upfronthosting.co.za> Message-ID: <1332378243.78.0.0896716145953.issue13959@psf.upfronthosting.co.za> ?ric Araujo added the comment: > Once things all the import stuff currently on the table is wrapped up, > I'll probably work on switching things over to using importlib directly. Please leave distutils unchanged; we don?t clean it up or improve it in any way, it?s bugfixes only. Changing packaging is fine; I?ll just keep using the imp module in the distutils2-python3 backport. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:05:00 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Mar 2012 01:05:00 +0000 Subject: [issue14204] Support for the NPN extension to TLS/SSL In-Reply-To: <1330978861.96.0.148487272162.issue14204@psf.upfronthosting.co.za> Message-ID: <1332378300.65.0.199080040699.issue14204@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Closing since the buildbots don't seem to show any new failures after the commit. Thank you for your contribution! ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:08:12 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 01:08:12 +0000 Subject: [issue14383] Generalize the use of _Py_IDENTIFIER in ceval.c and typeobject.c Message-ID: <1332378490.99.0.0291853361655.issue14383@psf.upfronthosting.co.za> New submission from STINNER Victor : Attached patch adds the followig functions: - _PyDict_GetItemId() - _PyDict_SetItemId() - _PyType_LookupId() (private) And it uses identifiers in ceval.c and typeobject.c where it is revelant. I expect a small speedup. The patch does also simplify the code: use the new identifier API instead of an explicit static keyword and call to PyUnicode_InternXXX. I can split the patch into smaller parts if you prefer. ---------- components: Interpreter Core files: identifier.patch keywords: patch messages: 156529 nosy: haypo, loewis, pitrou priority: normal severity: normal status: open title: Generalize the use of _Py_IDENTIFIER in ceval.c and typeobject.c type: performance versions: Python 3.3 Added file: http://bugs.python.org/file24987/identifier.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:08:54 2012 From: report at bugs.python.org (Eric Snow) Date: Thu, 22 Mar 2012 01:08:54 +0000 Subject: [issue13959] Re-implement parts of imp in pure Python In-Reply-To: <1328575890.24.0.0737633689073.issue13959@psf.upfronthosting.co.za> Message-ID: <1332378534.05.0.490018419843.issue13959@psf.upfronthosting.co.za> Eric Snow added the comment: Sounds good. It will be a while before we get there, but at that point I was already planning on getting in touch with the maintainers of relevant modules before messing with them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:09:15 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Mar 2012 01:09:15 +0000 Subject: [issue14383] Generalize the use of _Py_IDENTIFIER in ceval.c and typeobject.c In-Reply-To: <1332378490.99.0.0291853361655.issue14383@psf.upfronthosting.co.za> Message-ID: <1332378555.7.0.00651309106518.issue14383@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:09:19 2012 From: report at bugs.python.org (Miki Tebeka) Date: Thu, 22 Mar 2012 01:09:19 +0000 Subject: [issue14384] Add "default" kw argument to operator.itemgetter and operator.attrgetter Message-ID: <1332378559.49.0.430445927373.issue14384@psf.upfronthosting.co.za> New submission from Miki Tebeka : This way they will behave more like getattr and the dictionary get. If default is not specified, then if the item/attr not found, an execption will be raised, which is the current behavior. However if default is specified, then return it in case when item/attr not found - default value will be returned. I wanted this when trying to get configuration from a list of objects. I'd like to do get = attrgetter('foo', None) return get(args) or get(config) or get(env) ---------- components: Library (Lib) messages: 156531 nosy: tebeka priority: normal severity: normal status: open title: Add "default" kw argument to operator.itemgetter and operator.attrgetter versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:10:01 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 01:10:01 +0000 Subject: [issue14383] Generalize the use of _Py_IDENTIFIER in ceval.c and typeobject.c In-Reply-To: <1332378490.99.0.0291853361655.issue14383@psf.upfronthosting.co.za> Message-ID: <1332378601.32.0.977720131134.issue14383@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file24987/identifier.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:11:26 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 01:11:26 +0000 Subject: [issue14383] Generalize the use of _Py_IDENTIFIER in ceval.c and typeobject.c In-Reply-To: <1332378490.99.0.0291853361655.issue14383@psf.upfronthosting.co.za> Message-ID: <1332378686.15.0.13332047186.issue14383@psf.upfronthosting.co.za> STINNER Victor added the comment: Oops, my patch contained an unrelated change. I attach a new patch. I commited the change: changeset: 75866: tag: tip user: Victor Stinner date: Thu Mar 22 02:09:08 2012 +0100 files: Objects/object.c description: Micro-optimize PyObject_GetAttrString() ---------- Added file: http://bugs.python.org/file24988/identifier.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:35:33 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 22 Mar 2012 01:35:33 +0000 Subject: [issue14384] Add "default" kw argument to operator.itemgetter and operator.attrgetter In-Reply-To: <1332378559.49.0.430445927373.issue14384@psf.upfronthosting.co.za> Message-ID: <1332380133.17.0.890140886822.issue14384@psf.upfronthosting.co.za> R. David Murray added the comment: Thanks for the suggestion. It is an interesting idea, but there are some issues. attrgetter and itemgetter can take more than one key. It would probably make more sense to have the returned function be the one that takes the default, but in that case you might as well just use getattr. If we did accept a keyword-only argument for a default, what does the default mean if there is more than one key? And what if there are dotted names in the attrgetter keys? I'm inclined to reject this as too complex for a marginal a use case. But perhaps a python-ideas discussion would be appropriate. ---------- nosy: +r.david.murray type: -> enhancement versions: -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:35:38 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 01:35:38 +0000 Subject: [issue14385] Support other types than dict for __builtins__ Message-ID: <1332380135.46.0.264363154256.issue14385@psf.upfronthosting.co.za> New submission from STINNER Victor : CPython expects __builtins__ to be a dict, but it is interesting to be able to use another type. For example, my pysandbox project (sandbox to secure Python) requires a read-only mapping for __builtins__. The PEP 416 was rejected, so there is no builtin frozendict type, but it looks like the dictproxy type will be exposed as a public type. Attached patch uses PyDict_CheckExact() to check if __builtins__ is a dict and add a "slow-path" for other types. The overhead on runtime performance should be very low (near zero), PyDict_CheckExact() just dereference a pointer (to read the object type) and compare two pointers. The patch depends on issue #14383 patch (identifier.patch) for the __build_class__ identifier. I can write a new patch without this dependency if needed. ---------- components: Interpreter Core files: builtins.patch keywords: patch messages: 156534 nosy: haypo priority: normal severity: normal status: open title: Support other types than dict for __builtins__ type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file24989/builtins.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:48:43 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 22 Mar 2012 01:48:43 +0000 Subject: [issue3035] Removing apparently unwanted functions from Tkinter In-Reply-To: <1212517969.87.0.228224366447.issue3035@psf.upfronthosting.co.za> Message-ID: <1332380923.39.0.232157367822.issue3035@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I do not know or directly use tkinter enough to judge the proposed removal. (Although they do look like they might be useless.) I would like to see a little more explanation on the record. Who wrote "# XXX I don't like these -- take them away"? Also, deprecation messages often give the alternative or replacement to what is being removed. Are these so useless that there is no replacement? ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:50:04 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 01:50:04 +0000 Subject: [issue14386] Expose dictproxy as a public type Message-ID: <1332381004.13.0.167648412562.issue14386@psf.upfronthosting.co.za> New submission from STINNER Victor : Attached patch makes the dictproxy type public. Example: $ ./python Python 3.3.0a1+ (default:059489cec7b9+, Mar 22 2012, 02:45:36) >>> d=dictproxy({1:2}) >>> d dict_proxy({1: 2}) >>> d[1] 2 >>> d[1]=3 TypeError: 'dictproxy' object does not support item assignment >>> del d[1] TypeError: 'dictproxy' object doesn't support item deletion >>> d.copy() {1: 2} >>> dir(d) [..., '__getitem__', 'copy', 'get', 'items', 'keys', 'values'] The patch doesn't have any test or documentation yet. See also the (now rejected) PEP 416 (frozendict). ---------- components: Interpreter Core files: dictproxy.patch keywords: patch messages: 156536 nosy: gvanrossum, haypo priority: normal severity: normal status: open title: Expose dictproxy as a public type versions: Python 3.3 Added file: http://bugs.python.org/file24990/dictproxy.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:50:28 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 01:50:28 +0000 Subject: [issue14385] Support other types than dict for __builtins__ In-Reply-To: <1332380135.46.0.264363154256.issue14385@psf.upfronthosting.co.za> Message-ID: <1332381028.46.0.556759637374.issue14385@psf.upfronthosting.co.za> STINNER Victor added the comment: See the issue #14386 which exposes dictproxy as a public type. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:58:18 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 01:58:18 +0000 Subject: [issue14386] Expose dictproxy as a public type In-Reply-To: <1332381004.13.0.167648412562.issue14386@psf.upfronthosting.co.za> Message-ID: <1332381498.08.0.211219650038.issue14386@psf.upfronthosting.co.za> STINNER Victor added the comment: dictproxy.patch: proxy_new() should check that dict is a dict (PyDict_Check). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 02:58:32 2012 From: report at bugs.python.org (Eric Snow) Date: Thu, 22 Mar 2012 01:58:32 +0000 Subject: [issue14386] Expose dictproxy as a public type In-Reply-To: <1332381004.13.0.167648412562.issue14386@psf.upfronthosting.co.za> Message-ID: <1332381512.13.0.760050006955.issue14386@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 03:03:36 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 02:03:36 +0000 Subject: [issue14385] Support other types than dict for __builtins__ In-Reply-To: <1332380135.46.0.264363154256.issue14385@psf.upfronthosting.co.za> Message-ID: <1332381816.01.0.198972850539.issue14385@psf.upfronthosting.co.za> STINNER Victor added the comment: Example combining patches of #14385 and #14386 to run code with read-only __builtins__: ----------- test.py ------------- ns={'__builtins__': __builtins__.__dict__} exec(compile("__builtins__['superglobal']=1; print(superglobal)", "test", "exec"), ns) ns={'__builtins__': dictproxy(__builtins__.__dict__)} exec(compile("__builtins__['superglobal']=2; print(superglobal)", "test", "exec"), ns) ----------- end of test.py ----- Output: -------- $ ./python test.py 1 Traceback (most recent call last): File "x.py", line 4, in exec(compile("__builtins__['superglobal']=1; print(superglobal)", "test", "exec"), ns) File "test", line 1, in TypeError: 'dictproxy' object does not support item assignment -------- Note: this protection is not enough to secure Python, but it is an important part of a Python sandbox. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 05:11:33 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 22 Mar 2012 04:11:33 +0000 Subject: [issue5301] add mimetype for image/vnd.microsoft.icon (patch) In-Reply-To: <1234907792.31.0.00254559526039.issue5301@psf.upfronthosting.co.za> Message-ID: <1332389493.38.0.910597269662.issue5301@psf.upfronthosting.co.za> ?ric Araujo added the comment: Reopening for 2.7. See http://bugs.python.org/issue13952#msg153106 and also Terry?s proposal in the last message. ---------- nosy: +eric.araujo stage: committed/rejected -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 05:57:07 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 22 Mar 2012 04:57:07 +0000 Subject: [issue14241] io.UnsupportedOperation.__new__(io.UnsupportedOperation) fails In-Reply-To: <1331296756.01.0.329340447456.issue14241@psf.upfronthosting.co.za> Message-ID: <1332392227.12.0.0874641950704.issue14241@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 06:16:43 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 22 Mar 2012 05:16:43 +0000 Subject: [issue14357] Distutils2 does not work with virtualenv In-Reply-To: <1332052012.13.0.374309146875.issue14357@psf.upfronthosting.co.za> Message-ID: <1332393403.41.0.522024953293.issue14357@psf.upfronthosting.co.za> ?ric Araujo added the comment: Can you give more info about your OS, ~/.pydistutils.cfg, etc.? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 06:18:52 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 22 Mar 2012 05:18:52 +0000 Subject: [issue14378] __future__ imports fail when compiling from python ast In-Reply-To: <1332310782.47.0.882635712321.issue14378@psf.upfronthosting.co.za> Message-ID: <1332393532.26.0.0882121975171.issue14378@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +benjamin.peterson, brett.cannon, georg.brandl, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 06:22:53 2012 From: report at bugs.python.org (Dmitry Shachnev) Date: Thu, 22 Mar 2012 05:22:53 +0000 Subject: [issue14360] email.encoders.encode_quopri doesn't work with python 3.2 In-Reply-To: <1332063395.16.0.293436373736.issue14360@psf.upfronthosting.co.za> Message-ID: <1332393773.4.0.0422034595628.issue14360@psf.upfronthosting.co.za> Dmitry Shachnev added the comment: > You can get it to work by explicitly passing the charset Thanks, I didn't know about that. > Given the above, do you need it anymore? No. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 06:24:03 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 22 Mar 2012 05:24:03 +0000 Subject: [issue14376] sys.exit documents argument as "integer" but actually requires "subtype of int" In-Reply-To: <1332288480.19.0.200013792885.issue14376@psf.upfronthosting.co.za> Message-ID: <1332393843.24.0.866881001.issue14376@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- versions: -Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 06:26:18 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 22 Mar 2012 05:26:18 +0000 Subject: [issue5136] Deprecating (and removing) "globalcall", "merge" and "globaleval" In-Reply-To: <1233623088.62.0.412008570682.issue5136@psf.upfronthosting.co.za> Message-ID: <1332393978.45.0.0189180138911.issue5136@psf.upfronthosting.co.za> ?ric Araujo added the comment: Andrew, you can take over this issue if you want. As you?ve discovered with #3035, our deprecation process is a bit unclear (this was discussed on python-dev a few months ago), so using PendingDeprecationWarning vs. DeprecationWarning is a judgment call. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 07:45:51 2012 From: report at bugs.python.org (Dmitry Shachnev) Date: Thu, 22 Mar 2012 06:45:51 +0000 Subject: [issue14360] email.encoders.encode_quopri doesn't work with python 3.2 In-Reply-To: <1332063395.16.0.293436373736.issue14360@psf.upfronthosting.co.za> Message-ID: <1332398751.43.0.292106065693.issue14360@psf.upfronthosting.co.za> Dmitry Shachnev added the comment: > Then, which types of argument should encode_* functions take (I think str should be supported, and it's not a case here as encode_quopri will only accept bytes)? I meant which types of *payload* should they accept. Here's an illustration of what I mean: http://paste.ubuntu.com/894731/. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 11:02:36 2012 From: report at bugs.python.org (=?utf-8?q?Alex_Gr=C3=B6nholm?=) Date: Thu, 22 Mar 2012 10:02:36 +0000 Subject: [issue14357] Distutils2 does not work with virtualenv In-Reply-To: <1332052012.13.0.374309146875.issue14357@psf.upfronthosting.co.za> Message-ID: <1332410556.02.0.554537051904.issue14357@psf.upfronthosting.co.za> Alex Gr?nholm added the comment: Kubuntu 11.10, 64-bit. No ~/.pydistutils.cfg. What other info do you need? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 11:13:40 2012 From: report at bugs.python.org (Matt Joiner) Date: Thu, 22 Mar 2012 10:13:40 +0000 Subject: [issue9528] Add pure Python implementation of time module to CPython In-Reply-To: <1281069203.79.0.816772507809.issue9528@psf.upfronthosting.co.za> Message-ID: <1332411220.78.0.756342748729.issue9528@psf.upfronthosting.co.za> Changes by Matt Joiner : ---------- nosy: +anacrolix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 12:53:04 2012 From: report at bugs.python.org (Jeff Robbins) Date: Thu, 22 Mar 2012 11:53:04 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h Message-ID: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> New submission from Jeff Robbins : Windows.h includes RpcNdr.h which does this: #define small char accu.h in Python\Include (Python 3.2.3rc2) has this in it: typedef struct { PyObject *large; /* A list of previously accumulated large strings */ PyObject *small; /* Pending small strings */ } _PyAccu; An extension which includes both Windows.h and Python.h won't compile due to the Windows.h definition of "small". The compiler error (VS2008) starts with: c:\python32\include\accu.h(21) : error C2059: syntax error : 'type' ---------- components: Build, Windows messages: 156546 nosy: jeffr at livedata.com priority: normal severity: normal status: open title: Include\accu.h incompatible with Windows.h type: compile error versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 12:55:09 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 22 Mar 2012 11:55:09 +0000 Subject: [issue4024] float(0.0) singleton In-Reply-To: <1223004306.88.0.574076862856.issue4024@psf.upfronthosting.co.za> Message-ID: <1332417309.75.0.82487676096.issue4024@psf.upfronthosting.co.za> Changes by Kristj?n Valur J?nsson : ---------- superseder: -> Intern certain integral floats for memory savings and performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 13:19:13 2012 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Thu, 22 Mar 2012 12:19:13 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: <1332418753.57.0.891839270336.issue14387@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: I suggest to remove accu.h from Python.h: all functions are private anyway, and it's only used by couple of files. ---------- assignee: -> pitrou nosy: +amaury.forgeotdarc, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 13:20:00 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 22 Mar 2012 12:20:00 +0000 Subject: [issue14378] __future__ imports fail when compiling from python ast In-Reply-To: <1332310782.47.0.882635712321.issue14378@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset f57cbcefde34 by Benjamin Peterson in branch '3.2': check by equality for __future__ not identity (closes #14378) http://hg.python.org/cpython/rev/f57cbcefde34 New changeset 9d793be3b4eb by Benjamin Peterson in branch 'default': merge 3.2 (#14378) http://hg.python.org/cpython/rev/9d793be3b4eb ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 13:22:40 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 22 Mar 2012 12:22:40 +0000 Subject: [issue14360] email.encoders.encode_quopri doesn't work with python 3.2 In-Reply-To: <1332063395.16.0.293436373736.issue14360@psf.upfronthosting.co.za> Message-ID: <1332418960.03.0.833600064919.issue14360@psf.upfronthosting.co.za> R. David Murray added the comment: email in python3 doesn't necessarily work with binary payloads. (Obviously here you've found the opposite problem, but it is in methods that aren't used by the package itself.) There aren't any tests of binary payloads in the test suite. Ultimately this needs to be fixed one way or another, but I'm not sure when it is going to happen. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 13:29:46 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 22 Mar 2012 12:29:46 +0000 Subject: [issue14078] Add 'sourceline' property to xml.etree Elements In-Reply-To: <1329863134.79.0.699697784351.issue14078@psf.upfronthosting.co.za> Message-ID: <1332419386.93.0.553883246509.issue14078@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- keywords: +needs review stage: -> patch review type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 13:35:59 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 12:35:59 +0000 Subject: [issue14386] Expose dictproxy as a public type In-Reply-To: <1332381004.13.0.167648412562.issue14386@psf.upfronthosting.co.za> Message-ID: <1332419759.16.0.326090027041.issue14386@psf.upfronthosting.co.za> STINNER Victor added the comment: Patch version 2: - add tests and documentation - dictproxy code moved to dictproxyobject.c - dict_proxy replaced with dictproxy in repr(dictproxy) - "key in dictproxy" now handles correctly dict subclasses - dictproxy constructor raises a TypeError if the argument is not a dict I added a section "Immutable Mapping" in the doc, this title is maybe wrong because a dictproxy is not truly immutable. If the dict referenced by the dictproxy is modified, the dictproxy is also modified. dictproxy implementation supports any mapping, it is not specific to dict. It would be interesting any mapping, collections.ChainMap for example. The problem is to reject sequence in dictproxy constructor. The "PyMapping_Check(dict) && !PyMapping_Check(dict)" fails on ChainMap. type.__new__(ChainMap) fills tp_as_sequence->sq_item slot is defined because ChainMap has a __getitem__ method. Accepting sequences would be a bad idea because dictproxy(sequence)[missing_key] raises IndexError instead of KeyError. Note: issubclass(collections.ChainMap, collections.abc.Sequence) is False. ---------- Added file: http://bugs.python.org/file24991/dictproxy-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 13:36:40 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 12:36:40 +0000 Subject: [issue14386] Expose dictproxy as a public type In-Reply-To: <1332381004.13.0.167648412562.issue14386@psf.upfronthosting.co.za> Message-ID: <1332419800.21.0.0637305686506.issue14386@psf.upfronthosting.co.za> STINNER Victor added the comment: The dictproxy is useful to implement a Python sandbox: see the related issue #14385. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 13:38:16 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 12:38:16 +0000 Subject: [issue14385] Support other types than dict for __builtins__ In-Reply-To: <1332380135.46.0.264363154256.issue14385@psf.upfronthosting.co.za> Message-ID: <1332419896.3.0.91037180115.issue14385@psf.upfronthosting.co.za> STINNER Victor added the comment: > Note: this protection is not enough to secure Python, > but it is an important part of a Python sandbox. Oh, and by the way, I workaround the lack of read-only mapping in pysandbox by removing dict methods: dict.__init__(), dict.clear(), dict.update(), etc. This is a problem because these methods are useful in Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 13:40:06 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 22 Mar 2012 12:40:06 +0000 Subject: [issue14367] try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2 In-Reply-To: <1332132143.66.0.7093323157.issue14367@psf.upfronthosting.co.za> Message-ID: <1332420006.52.0.452910552213.issue14367@psf.upfronthosting.co.za> R. David Murray added the comment: Thanks for the report and patch. However, in general we prefer not to mask exceptions (doing that can hide bugs in programs). It would probably be reasonable to fix this in pydoc, however. Alternatively there might be a specific exception or set of exceptions that should indeed result in a False value. What exception is being raised? Can you provide a test case extracted from what pygame is doing that triggers the problem? ---------- nosy: +r.david.murray stage: -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 13:41:44 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Mar 2012 12:41:44 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: <1332420104.62.0.996755499469.issue14387@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +benjamin.peterson, georg.brandl priority: normal -> release blocker versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 13:49:04 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 22 Mar 2012 12:49:04 +0000 Subject: [issue14378] __future__ imports fail when compiling from python ast In-Reply-To: <1332310782.47.0.882635712321.issue14378@psf.upfronthosting.co.za> Message-ID: <1332420544.44.0.520865190072.issue14378@psf.upfronthosting.co.za> R. David Murray added the comment: After this commit the buildbots are dying randomly with segfaults. ---------- nosy: +r.david.murray priority: normal -> release blocker status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 13:58:04 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 22 Mar 2012 12:58:04 +0000 Subject: [issue14378] __future__ imports fail when compiling from python ast In-Reply-To: <1332310782.47.0.882635712321.issue14378@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 1729ec440bb6 by Benjamin Peterson in branch '2.7': check by equality for __future__ not identity (closes #14378) http://hg.python.org/cpython/rev/1729ec440bb6 ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 13:58:51 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 22 Mar 2012 12:58:51 +0000 Subject: [issue14378] __future__ imports fail when compiling from python ast In-Reply-To: <1332310782.47.0.882635712321.issue14378@psf.upfronthosting.co.za> Message-ID: <1332421131.57.0.0533865995064.issue14378@psf.upfronthosting.co.za> Benjamin Peterson added the comment: 1b467efb9b27 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 14:34:11 2012 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 22 Mar 2012 13:34:11 +0000 Subject: [issue14382] test_unittest crashes loading 'unittest.test.testmock' when run from installed Python In-Reply-To: <1332374837.69.0.204107861729.issue14382@psf.upfronthosting.co.za> Message-ID: <1332423251.77.0.390362310813.issue14382@psf.upfronthosting.co.za> Vinay Sajip added the comment: This should be fixable using the attached patch. ---------- keywords: +patch nosy: +vinay.sajip stage: needs patch -> patch review type: -> behavior Added file: http://bugs.python.org/file24992/Makefile.pre.in.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 14:34:52 2012 From: report at bugs.python.org (Eli Bendersky) Date: Thu, 22 Mar 2012 13:34:52 +0000 Subject: [issue14078] Add 'sourceline' property to xml.etree Elements In-Reply-To: <1329863134.79.0.699697784351.issue14078@psf.upfronthosting.co.za> Message-ID: <1332423292.11.0.46332676585.issue14078@psf.upfronthosting.co.za> Eli Bendersky added the comment: Hi Leon, Thanks for the patch. I suggest to start by raising this to the python-ideas mailing list, to see if anyone has objections / different idea about doing this. Next, keep in mind that starting with 3.3, the default ElementTree implementation comes from the C accelerator Modules/_elementtree.c, and compatibility between the Python and C implementations becomes important. Therefore, each such change has to be added to both implementations. Is your patch done in a common section, or just the Python implementation? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 14:40:33 2012 From: report at bugs.python.org (Sol Jerome) Date: Thu, 22 Mar 2012 13:40:33 +0000 Subject: [issue14388] configparser.py traceback Message-ID: <1332423633.15.0.137948334138.issue14388@psf.upfronthosting.co.za> New submission from Sol Jerome : This seems like it could be user error, but the traceback doesn't provide useful information on where the problem could be. The relevant class is at the following URL. https://github.com/Bcfg2/bcfg2/blob/master/src/lib/Server/Plugin.py#L1180 Traceback (most recent call last): File "/root/bcfg2/Bcfg2/Server/FileMonitor.py", line 64, in handle_one_event self.handles[event.requestID].HandleEvent(event) File "/root/bcfg2/Bcfg2/Server/Plugins/Packages/PackagesSources.py", line 52, in HandleEvent self.pkg_obj.Reload() File "/root/bcfg2/Bcfg2/Server/Plugins/Packages/__init__.py", line 193, in Reload self._load_config() File "/root/bcfg2/Bcfg2/Server/Plugins/Packages/__init__.py", line 203, in _load_config self._load_sources(force_update) File "/root/bcfg2/Bcfg2/Server/Plugins/Packages/__init__.py", line 221, in _load_sources if not self.disableMetaData: File "/root/bcfg2/Bcfg2/Server/Plugins/Packages/__init__.py", line 65, in disableMetaData return not self.config.getboolean("global", "resolver") File "/root/bcfg2/Bcfg2/Server/Plugin.py", line 1216, in getboolean section, option) File "/usr/lib64/python3.2/configparser.py", line 819, in getboolean raw=raw, vars=vars) File "/usr/lib64/python3.2/configparser.py", line 793, in _get return conv(self.get(section, option, **kwargs)) TypeError: get() got an unexpected keyword argument 'raw' Please let me know if more information is required. ---------- components: Library (Lib) messages: 156559 nosy: solj priority: normal severity: normal status: open title: configparser.py traceback type: crash versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 14:48:54 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 22 Mar 2012 13:48:54 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset f34ac2e9d5cf by Antoine Pitrou in branch '3.2': Issue #14387: Do not include accu.h from Python.h. http://hg.python.org/cpython/rev/f34ac2e9d5cf New changeset 5fe7d19ec49a by Antoine Pitrou in branch 'default': Issue #14387: Do not include accu.h from Python.h. http://hg.python.org/cpython/rev/5fe7d19ec49a ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 14:49:31 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Mar 2012 13:49:31 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: <1332424171.71.0.096779059764.issue14387@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Fixed according to Amaury's suggestion. Georg, Benjamin, I think this should probably go into the final releases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 14:56:26 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 22 Mar 2012 13:56:26 +0000 Subject: [issue14388] configparser.py traceback In-Reply-To: <1332423633.15.0.137948334138.issue14388@psf.upfronthosting.co.za> Message-ID: <1332424586.27.0.0827220179584.issue14388@psf.upfronthosting.co.za> R. David Murray added the comment: Looking at the traceback and your code, configparser is calling 'get', expecting to call its own get method (that takes a 'raw' keyword), but instead is calling the get on your subclass, which doesn't take a 'raw' keyword. Since this appears to be example code, probably what you should do to fix this is remove those get methods. Your 'default' is spelled 'fallback' in Python3.2 configparser and does the same thing your code does. ---------- nosy: +lukasz.langa, r.david.murray resolution: -> invalid status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 15:25:29 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Thu, 22 Mar 2012 14:25:29 +0000 Subject: [issue13325] no address in the representation of asyncore dispatcher after connection established In-Reply-To: <1320252902.0.0.0833758767698.issue13325@psf.upfronthosting.co.za> Message-ID: <1332426329.67.0.317819294879.issue13325@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: Closing as duplicate of issue 13694. ---------- resolution: -> duplicate status: open -> closed versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 15:43:44 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 22 Mar 2012 14:43:44 +0000 Subject: [issue14381] Intern certain integral floats for memory savings and performance In-Reply-To: <1332352043.3.0.236525644282.issue14381@psf.upfronthosting.co.za> Message-ID: <1332427424.57.0.971526276394.issue14381@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Yes, there is a measurable performance decrease in pybench arithmetic tests. Integers don't fall out of arithmetic that often, true. But integral floats are incredibly common in tabular data. In a game such as Eve Online, configuration data contains a lot of 0.0, 1.0, -1.0 and so on. This patch saved us many megabytes on the server. I can check again... >>> [sys.getrefcount(float(i)) for i in range(-10, 11)] [777, 4, 38, 9, 215, 691, 627, 185, 98, 603, 73180, 62111, 8326, 6225, 6357, 11737, 2906, 1393, 3142, 1145, 5601] >>> sum([sys.getrefcount(float(i)) for i in range(-10, 11)]) 185340 >>> This is on an idle server. A server with lots of stuff going on will have this: [16715, 184, 1477, 34, 1505, 27102, 3878, 1344, 6248, 974, 595889, 313062, 124072, 120054, 65585, 138667, 13265, 2499, 15677, 3175, 24821] >>> sum([sys.getrefcount(float(i)) for i in range(-10, 11)]) 1465155 About half of the interned floats are 0.0 On a 64 bit machine with each float taking 24 bytes, this is 35mb net. An alternative could be to add a function for manual intering of floating point data, which one can use e.g. when reading tabular data. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 15:44:13 2012 From: report at bugs.python.org (Michael Foord) Date: Thu, 22 Mar 2012 14:44:13 +0000 Subject: [issue14382] test_unittest crashes loading 'unittest.test.testmock' when run from installed Python In-Reply-To: <1332374837.69.0.204107861729.issue14382@psf.upfronthosting.co.za> Message-ID: <1332427453.81.0.173296700216.issue14382@psf.upfronthosting.co.za> Michael Foord added the comment: Thanks vinay (and ned). I thought that was the cause of the problem - but glad you diagnosed and fixed it before I had to look into it. Patch looks good to apply. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 15:59:46 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Mar 2012 14:59:46 +0000 Subject: [issue14381] Intern certain integral floats for memory savings and performance In-Reply-To: <1332352043.3.0.236525644282.issue14381@psf.upfronthosting.co.za> Message-ID: <1332428386.72.0.528181835307.issue14381@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Integers don't fall out of arithmetic that often, true. But integral > floats are incredibly common in tabular data. In a game such as Eve > Online, configuration data contains a lot of 0.0, 1.0, -1.0 and so > on. This patch saved us many megabytes on the server. Can't you do your own interning when reading configuration data? You can even do it in pure Python. If CPython starts interning some integral floats, I think only {-1.0, -0.0, 0.0, 1.0} should apply. The rest is too application-specific. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:06:54 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 22 Mar 2012 15:06:54 +0000 Subject: [issue10340] asyncore doesn't properly handle EINVAL on OSX In-Reply-To: <1289055392.69.0.485144076522.issue10340@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 8c19c9914c22 by Giampaolo Rodola' in branch '2.7': fix #10340: properly handle EINVAL on OSX and also avoid to call handle_connect() in case of a disconnetected socket which is not meant to connect. http://hg.python.org/cpython/rev/8c19c9914c22 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:07:45 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 22 Mar 2012 15:07:45 +0000 Subject: [issue14381] Intern certain integral floats for memory savings and performance In-Reply-To: <1332352043.3.0.236525644282.issue14381@psf.upfronthosting.co.za> Message-ID: <1332428865.34.0.316494979692.issue14381@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: The -10..11 range was determined empirically. As you see from the values, only -10 shows up as significant... In fact, just storing 0 to 5 would capture the bulk of the savings. Right, I'll do some test with the hardcoded values you mentioned. Btw, I don't think -0.0 is worth it, that value is a typical arithmetic result and not something you typically get from input data. Also, while interning in python is certainly possible, perhaps it would make sense to implement such in c. Perhaps in the math module, or perhaps even the 'intern' builtin can be extended for this purpose? It could be documented to intern any immutable object that it sees fit to intern, leaving the details to the implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:12:56 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Mar 2012 15:12:56 +0000 Subject: [issue14381] Intern certain integral floats for memory savings and performance In-Reply-To: <1332428865.34.0.316494979692.issue14381@psf.upfronthosting.co.za> Message-ID: <1332428893.3430.34.camel@localhost.localdomain> Antoine Pitrou added the comment: > Right, I'll do some test with the hardcoded values you mentioned. > Btw, I don't think -0.0 is worth it, that value is a typical > arithmetic result and not something you typically get from input data. I was suggesting -0.0 in the hope that it might make the patch a bit simpler, but I was probably wrong: you still have to test the float's sign to distinguish between the two values. > Also, while interning in python is certainly possible, perhaps it > would make sense to implement such in c. I think it makes sense in the float implementation if it doesn't significantly decrease performance. I suggest you post the benchmark numbers (see http://hg.python.org/benchmarks/ ). Adding a separate builtin/stdlib function would be overkill IMO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:19:54 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 22 Mar 2012 15:19:54 +0000 Subject: [issue10340] asyncore doesn't properly handle EINVAL on OSX In-Reply-To: <1289055392.69.0.485144076522.issue10340@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset e2cddb3f4526 by Giampaolo Rodola' in branch '3.2': fix #10340: properly handle EINVAL on OSX and also avoid to call handle_connect() in case of a disconnetected socket which is not meant to connect. http://hg.python.org/cpython/rev/e2cddb3f4526 New changeset 6ffdca50a5ef by Giampaolo Rodola' in branch 'default': merge 79422b3684f1 in 3.3 branch (issue 10340) http://hg.python.org/cpython/rev/6ffdca50a5ef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:20:30 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Mar 2012 15:20:30 +0000 Subject: [issue14381] Intern certain integral floats for memory savings and performance In-Reply-To: <1332352043.3.0.236525644282.issue14381@psf.upfronthosting.co.za> Message-ID: <1332429630.87.0.844856236056.issue14381@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Try moving your changes from PyFloat_FromDouble to PyFloat_FromString. Look at memory and perfomance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:23:40 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 22 Mar 2012 15:23:40 +0000 Subject: [issue10340] asyncore doesn't properly handle EINVAL on OSX In-Reply-To: <1289055392.69.0.485144076522.issue10340@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 8c1fd9276b25 by Giampaolo Rodola' in branch '3.2': issue 10340 - forgot to update Misc/NEWS http://hg.python.org/cpython/rev/8c1fd9276b25 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:24:41 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 22 Mar 2012 15:24:41 +0000 Subject: [issue10340] asyncore doesn't properly handle EINVAL on OSX In-Reply-To: <1289055392.69.0.485144076522.issue10340@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 13cefcbcc7da by Giampaolo Rodola' in branch 'default': fix #10340: properly handle EINVAL on OSX and also avoid to call handle_connect() in case of a disconnetected socket which is not meant to connect. http://hg.python.org/cpython/rev/13cefcbcc7da ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:26:06 2012 From: report at bugs.python.org (telmich) Date: Thu, 22 Mar 2012 15:26:06 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1332429966.87.0.260730385168.issue14228@psf.upfronthosting.co.za> telmich added the comment: It seems not even using -S fixes the problem: [16:25] brief:python-traceback-test% head -n 2 caller.py #!/usr/bin/python3 -S [16:25] brief:python-traceback-test% ./caller.py Indirect child being called Indirect child being called Indirect child being called ^Ccaught signint in parent Traceback (most recent call last): File "/usr/lib/python3.2/functools.py", line 176, in wrapper result = cache[key] KeyError: (, '[ \\f\\t]*(\\\\\\r?\\n[ \\f\\t]*)*(#[^\\r\\n]*)?((([0-9]+[jJ]|(([0-9]+\\.[0-9]*|\\.[0-9]+)([eE][-+]?[0-9]+)?|[0-9]+[eE][-+]?[0-9]+)[jJ])|(([0-9]+\\.[0-9]*|\\.[0-9]+)([eE][-+]?[0-9]+)?|[0-9]+[eE][-+]?[0-9]+)|(0[xX][0-9a-fA-F]+|0[bB][01]+|0[oO][0-7]+|(?:0+|[1-9][0-9]*)))|((\\*\\*=?|>>=?|<<=?|!=|//=?|->|[+\\-*/%&|^=<>]=?|~)|[][(){}]|(\\r?\\n|\\.\\.\\.|[:;.,@]))|([bB]?[rR]?\'[^\\n\'\\\\]*(?:\\\\.[^\\n\'\\\\]*)*\'|[bB]?[rR]?"[^\\n"\\\\]*(?:\\\\.[^\\n"\\\\]*)*")|\\w+)', 32) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "./__testpython", line 4, in import site File "/usr/lib/python3.2/site.py", line 58, in import traceback File "/usr/lib/python3.2/traceback.py", line 3, in import linecache File "/usr/lib/python3.2/linecache.py", line 10, in import tokenize File "/usr/lib/python3.2/tokenize.py", line 118, in _compile, (Token, PseudoToken, Single3, Double3)) File "/usr/lib/python3.2/tokenize.py", line 115, in _compile return re.compile(expr, re.UNICODE) File "/usr/lib/python3.2/re.py", line 206, in compile [16:25] brief:python-traceback-test% return _compile(pattern, flags) File "/usr/lib/python3.2/re.py", line 255, in _compile return _compile_typed(type(pattern), pattern, flags) File "/usr/lib/python3.2/functools.py", line 180, in wrapper result = user_function(*args, **kwds) File "/usr/lib/python3.2/re.py", line 267, in _compile_typed return sre_compile.compile(pattern, flags) File "/usr/lib/python3.2/sre_compile.py", line 495, in compile code = _code(p, flags) File "/usr/lib/python3.2/sre_compile.py", line 477, in _code _compile_info(code, p, flags) File "/usr/lib/python3.2/sre_compile.py", line 366, in _compile_info lo, hi = pattern.getwidth() File "/usr/lib/python3.2/sre_parse.py", line 163, in getwidth i, j = av[1].getwidth() File "/usr/lib/python3.2/sre_parse.py", line 153, in getwidth l, h = av.getwidth() File "/usr/lib/python3.2/sre_parse.py", line 163, in getwidth i, j = av[1].getwidth() File "/usr/lib/python3.2/sre_parse.py", line 153, in getwidth l, h = av.getwidth() File "/usr/lib/python3.2/sre_parse.py", line 163, in getwidth i, j = av[1].getwidth() File "/usr/lib/python3.2/sre_parse.py", line 153, in getwidth l, h = av.getwidth() File "/usr/lib/python3.2/sre_parse.py", line 163, in getwidth i, j = av[1].getwidth() File "/usr/lib/python3.2/sre_parse.py", line 153, in getwidth l, h = av.getwidth() File "/usr/lib/python3.2/sre_parse.py", line 147, in getwidth REPEATCODES = (MIN_REPEAT, MAX_REPEAT) KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "./__testpython", line 26, in if re.match("__", os.path.basename(sys.argv[0])): NameError: name 're' is not defined ---------- Added file: http://bugs.python.org/file24993/caller.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:26:28 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Thu, 22 Mar 2012 15:26:28 +0000 Subject: [issue10340] asyncore doesn't properly handle EINVAL on OSX In-Reply-To: <1289055392.69.0.485144076522.issue10340@psf.upfronthosting.co.za> Message-ID: <1332429988.69.0.556976681367.issue10340@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- assignee: -> giampaolo.rodola priority: high -> normal resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:31:34 2012 From: report at bugs.python.org (telmich) Date: Thu, 22 Mar 2012 15:31:34 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1332430294.91.0.883112490054.issue14228@psf.upfronthosting.co.za> telmich added the comment: I think setting up SIGINT after importing site is a good solution: It will kill the program as expected and as soon as the user takes over control, she can decide what todo. In which stage/part is the python interpreter when I guess/hope that the race condition between initsigs(); would have been moved downwards? I'm asking, because if 'import site' is done, the maximum output seen that could occur is KeyboardInterrupt if there is no code around there. Which looks way more sane that what I see currently. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:37:16 2012 From: report at bugs.python.org (Practicing Zazen) Date: Thu, 22 Mar 2012 15:37:16 +0000 Subject: [issue14389] Mishandling of large numbers Message-ID: <1332430636.96.0.433531616111.issue14389@psf.upfronthosting.co.za> New submission from Practicing Zazen : Please let me know if this is accepted behavior or not. >>> 99999*99999999999 9999899999900001 >>> 99999*99999999999+0.1 9999899999900000.0 >>> 99999*99999999999+1 9999899999900002 ---------- messages: 156576 nosy: Practicing.Zazen priority: normal severity: normal status: open title: Mishandling of large numbers _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:39:04 2012 From: report at bugs.python.org (Dave Burton) Date: Thu, 22 Mar 2012 15:39:04 +0000 Subject: [issue14367] try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2 In-Reply-To: <1332132143.66.0.7093323157.issue14367@psf.upfronthosting.co.za> Message-ID: <1332430744.6.0.41603542026.issue14367@psf.upfronthosting.co.za> Dave Burton added the comment: Well, the exception is NotImplementedError. It's raised explicitly in pygame\__init__.py I uncommented my commented-out print statement in inspect.py, and added a traceback print, and ran pydoc like this: c:\python32\python.exe c:\python32\Lib\pydoc.py -p 7464 The I viewed http://localhost:7464/pygame.html in a web browser, and the pydoc server printed: Server ready at http://localhost:7464/ Server commands: [b]rowser, [q]uit server> c:\python32\Lib\inspect.py:105: RuntimeWarning: use scrap: No module named scrap (ImportError: No module named scrap) result = (hasattr(object, "__get__") dbg: ismethoddescriptor() failed, exception=NotImplementedError('scrap module not available\n(ImportError: No module named scrap)',) Traceback (most recent call last): File "c:\python32\Lib\inspect.py", line 105, in ismethoddescriptor result = (hasattr(object, "__get__") File "c:\python32\lib\site-packages\pygame\__init__.py", line 74, in __getattr__ raise NotImplementedError(MissingPygameModule) NotImplementedError: scrap module not available (ImportError: No module named scrap) ------------------------------------------------------------ c:\python32\Lib\inspect.py:105: RuntimeWarning: use sndarray: no module named numpy or Numeric found (ImportError: no module named numpy or Numeric found) result = (hasattr(object, "__get__") dbg: ismethoddescriptor() failed, exception=NotImplementedError('sndarray module not available\n(ImportError: no module named numpy or Numeric found)',) Traceback (most recent call last): ...(etc.) Here's the modified ismethoddescriptor() in inspect.py: def ismethoddescriptor(object): """Return true if the object is a method descriptor. But not if ismethod() or isclass() or isfunction() are true. This is new in Python 2.2, and, for example, is true of int.__add__. An object passing this test has a __get__ attribute but not a __set__ attribute, but beyond that the set of attributes varies. __name__ is usually sensible, and __doc__ often is. Methods implemented via descriptors that also pass one of the other tests return false from the ismethoddescriptor() test, simply because the other tests promise more -- you can, e.g., count on having the __func__ attribute (etc) when an object passes ismethod().""" import traceback try: result = (hasattr(object, "__get__") and not hasattr(object, "__set__") # else it's a data descriptor and not ismethod(object) # mutual exclusion and not isfunction(object) and not isclass(object)) except Exception as whichone: print('dbg: ismethoddescriptor('+repr(object)+') failed, exception='+repr(whichone)) traceback.print_exc(file=sys.stdout) print("-"*60 + '\n') result = False return result ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:49:36 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 22 Mar 2012 15:49:36 +0000 Subject: [issue14381] Intern certain integral floats for memory savings and performance In-Reply-To: <1332352043.3.0.236525644282.issue14381@psf.upfronthosting.co.za> Message-ID: <1332431376.48.0.723378079453.issue14381@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: PyFloat_FromString() is very restrictive. In our case, for example, the floats in question don't come from text files. I'm adding a new file with changes suggested by Antoine. only 0.0 and 1.0 are interned. It turns out that the "int" test is expensive, and special casing it to check for '0.0' and '1.0' with direct float comparison makes the performance hit go away. Here are the figures: D:\pydev\hg\cpython2>pcbuild10\python.exe Tools\pybench\pybench.py -s interned8 -c normal ------------------------------------------------------------------------------- PYBENCH 2.1 ------------------------------------------------------------------------------- * using CPython 3.3.0a1+ (default, Mar 22 2012, 15:39:50) [MSC v.1600 32 bit (Intel)] * disabled garbage collection * system check interval set to maximum: 2147483647 * using timer: time.clock ------------------------------------------------------------------------------- Benchmark: interned8 ------------------------------------------------------------------------------- Rounds: 10 Warp: 10 Timer: time.clock Machine Details: Platform ID: Windows-7-6.1.7601-SP1 Processor: Intel64 Family 6 Model 26 Stepping 5, GenuineIntel Python: Implementation: CPython Executable: D:\pydev\hg\cpython2\pcbuild10\python.exe Version: 3.3.0a1+ Compiler: MSC v.1600 32 bit (Intel) Bits: 32bit Build: Mar 22 2012 15:39:50 (#default) Unicode: UCS4 ------------------------------------------------------------------------------- Comparing with: normal ------------------------------------------------------------------------------- Rounds: 10 Warp: 10 Timer: time.clock Machine Details: Platform ID: Windows-7-6.1.7601-SP1 Processor: Intel64 Family 6 Model 26 Stepping 5, GenuineIntel Python: Implementation: CPython Executable: D:\pydev\hg\cpython2\pcbuild10\python.exe Version: 3.3.0a1+ Compiler: MSC v.1600 32 bit (Intel) Bits: 32bit Build: Mar 22 2012 13:53:45 (#default) Unicode: UCS4 Test minimum run-time average run-time this other diff this other diff ------------------------------------------------------------------------------- BuiltinFunctionCalls: 59ms 59ms -0.7% 60ms 60ms -0.3% BuiltinMethodLookup: 40ms 40ms -0.2% 40ms 40ms -0.2% CompareFloats: 47ms 46ms +2.3% 47ms 46ms +2.3% CompareFloatsIntegers: 125ms 126ms -0.8% 129ms 131ms -2.0% CompareIntegers: 76ms 76ms -0.2% 76ms 76ms -0.3% CompareInternedStrings: 60ms 60ms -0.0% 61ms 61ms +0.2% CompareLongs: 44ms 44ms -0.4% 44ms 44ms -0.4% CompareStrings: 59ms 58ms +2.1% 59ms 58ms +1.8% ComplexPythonFunctionCalls: 59ms 60ms -1.7% 60ms 61ms -2.5% ConcatStrings: 49ms 55ms -10.7% 49ms 55ms -10.6% CreateInstances: 67ms 66ms +1.1% 68ms 68ms -0.1% CreateNewInstances: 50ms 50ms +1.3% 51ms 50ms +0.4% CreateStringsWithConcat: 70ms 71ms -1.3% 70ms 72ms -1.7% DictCreation: 45ms 46ms -1.7% 46ms 46ms -1.5% DictWithFloatKeys: 81ms 84ms -2.8% 81ms 84ms -2.7% DictWithIntegerKeys: 52ms 55ms -5.4% 52ms 55ms -5.1% DictWithStringKeys: 47ms 51ms -6.6% 48ms 51ms -6.6% ForLoops: 42ms 42ms +0.2% 42ms 42ms +0.2% IfThenElse: 63ms 59ms +5.5% 63ms 59ms +5.6% ListSlicing: 39ms 39ms +0.0% 39ms 39ms -0.4% NestedForLoops: 67ms 67ms -0.2% 68ms 68ms +0.0% NestedListComprehensions: 63ms 62ms +1.2% 64ms 63ms +1.2% NormalClassAttribute: 102ms 100ms +1.3% 102ms 101ms +1.4% NormalInstanceAttribute: 62ms 62ms +0.2% 63ms 63ms +0.2% PythonFunctionCalls: 60ms 60ms +0.8% 61ms 60ms +1.3% PythonMethodCalls: 74ms 74ms -0.0% 74ms 74ms -0.3% Recursion: 103ms 102ms +1.4% 104ms 102ms +1.3% SecondImport: 109ms 109ms -0.4% 110ms 110ms -0.6% SecondPackageImport: 111ms 112ms -0.6% 113ms 113ms +0.2% SecondSubmoduleImport: 154ms 153ms +0.7% 155ms 155ms -0.2% SimpleComplexArithmetic: 56ms 54ms +3.7% 57ms 56ms +1.9% SimpleDictManipulation: 94ms 93ms +0.3% 94ms 94ms -0.2% SimpleFloatArithmetic: 45ms 44ms +3.2% 45ms 45ms +1.7% SimpleIntFloatArithmetic: 57ms 56ms +1.8% 57ms 57ms +0.1% SimpleIntegerArithmetic: 56ms 56ms +1.2% 57ms 56ms +1.0% SimpleListComprehensions: 53ms 52ms +1.8% 54ms 53ms +2.4% SimpleListManipulation: 49ms 53ms -8.0% 50ms 53ms -6.7% SimpleLongArithmetic: 41ms 40ms +1.6% 41ms 41ms +0.1% SmallLists: 66ms 68ms -2.8% 67ms 68ms -2.5% SmallTuples: 76ms 72ms +5.5% 76ms 72ms +5.8% SpecialClassAttribute: 144ms 140ms +2.8% 145ms 142ms +2.1% SpecialInstanceAttribute: 64ms 64ms +0.7% 65ms 64ms +1.1% StringMappings: 126ms 132ms -4.2% 127ms 132ms -4.0% StringPredicates: 71ms 70ms +2.3% 72ms 70ms +2.5% StringSlicing: 66ms 67ms -0.6% 67ms 67ms -1.1% TryExcept: 44ms 43ms +1.5% 44ms 44ms +0.7% TryFinally: 49ms 53ms -7.4% 49ms 54ms -8.1% TryRaiseExcept: 24ms 22ms +8.6% 25ms 23ms +8.9% TupleSlicing: 61ms 61ms -0.7% 61ms 62ms -0.5% WithFinally: 65ms 65ms -0.3% 65ms 65ms -0.0% WithRaiseExcept: 62ms 62ms -0.4% 62ms 63ms -0.6% ------------------------------------------------------------------------------- Totals: 3448ms 3454ms -0.2% 3474ms 3487ms -0.4% (this=interned8, other=normal) D:\pydev\hg\cpython2> ---------- Added file: http://bugs.python.org/file24994/internfloat.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:50:40 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Mar 2012 15:50:40 +0000 Subject: [issue14389] Mishandling of large numbers In-Reply-To: <1332430636.96.0.433531616111.issue14389@psf.upfronthosting.co.za> Message-ID: <1332431440.61.0.927504724859.issue14389@psf.upfronthosting.co.za> Antoine Pitrou added the comment: See http://docs.python.org/dev/faq/design.html#why-are-floating-point-calculations-so-inaccurate ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:56:12 2012 From: report at bugs.python.org (poq) Date: Thu, 22 Mar 2012 15:56:12 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1332431772.64.0.158728268403.issue14228@psf.upfronthosting.co.za> poq added the comment: > It seems not even using -S fixes the problem That's because you try to use re and os in your except block, and the KeyboardInterrupt is raised before they are imported. ---------- nosy: +poq _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 16:58:04 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 22 Mar 2012 15:58:04 +0000 Subject: [issue14367] try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2 In-Reply-To: <1332132143.66.0.7093323157.issue14367@psf.upfronthosting.co.za> Message-ID: <1332431884.49.0.826481869607.issue14367@psf.upfronthosting.co.za> R. David Murray added the comment: Michael, I thought you might be interested in this one since it looks like it might involve inspect executing code unexpectedly, and I know you worked on ways of not doing that... ---------- nosy: +michael.foord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:02:23 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 22 Mar 2012 16:02:23 +0000 Subject: [issue10538] PyArg_ParseTuple("s*") does not always incref object In-Reply-To: <1290758853.31.0.608837110631.issue10538@psf.upfronthosting.co.za> Message-ID: <1332432143.8.0.383732704767.issue10538@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Adding a patch here. ---------- keywords: +patch Added file: http://bugs.python.org/file24995/#10538.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:08:59 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 22 Mar 2012 16:08:59 +0000 Subject: [issue14389] Mishandling of large numbers In-Reply-To: <1332430636.96.0.433531616111.issue14389@psf.upfronthosting.co.za> Message-ID: <1332432539.41.0.797602097707.issue14389@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- resolution: -> invalid stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:09:25 2012 From: report at bugs.python.org (telmich) Date: Thu, 22 Mar 2012 16:09:25 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1332432565.68.0.473229192063.issue14228@psf.upfronthosting.co.za> telmich added the comment: Oh yes, you are right. Sorry for the confusion. When modifying caller.py to only print(), everything works. But then I've a different problem: If I want to exit(1), in case I get a SIGINT, I'd like to try to import sys. But trying to import sys, will probably fail again, because the user is still pressing ctrl-c: [17:05] brief:python-traceback-test% ./caller.py Indirect child being called Indirect child being called Indirect child being called Indirect child being called Indirect child being called Indirect child being called Indirect child being called Indirect child being called Indirect child being called Indirect child being called ^Ccaught signint in child [17:05] brief:python-traceback-test% ./caller.py Indirect child being called Indirect child being called Indirect child being called Indirect child being called Indirect child being called Indirect child being called Indirect child being called ^Ccaught signint in child Fatal Python error: Py_Initialize: can't initialize sys standard streams Traceback (most recent call last): File "/usr/lib/python3.2/io.py", line 60, in [17:05] brief:python-traceback-test% import _io File "/usr/lib/python3.2/os.py", line 22, in """ KeyboardInterrupt ./shellpart.sh: line 7: 23123 Aborted ./__testpython I'll change my production code to run with -S and restoring SIGINT and report back. In any case, I'd appreciate, if cpython would be changed to something more sane/less verbose by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:09:43 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 22 Mar 2012 16:09:43 +0000 Subject: [issue14307] Make subclassing SocketServer simpler for non-blocking frameworks In-Reply-To: <1331767378.71.0.470789063251.issue14307@psf.upfronthosting.co.za> Message-ID: <1332432583.38.0.642554978385.issue14307@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: What's wrong with making functionality overridable, Antoine? By all means, let's keep the select() but allow subclasses to elect not to use it. As for the wakeup fd, there isn't such a thing. Why object on the basis of a hypothetical feature which might be added later? And should it be added later, it would require changes to SocketServer anyway. Why not arrange it so that such functionality can be added in an extensible manner? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:10:07 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 22 Mar 2012 16:10:07 +0000 Subject: [issue14389] Mishandling of large numbers In-Reply-To: <1332430636.96.0.433531616111.issue14389@psf.upfronthosting.co.za> Message-ID: <1332432607.57.0.107985075943.issue14389@psf.upfronthosting.co.za> R. David Murray added the comment: You might want to take a look at the Decimal module. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:16:45 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 22 Mar 2012 16:16:45 +0000 Subject: [issue10340] asyncore doesn't properly handle EINVAL on OSX In-Reply-To: <1289055392.69.0.485144076522.issue10340@psf.upfronthosting.co.za> Message-ID: <1332433005.58.0.117490880788.issue10340@psf.upfronthosting.co.za> R. David Murray added the comment: This appears to be causing buildbot failures: http://www.python.org/dev/buildbot/all/builders/x86%20debian%20parallel%203.x/builds/4077 http://www.python.org/dev/buildbot/all/builders/AMD64%20Gentoo%20Wide%203.x/builds/3520 ---------- keywords: +buildbot status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:18:26 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Mar 2012 16:18:26 +0000 Subject: [issue10538] PyArg_ParseTuple("s*") does not always incref object In-Reply-To: <1290758853.31.0.608837110631.issue10538@psf.upfronthosting.co.za> Message-ID: <1332433106.11.0.555393809105.issue10538@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Looks good to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:20:34 2012 From: report at bugs.python.org (Georg Brandl) Date: Thu, 22 Mar 2012 16:20:34 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: <1332433234.59.0.290482193951.issue14387@psf.upfronthosting.co.za> Georg Brandl added the comment: Sounds reasonable to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:22:39 2012 From: report at bugs.python.org (Stefan Krah) Date: Thu, 22 Mar 2012 16:22:39 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: <1332433359.52.0.82453403142.issue14387@psf.upfronthosting.co.za> Stefan Krah added the comment: Hmm, I still get the error in 13cefcbcc7da: c:\Users\stefan\pydev\cpython\Include\accu.h(21) : error C2059: syntax error : 'type' c:\Users\stefan\pydev\cpython\Include\accu.h(22) : error C2059: syntax error : '}' c:\Users\stefan\pydev\cpython\Include\accu.h(24) : error C2143: syntax error : missing ')' before '* ' c:\Users\stefan\pydev\cpython\Include\accu.h(24) : error C2143: syntax error : missing '{' before '* ' c:\Users\stefan\pydev\cpython\Include\accu.h(24) : error C2059: syntax error : ')' c:\Users\stefan\pydev\cpython\Include\accu.h(25) : error C2143: syntax error : missing ')' before '* ' c:\Users\stefan\pydev\cpython\Include\accu.h(25) : error C2143: syntax error : missing '{' before '* ' c:\Users\stefan\pydev\cpython\Include\accu.h(25) : error C2371: 'PyObject' : redefinit [...] c:\users\stefan\pydev\cpython\objects\stringlib/unicode_format.h(128) : error C2143: syntax error : missing ')' before '*' c:\users\stefan\pydev\cpython\objects\stringlib/unicode_format.h(128) : error C2143: syntax error : missing '{' before '*' c:\users\stefan\pydev\cpython\objects\stringlib/unicode_format.h(128) : error C2371: 'PyObject' : re definition; different basic types ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:24:03 2012 From: report at bugs.python.org (Georg Brandl) Date: Thu, 22 Mar 2012 16:24:03 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: <1332433443.64.0.424981124892.issue14387@psf.upfronthosting.co.za> Georg Brandl added the comment: We can of course also rename "small". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:37:34 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 22 Mar 2012 16:37:34 +0000 Subject: [issue10538] PyArg_ParseTuple("s*") does not always incref object In-Reply-To: <1290758853.31.0.608837110631.issue10538@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 17c671529f7e by Kristj?n Valur J?nsson in branch '2.7': Issue #10538. Put a reference to the source object in the Py_buffer when http://hg.python.org/cpython/rev/17c671529f7e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:38:31 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 22 Mar 2012 16:38:31 +0000 Subject: [issue10538] PyArg_ParseTuple("s*") does not always incref object In-Reply-To: <1290758853.31.0.608837110631.issue10538@psf.upfronthosting.co.za> Message-ID: <1332434311.06.0.381199753406.issue10538@psf.upfronthosting.co.za> Changes by Kristj?n Valur J?nsson : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:46:27 2012 From: report at bugs.python.org (Miki Tebeka) Date: Thu, 22 Mar 2012 16:46:27 +0000 Subject: [issue14384] Add "default" kw argument to operator.itemgetter and operator.attrgetter In-Reply-To: <1332378559.49.0.430445927373.issue14384@psf.upfronthosting.co.za> Message-ID: <1332434787.76.0.413820575606.issue14384@psf.upfronthosting.co.za> Miki Tebeka added the comment: IMO in the case of multiple items/attrs then you return default in their place: attrgetter('x', 'y', default=7)(None) => (7, 7) In case of dotted attribute again it'll return default value of any of the attributes is not found: attrgetter('x.y', default=7)(None) => 7 BTW: This is inspired from Clojure's get-in (http://bit.ly/GGzqjh) function. I'll bring this up in python-ideas. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:50:25 2012 From: report at bugs.python.org (Miki Tebeka) Date: Thu, 22 Mar 2012 16:50:25 +0000 Subject: [issue14384] Add "default" kw argument to operator.itemgetter and operator.attrgetter In-Reply-To: <1332378559.49.0.430445927373.issue14384@psf.upfronthosting.co.za> Message-ID: <1332435025.64.0.839780819743.issue14384@psf.upfronthosting.co.za> Miki Tebeka added the comment: python-ideas post at https://groups.google.com/d/msg/python-ideas/lc_hkpKNvAg/ledftgY0mFUJ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:55:27 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Mar 2012 16:55:27 +0000 Subject: [issue14371] Add support for bzip2 compression to the zipfile module In-Reply-To: <1332243041.43.0.499117498297.issue14371@psf.upfronthosting.co.za> Message-ID: <1332435327.29.0.576091982542.issue14371@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: All errors are fixed. All tests are passed. Unfortunately, the patch was more than expected. This is necessary for correct and effective work with large bzip2 buffers (for other codecs can also be a profit). ---------- Added file: http://bugs.python.org/file24996/bzip2_in_zip_2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 17:57:27 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 22 Mar 2012 16:57:27 +0000 Subject: [issue14384] Add "default" kw argument to operator.itemgetter and operator.attrgetter In-Reply-To: <1332378559.49.0.430445927373.issue14384@psf.upfronthosting.co.za> Message-ID: <1332435447.78.0.841515243652.issue14384@psf.upfronthosting.co.za> R. David Murray added the comment: Great. I'm going to close the issue, but it's only "for now": if you get a good response and a design agreement on python-ideas please reopen the issue. Of course, we'd need a patch, too; and I believe there would need to be close to zero impact on performance, since as I understand it a large part of the point of attrgetter and friends is speed. ---------- nosy: +rhettinger resolution: -> later stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 18:21:39 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Mar 2012 17:21:39 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: <1332436899.25.0.0661399001214.issue14387@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Hmm, I still get the error in 13cefcbcc7da: Can you try to find a fix? I don't have anything to test here. ---------- assignee: pitrou -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 18:22:58 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Mar 2012 17:22:58 +0000 Subject: [issue14371] Add support for bzip2 compression to the zipfile module In-Reply-To: <1332243041.43.0.499117498297.issue14371@psf.upfronthosting.co.za> Message-ID: <1332436978.92.0.186691057308.issue14371@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +nadeem.vawda stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 18:28:47 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 17:28:47 +0000 Subject: [issue10538] PyArg_ParseTuple("s*") does not always incref object In-Reply-To: <1290758853.31.0.608837110631.issue10538@psf.upfronthosting.co.za> Message-ID: <1332437327.83.0.820163026799.issue10538@psf.upfronthosting.co.za> STINNER Victor added the comment: You should mention your change in Misc/NEWS. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 18:50:30 2012 From: report at bugs.python.org (Jeff Robbins) Date: Thu, 22 Mar 2012 17:50:30 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: <1332438630.58.0.594774990883.issue14387@psf.upfronthosting.co.za> Jeff Robbins added the comment: The easiest fix would be to rename the "small" field in accu.h (and of course in any file that references that field.) I have no idea who uses this file. Perhaps the 2nd easiest fix would be to put this after the #include of Windows.h #ifdef small #undef small #endif As long as any extension also including Windows.h included Windows.h BEFORE Python.h, this should fix the problem for an extension builder. A further thought is to put #define WIN32_LEAN_AND_MEAN right before the #include Windows.h This doesn't fix the extension problem in that every #include of Windows.h would need to do this (SQLITE doesn't right now) but if all Python needs from Windows.h is in the "WIN32_LEAN_AND_MEAN" subset, it seems like a good thing in general, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 19:18:52 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 22 Mar 2012 18:18:52 +0000 Subject: [issue1676] Fork/exec issues with Tk 8.5/Python 2.5.1 on OS X In-Reply-To: <1198200328.37.0.27301275997.issue1676@psf.upfronthosting.co.za> Message-ID: <1332440332.81.0.944632050926.issue1676@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Let's close this issue as very old and obsolete. ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 19:23:35 2012 From: report at bugs.python.org (Daniel Swanson) Date: Thu, 22 Mar 2012 18:23:35 +0000 Subject: [issue14361] No link to issue tracker on Python home page In-Reply-To: <1332069267.85.0.0257661397774.issue14361@psf.upfronthosting.co.za> Message-ID: <1332440615.08.0.10290568903.issue14361@psf.upfronthosting.co.za> Daniel Swanson added the comment: I agree that the link to the bug tracker should be more obvious (yesterday it took me almost an hour to find it) ---------- nosy: +weirdink13 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 19:32:52 2012 From: report at bugs.python.org (Michael Foord) Date: Thu, 22 Mar 2012 18:32:52 +0000 Subject: [issue14367] try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2 In-Reply-To: <1332132143.66.0.7093323157.issue14367@psf.upfronthosting.co.za> Message-ID: <1332441172.74.0.40862531987.issue14367@psf.upfronthosting.co.za> Michael Foord added the comment: The code is *already* triggering execution through the use of hasattr. It could be switched to use getattr_static instead, but the try...except in the patch looks reasonable whether or not that change is made. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 19:39:21 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Mar 2012 18:39:21 +0000 Subject: [issue14367] try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2 In-Reply-To: <1332132143.66.0.7093323157.issue14367@psf.upfronthosting.co.za> Message-ID: <1332441561.96.0.885045209699.issue14367@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Well, the exception shouldn't be silenced. As David said, I think it would be better to silence the exception in pydoc. Besides, it would be nice to come with a standalone test case, because it's not clear exactly why pygame triggers this. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 19:42:50 2012 From: report at bugs.python.org (Jeff Knupp) Date: Thu, 22 Mar 2012 18:42:50 +0000 Subject: [issue14380] MIMEText should default to utf8 charset if input text contains non-ASCII In-Reply-To: <1332351288.3.0.0981603454883.issue14380@psf.upfronthosting.co.za> Message-ID: <1332441770.67.0.5600115225.issue14380@psf.upfronthosting.co.za> Jeff Knupp added the comment: Patch to default character set to utf8 if non-ascii characters are found in the input string. Please let me know if this is what you had in mind. ---------- nosy: +Jeff.Knupp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 19:43:15 2012 From: report at bugs.python.org (Jeff Knupp) Date: Thu, 22 Mar 2012 18:43:15 +0000 Subject: [issue14380] MIMEText should default to utf8 charset if input text contains non-ASCII In-Reply-To: <1332351288.3.0.0981603454883.issue14380@psf.upfronthosting.co.za> Message-ID: <1332441795.21.0.100966173688.issue14380@psf.upfronthosting.co.za> Changes by Jeff Knupp : ---------- keywords: +patch Added file: http://bugs.python.org/file24997/mailutf8.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 19:51:15 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Mar 2012 18:51:15 +0000 Subject: [issue14307] Make subclassing SocketServer simpler for non-blocking frameworks In-Reply-To: <1331767378.71.0.470789063251.issue14307@psf.upfronthosting.co.za> Message-ID: <1332442275.59.0.346238263185.issue14307@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > What's wrong with making functionality overridable, Antoine? By all > means, let's keep the select() but allow subclasses to elect not to use > it. It's making the implementation more complex for no obvious point. Using select() is not a bug in itself. Furthermore, you can simply reimplement serve_forever() in your subclass, if you really want it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 19:57:06 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 22 Mar 2012 18:57:06 +0000 Subject: [issue14380] MIMEText should default to utf8 charset if input text contains non-ASCII In-Reply-To: <1332351288.3.0.0981603454883.issue14380@psf.upfronthosting.co.za> Message-ID: <1332442626.06.0.68801101853.issue14380@psf.upfronthosting.co.za> R. David Murray added the comment: Pretty close. I'd do the check for us_ascii first, and only do the encode test/switch to utf-8 if that's the charset. The reason is that that if a charset has been specified, we don't waste time doing an unnecessary encoding (and the ascii codec is very fast, which you can't say about all the codecs). Now, what would be *really* nice is to also try latin-1 before falling back to utf-8, but I wouldn't want to make that the default behavior for performance reasons. I'm planning to add support for that at some point, but I haven't decided exactly how (policy setting? New optional setting in the alias structure?) There seem to be unrelated changes to torture_test in your patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 20:04:48 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 22 Mar 2012 19:04:48 +0000 Subject: [issue1222721] tk + setlocale problems... Message-ID: <1332443088.72.0.581625839364.issue1222721@psf.upfronthosting.co.za> Andrew Svetlov added the comment: I have no problems with executing demo. I used Russian locale with LC_NUMERIC, utf-8 and cp1251 (Russian Windows encoding). Looks like the problem cannot be reproduced. ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 20:12:55 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 22 Mar 2012 19:12:55 +0000 Subject: [issue14384] Add "default" kw argument to operator.itemgetter and operator.attrgetter In-Reply-To: <1332378559.49.0.430445927373.issue14384@psf.upfronthosting.co.za> Message-ID: <1332443575.11.0.0398226778784.issue14384@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 20:22:46 2012 From: report at bugs.python.org (Stefan Krah) Date: Thu, 22 Mar 2012 19:22:46 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: <1332444166.4.0.498250560689.issue14387@psf.upfronthosting.co.za> Stefan Krah added the comment: Jeff's #undef suggestion works here (see patch). But I have a question: Where is Windows.h pulled in anyway? A grep only shows signalmodule.c: $ find . -name "\.hg" -prune -o -type f -print0 | xargs -0 grep -n 'Windows\.h' ./Modules/signalmodule.c:9:#include ./Doc/using/windows.rst:341: `A Python for Windows Tutorial `_ ---------- keywords: +patch Added file: http://bugs.python.org/file24998/issue14387.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 20:27:29 2012 From: report at bugs.python.org (Jeff Robbins) Date: Thu, 22 Mar 2012 19:27:29 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: <1332444449.8.0.408323436004.issue14387@psf.upfronthosting.co.za> Jeff Robbins added the comment: re Stefan Krah's posting: I am sorry if I've caused any confusion. I am building a Python extension (APSW), and it includes the sqlite "amalgamation" and also includes Python.h. Sqlite includes Windows.h. Which then causes the problem when Python.h is included. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 20:37:25 2012 From: report at bugs.python.org (Jeff Knupp) Date: Thu, 22 Mar 2012 19:37:25 +0000 Subject: [issue14380] MIMEText should default to utf8 charset if input text contains non-ASCII In-Reply-To: <1332351288.3.0.0981603454883.issue14380@psf.upfronthosting.co.za> Message-ID: <1332445045.42.0.345563250047.issue14380@psf.upfronthosting.co.za> Jeff Knupp added the comment: Understood. Please take a look at the updated patch. Also, removed the unrelated diffs that somehow were hanging around in my hg mq. ---------- Added file: http://bugs.python.org/file24999/mimeutf8.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 20:44:22 2012 From: report at bugs.python.org (Stefan Krah) Date: Thu, 22 Mar 2012 19:44:22 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332444449.8.0.408323436004.issue14387@psf.upfronthosting.co.za> Message-ID: <20120322194421.GA14077@sleipnir.bytereef.org> Stefan Krah added the comment: Jeff Robbins wrote: > I am sorry if I've caused any confusion. I am building a Python extension > (APSW), and it includes the sqlite "amalgamation" and also includes Python.h. The Python build itself failed here, too, specifically in unicodeobject.c. But I now see that apart from Windows.h there's also windows.h. Case insensitivity is a difficult concept for a Unix user... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:11:37 2012 From: report at bugs.python.org (Ned Deily) Date: Thu, 22 Mar 2012 20:11:37 +0000 Subject: [issue1676] Fork/exec issues with Tk 8.5/Python 2.5.1 on OS X In-Reply-To: <1198200328.37.0.27301275997.issue1676@psf.upfronthosting.co.za> Message-ID: <1332447097.3.0.0974828247297.issue1676@psf.upfronthosting.co.za> Ned Deily added the comment: Yes, whatever the initial problem, it doesn't seem to be an issue anymore. ---------- nosy: +ned.deily resolution: -> out of date stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:13:43 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 22 Mar 2012 20:13:43 +0000 Subject: [issue14380] MIMEText should default to utf8 charset if input text contains non-ASCII In-Reply-To: <1332351288.3.0.0981603454883.issue14380@psf.upfronthosting.co.za> Message-ID: <1332447223.63.0.60404433374.issue14380@psf.upfronthosting.co.za> R. David Murray added the comment: That looks good. ---------- stage: test needed -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:14:57 2012 From: report at bugs.python.org (Stefan Krah) Date: Thu, 22 Mar 2012 20:14:57 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: <1332447297.46.0.700856384788.issue14387@psf.upfronthosting.co.za> Stefan Krah added the comment: To prevent further confusion. :) db154e62ac03 -> OK 5fe7d19ec49a -> failure 5fe7d19ec49a with #undef patch -> OK So I don't know if it is better to revert to db154e62ac03 or to use the #undef patch. Jeff, you originally said: 'An extension which includes both Windows.h and Python.h won't compile due to the Windows.h definition of "small".' Did you include Python.h before or after Windows.h? Extensions are supposed to include Python.h before anything else. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:20:21 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 22 Mar 2012 20:20:21 +0000 Subject: [issue10538] PyArg_ParseTuple("s*") does not always incref object In-Reply-To: <1290758853.31.0.608837110631.issue10538@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 8efe88c0f14e by krisvale in branch '2.7': Issue #10538 - Update Misc/NEWS http://hg.python.org/cpython/rev/8efe88c0f14e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:27:47 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 22 Mar 2012 20:27:47 +0000 Subject: [issue3035] Removing apparently unwanted functions from Tkinter In-Reply-To: <1212517969.87.0.228224366447.issue3035@psf.upfronthosting.co.za> Message-ID: <1332448067.32.0.643579475994.issue3035@psf.upfronthosting.co.za> Andrew Svetlov added the comment: David Murray, I used to think what deprecation process in Python have to go trough PendingDeprectaionWarning to DeprecationWarning and removing in next next release at end. Is it right? Also I thought what that trivial patch does not need to be published in tracker. Will do next time. Terry J. Reedy, the message what you asked was made by GvR in 1995. That functions can be used to point position in text widget (single-line Entry doesn't support it). Now I think we need to deprecate that functions, but also add keyword-only parameters in widgets methods which can accept that ones. Documentation need to be updated as well. I'll make a patch for that. Thank you for mentoring. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:29:22 2012 From: report at bugs.python.org (Jeff Robbins) Date: Thu, 22 Mar 2012 20:29:22 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: <1332448162.51.0.120796128346.issue14387@psf.upfronthosting.co.za> Jeff Robbins added the comment: Stefan asked 'Did you include Python.h before or after Windows.h? Extensions are supposed to include Python.h before anything else. ' I downloaded http://code.google.com/p/apsw/ to test it out on the latest sqlite release. I followed the build instructions on its website and discovered this problem. While the code isn't mine, inspecting apsw.c, the main source file, I can see that the sqlite "amalgamation" is included BEFORE Python.h. It is this "amalgamation" that, in turn, includes Windows.h. Should I contact the extension's author(s)/maintainer(s) and tell them about this ordering requirement? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:29:29 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 22 Mar 2012 20:29:29 +0000 Subject: [issue11077] Tkinter is not thread safe In-Reply-To: <1296488432.58.0.0945320697853.issue11077@psf.upfronthosting.co.za> Message-ID: <1332448169.25.0.529583656982.issue11077@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:31:54 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 22 Mar 2012 20:31:54 +0000 Subject: [issue5527] multiprocessing won't work with Tkinter (under Linux) In-Reply-To: <1237574081.02.0.0677822756927.issue5527@psf.upfronthosting.co.za> Message-ID: <1332448314.8.0.941580840299.issue5527@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:32:54 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 22 Mar 2012 20:32:54 +0000 Subject: [issue1447222] tkinter Dialog fails when more than four buttons are used Message-ID: <1332448374.93.0.228879316307.issue1447222@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:34:01 2012 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Mar 2012 20:34:01 +0000 Subject: [issue10538] PyArg_ParseTuple("s*") does not always incref object In-Reply-To: Message-ID: STINNER Victor added the comment: Thanks :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:34:15 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 22 Mar 2012 20:34:15 +0000 Subject: [issue1252236] Simplying Tkinter's event loop Message-ID: <1332448455.27.0.0281054324961.issue1252236@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:35:23 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 22 Mar 2012 20:35:23 +0000 Subject: [issue14382] test_unittest crashes loading 'unittest.test.testmock' when run from installed Python In-Reply-To: <1332374837.69.0.204107861729.issue14382@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 1ec74eeda4e8 by Ned Deily in branch 'default': Issue #14382: Ensure new unittest.test.testmock is installed. http://hg.python.org/cpython/rev/1ec74eeda4e8 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:36:17 2012 From: report at bugs.python.org (Ned Deily) Date: Thu, 22 Mar 2012 20:36:17 +0000 Subject: [issue14382] test_unittest crashes loading 'unittest.test.testmock' when run from installed Python In-Reply-To: <1332374837.69.0.204107861729.issue14382@psf.upfronthosting.co.za> Message-ID: <1332448577.75.0.6015627816.issue14382@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 21:48:31 2012 From: report at bugs.python.org (John Bollinger) Date: Thu, 22 Mar 2012 20:48:31 +0000 Subject: [issue14390] Tkinter single-threaded deadlock Message-ID: <1332449311.13.0.974359232681.issue14390@psf.upfronthosting.co.za> New submission from John Bollinger : This is the same as issue 452973, created as a new issue pursuant to the instruction given when 452973 was closed as "out of date". In a nutshell, in a program using combining Tkinter with Tcl callbacks written in C, it is possible for even a single-threaded program to deadlock. The case I ran into had these particulars: The main program is in Python, but it relies on a custom extension written in C. Through that extension, C callbacks are registered for various Tcl GUI events, and most of these invoke Python functions via Python's C API. Many of those Python functions invoke Tkinter methods. For example, many of the callbacks are bound to menu item activations, and these typically [try to] contruct a Tkinter dialog the first time they are called. What happens in practice is that the program starts fine, but the GUI freezes as soon as any menu item is activated that has one of the affected callbacks bound to it. Gdb and I are confident that the problem is as described in issue 452973: the program's single thread acquires TKinter's internal Tcl lock when the mouse event processing begins, and does not release it before control re-enters Python (there is no public API by which it can be made to do so). When the Python function invokes Tkinter methods, tkinter attempts to acquire the lock again, at which point it deadlocks because it holds the lock already. I encountered this issue on CentOS 6 (thus Python 2.6.6), but it appears that the problem is still present in the Python 3 trunk. I have flagged this issue only for version 2.6, however, because I cannot currently confirm that it affects later versions (see below regarding testing). I developed a patch against 2.6.6. It fixes the problem by allowing the Tcl lock to be acquired multiple times by any one thread (and requiring it to be released the same number of times before another thread can acquire it). That is perhaps technically inferior to creating public functions around _tkinter.c's ENTER_PYTHON and LEAVE_PYTHON macros, but it doesn't touch the public API. Even if new public functions were provided, the reentrant locking might still be a good fallback. The patch applies cleanly to the trunk, so probably also to every version between that and 2.6.6. I would be happy to contribute the patch, but I am a bit at a loss as to how to write an automated test for it because (1) such a test must depend on an extension module, and (2) test failure means causing a deadlock. Any advice as to whether such a patch would be considered, or as to how best to test it would be welcome. ---------- components: Tkinter messages: 156619 nosy: jcbollinger priority: normal severity: normal status: open title: Tkinter single-threaded deadlock type: behavior versions: Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 22:10:59 2012 From: report at bugs.python.org (R. David Murray) Date: Thu, 22 Mar 2012 21:10:59 +0000 Subject: [issue3035] Removing apparently unwanted functions from Tkinter In-Reply-To: <1212517969.87.0.228224366447.issue3035@psf.upfronthosting.co.za> Message-ID: <1332450659.09.0.297767988778.issue3035@psf.upfronthosting.co.za> R. David Murray added the comment: You are theoretically right about not posting trivial patches, but as you can see, sometimes even a trivial patch elicits unexpected insights. So I like to always post my patches, even the seemingly trivial ones. Then if I don't get any responses, I figure it is OK to to ahead on the trivial ones :) Of course, I don't do this 100% of the time. This is especially true if there has been prior discussion, or sometimes discussion on IRC (although in the latter case I still may post the patch and always post summary of the IRC discussion). As for the deprecation process. PendingDeprecationWarning was introduced for...I forget which feature it was. Something that was going to be around for several releases, anyway. And I think that feature wound up not getting removed until Python3, but I don't remember for sure. Then for a short time we did start using it as you say, giving a three release deprecation cycle (pending, deprecated, gone), but that was before deprecation warnings were made silent. PendingDeprecations were silent, you see, so using them one release early was a hack around the fact that DeprecationWarnings were *not* silent. On the other hand I think we've gotten more strict about "needless" deprecations. If there's no harm in leaving something in, we leave it in. It's too bad Guido's comment wasn't noticed at the Python3 boundary; that is the perfect time to remove such cruft. So doing a PendingDeprecationWarning to remind ourselves that this is something we want to remove in Python4 is also a reasonable approach. Really, I think this is an area where our procedures and criteria are still a bit in flux... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 22:17:05 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 22 Mar 2012 21:17:05 +0000 Subject: [issue3367] Uninitialized value read in parsetok.c In-Reply-To: <1216153264.95.0.467111480464.issue3367@psf.upfronthosting.co.za> Message-ID: <1332451025.21.0.712597397153.issue3367@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Victor, could you check out the last patch here for sysmodule? I gather that you are familiar with it. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 22:18:41 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 22 Mar 2012 21:18:41 +0000 Subject: [issue1222721] tk + setlocale problems... Message-ID: <1332451121.4.0.731692383488.issue1222721@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Thanks for retesting. Closing until there is a clear problem with current releases. ---------- resolution: -> out of date status: open -> closed versions: -Python 2.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 23:38:41 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 22 Mar 2012 22:38:41 +0000 Subject: [issue6270] Menu deletecommand fails if command is already deleted In-Reply-To: <1244754580.13.0.801057820447.issue6270@psf.upfronthosting.co.za> Message-ID: <1332455921.53.0.0633723117472.issue6270@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 23:39:43 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 22 Mar 2012 22:39:43 +0000 Subject: [issue3015] tkinter with wantobjects=False has been broken for some time In-Reply-To: <1212187898.67.0.391803496997.issue3015@psf.upfronthosting.co.za> Message-ID: <1332455983.83.0.488235384579.issue3015@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 23:44:57 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Mar 2012 22:44:57 +0000 Subject: [issue14381] Intern certain integral floats for memory savings and performance In-Reply-To: <1332352043.3.0.236525644282.issue14381@psf.upfronthosting.co.za> Message-ID: <1332456297.12.0.578912918454.issue14381@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Ok. In the current state it doesn't look detrimental, although I'm not convinced it's that useful either. That said, the implementation needs a bit of work, I don't think it's ok for float_is_positive_zero() to use the Py_LONG_LONG casting thing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Mar 22 23:57:30 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 22 Mar 2012 22:57:30 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: <1332457050.88.0.267608535432.issue14387@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Now unicodedata.c does not compile with VS2010, because somewhere, "small" is defined. Do you mind if I change the _PyAccu.small member to 'smalls'? ---------- nosy: +krisvale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 00:00:54 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 22 Mar 2012 23:00:54 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332457050.88.0.267608535432.issue14387@psf.upfronthosting.co.za> Message-ID: <1332456917.3567.0.camel@localhost.localdomain> Antoine Pitrou added the comment: > Now unicodedata.c does not compile with VS2010, because somewhere, "small" is defined. > Do you mind if I change the _PyAccu.small member to 'smalls'? How about the #undef suggested somewhere? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 00:05:16 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 22 Mar 2012 23:05:16 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: <1332457516.49.0.534873683219.issue14387@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Sure, that's simpler. I'll submit a fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 00:10:24 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 22 Mar 2012 23:10:24 +0000 Subject: [issue1524639] Fix Tkinter Tcl-commands memory-leaks Message-ID: <1332457824.02.0.0599266783264.issue1524639@psf.upfronthosting.co.za> Changes by Andrew Svetlov : ---------- assignee: -> asvetlov nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 00:16:20 2012 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 22 Mar 2012 23:16:20 +0000 Subject: [issue1752252] tkFileDialog closes Python when used Message-ID: <1332458180.69.0.298209595052.issue1752252@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Ping. Is there can be reproduced? I like to see the issue as out of date. ---------- nosy: +asvetlov, georg.brandl, loewis, terry.reedy versions: +Python 3.3 -Python 2.6, Python 3.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 00:16:43 2012 From: report at bugs.python.org (Roundup Robot) Date: Thu, 22 Mar 2012 23:16:43 +0000 Subject: [issue14387] Include\accu.h incompatible with Windows.h In-Reply-To: <1332417184.03.0.15615521555.issue14387@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset aff7ff2aae8c by Kristj?n Valur J?nsson in branch '3.2': Issue #14387 : undefine 'small' so that it doesn't clash with Windows headers. http://hg.python.org/cpython/rev/aff7ff2aae8c New changeset 780aaa7b4b62 by Kristj?n Valur J?nsson in branch 'default': Merge with 3.2 (Issue #14387) http://hg.python.org/cpython/rev/780aaa7b4b62 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 02:32:34 2012 From: report at bugs.python.org (R. David Murray) Date: Fri, 23 Mar 2012 01:32:34 +0000 Subject: [issue12553] email should default to 8bit CTE unless policy.must_be_7bit is set In-Reply-To: <1310575646.04.0.928731351527.issue12553@psf.upfronthosting.co.za> Message-ID: <1332466354.14.0.990804008236.issue12553@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- assignee: -> r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 02:33:36 2012 From: report at bugs.python.org (R. David Murray) Date: Fri, 23 Mar 2012 01:33:36 +0000 Subject: [issue7304] email.message.Message.set_payload and as_string given charset 'us-ascii' plus 8bit data produces invalid message In-Reply-To: <1257892368.6.0.221695441401.issue7304@psf.upfronthosting.co.za> Message-ID: <1332466416.6.0.899261777666.issue7304@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- assignee: -> r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 02:55:46 2012 From: report at bugs.python.org (R. David Murray) Date: Fri, 23 Mar 2012 01:55:46 +0000 Subject: [issue7304] email.message.Message.set_payload and as_string given charset 'us-ascii' plus 8bit data produces invalid message In-Reply-To: <1257892368.6.0.221695441401.issue7304@psf.upfronthosting.co.za> Message-ID: <1332467746.22.0.708528981183.issue7304@psf.upfronthosting.co.za> R. David Murray added the comment: In Python2 the fix would be to use charset unknown-8bit instead of us-ascii. In Python3 this actually puts unicode in the message body. There we should default to utf-8, but this requires a more extensive change than the Python2 change, and probably should not be backported. Once this is fixed in Python3 the utf-8 default check can be removed from MIMEText (issue 14380). ---------- versions: +Python 3.3 -Python 3.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 03:18:03 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 23 Mar 2012 02:18:03 +0000 Subject: [issue14380] MIMEText should default to utf8 charset if input text contains non-ASCII In-Reply-To: <1332351288.3.0.0981603454883.issue14380@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset bfd1ba2bbaf8 by R David Murray in branch 'default': #14380: Have MIMEText defaults to utf-8 when passed non-ASCII unicode http://hg.python.org/cpython/rev/bfd1ba2bbaf8 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 03:19:30 2012 From: report at bugs.python.org (R. David Murray) Date: Fri, 23 Mar 2012 02:19:30 +0000 Subject: [issue14380] MIMEText should default to utf8 charset if input text contains non-ASCII In-Reply-To: <1332351288.3.0.0981603454883.issue14380@psf.upfronthosting.co.za> Message-ID: <1332469170.37.0.651118857667.issue14380@psf.upfronthosting.co.za> R. David Murray added the comment: See also issue 7304. It was niggling at the back of my brain, and I finally managed to dig it up. Fixing that is much more complex than fixing this (because set_charset is a *very* strange method), so I committed this patch in case we don't manage to fix 7304 before 3.3 is ready, but with a comment about removing it when 7304 is fixed. Thanks, Jeff. ---------- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 03:41:21 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 23 Mar 2012 02:41:21 +0000 Subject: [issue14380] MIMEText should default to utf8 charset if input text contains non-ASCII In-Reply-To: <1332351288.3.0.0981603454883.issue14380@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 9ceac471bd8c by R David Murray in branch 'default': #14380: Make actual default match docs, fix __init__ order. http://hg.python.org/cpython/rev/9ceac471bd8c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 04:12:53 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 23 Mar 2012 03:12:53 +0000 Subject: [issue1752252] tkFileDialog closes Python when used Message-ID: <1332472373.7.0.717926384363.issue1752252@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Without a specific claimed failing program and contemporary verification, it is hard to know whether one has reproduced or not. With 3.3 I did import tkinter.filedialog as tkf import tkinter as tk fd=tkf.FileDialog(tk.Tk()) fd.go() and got a file dialog window as well as a root window which sat there until I closed the fd window at least 10 seconds later. The root window did not close properly, but I suspect the above in missing anything. In any case, several crash causes have been fixed since 2007, so I agree to close. The file dialog window was not the native window displayed for file selection in IDLE, and was pretty ugly. So I do not imagine that this is used much. It probably could be updated, but that is another issue for another time. ---------- resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 06:04:41 2012 From: report at bugs.python.org (Jim Jewett) Date: Fri, 23 Mar 2012 05:04:41 +0000 Subject: [issue14386] Expose dictproxy as a public type In-Reply-To: <1332381004.13.0.167648412562.issue14386@psf.upfronthosting.co.za> Message-ID: <1332479081.3.0.39400386744.issue14386@psf.upfronthosting.co.za> Jim Jewett added the comment: > The problem is to reject sequence in dictproxy constructor. Why? Just because you can't delegate in quite the same way? A sequence *does* meet the (immutable) Mapping interface; it just won't happen to have any non-integer keys. Or are you worried about IndexError vs KeyError? Personally, I would just document it as returning LookupError, but if you're really worried, you could always catch the IndexError and raise a KeyError from it. > The "PyMapping_Check(dict) && !PyMapping_Check(dict)" I'm not seeing how anything could sanely pass that ... was there a typo when pasting? ---------- nosy: +Jim.Jewett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 07:25:33 2012 From: report at bugs.python.org (Toshihiro Kamishima) Date: Fri, 23 Mar 2012 06:25:33 +0000 Subject: [issue14391] misc TYPO in argparse.Action docstring Message-ID: <1332483933.58.0.148840583117.issue14391@psf.upfronthosting.co.za> New submission from Toshihiro Kamishima : Keywords to specify as string type are incorrect. 'string' should be 'str' ---------- components: Library (Lib) files: argparse.py.patch keywords: patch messages: 156635 nosy: shima__shima priority: normal severity: normal status: open title: misc TYPO in argparse.Action docstring type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file25000/argparse.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 08:03:28 2012 From: report at bugs.python.org (Toshihiro Kamishima) Date: Fri, 23 Mar 2012 07:03:28 +0000 Subject: [issue14392] type=bool doesn't raise error in argparse.Action Message-ID: <1332486208.67.0.940302931961.issue14392@psf.upfronthosting.co.za> New submission from Toshihiro Kamishima : According to the documentation of "argparse.Action", a keyword 'bool' is not allowed for type argument, but it doesn't raise no errors. One possible way to fix this issue is to check in the "argparse._ActionsContainer.add_argument" method. ---------- components: Library (Lib) files: argparse.py.patch keywords: patch messages: 156636 nosy: shima__shima priority: normal severity: normal status: open title: type=bool doesn't raise error in argparse.Action versions: Python 2.7 Added file: http://bugs.python.org/file25001/argparse.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 08:52:56 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 23 Mar 2012 07:52:56 +0000 Subject: [issue14381] Intern certain integral floats for memory savings and performance In-Reply-To: <1332352043.3.0.236525644282.issue14381@psf.upfronthosting.co.za> Message-ID: <1332489176.12.0.469631672697.issue14381@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PyBench contains a lot of different tests and executes them not too long. Random fluctuations of a few percent are possible. We need a more stable realistic test working with floats. $ ./python -m timeit 'x,y,d=1,0,0.01 for i in range(628): x,y=x-d*y,y+d*x' Without patch: 1000 loops, best of 3: 220 usec per loop With patch: 1000 loops, best of 3: 232 usec per loop Difference is 5%. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 09:54:28 2012 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Fri, 23 Mar 2012 08:54:28 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1332432565.68.0.473229192063.issue14228@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: > In any case, I'd appreciate, if cpython would be changed to something more sane/less verbose by default. By default, certainly not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 10:01:35 2012 From: report at bugs.python.org (Dirkjan Ochtman) Date: Fri, 23 Mar 2012 09:01:35 +0000 Subject: [issue14393] Incorporate Guide to Magic Methods? Message-ID: <1332493295.71.0.816804721304.issue14393@psf.upfronthosting.co.za> New submission from Dirkjan Ochtman : Should we perhaps ask if we can include https://github.com/RafeKettler/magicmethods in the official docs? It seems nice (and now ranks higher on Google than the official docs...). ---------- assignee: docs at python components: Documentation messages: 156639 nosy: djc, docs at python priority: normal severity: normal status: open title: Incorporate Guide to Magic Methods? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 10:51:11 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Fri, 23 Mar 2012 09:51:11 +0000 Subject: [issue14394] missing links on performance claims of cdecimal Message-ID: <1332496271.62.0.623566153633.issue14394@psf.upfronthosting.co.za> New submission from Tshepang Lekhonkhobe : Looking at "What's New" section for cdecimal [1], I see this claim: "Performance gains range from 12x for database applications to 80x for numerically intensive applications..." But there's no link on the benchmark code. [1] http://hg.python.org/cpython/file/9ceac471bd8c/Doc/whatsnew/3.3.rst#l599 ---------- assignee: docs at python components: Documentation messages: 156640 nosy: docs at python, tshepang priority: normal severity: normal status: open title: missing links on performance claims of cdecimal versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 10:54:33 2012 From: report at bugs.python.org (Georg Brandl) Date: Fri, 23 Mar 2012 09:54:33 +0000 Subject: [issue14394] missing links on performance claims of cdecimal In-Reply-To: <1332496271.62.0.623566153633.issue14394@psf.upfronthosting.co.za> Message-ID: <1332496473.19.0.187572678229.issue14394@psf.upfronthosting.co.za> Georg Brandl added the comment: It would be nice to have access to the benchmarks, yes, but I hope our users have enough trust in Python to believe this "claim" as it is. ---------- nosy: +georg.brandl priority: normal -> low type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 10:59:21 2012 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Fri, 23 Mar 2012 09:59:21 +0000 Subject: [issue14394] missing links on performance claims of cdecimal In-Reply-To: <1332496473.19.0.187572678229.issue14394@psf.upfronthosting.co.za> Message-ID: Tshepang Lekhonkhobe added the comment: > Georg Brandl added the comment: > > It would be nice to have access to the benchmarks, yes, but I hope our users have enough trust in Python to believe this "claim" as it is. Well, there's also curiosity. For example to find out what is "pi" and "telco", and having to go through that massive issue 7652 to find out is a bit much. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 11:05:31 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Fri, 23 Mar 2012 10:05:31 +0000 Subject: [issue14371] Add support for bzip2 compression to the zipfile module In-Reply-To: <1332243041.43.0.499117498297.issue14371@psf.upfronthosting.co.za> Message-ID: <1332497131.23.0.453177896302.issue14371@psf.upfronthosting.co.za> Nadeem Vawda added the comment: [Adding Alan McIntyre, who is listed as zipfile's maintainer.] I haven't yet had a chance to properly familiarize myself with the zipfile module, but I did notice an issue in the changes to ZipExtFile's read() method. The existing code uses the b"".join() idiom for linear- time concatenation, but the patch replaces it with a version that does "buf += data" after each read. CPython can (I think) do this efficiently, but it can be much slower on other implementations. Martin: > As for the documentation, I propose the wording > > "bzip2 compression was added to the zip file format in 2001. However, even more recent tools (including older Python releases) may not support it, causing either refusal to process the zip file altogether, or faiilure to extract individual files." How about this? "The zip format specification has included support for bzip2 compression since 2001. However, some tools (including older Python releases) do not support it, and may either refuse to process the zip file altogether, or fail to extract individual files." ---------- nosy: +alanmcintyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 11:35:58 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Fri, 23 Mar 2012 10:35:58 +0000 Subject: [issue14366] Supporting bzip2 and lzma compression in zip files In-Reply-To: <1332112236.1.0.964135054036.issue14366@psf.upfronthosting.co.za> Message-ID: <1332498958.52.0.359055274395.issue14366@psf.upfronthosting.co.za> Nadeem Vawda added the comment: I plan on doing a review of the patch, but it might be a week or two before I have time to do it. Regarding changes to lzma; exactly what is being proposed? If it's just additional functions for encoding and decoding of filter specs, then I'm fine with that (and it's not *necessary* to get it into 3.3, though it would still be nice). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 11:38:25 2012 From: report at bugs.python.org (Michael Foord) Date: Fri, 23 Mar 2012 10:38:25 +0000 Subject: [issue14367] try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2 In-Reply-To: <1332132143.66.0.7093323157.issue14367@psf.upfronthosting.co.za> Message-ID: <1332499105.79.0.716474557716.issue14367@psf.upfronthosting.co.za> Michael Foord added the comment: So PyGame __init__.py has various not-a-module objects with __getattr__ that raises a NotImplementedError on every attribute access. Changing inspect to use getattr_static, so it doesn't trigger code execution on attribute access, would fix the problem. Making pydoc resilient against exceptions is probably a *better* solution for the specific problem - although changing ismethoddescriptor to not trigger code execution would be good *as well*. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 11:40:09 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 23 Mar 2012 10:40:09 +0000 Subject: [issue14371] Add support for bzip2 compression to the zipfile module In-Reply-To: <1332497131.23.0.453177896302.issue14371@psf.upfronthosting.co.za> Message-ID: <201203231239.39508.storchaka@gmail.com> Serhiy Storchaka added the comment: > The existing code uses the b"".join() idiom for linear- > time concatenation, but the patch replaces it with a version that does > "buf += data" after each read. You made a mess. The existing code uses ``buf += data``, but I allowed myself to replace it with the ``b"".join()`` idiom. The bzip2 codec has to deal with large pieces of data, now this may be important. In read1 still used ``buf += data``, but not in loop, there is a concatenation of the only two pieces. > "The zip format specification has included support for bzip2 compression Thank you. Can you offer the variant with including both bzip2 and lzma (supported since 2006)? I put him in the upcoming patch that adds support for lzma compression to the zipfile module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 11:52:31 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Fri, 23 Mar 2012 10:52:31 +0000 Subject: [issue14371] Add support for bzip2 compression to the zipfile module In-Reply-To: <1332243041.43.0.499117498297.issue14371@psf.upfronthosting.co.za> Message-ID: <1332499951.25.0.739074097034.issue14371@psf.upfronthosting.co.za> Nadeem Vawda added the comment: > You made a mess. The existing code uses ``buf += data``, but I allowed myself > to replace it with the ``b"".join()`` idiom. The bzip2 codec has to deal with > large pieces of data, now this may be important. In read1 still used ``buf += > data``, but not in loop, there is a concatenation of the only two pieces. My mistake; I confused the bodies of read() and read1(). > Thank you. Can you offer the variant with including both bzip2 and lzma > (supported since 2006)? I put him in the upcoming patch that adds support for > lzma compression to the zipfile module. "The zip format specification has included support for bzip2 compression since 2001, and for LZMA compression since 2006. However, some tools (including older Python releases) do not support these compression methods, and may either refuse to process the zip file altogether, or fail to extract individual files." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 13:06:04 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 23 Mar 2012 12:06:04 +0000 Subject: [issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing In-Reply-To: <1332305186.87.0.484792091693.issue14377@psf.upfronthosting.co.za> Message-ID: <1332504364.2.0.970270669488.issue14377@psf.upfronthosting.co.za> Eli Bendersky added the comment: Hello, thanks for the patch! Since this is a new feature, I suggest discussion it on the python-ideas list first. Next, as for your patch: 1. What is ElementTree_new.py? 2. Note that new features have to be added to in-development versions of Python - 3.3 in our case. In 3.3, the C and Python implementations of the ElementTree API must be compatible. Hence, all new features have to be added to both implementations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 13:14:51 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 23 Mar 2012 12:14:51 +0000 Subject: [issue14349] The documentation of 'dis' doesn't describe MAKE_FUNCTION correctly In-Reply-To: <1331996886.47.0.46755295506.issue14349@psf.upfronthosting.co.za> Message-ID: <1332504891.06.0.00859601507922.issue14349@psf.upfronthosting.co.za> Eli Bendersky added the comment: Patch attached. ---------- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file25002/issue14349.1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 13:24:54 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 23 Mar 2012 12:24:54 +0000 Subject: [issue13782] xml.etree.ElementTree: Element.append doesn't type-check its argument In-Reply-To: <1326502453.32.0.206779556991.issue13782@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 75268a773455 by Eli Bendersky in branch 'default': Issue #13782: streamline argument type-checking in ET.Element http://hg.python.org/cpython/rev/75268a773455 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 13:26:58 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 23 Mar 2012 12:26:58 +0000 Subject: [issue13782] xml.etree.ElementTree: Element.append doesn't type-check its argument In-Reply-To: <1326502453.32.0.206779556991.issue13782@psf.upfronthosting.co.za> Message-ID: <1332505618.55.0.190516981692.issue13782@psf.upfronthosting.co.za> Eli Bendersky added the comment: Closing the issue. 3.3 was fixed, and there was no concensus regarding 2.7/3.2 in the list, so status-quo as usual. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 13:27:00 2012 From: report at bugs.python.org (Ramchandra Apte) Date: Fri, 23 Mar 2012 12:27:00 +0000 Subject: [issue13657] IDLE doesn't support sys.ps1 and sys.ps2. In-Reply-To: <1324640742.58.0.860347532783.issue13657@psf.upfronthosting.co.za> Message-ID: <1332505620.8.0.310871187004.issue13657@psf.upfronthosting.co.za> Ramchandra Apte added the comment: What is the status of this bug? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 13:27:11 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 23 Mar 2012 12:27:11 +0000 Subject: [issue13782] xml.etree.ElementTree: Element.append doesn't type-check its argument In-Reply-To: <1326502453.32.0.206779556991.issue13782@psf.upfronthosting.co.za> Message-ID: <1332505631.8.0.175780729312.issue13782@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- stage: test needed -> committed/rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 13:30:04 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 23 Mar 2012 12:30:04 +0000 Subject: [issue10340] asyncore doesn't properly handle EINVAL on OSX In-Reply-To: <1289055392.69.0.485144076522.issue10340@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset e35a5bbb0b91 by Giampaolo Rodola' in branch 'default': fix failing asyncore test as per http://bugs.python.org/issue10340#msg156586 http://hg.python.org/cpython/rev/e35a5bbb0b91 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 13:31:13 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 23 Mar 2012 12:31:13 +0000 Subject: [issue10340] asyncore doesn't properly handle EINVAL on OSX In-Reply-To: <1289055392.69.0.485144076522.issue10340@psf.upfronthosting.co.za> Message-ID: <1332505873.94.0.152922449099.issue10340@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: Sorry about that. It should now be fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 13:42:21 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 23 Mar 2012 12:42:21 +0000 Subject: [issue10131] deepcopying an xml.dom.minidom.Document generates an invalid XML document In-Reply-To: <1287322940.78.0.0838139062813.issue10131@psf.upfronthosting.co.za> Message-ID: <1332506541.66.0.354013728298.issue10131@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- nosy: -eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 13:45:03 2012 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 23 Mar 2012 12:45:03 +0000 Subject: [issue13968] Support recursive globs In-Reply-To: <1328700146.65.0.884103301197.issue13968@psf.upfronthosting.co.za> Message-ID: <1332506703.84.0.480523621301.issue13968@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- nosy: -eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 14:08:28 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 23 Mar 2012 13:08:28 +0000 Subject: [issue13657] IDLE doesn't support sys.ps1 and sys.ps2. In-Reply-To: <1324640742.58.0.860347532783.issue13657@psf.upfronthosting.co.za> Message-ID: <1332508108.92.0.0902541726375.issue13657@psf.upfronthosting.co.za> Terry J. Reedy added the comment: This is an issue, not a bug, and the status is as it was: unclear just what to do; would require some major work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 14:11:07 2012 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 23 Mar 2012 13:11:07 +0000 Subject: [issue13657] IDLE doesn't support sys.ps1 and sys.ps2. In-Reply-To: <1324640742.58.0.860347532783.issue13657@psf.upfronthosting.co.za> Message-ID: <1332508267.02.0.735096788536.issue13657@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- stage: -> needs patch versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 14:16:03 2012 From: report at bugs.python.org (telmich) Date: Fri, 23 Mar 2012 13:16:03 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1332508563.54.0.0213162984985.issue14228@psf.upfronthosting.co.za> telmich added the comment: Hello Fran?ois, I'm confused about your statement: You prefer to throw random and useless error messages to users who are using python instead of doing a clean shutdown like every other application by default? Don't be offended, but this looks like a software coded by a 12 years old, who is proud about it and does not accept an error being an error and insists on doing it right, although it's a common understanding that throwing errors in non error situations. I would have imagined a more mature understanding and broader view of python developers. If you're not willing to fix this bug but insist on doing it the wrong way by default, I'd recommened to reject this bug so that the problem, the reason and the reason why it continues to exists are cleanly documented. Cheers, Nico ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 14:17:12 2012 From: report at bugs.python.org (R. David Murray) Date: Fri, 23 Mar 2012 13:17:12 +0000 Subject: [issue10340] asyncore doesn't properly handle EINVAL on OSX In-Reply-To: <1289055392.69.0.485144076522.issue10340@psf.upfronthosting.co.za> Message-ID: <1332508632.58.0.39095561278.issue10340@psf.upfronthosting.co.za> R. David Murray added the comment: Better, but not stable: http://www.python.org/dev/buildbot/all/builders/AMD64%20OpenIndiana%203.2/builds/984/steps/test/logs/stdio http://www.python.org/dev/buildbot/all/builders/x86%20OpenIndiana%203.2/builds/998/steps/test/logs/stdio ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 14:19:00 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Fri, 23 Mar 2012 13:19:00 +0000 Subject: [issue13210] Support Visual Studio 2010 In-Reply-To: <1318942521.44.0.961979099616.issue13210@psf.upfronthosting.co.za> Message-ID: <1332508740.98.0.362574674499.issue13210@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Adding a patch to disable Side by Side assemblies in VS2010 (MS saw the light) ---------- keywords: +patch Added file: http://bugs.python.org/file25003/sxs.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 14:27:04 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Fri, 23 Mar 2012 13:27:04 +0000 Subject: [issue13210] Support Visual Studio 2010 In-Reply-To: <1318942521.44.0.961979099616.issue13210@psf.upfronthosting.co.za> Message-ID: <1332509224.39.0.791419656324.issue13210@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Here is a comprehensive patch to errnomodule.c, as used in production at CCP ---------- Added file: http://bugs.python.org/file25004/errnomodule.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 14:32:30 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 23 Mar 2012 13:32:30 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1332508563.54.0.0213162984985.issue14228@psf.upfronthosting.co.za> Message-ID: <1332509264.3416.5.camel@localhost.localdomain> Antoine Pitrou added the comment: > Don't be offended, but this looks like a software coded by a 12 years > old, who is proud about it and does not accept an error being an error > and insists on doing it right, although it's a common understanding > that throwing errors in non error situations. No, the point is that the exception may be caused by a real bug and having the traceback is tremendously useful to debug such situations. So the Python runtime by default prints out the whole traceback when an uncaught exception occurs. KeyboardInterrupt is not different in this regard from, say, ZeroDivisionError. As I said, a possible solution is to allow users to alter the default signal handling (using an env var). (note that, AFAICT, you're the first to report a problem here, although this behaviour has existed for ages) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 14:52:24 2012 From: report at bugs.python.org (telmich) Date: Fri, 23 Mar 2012 13:52:24 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1332510744.76.0.87969119224.issue14228@psf.upfronthosting.co.za> telmich added the comment: Antoine, let me explain again: I do not say, python should not print uncaught exceptions. My point here is that an exception is thrown, which is not catchable at all and this results in random and misleading errors. I really hope you understand that this is the core problem. It's not about printing uncaught exceptions. And being the first to report is not something I feel is a bad sign. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 15:22:06 2012 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 23 Mar 2012 14:22:06 +0000 Subject: [issue10340] asyncore doesn't properly handle EINVAL on OSX In-Reply-To: <1289055392.69.0.485144076522.issue10340@psf.upfronthosting.co.za> Message-ID: <1332512526.83.0.0138723537661.issue10340@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: http://hg.python.org/cpython/rev/0b960e41e533 Let's see how it goes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 15:33:56 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Fri, 23 Mar 2012 14:33:56 +0000 Subject: [issue13210] Support Visual Studio 2010 In-Reply-To: <1318942521.44.0.961979099616.issue13210@psf.upfronthosting.co.za> Message-ID: <1332513236.56.0.976975573584.issue13210@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Adding a patch containing a proposed PCBuild10 folder. This consists of: 1) automatically updated .vcxproj and .sol files, provessed by 3) below 2) manually edited and new .props files to edit TargetName and Extension attributes 3) a vs9to10.py file to additionally process autoconverted .vcxproj files 4) edited .txt and .bat files. Please notice how I have removed a lot of redundant settings from .vcxproj files and moved them to .props files. This is proposed as a new top level directory, similar to what PCBuild9 used to be. Putting stuff inside PC/VS10.0 would require a much more intensive surgery of relative paths and things. Not very nice. ---------- Added file: http://bugs.python.org/file25005/pcbuild10.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 15:38:31 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 23 Mar 2012 14:38:31 +0000 Subject: [issue14314] logging smtp handler (and test) timeout issue In-Reply-To: <1331787575.82.0.497209791656.issue14314@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 113b8e3cbba4 by Vinay Sajip in branch '2.7': Closes #14314: backported fix. http://hg.python.org/cpython/rev/113b8e3cbba4 New changeset 54055646fd1f by Vinay Sajip in branch '3.2': Closes #14314: backported fix. http://hg.python.org/cpython/rev/54055646fd1f ---------- stage: needs patch -> committed/rejected status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 15:42:18 2012 From: report at bugs.python.org (poq) Date: Fri, 23 Mar 2012 14:42:18 +0000 Subject: [issue14228] It is impossible to catch sigint on startup in python code In-Reply-To: <1331197536.95.0.87995012042.issue14228@psf.upfronthosting.co.za> Message-ID: <1332513738.43.0.395081755722.issue14228@psf.upfronthosting.co.za> poq added the comment: > No, the point is that the exception may be caused by a real bug and having the traceback is tremendously useful to debug such situations. [...] KeyboardInterrupt is not different in this regard from, say, ZeroDivisionError. KeyboardInterrupt *is* different though. It is caused by the user instead of by any bug. Of course, it can still be useful to know where the program was interrupted, so showing a traceback for KeyboardInterrupt by default makes sense IMO. > As I said, a possible solution is to allow users to alter the default signal handling (using an env var). Why an environment variable instead of a command line switch (as suggested by Ian Jackson)? Shouldn't a script be able to decide for itself how it handles signals? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 15:54:50 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 23 Mar 2012 14:54:50 +0000 Subject: [issue14393] Incorporate Guide to Magic Methods? In-Reply-To: <1332493295.71.0.816804721304.issue14393@psf.upfronthosting.co.za> Message-ID: <1332514490.56.0.290358130867.issue14393@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Someone would have to 1) determine if this a good idea 2) ask the author 3) actually perform the integration (that is determine how this would replace/complement things in reference/*). ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 16:03:39 2012 From: report at bugs.python.org (Daniel Swanson) Date: Fri, 23 Mar 2012 15:03:39 +0000 Subject: [issue4652] IDLE does not work with Unicode In-Reply-To: <1229154229.3.0.726059762082.issue4652@psf.upfronthosting.co.za> Message-ID: <1332515019.2.0.81024961885.issue4652@psf.upfronthosting.co.za> Daniel Swanson added the comment: ok ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 16:51:18 2012 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 23 Mar 2012 15:51:18 +0000 Subject: [issue14243] NamedTemporaryFile unusable under Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1332517878.94.0.70330613598.issue14243@psf.upfronthosting.co.za> Changes by Jason R. Coombs : ---------- nosy: +jason.coombs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 17:22:06 2012 From: report at bugs.python.org (devurandom) Date: Fri, 23 Mar 2012 16:22:06 +0000 Subject: [issue3581] failures in test_uuid In-Reply-To: <1218991997.09.0.347137407735.issue3581@psf.upfronthosting.co.za> Message-ID: <1332519726.47.0.885544033388.issue3581@psf.upfronthosting.co.za> devurandom added the comment: > Well, without a valid MAC address the function cannot work... It should not break in such ugly way either, imo. > On the other hand, I would not worry too much: > uuid._ifconfig_getnode() is an internal function; and since all the > other tests pass, uuid.getnode() probably has other ways to get a > unique identifier for the machine. Here test_uuid fails due to this issue. Which in turn prevents my python3 rpm from being build. > And by the way, in python 3.2, the test function is skipped with this > message: > """WARNING: uuid._ifconfig_getnode is unreliable on many platforms. > It is disabled until the code and/or test can be fixed properly.""" That does not seem to be true anymore in Python 3.2.2. Would be nice if you could detect the all-zero case and just skip the test in that case. ---------- nosy: +devurandom _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 17:47:24 2012 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 23 Mar 2012 16:47:24 +0000 Subject: [issue14361] No link to issue tracker on Python home page In-Reply-To: <1332069267.85.0.0257661397774.issue14361@psf.upfronthosting.co.za> Message-ID: <1332521244.24.0.753960198823.issue14361@psf.upfronthosting.co.za> Ezio Melotti added the comment: Could you tell us something more (e.g. where you were expecting to find it, where have you looked, how/where have you found it eventually, what search queries you have used)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 17:55:32 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 23 Mar 2012 16:55:32 +0000 Subject: [issue14371] Add support for bzip2 compression to the zipfile module In-Reply-To: <1332243041.43.0.499117498297.issue14371@psf.upfronthosting.co.za> Message-ID: <1332521732.8.0.568354165068.issue14371@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Fixed regeression in decompression. Nadeem Vawda, we both were wrong. `buf += data` is noticeably faster `b''.join()` in CPython. ---------- Added file: http://bugs.python.org/file25006/bzip2_in_zip_3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 19:07:32 2012 From: report at bugs.python.org (Roundup Robot) Date: Fri, 23 Mar 2012 18:07:32 +0000 Subject: [issue7652] Merge C version of decimal into py3k. In-Reply-To: <1262860972.65.0.690079130991.issue7652@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset f6d646e30028 by Stefan Krah in branch 'default': Issue #7652: Enable linking of _decimal.so against an installed libmpdec. http://hg.python.org/cpython/rev/f6d646e30028 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 20:16:18 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 23 Mar 2012 19:16:18 +0000 Subject: [issue3035] Removing apparently unwanted functions from Tkinter In-Reply-To: <1212517969.87.0.228224366447.issue3035@psf.upfronthosting.co.za> Message-ID: <1332530178.39.0.307979857485.issue3035@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Usually, I would counsel against removing anything that isn't broken by design, but the code for these functions offers nothing substantive. So, +1 for marking as deprecated in 3.3 and removing in 3.4. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 20:16:34 2012 From: report at bugs.python.org (David Manowitz) Date: Fri, 23 Mar 2012 19:16:34 +0000 Subject: [issue6634] sys.exit() called from threads other than the main one: undocumented behaviour In-Reply-To: <1249327311.32.0.926815032903.issue6634@psf.upfronthosting.co.za> Message-ID: <1332530194.28.0.545044730007.issue6634@psf.upfronthosting.co.za> David Manowitz added the comment: I don't see why this should be considered acceptable behavior. Why don't threads have their own ThreadExit exception, rather than overloading the use, and therefore, the meaning, of the SystemExit exception? As indicated by their names, sys.exit and the SystemExit exception should *only* be used to exit the entire system, not just a thread! ---------- components: +Library (Lib) nosy: +David.Manowitz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 20:22:05 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 23 Mar 2012 19:22:05 +0000 Subject: [issue14366] Supporting bzip2 and lzma compression in zip files In-Reply-To: <1332112236.1.0.964135054036.issue14366@psf.upfronthosting.co.za> Message-ID: <1332530525.2.0.666669259223.issue14366@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file25007/bzip2_and_lzma_in_zip_3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 20:31:25 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 23 Mar 2012 19:31:25 +0000 Subject: [issue14366] Supporting bzip2 and lzma compression in zip files In-Reply-To: <1332202368.59.0.014961470392.issue14366@psf.upfronthosting.co.za> Message-ID: <201203232130.54045.storchaka@gmail.com> Serhiy Storchaka added the comment: > For EOS, please re-read the specification. Well, nothing prevents the setting of this bit. Lzma raw compressor already appends EOS. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 20:48:17 2012 From: report at bugs.python.org (Stefan Krah) Date: Fri, 23 Mar 2012 19:48:17 +0000 Subject: [issue14394] missing links on performance claims of cdecimal In-Reply-To: <1332496271.62.0.623566153633.issue14394@psf.upfronthosting.co.za> Message-ID: <1332532097.33.0.820119695029.issue14394@psf.upfronthosting.co.za> Stefan Krah added the comment: > But there's no link on the benchmark code. I don't know if external links are appropriate in whatsnew, but this is it: http://www.bytereef.org/mpdecimal/quickstart.html ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 20:48:39 2012 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 23 Mar 2012 19:48:39 +0000 Subject: [issue14366] Supporting bzip2 and lzma compression in zip files In-Reply-To: <1332498958.52.0.359055274395.issue14366@psf.upfronthosting.co.za> Message-ID: <201203232148.15682.storchaka@gmail.com> Serhiy Storchaka added the comment: > Regarding changes to lzma; exactly what is being proposed? Yes, it's just additional functions for encoding and decoding of filter specs. But this is not necessary, the current implementation uses own functions (need the support of only LZMA1 format, which is unlikely to change). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 21:11:47 2012 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 23 Mar 2012 20:11:47 +0000 Subject: [issue14381] Intern certain integral floats for memory savings and performance In-Reply-To: <1332352043.3.0.236525644282.issue14381@psf.upfronthosting.co.za> Message-ID: <1332533507.43.0.866709160744.issue14381@psf.upfronthosting.co.za> Raymond Hettinger added the comment: FWIW, I'm -1 on making the change. Any memory savings would be microscopic for most Python programs. And anything that slows down float creation (even a teeny bit) is detrimental to all Python programs. We're better off not adding special case logic unless there is a clear benefit (there isn't). ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 22:51:40 2012 From: report at bugs.python.org (Parand Darugar) Date: Fri, 23 Mar 2012 21:51:40 +0000 Subject: [issue14395] sftp: downloading files with % in name fails due to logging Message-ID: <1332539499.99.0.427604152776.issue14395@psf.upfronthosting.co.za> New submission from Parand Darugar : Attempting to download a file with a "%" as part of the name (eg. "test%sfile") , sftp.get fails with: File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 328, in getMessage msg = msg % self.args TypeError: not enough arguments for format string This appears to be because of the logging in sftp.py: def _log(self, level, msg, *args): self.logger.log(level, msg, *args) I'm able to work around it by escaping the "%" to "%%" before calling sftp.get . ---------- messages: 156678 nosy: darugar priority: normal severity: normal status: open title: sftp: downloading files with % in name fails due to logging type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Mar 23 23:38:18 2012 From: report at bugs.python.org (Jim Jewett) Date: Fri, 23 Mar 2012 22:38:18 +0000 Subject: [issue14318] clarify "may not" in time.steady docs In-Reply-To: <1331829668.71.0.947018206764.issue14318@psf.upfronthosting.co.za> Message-ID: <1332542298.52.0.507304960878.issue14318@psf.upfronthosting.co.za> Jim Jewett added the comment: (1) How does the user control (or even find out) which clock is used by time.steady()? If the answer is time.steady(clock=QueryPerformanceCounter) then there is no need for strict=?, but then I'm not sure what the point of time.steady itself is. I had been assuming that time.steady() relied on the best clock it could find, which shouldn't normally change on a specific machine, let alone within a single process. In that case, exposing the actual clock (or its name) as an attribute seems better than a boolean "complain_if_my_machine_is_not_good_enough" parameter. (2) That fragment from the C++ standard suggests that "MAY NOT" ought to have been replaced by the unambiguous "MUST NOT". I do not think that python should repeat the editorial error. (3) Even leaving aside the question of which clock is actually provided, I still prefer a change in wording. My trailing paragraph might change with the API, but the rationale for: """Return elapsed seconds as a floating point number. The start time is undefined, so only differences between calls are meaningful. steady() is the best clock for profiling response time, as opposed to CPU usage. """ includes: "elapsed" ==> time since something, as opposed to absolute time. If practicality and efficiency weren't important, I would even suggest that the function return an opaque object that supported only ordering and subtraction (returning a timedelta). There are enough time-related modules/classes/functions/etc that people *will* get confused; the name "steady" isn't obvious enough. Including the intended use case in the docstring gives people a fighting chance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 00:40:31 2012 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Mar 2012 23:40:31 +0000 Subject: [issue14318] clarify "may not" in time.steady docs In-Reply-To: <1331829668.71.0.947018206764.issue14318@psf.upfronthosting.co.za> Message-ID: <1332546031.69.0.263446826662.issue14318@psf.upfronthosting.co.za> STINNER Victor added the comment: > (2) That fragment from the C++ standard suggests that "MAY NOT" ought to have been replaced by the unambiguous "MUST NOT". No. A program cannot deny the modification of system clock and time.steady() may use the system date. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 00:55:06 2012 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 23 Mar 2012 23:55:06 +0000 Subject: [issue14394] missing links on performance claims of cdecimal In-Reply-To: <1332496271.62.0.623566153633.issue14394@psf.upfronthosting.co.za> Message-ID: <1332546906.24.0.051036340459.issue14394@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Instead of what's new, I think, linking the benchmarks in the docs could be helpful so that library users can find it they want to. I think, we have similar performance benchmark links at other places too. ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 01:57:32 2012 From: report at bugs.python.org (Ariel Poliak) Date: Sat, 24 Mar 2012 00:57:32 +0000 Subject: [issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing In-Reply-To: <1332305186.87.0.484792091693.issue14377@psf.upfronthosting.co.za> Message-ID: <1332550652.52.0.58539801685.issue14377@psf.upfronthosting.co.za> Ariel Poliak added the comment: To answer eli.bendersky's questions: 1. That's just the name of the file with my changes in it. I pulled the original file from Hg, copied it to "ElementTree_new.py", made my changes, and created a patch from the two. 2. I'm not very familiar with the structure of the codebase for Python, so I'll provide some information that sounds relevant to me... The changes I made were for the ElementTree.py file under cpython/Lib/xml/etree/ . I used http://hg.python.org/cpython/file/54055646fd1f/Lib/xml/etree/ElementTree.py as the base to make a new patch, reflecting storchaka's recommendation on logic order and a clarification on path name for the modified file. The source for the 'ElementC14N' module is not part of Python, so I cannot modify the code for the '_serialize_c14n' function. It appears that this is dependent on http://bugs.python.org/issue13611 . Looks like I may need to refactor this patch to work in a way that does not alter the signature for the _serialize_* methods. ---------- Added file: http://bugs.python.org/file25008/ElementTree_py-force_long_tags-v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 05:04:24 2012 From: report at bugs.python.org (Adin Scannell) Date: Sat, 24 Mar 2012 04:04:24 +0000 Subject: [issue14396] Popen wait() doesn't handle spurious wakeups Message-ID: <1332561864.36.0.581817043223.issue14396@psf.upfronthosting.co.za> New submission from Adin Scannell : While running a complex python process that executes a bunch of subprocesses (using the subprocess module, specifically calling communicate()), I found myself with occasional zombie processes piling up. Turns out Python is not correctly wait()ing for the children. Although in my case it happens for < 5% of subprocesses, it happens for random Popen objects, used in different ways (using Popen() and then read()/write()/wait() directly or with communicate()). I'd love to find out I'm crazy, but I'm not doing anything too sneaky and the patch below fixes the problem. I'm not sure why it's happening in my particular environment (maybe it just so happens that the child processes enter into states with particular timing, or the parent receives signals at the wrong moments) but it's very reproducible for me. I believe that the cause of the zombie processes is as follows: If you read the description of the waitpid system call (http://www.kernel.org/doc/man-pages/online/pages/man2/wait.2.html), there are several events that could cause waitpid() to return. I have no idea why, but even without WNOHANG set, it looks I'm getting back an occasional 0 return value from waitpid(). Interrupted system call? Stopped child process? Not sure why at the moment. The documentation is a bit ambiguous as to whether this can happen, BUT looking at the example code at the bottom, it seems to handle this spurious wakeup case (which subprocess does not). The net result is that this process has *not* exited or been killed. The python code paths don't consider this possibility (as I believe in normal circumstances, it rarely happens!). I discovered this bug on 2.7.2. I've prepared a patch for the 2.7 branch (75701:d46c1973d3c4), although I'm certain almost all versions, including the tip suffer from this problem. I'm happy to port to other branches if necessary, although I think appropriate maintainers could whip it up in no time flat. I've tested my 2.7 fix and it solves my problem -- no more zombies. This patch does not change the behaviour of the Popen class in the normal case but allows it to handle spurious wakeups. ---------- components: Library (Lib) files: waitpid-2.7.patch keywords: patch messages: 156683 nosy: amscanne priority: normal severity: normal status: open title: Popen wait() doesn't handle spurious wakeups type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file25009/waitpid-2.7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 06:48:26 2012 From: report at bugs.python.org (Brian Curtin) Date: Sat, 24 Mar 2012 05:48:26 +0000 Subject: [issue14396] Popen wait() doesn't handle spurious wakeups In-Reply-To: <1332561864.36.0.581817043223.issue14396@psf.upfronthosting.co.za> Message-ID: <1332568106.12.0.667832308823.issue14396@psf.upfronthosting.co.za> Changes by Brian Curtin : ---------- keywords: +needs review nosy: +gps stage: -> patch review versions: -Python 2.6, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 08:05:37 2012 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 24 Mar 2012 07:05:37 +0000 Subject: [issue14396] Popen wait() doesn't handle spurious wakeups In-Reply-To: <1332561864.36.0.581817043223.issue14396@psf.upfronthosting.co.za> Message-ID: <1332572737.58.0.919288145499.issue14396@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Thanks. I'll see that this fix gets into 2.7, 3.2 and 3.3. Out of curiosity, what Linux kernel version and glibc version were you using? I'm somewhat surprised that I haven't run into this before. :) ---------- assignee: -> gregory.p.smith nosy: +gregory.p.smith -gps versions: +Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 09:14:39 2012 From: report at bugs.python.org (Adin Scannell) Date: Sat, 24 Mar 2012 08:14:39 +0000 Subject: [issue14396] Popen wait() doesn't handle spurious wakeups In-Reply-To: <1332561864.36.0.581817043223.issue14396@psf.upfronthosting.co.za> Message-ID: <1332576879.32.0.554362198226.issue14396@psf.upfronthosting.co.za> Adin Scannell added the comment: Kernel is 3.0.0-15-generic (I believe stock Ubuntu Oneric kernel). Version for glibc is Ubuntu EGLIBC 2.13-20ubuntu5. I'm working on figuring out the exact conditions under which it happens and creating a harness. I'll post it when I've got it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 10:06:49 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 24 Mar 2012 09:06:49 +0000 Subject: [issue14154] reimplement the bigmem test memory watchdog as a subprocess In-Reply-To: <1330459989.98.0.769260493369.issue14154@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 53a2488605e3 by Charles-Fran?ois Natali in branch 'default': Issue #14154: Reimplement the bigmem test memory watchdog as a subprocess. http://hg.python.org/cpython/rev/53a2488605e3 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 11:17:31 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Sat, 24 Mar 2012 10:17:31 +0000 Subject: [issue14310] Socket duplication for windows In-Reply-To: <1331775486.86.0.119356098147.issue14310@psf.upfronthosting.co.za> Message-ID: <1332584251.44.0.940035746718.issue14310@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: So, what is the consensus, does this go in or out? What about the "share()" and "fromshare()" functions, are people ok with that? ---------- versions: +Python 3.3 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 11:19:22 2012 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Sat, 24 Mar 2012 10:19:22 +0000 Subject: [issue14288] Make iterators pickleable In-Reply-To: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> Message-ID: <1332584362.08.0.900329441744.issue14288@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: sbt, I will fix the api name. Any other objections then? Leave it as it is with the "iter()" trick? ---------- versions: +Python 3.3 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 11:33:07 2012 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sat, 24 Mar 2012 10:33:07 +0000 Subject: [issue13902] Sporadic test_threading failure on FreeBSD 6.4 buildbot In-Reply-To: <1327845211.23.0.0250327265855.issue13902@psf.upfronthosting.co.za> Message-ID: <1332585187.04.0.325325713562.issue13902@psf.upfronthosting.co.za> Charles-Fran?ois Natali added the comment: And here's the full message: """ ====================================================================== FAIL: test_6_daemon_threads (test.test_threading.ThreadJoinOnShutdown) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/db3l/buildarea/3.2.bolen-freebsd/build/Lib/test/test_threading.py", line 667, in test_6_daemon_threads self.assertFalse(err) AssertionError: b'[46830 refs]\nThread 85d0600 has exited with leftover thread-specific data after 4 destructor iterations' is not false """ It's actually a bug in FreeBSD < 7 pthread implementation, see http://lists.freebsd.org/pipermail/freebsd-threads/2009-June/004563.html The patch attached simply skips this test on FreeBSD 6 (like many other similar tests do). ---------- keywords: +patch nosy: +neologix Added file: http://bugs.python.org/file25010/freebsd_tls_spurious.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 11:44:15 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 24 Mar 2012 10:44:15 +0000 Subject: [issue14396] Popen wait() doesn't handle spurious wakeups In-Reply-To: <1332561864.36.0.581817043223.issue14396@psf.upfronthosting.co.za> Message-ID: <1332585855.27.0.806296043166.issue14396@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +neologix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 11:44:41 2012 From: report at bugs.python.org (STINNER Victor) Date: Sat, 24 Mar 2012 10:44:41 +0000 Subject: [issue14397] Use GetTickCount/GetTickCount64 instead of QueryPerformanceCounter for monotonic clock Message-ID: <1332585881.7.0.0863389959921.issue14397@psf.upfronthosting.co.za> New submission from STINNER Victor : QueryPerformanceCounter() is not monotonic on a multiprocessor computer on Windows XP. Extract of its documentation: "Remarks On a multiprocessor computer, it should not matter which processor is called. However, you can get different results on different processors due to bugs in the basic input/output system (BIOS) or the hardware abstraction layer (HAL). To specify processor affinity for a thread, use the SetThreadAffinityMask function." See also: http://bytes.com/topic/python/answers/527849-time-clock-going-backwards time.steady(strict-True) (or "time.monotonic()"? the function name is not decided yet :?)) should use GetTickCounter64(), or GetTickCounter(). GetTickCount64() was added to Windows Seven / Server 2008. GetTickCount() overflows after 49 days. QueryPerformanceCounter() has a better resolution than GetTickCount[64]() and so it's maybe better to keep it for time.steady(strict-False)? ---------- components: Library (Lib), Windows messages: 156690 nosy: haypo priority: normal severity: normal status: open title: Use GetTickCount/GetTickCount64 instead of QueryPerformanceCounter for monotonic clock versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 11:45:44 2012 From: report at bugs.python.org (STINNER Victor) Date: Sat, 24 Mar 2012 10:45:44 +0000 Subject: [issue14397] Use GetTickCount/GetTickCount64 instead of QueryPerformanceCounter for monotonic clock In-Reply-To: <1332585881.7.0.0863389959921.issue14397@psf.upfronthosting.co.za> Message-ID: <1332585944.94.0.913270197776.issue14397@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +brian.curtin, loewis, tim.golden _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 11:47:52 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 24 Mar 2012 10:47:52 +0000 Subject: [issue6634] sys.exit() called from threads other than the main one: undocumented behaviour In-Reply-To: <1249327311.32.0.926815032903.issue6634@psf.upfronthosting.co.za> Message-ID: <1332586072.39.0.983087451163.issue6634@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > I don't see why this should be considered acceptable behavior. Why > don't threads have their own ThreadExit exception, rather than > overloading the use, and therefore, the meaning, of the SystemExit > exception? As indicated by their names, sys.exit and the SystemExit > exception should *only* be used to exit the entire system, not just a > thread! I agree the situation isn't optimal. However, fixing this would also break compatibility with any application that uses sys.exit() in a thread and expects it to exit the thread, not the whole process. So we're kind of stuck with it. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 13:18:30 2012 From: report at bugs.python.org (Georg Brandl) Date: Sat, 24 Mar 2012 12:18:30 +0000 Subject: [issue14349] The documentation of 'dis' doesn't describe MAKE_FUNCTION correctly In-Reply-To: <1331996886.47.0.46755295506.issue14349@psf.upfronthosting.co.za> Message-ID: <1332591510.77.0.844557423091.issue14349@psf.upfronthosting.co.za> Georg Brandl added the comment: Looks good to me. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 14:26:48 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Sat, 24 Mar 2012 13:26:48 +0000 Subject: [issue13902] Sporadic test_threading failure on FreeBSD 6.4 buildbot In-Reply-To: <1327845211.23.0.0250327265855.issue13902@psf.upfronthosting.co.za> Message-ID: <1332595608.9.0.65390740048.issue13902@psf.upfronthosting.co.za> Nadeem Vawda added the comment: Patch looks good to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 14:53:14 2012 From: report at bugs.python.org (Yury Selivanov) Date: Sat, 24 Mar 2012 13:53:14 +0000 Subject: [issue14397] Use GetTickCount/GetTickCount64 instead of QueryPerformanceCounter for monotonic clock In-Reply-To: <1332585881.7.0.0863389959921.issue14397@psf.upfronthosting.co.za> Message-ID: <1332597194.71.0.615468825787.issue14397@psf.upfronthosting.co.za> Changes by Yury Selivanov : ---------- nosy: +Yury.Selivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 14:53:49 2012 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 24 Mar 2012 13:53:49 +0000 Subject: [issue14288] Make iterators pickleable In-Reply-To: <1331655020.29.0.612944465478.issue14288@psf.upfronthosting.co.za> Message-ID: <1332597229.6.0.337206725121.issue14288@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 14:56:09 2012 From: report at bugs.python.org (Yury Selivanov) Date: Sat, 24 Mar 2012 13:56:09 +0000 Subject: [issue14397] Use GetTickCount/GetTickCount64 instead of QueryPerformanceCounter for monotonic clock In-Reply-To: <1332585881.7.0.0863389959921.issue14397@psf.upfronthosting.co.za> Message-ID: <1332597369.35.0.435910502343.issue14397@psf.upfronthosting.co.za> Yury Selivanov added the comment: I vote for adding just one function to the 'time' module: monotonic(), which should exist only if the host OS support it. And I don't see the point of having 'steady()' at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 15:20:17 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 24 Mar 2012 14:20:17 +0000 Subject: [issue14397] Use GetTickCount/GetTickCount64 instead of QueryPerformanceCounter for monotonic clock In-Reply-To: <1332585881.7.0.0863389959921.issue14397@psf.upfronthosting.co.za> Message-ID: <1332598817.69.0.94359446078.issue14397@psf.upfronthosting.co.za> Martin v. L?wis added the comment: A monotonic clock is not suitable for measuring durations, as it may still jump forward. A steady clock will not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 16:21:54 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 24 Mar 2012 15:21:54 +0000 Subject: [issue14364] Argparse incorrectly handles '--' In-Reply-To: <1332080953.55.0.495639573781.issue14364@psf.upfronthosting.co.za> Message-ID: <1332602514.85.0.0607711145185.issue14364@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 16:24:41 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 24 Mar 2012 15:24:41 +0000 Subject: [issue14365] argparse: subparsers, argument abbreviations and ambiguous option In-Reply-To: <1332102480.28.0.401837291603.issue14365@psf.upfronthosting.co.za> Message-ID: <1332602681.51.0.201485607671.issue14365@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo stage: -> test needed versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 16:27:11 2012 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 24 Mar 2012 15:27:11 +0000 Subject: [issue14367] try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2 In-Reply-To: <1332132143.66.0.7093323157.issue14367@psf.upfronthosting.co.za> Message-ID: <1332602831.06.0.08248247555.issue14367@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 16:51:22 2012 From: report at bugs.python.org (Daniel Swanson) Date: Sat, 24 Mar 2012 15:51:22 +0000 Subject: [issue14361] No link to issue tracker on Python home page In-Reply-To: <1332069267.85.0.0257661397774.issue14361@psf.upfronthosting.co.za> Message-ID: <1332604282.65.0.598926975675.issue14361@psf.upfronthosting.co.za> Daniel Swanson added the comment: i don't remember ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 16:52:03 2012 From: report at bugs.python.org (Florent Xicluna) Date: Sat, 24 Mar 2012 15:52:03 +0000 Subject: [issue9995] "setup.py register sdist upload" requires pass to be saved In-Reply-To: <1285838842.84.0.5702466564.issue9995@psf.upfronthosting.co.za> Message-ID: <1332604323.4.0.71389045011.issue9995@psf.upfronthosting.co.za> Florent Xicluna added the comment: If someone else is looking for the PyPI SSH support, it's there. http://pypi.python.org/pypi/pypissh (I did not find it mentioned in the tutorial) Thanks Martin. ---------- nosy: +flox _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:14:44 2012 From: report at bugs.python.org (Matt Joiner) Date: Sat, 24 Mar 2012 16:14:44 +0000 Subject: [issue4331] Can't use _functools.partial() created function as method In-Reply-To: <1226817180.09.0.841012218041.issue4331@psf.upfronthosting.co.za> Message-ID: <1332605684.24.0.58165680328.issue4331@psf.upfronthosting.co.za> Changes by Matt Joiner : ---------- nosy: +anacrolix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:15:19 2012 From: report at bugs.python.org (Laurent Gautier) Date: Sat, 24 Mar 2012 16:15:19 +0000 Subject: [issue14398] bz2.BZ2DEcompressor.decompress fail on large files Message-ID: <1332605719.75.0.496276331472.issue14398@psf.upfronthosting.co.za> New submission from Laurent Gautier : The call ends with: Objects/stringobject.c:3884: bad argument to internal function sys.version: '2.7.2 (default, Jun 13 2011, 15:14:50) \n[GCC 4.4.5]' (on 64bit Linux) ---------- messages: 156698 nosy: Laurent.Gautier priority: normal severity: normal status: open title: bz2.BZ2DEcompressor.decompress fail on large files type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:27:11 2012 From: report at bugs.python.org (Cassaigne) Date: Sat, 24 Mar 2012 16:27:11 +0000 Subject: [issue14399] zipfile and creat/update comment Message-ID: <1332606431.21.0.286905846716.issue14399@psf.upfronthosting.co.za> New submission from Cassaigne : I want to update or create a comment to zip file. For instance, I have test.zip file. I'm using these statement to create a comment : from zipfile import ZipFile z=ZipFile('test.zip','a') z.comment='Create a new comment' z.close() After to ran this script, the zip file test.zip doesn't including the new comment ! I can have the expected behavior when I add a new file inner zip archive. ---------- components: Library (Lib) files: bug_zipfile_comment.py messages: 156699 nosy: acassaigne priority: normal severity: normal status: open title: zipfile and creat/update comment type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file25011/bug_zipfile_comment.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:27:48 2012 From: report at bugs.python.org (Dionysios Kalofonos) Date: Sat, 24 Mar 2012 16:27:48 +0000 Subject: [issue14400] Typo in cporting.rst Message-ID: <1332606468.59.0.165889017465.issue14400@psf.upfronthosting.co.za> New submission from Dionysios Kalofonos : A typo (see attached file). ---------- assignee: docs at python components: Documentation files: typo.diff keywords: patch messages: 156700 nosy: dk, docs at python priority: normal severity: normal status: open title: Typo in cporting.rst versions: Python 2.7 Added file: http://bugs.python.org/file25012/typo.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:31:50 2012 From: report at bugs.python.org (Dionysios Kalofonos) Date: Sat, 24 Mar 2012 16:31:50 +0000 Subject: [issue14400] Typo in cporting.rst In-Reply-To: <1332606468.59.0.165889017465.issue14400@psf.upfronthosting.co.za> Message-ID: <1332606710.98.0.0997358126256.issue14400@psf.upfronthosting.co.za> Changes by Dionysios Kalofonos : ---------- versions: +Python 3.1, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:36:14 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 24 Mar 2012 16:36:14 +0000 Subject: [issue14398] bz2.BZ2DEcompressor.decompress fail on large files In-Reply-To: <1332605719.75.0.496276331472.issue14398@psf.upfronthosting.co.za> Message-ID: <1332606974.0.0.487975695691.issue14398@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I can't reproduce this. Can you please provide a test script along with input data that allows us to reproduce this error? ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:38:36 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 24 Mar 2012 16:38:36 +0000 Subject: [issue14400] Typo in cporting.rst In-Reply-To: <1332606468.59.0.165889017465.issue14400@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset e0e28695f11b by Martin v. L?wis in branch '2.7': Issue #14400: Fix typo. http://hg.python.org/cpython/rev/e0e28695f11b ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:40:58 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 24 Mar 2012 16:40:58 +0000 Subject: [issue14400] Typo in cporting.rst In-Reply-To: <1332606468.59.0.165889017465.issue14400@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset ff679f22682b by Martin v. L?wis in branch '3.2': Issue #14400: Fix typo. http://hg.python.org/cpython/rev/ff679f22682b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:41:19 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 24 Mar 2012 16:41:19 +0000 Subject: [issue14400] Typo in cporting.rst In-Reply-To: <1332606468.59.0.165889017465.issue14400@psf.upfronthosting.co.za> Message-ID: <1332607279.76.0.704835077561.issue14400@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Thanks for the patch. ---------- nosy: +loewis resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:45:34 2012 From: report at bugs.python.org (Laurent Gautier) Date: Sat, 24 Mar 2012 16:45:34 +0000 Subject: [issue14398] bz2.BZ2DEcompressor.decompress fail on large files In-Reply-To: <1332605719.75.0.496276331472.issue14398@psf.upfronthosting.co.za> Message-ID: <1332607534.89.0.188180294934.issue14398@psf.upfronthosting.co.za> Laurent Gautier added the comment: Wow! Quick follow-up. The data file is about 1.6Gb. Is there a preferred way to pass it on (I suspect that the bug tracker is not the preferred way). The code goes like: import bz2 f = file("foobar.bz2", mode="rb") src_buf = f.read() decomp = bz2.BZ2Decompressor() tmp = decomp.decompress(src_buf) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:48:13 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 24 Mar 2012 16:48:13 +0000 Subject: [issue14065] Element should support cyclic GC In-Reply-To: <1329755208.03.0.143933032526.issue14065@psf.upfronthosting.co.za> Message-ID: <1332607693.29.0.811366156145.issue14065@psf.upfronthosting.co.za> Eli Bendersky added the comment: Find attached a patch. Added cyclic GC support to Element objects. Also added tests that verify that cycles involving Element objects are being collected. I'd really appreciate a review on this, since this is the first time I have to explicitly deal with cyclic GC from C extensions. ---------- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file25013/issue14065.1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:53:24 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 24 Mar 2012 16:53:24 +0000 Subject: [issue14349] The documentation of 'dis' doesn't describe MAKE_FUNCTION correctly In-Reply-To: <1331996886.47.0.46755295506.issue14349@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 242d3f8e8c50 by Eli Bendersky in branch 'default': Issue #14349: Fix the doc of the MAKE_FUNCTION opcode in Doc/library/dis.rst to http://hg.python.org/cpython/rev/242d3f8e8c50 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 17:54:09 2012 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 24 Mar 2012 16:54:09 +0000 Subject: [issue14349] The documentation of 'dis' doesn't describe MAKE_FUNCTION correctly In-Reply-To: <1331996886.47.0.46755295506.issue14349@psf.upfronthosting.co.za> Message-ID: <1332608049.27.0.773644340087.issue14349@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 18:32:13 2012 From: report at bugs.python.org (Dionysios Kalofonos) Date: Sat, 24 Mar 2012 17:32:13 +0000 Subject: [issue14401] Typos in curses.rst Message-ID: <1332610333.54.0.189521557338.issue14401@psf.upfronthosting.co.za> New submission from Dionysios Kalofonos : Typos (see attached file). ---------- assignee: docs at python components: Documentation files: curses.diff keywords: patch messages: 156708 nosy: dk, docs at python priority: normal severity: normal status: open title: Typos in curses.rst versions: Python 2.7, Python 3.1, Python 3.3 Added file: http://bugs.python.org/file25014/curses.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 18:33:47 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Sat, 24 Mar 2012 17:33:47 +0000 Subject: [issue14398] bz2.BZ2DEcompressor.decompress fail on large files In-Reply-To: <1332605719.75.0.496276331472.issue14398@psf.upfronthosting.co.za> Message-ID: <1332610427.29.0.895993489101.issue14398@psf.upfronthosting.co.za> Nadeem Vawda added the comment: I have been able to reproduce it; see attached script. It happens for inputs of 2GB (decompressed), but not for ones of 1GB. It seems that bz2module.c doesn't guard against 32-bit overflows when handling the size of the decompressed data. This affects both the BZ2Decompressor object's decompress() method, and the module-level decompress() function. All python versions prior to 3.3 are affected. ---------- assignee: -> nadeem.vawda components: +Extension Modules nosy: +nadeem.vawda stage: -> needs patch Added file: http://bugs.python.org/file25015/testbz2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 18:35:03 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Sat, 24 Mar 2012 17:35:03 +0000 Subject: [issue14398] bz2.BZ2DEcompressor.decompress fail on large files In-Reply-To: <1332605719.75.0.496276331472.issue14398@psf.upfronthosting.co.za> Message-ID: <1332610503.38.0.0970831744115.issue14398@psf.upfronthosting.co.za> Nadeem Vawda added the comment: (the contents of the input file don't matter; I just pulled out a bunch of zeros from /dev/zero and compressed them with bzip2.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 18:39:16 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Sat, 24 Mar 2012 17:39:16 +0000 Subject: [issue14398] bz2.BZ2DEcompressor.decompress fail on large files In-Reply-To: <1332605719.75.0.496276331472.issue14398@psf.upfronthosting.co.za> Message-ID: <1332610756.64.0.554070354957.issue14398@psf.upfronthosting.co.za> Changes by Nadeem Vawda : ---------- versions: +Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 18:52:26 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Sat, 24 Mar 2012 17:52:26 +0000 Subject: [issue14398] bz2.BZ2DEcompressor.decompress fail on large files In-Reply-To: <1332605719.75.0.496276331472.issue14398@psf.upfronthosting.co.za> Message-ID: <1332611546.24.0.906946000036.issue14398@psf.upfronthosting.co.za> Nadeem Vawda added the comment: This should be fixed for 2.7.3. I'll have a patch ready in the next day or two. ---------- nosy: +benjamin.peterson, georg.brandl priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 19:23:40 2012 From: report at bugs.python.org (Matt Joiner) Date: Sat, 24 Mar 2012 18:23:40 +0000 Subject: [issue4331] Can't use _functools.partial() created function as method In-Reply-To: <1226817180.09.0.841012218041.issue4331@psf.upfronthosting.co.za> Message-ID: <1332613420.81.0.777145147581.issue4331@psf.upfronthosting.co.za> Matt Joiner added the comment: I've attached a patch that implements the descriptor protocol for functools.partial with minimum changes. ---------- Added file: http://bugs.python.org/file25016/functools.partial-descrget.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 20:31:43 2012 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 24 Mar 2012 19:31:43 +0000 Subject: [issue14398] bz2.BZ2DEcompressor.decompress fail on large files In-Reply-To: <1332605719.75.0.496276331472.issue14398@psf.upfronthosting.co.za> Message-ID: <1332617503.26.0.591617301242.issue14398@psf.upfronthosting.co.za> Benjamin Peterson added the comment: This isn't a regression, is it? If it's not, I don't think it's essential to get into 2.7.3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 20:35:51 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Sat, 24 Mar 2012 19:35:51 +0000 Subject: [issue14398] bz2.BZ2DEcompressor.decompress fail on large files In-Reply-To: <1332605719.75.0.496276331472.issue14398@psf.upfronthosting.co.za> Message-ID: <1332617752.0.0.128722820864.issue14398@psf.upfronthosting.co.za> Nadeem Vawda added the comment: No, it's been around since at least 2.6. I wasn't really sure what the protocol was for bugs found during the RC process. It'd be nice to get a fix for this into 2.7.3 (and 3.2.3), but it's not urgent. ---------- priority: release blocker -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 20:37:12 2012 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 24 Mar 2012 19:37:12 +0000 Subject: [issue14398] bz2.BZ2DEcompressor.decompress fail on large files In-Reply-To: <1332605719.75.0.496276331472.issue14398@psf.upfronthosting.co.za> Message-ID: <1332617832.04.0.691353819611.issue14398@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Nadeem: the final release candidate of 2.7.3 was already made. Any further change would require another release candidate, which in turn would delay the release further. This has to wait for 2.7.4. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 20:37:44 2012 From: report at bugs.python.org (Roundup Robot) Date: Sat, 24 Mar 2012 19:37:44 +0000 Subject: [issue13902] Sporadic test_threading failure on FreeBSD 6.4 buildbot In-Reply-To: <1327845211.23.0.0250327265855.issue13902@psf.upfronthosting.co.za> Message-ID: Roundup Robot added the comment: New changeset 2456e4e69cd0 by Charles-Fran?ois Natali in branch '3.2': Issue #13902: Fix a random test_threading failure on FreeBSD 6 buildbots (due http://hg.python.org/cpython/rev/2456e4e69cd0 New changeset c1191cbc7b37 by Charles-Fran?ois Natali in branch 'default': Issue #13902: Fix a random test_threading failure on FreeBSD 6 buildbots (due http://hg.python.org/cpython/rev/c1191cbc7b37 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 20:38:27 2012 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sat, 24 Mar 2012 19:38:27 +0000 Subject: [issue14154] reimplement the bigmem test memory watchdog as a subprocess In-Reply-To: <1330459989.98.0.769260493369.issue14154@psf.upfronthosting.co.za> Message-ID: <1332617907.21.0.311363644127.issue14154@psf.upfronthosting.co.za> Changes by Charles-Fran?ois Natali : ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 20:38:54 2012 From: report at bugs.python.org (Nadeem Vawda) Date: Sat, 24 Mar 2012 19:38:54 +0000 Subject: [issue14398] bz2.BZ2DEcompressor.decompress fail on large files In-Reply-To: <1332605719.75.0.496276331472.issue14398@psf.upfronthosting.co.za> Message-ID: <1332617934.15.0.754286139328.issue14398@psf.upfronthosting.co.za> Nadeem Vawda added the comment: That's fine by me, then. Sorry for the confusion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 21:14:30 2012 From: report at bugs.python.org (Yury Selivanov) Date: Sat, 24 Mar 2012 20:14:30 +0000 Subject: [issue14397] Use GetTickCount/GetTickCount64 instead of QueryPerformanceCounter for monotonic clock In-Reply-To: <1332585881.7.0.0863389959921.issue14397@psf.upfronthosting.co.za> Message-ID: <1332620070.1.0.545426399864.issue14397@psf.upfronthosting.co.za> Yury Selivanov added the comment: > A monotonic clock is not suitable for measuring durations, as it may still jump forward. A steady clock will not. Well, Victor's implementation of 'steady()' is just a tiny wrapper, which uses 'monotonic()' or 'time()' if the former is not available. Hence 'steady()' is a misleading name. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Mar 24 21:21:23 2012 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 24 Mar 2012 20:21:23 +0000 Subject: [issue14402] Notice PayPaI : Your account was accesed by a third party. Message-ID: New submission from Guido van Rossum : Dear Member of PayPaI, We have reason to believe that your account was accessed by a third party. Please download the form and follow the instructions on your screen. We apologize for any inconvenience this may have caused. Copyright ? 1999-2012 PayPal. All rights reserved. Sincerely, The PayPal Team PayPal Email ID PP529 ---------- files: Restore Your Account.html messages: 156719 nosy: gvanrossum priority: normal severity: normal status: open title: Notice PayPaI : Your account was accesed by a third party. Added file: http://bugs.python.org/file25017/Restore Your Account.html _______________________________________ Python tracker _______________________________________ -------------- next part -------------- ??? Security - Issue - PayPaI

NOTE: Many features on the PayPaI Web site require Javascript and cookies. You can enable both via your browser's preference settings.